Skip to content

Node Operation

Node Operation#

Logging In#

If you followed the one-liner install scriptto install the node onto Digital Ocean then you will have received an email from Digital Ocean with your login credentials that will contain info such as:

!!! quote Your new Droplet is all set to go! You can access it using the following credentials:

Droplet Name: taraxa-node-oneclick-d2km

IP Address: 104.248.84.85

Username: root

Password: 035ce9a6bf7d61ec3003f3255e

You will be prompted to change your password on your first login.

!!! caution You will receive your login credential and be able to login to the machine before docker may have finished installing and launching the docker image of the Taraxa node. Once its finished the following steps will work.

Account and Receiving Coins#

Your new Taraxa account will automatically receive an intial supply of 50000 coins from the Taraxa testnet faucet. The installation script automatically has generated your private key, public key, and account address. They can be read from /opt/ethereum-generate-wallet/generated-account.txt

Sample file:

Private key: 921bac6edbb0e2588bde7f5f8ec43efe8e45db4a1297c185e48f064113dd5e6a
Public key:  d7a649788f82f3b81d4f849110000cc885da9728a4bd62ec2d531634783367f048c4c8cb89052c62ddf096ffcfe48ce79fd856$
Address:     0x887f35ff63d2c7592618808c6c9ed328737da74d

!!! caution If you don't see the following commands as part of your path then the install script hadn't finished running when you logged in. You can log out and log back in once the install script is done and they will be part of the root user's path.

Viewing Logs#

You can view the logs ouptut by your Taraxa node by using the command taraxa-logs. (This is a shorcut for the longer command docker logs -f taraxa-node)

root@taraxa-node-1:~# taraxa-logs
DEBUG 09-29 02:32:28 p2p  VOTE_MGR e6c8feba…|TaraxaNode Add vote #5b77ea08…, block hash #0db02f13…, vote type 2, in round 113, for step 3
DEBUG 09-29 02:32:28 p2p  VOTE_MGR bcb33f59…|TaraxaNode Add vote #eb97eab5…, block hash #0db02f13…, vote type 2, in round 113, for step 3
DEBUG 09-29 02:32:28 p2p  VOTE_MGR a8f8e430…|TaraxaNode Add vote #ca748feb…, block hash #0db02f13…, vote type 2, in round 113, for step 3
DEBUG 09-29 02:32:28 p2p  VOTE_MGR 8c797825…|TaraxaNode Add vote #7b1988dc…, block hash #0db02f13…, vote type 2, in round 113, for step 3
DEBUG 09-29 02:32:28 main PBFT_MGR find block hash #0db02f13… vote type 2 in round 113 has 5 votes
DEBUG 09-29 02:32:28 p2p  VOTE_MGR bcb33f59…|TaraxaNode Add vote #8b1802fd…, block hash #0db02f13…, vote type 2, in round 113, for step 3
INFO  09-29 02:32:28 main PBFT_CHAIN Push pbft block #0db02f13… into pbft chain, current pbft chain period 56 chain size is 113
INFO  09-29 02:32:28 main PBFT_MGR Successful push pbft schedule block #0db02f13… into chain! in round 113
      09-29 02:32:28 main PBFT_MGR @de2b1203… Finalize cs block in period 56 round 113 step 3 anchor: #76c104b1…
DEBUG 09-29 02:32:28 main PBFT_MGR The cert voted pbft block is #0db02f13…
DEBUG 09-29 02:32:28 main PBFT_MGR Pushing PBFT block and Execution spent 153 ms. in round 113

Simple Scripts To Interact With#

!!! caution If you don't see the following commands as part of your path then the install script hadn't finished running when you logged in. You can log out and log back in once the install script is done and they will be part of the root user's path.

Checking Your Balance#

To check your node's account balance you can use the command taraxa-check-balance which has been added to root's path.

Example:

root@taraxa-node-1:~# taraxa-check-balance 
"50000"

Sending a Transaction#

To send a transaction you can use the interactive taraxa-send-transaction which has been added to root's path. It will ask you to input the amount of Taraxa coins you want to send

Example:

root@taraxa-node-1:~# taraxa-send-transaction 
Enter the amount you want to send:
1000
Enter the destination Address:
7dbd9065d38ffbbb27c884baeffca113eda3cb50
POST_DATA:
{
  "jsonrpc": "2.0",
  "id": 0,
  "method": "send_coin_transaction",
  "params": [
    {
      "nonce": 8,
      "value": 1000,
      "gas": "300000",
      "gas_price": "1000000000",
      "receiver": "7dbd9065d38ffbbb27c884baeffca113eda3cb50",
      "secret": "a946a99cd09510b972a86e377756f2b4e6ccf1c710f5fddc59cf4855c3802bcb"
    }
  ]
}
RESULT:
{
  "id": 0,
  "jsonrpc": "2.0",
  "result": "{\n\t\"chain_id\" : -4,\n\t\"data\" : \"\",\n\t\"gas\" : \"0x493e0\",\n\t\"gas_price\" : \"0x3b9aca00\",\n\t\"hash\" : \"0x6111c7ea3f52be0cb9bbf6a11bed5ba7f8ccd10a0af4091e93e3d9a37f209fd7\",\n\t\"nonce\" : \"0x8\",\n\t\"receiver\" : \"0x7dbd9065d38ffbbb27c884baeffca113eda3cb50\",\n\t\"sender\" : \"0x18935232c6487bb235f763e770dace9f1334d672\",\n\t\"sig\" : \"0x312a81d58a6425b41e041cb1180b5ff09582e8b304ffbd5779e1b7f7212ccfac53145bc65019503865f6fcae132c8d5f41e308db0645924e021e31e6bd244e1100\",\n\t\"type\" : 2,\n\t\"value\" : \"0x3e8\"\n}"
}

Command Line Lookup Of Node Account Address#

root@taraxa-node-2:~# MY_ADDRESS=$(grep Address /opt/ethereum-generate-wallet/generated-account.txt | cut -d':' -f2 | sed 's/     0x//g') ; echo $MY_ADDRESS
0x7dbd9065d38ffbbb27c884baeffca113eda3cb50

You will want to use the address without the 0x in the taraxa-send-transaction command

Checking Another Address's Balance#

If you know another account address you can check it's balance using the following curl RPC call: (TODO: Make this a command script)

curl -d '{"jsonrpc":"2.0", "id":0, "method": "get_account_balance", "params":[{"address": "7dbd9065d38ffbbb27c884baeffca113eda3cb50"}]}'  -H 'content-type:text/plain;' localhost:7777

Example to check balance of account 0x887f35ff63d2c7592618808c6c9ed328737da74d:

root@taraxa-node-1:~# curl -d '{"jsonrpc":"2.0", "id":0, "method": "get_account_balance", "params":[{"address": "7dbd9065d38ffbbb27c884baeffca113eda3cb50"}]}'  -H 'content-type:text/plain;' localhost:7777
{"id":0,"jsonrpc":"2.0","result":{"found":true,"value":"51000"}}

Response:

{"id":0,"jsonrpc":"2.0","result":{"found":true,"value":"50000"}}

```