docker-compose up -d app ganache
docker-compose up -d app geth
docker-compose up -d app rinkeby
ONLY START 1 of the node containers at the same time
yarn run dev
to start the frontend servertruffle test --network [ganache|geth]
to run the contracts teststruffle migrate --network [ganache|geth]
to migrate the contractstruffle console --network [ganache|geth]
for an interactive console with the node
Here are some commands to use with the contract
MercadoChain.deployed().then((instance) => {app = instance;});
app.itemPutForSale({}, {fromBlock: 0, toBlock: 'latest'}).watch((error, event) => {console.log(error); console.log(event)});
app.itemBought({}, {fromBlock: 0, toBlock: 'latest'}).watch((error, event) => {console.log(error); console.log(event)});
app.items(1)
app.sellItem('Item 1', 'Description 1', web3.toWei(5, 'ether'), {from: web3.eth.accounts[0]});
app.buyItem(1, {from: web3.eth.accounts[1], value: web3.toWei(5, 'ether')});
- The node starts automatically when the container is up
- It will create 3 accounts with 100ETH each.
-
The node starts automatically when the container is up
-
The first time the node runs, it will generate the DAG data structure
Check for "Generating DAG in progress" in the logs (
docker logs -f <container_name>
) and wait until it reaches 100% before using the node -
3 accounts will be created by default, with password
pass1234
-
geth attach http://localhost:8545
to get a console
-
The node starts automatically when the container is up
-
The first time the node runs, it will synchronize with the network. It will take a while.
Check the logs (
docker logs -f <container_name>
) and wait until it finishes -
3 accounts will be created by default, with password
M3rc4d0Ch41n88
-
geth attach http://localhost:8545
to get a console -
In the geth console, you can execute
eth.syncing
to view the progress of the syncing process