A carbon-credit marketplace powered by the Ethereum blockchain
Express
Vue
Solidity
Truffle
Install Ganache for local blockchain
Visit https://www.trufflesuite.com/ganache
Start Ganache and create an application workspace
Visit https://www.trufflesuite.com/tutorial
Install project dependencies
npm install
cd client
npm install
create a dbconfig.json
file within the root folder of the project and populate it with the following configuration, replacing blank details with your own.
{
"development": {
"username": "",
"password": "",
"database": "",
"host": "",
"dialect": "",
"logging": true
},
"test": {
"username": "",
"password": "",
"database": "",
"host": "",
"dialect": "",
"logging": true
},
"production": {
"username": "",
"password": "",
"database": "",
"host": "",
"dialect": "",
"logging": false
}
}
in the client
folder create an .env.local
environment variable file and populate with the following:
VUE_APP_VENDOR_CONTRACT_ADDRESS=<place address of deployed vendor contract here>
VUE_APP_TOKEN_CONTRACT_ADDRESS=<place address of deployed token contract here>
- run Ganache and start the workspace linked to the project
- compile the contracts
truffle compile
truffle migrate
- The command below will build frontend and start the backend
- run it from root folder
npm run build-app
- After building the app will be accessible on
https://localhost:3001
- Start Ganache , compile and migrate contracts as noted above and in the root folder run
npm run dev
- The API will be accessible on
http://localhost:3001
- Navigate to client folder
cd client
npm run serve
- The Frontend will be accessible on
http://localhost:8080
Compile and Deploy smart contract (located in contracts/) to Ganache
truffle compile
truffle migrate
Scaffolding contracts
truffle create contract YourContractName # scaffold a contract
truffle create test YourTestName
truffle compile
truffle migrate --reset
Copyright 2023 Tatenda Muvhu
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.