Course02: How to Use Solo-chain
At 2018-11-19 By zhaoyue
How to Use Solo-chain
Click here to view the course video
Solo-chain is an Ontology single-node private-net. It generates a block every six seconds.
You can view the source code in GitHub and download the release version from here.
- The function of "reboot" is to restart the private-net and clear the existing data. And the function of "stop" is to stop the private-net.
- The default port of RPC server is 20336. For Restful server, the port is 20334. For websocket server, it is 20335.
- The height of blockchain will increase by one every six seconds. Gas price can be changed in the setting. Gas limit is a fixed number, 20000.
- In the account page, we have 5 accounts at first and the ONT and ONG in each account can be transferred. The ONG can be obtained by redeeming ONG.
- The block page displays all blocks that contain transactions.
- The transaction page displays transactions. It includes two types, deploy and invoke. You can see transaction details by clicking "Detail".
- The event page displays all events that are invoked by "notify" in the smart contract.
- The page of smart contract displays all smart contracts that has been deployed in the blockchain.
At initialization, the blockchain will deploy several native contract by default.
- The log page displays all log of test node at runtime.
3. Solo-chain demo
Step1 - Start solo-chain
Step2 - Transfer and redeem ONG
2.1 Transfer ONT to another account
2.2 redeem ONG
Step3 - Write a smart contract with SmartX
You can refer to this document for how to write a smart contract with SmartX.
Step4 - Transfer 1000 ONG to Cyano wallet for deploying smart contracts.
4.1 Install Cyano wallet in Chrome, open it and create a new account.
4.2 Create a new account and get public address
4.3 Transfer ONG to the new account by solo-chain
NOTE: You need to select Private-Net at first and then set the private node ip/address to be 127.0.0.1 in the setting
Please feel free to give any suggestion
Contact: Yue Zhao