Getting Started
Set Up a Node
Please see here for how to set up a SCDO node. You can use a SCDO node to join the SCDO mainnet. With a SCDO node, you are able to generate blocks for the SCDO mainnet and mine SCDO tokens. Or you can simply synchronize the data of SCDO mainnet without mining.
Create a Client Executable
A client executable can be downloaded directly from download page. It's a tool for users to quickly interact with SCDO nodes. You can also find this executable in the go-scdo/build directory after you compile go-scdo. Please see here for a complete client command list.
Some Commonly Used Commands With Client:
0. Create an account
You can use
to create an address in shard 1 with corresponding private key. An example of the result is
Since SCDO mainnet has 4 shards, you can generate accounts from shard 1 to shard 4 by modifying the shard parameter. Also see here for more details.
1. Create a keystore file
After creating your account, you can store your private key in a keystore file which can be used to sign your transactions. For example, use
to save the private key in mykeyfile. You will be asked to type in a password for using this keystore file.
2. Send a transaction
The following is an example of how to send transaction to a SCDO node via client:
Note: The shard parameter indicates the shard of the sender. The -a flag indicates the ip address and port of the SCDO node you are sending transaction to. In this example, 127.0.0.1 is your local address. There should be a local SCDO node running so that the transaction is sent successfully.
You will be asked to type in your key file password:
Then, a result similar to the following should be displayed:
To check the transfer result with the tx hash, use
A response is returned:
The result of "failure": false
row, indicating that the transfer was successful. By the way, if tx is not packed by the miner or the miner is packing, you may seeget error when call rpc leveldb: not found
. Don't worry, just wait for a few seconds, or you can use client gettxbyhash
to check the transaction status.
To check the account balance, use
A response is displayed:
Note: To send multiple transactions using client, it is recommended to confirm the last transaction in block before sending the next one. If the last transaction is still pending, the next transaction may be rejected by the transaction pool. A workaround is to increase the nonces of the transactions to let all the transactions enter the transaction pool. But there is a chance that the transactions with smaller nonces cannot be packed because the transactions with larger nonces are packed first.
3. Deploy and call contracts
Please see here.
4. Check the information of a node
The client provides a command for you to check the information of a node quickly. For example, use
to check the status of your local node. The string after "-a" indicates the ip and port of the node that you want to check. In this example, we assume you have a local node running and the port is 8027. The outcome will be like
See here for more details.
Last updated