From Compile To Private-Net
Compile Section
Get the main chain source. Make sure that go is ready.
git clone https://github.com/user00000001/TesraMainChain.git
cd TesraMainChain
make tesramain # for chain execution file.
make all # for all execution files.
make clean # clean all compiled results.
Prepare For Using It
Put binary files path into env path or move them into some env paths.
echo "export PATH=$PATH:`pwd`/build/bin" >> ~/.bashrc && source ~/.bashrc
Usage
Tesra Main Chain bases on go-ethereum, for more common usage details, you might need to visit geth documents. Before using tesramain you need prepare some accounts. See Generate Accounts, and prepare 7 or more accounts to add some accounts into source code, compile again to gain final tesramain, Modify Code. Use tesramain's console bases on web3, include pos modification could read this, API.
-
Boot first node.
index=0 ;rm -rf ~/tesramainchain/data/$index/tesramain ;tesramain --etherbase $index --ethash.dagdir ~/tesramainchain/dag/$index --nodiscover --ipcpath ~/tesramainchain/ipc/$index --datadir ~/tesramainchain/data/$index --keystore ~/tesramainchain/keystore --port $((20000+$index)) --unlock $index --password ~/tesramainchain/password --verbosity 100 --firstPos 10 console
-
Under the tesramain console, set the miner to work.
**********************!!!PROTECTION POLICY!!!**********************
Waiting For The Next Deployment, Maybe It Will Be Displayed After That. -
Check pow2pos block and mine status, whether mine blocked.
eth.blockNumber
-
When the block number was not increased for a long while. Exit this console.
exit
-
Start tesramain with the generated data and mine block.
index=0 ;tesramain --etherbase $index --ethash.dagdir ~/tesramainchain/dag/$index --nodiscover --ipcpath ~/tesramainchain/ipc/$index --datadir ~/tesramainchain/data/$index --keystore ~/tesramainchain/keystore --port $((20000+$index)) --unlock $index --password ~/tesramainchain/password --verbosity 100 --firstPos 10 --mine console
-
Watch terminal logs, miner will block again then record slot leader public key. check all accounts infomation. record the matched public key's index FirstPosSlotLeaderIndex.
**********************!!!PROTECTION POLICY!!!**********************
Waiting For The Next Deployment, Maybe It Will Be Displayed After That.