A marketplace application based on blockchain where users can buy/sell products. The marketplace can be accessed here.
- migrations/ - Contains the migration scripts.
- src/components/ - Contains the React files to render the front end.
- src/contracts/ - Contains the smart contracts of the applications which are essentially the back end.
- Migrations.sol - A smart contract that helps in migrating other smart contracts.
- Marketplace.sol - Handles all the logic to buy and sell on the marketplace. This will also read from and write to the blockchain.
At their simplest, migrations are simply a set of managed deployment scripts and they are located inside the migrations directory. The migrations are run using the truffle migrate
command.
The files must be numbered so that truffle knows the order in which the files should be run. Migration files should contain the details of the contracts that you want to migrate to the blockchain. Failing to configure them will result in an error when calling the < contract name >.deployed()
function in truffle.
- truffle-config.js - Contains the network configuration of the local blockchain (Ganache) and locations of smart contracts
truffle compile
- Checks the contracts for any errors and compiles them.truffle migrate
- Deploys the contracts to the blockchain. Ensure that the Ganache blockchain is running and the migration files are present inside migrations/.truffle test
- Runs all the tests.
The contract has been deployed in the Sepolia Test Network and the deployment of the contract can be verified on https://sepolia.etherscan.io/.