Simple smart contact blockhain training project
How to start
- Install all packages: npm install;
- If you haven't had your keys, goto terminal and type node keygen, it will generate key;
- If you want start a node, open the terminal, configure it first; set PORT=Your port set PEERS=Address 1, Address 2, Address 3 set MY_ADDRES=ws://your.ip.and:port set PRIVATE_KEY=your key set ENABLE_MINING=true
node .
- You can mine block: mine();
- You can broadcast a transaction: sendTransaction(yourTransaction);
- You can request for a chain and chain's info with function: requestChain();
- You can set up a node that mines continously: loopMine(optional_delay_time);
- You can manually connect to a node: connect("address");