This repo contains the demo code from the NFT marketplace application discussed on the blogs:
Clone the repository and run the following commands to setup the code ($ is not part of the command):
$ npm install -g ganache-cli truffle
$ cd ShareToWinContract
$ npm install
$ ../cd ShareToWinRestApi
$ npm install
$ ../cd ShareToWinWeb
$ npm install
$ aws dynamodb create-table --table-name ShareToWin --attribute-definitions AttributeName=AssetID,AttributeType=N --key-schema AttributeName=AssetID,KeyType=HASH --provisioned-throughput ReadCapacityUnits=1,WriteCapacityUnits=1
Open four terminal windows.
npx ganache-cli --acctKeys ../ShareToWinRestApi/ethaccounts.json
truffle console --network development
Once connected to truffle console, issue the migrate command.
migrate
The migrate command will deploy the smart contract on ganache development network and display the deployed contract address
Deploying 'AssetToken'
transaction hash: 0xd20be4f8f7126f40ab66d11efac49ec260db251375bd11e729dd658373ecebe8
Blocks: 0 Seconds: 0
contract address: 0x0b10d5619d36aeF3ab9eD509196D7937F842a882
block number: 3
block timestamp: 1644449968
account: 0x3d46282D895a9e4Ba8Cb081fbcd6fA2Dd2844e62
balance: 99.91223912
gas used: 4096677 (0x3e82a5)
gas price: 20 gwei
value sent: 0 ETH
total cost: 0.08193354 ETH
source envExport.sh
npx nodemon --delay 1000ms index.js
This will start the express web server and listen on port 4080
npm run start
This sample code is made available under a modified MIT license. See the LICENSE file.