keosd/BP Node executing simultaneously

Executing keosd, BP Docker simultaneously

Page herein, describes how to execute keosd and BP Docker simultaneously. Please note that this is not required in general cases.

Execute keosd

Execute the script file to drive keosd.

root@2515550468dc:/omnione-testnet# ./keosd_start.sh
root@2515550468dc:/omnione-testnet# info  2020-02-10T02:28:47.589 keosd wallet_plugin.cpp:42          plugin_initialize ] initializing wallet plugin
info  2020-02-10T02:28:47.589 keosd     http_plugin.cpp:465 plugin_initialize    ] configured http to listen on 127.0.0.1:9876
info  2020-02-10T02:28:47.589 keosd     http_plugin.cpp:625 add_handler          ] add api url: /v1/keosd/stop
info  2020-02-10T02:28:47.589 keosd     http_plugin.cpp:538 plugin_startup       ] start listening for http requests
info  2020-02-10T02:28:47.590 keosd     http_plugin.cpp:625 add_handler          ] add api url: /v1/node/get_supported_apis
info  2020-02-10T02:28:47.590 keosd     wallet_api_plugin.cpp:73 plugin_startup       ] starting wallet_api_plugin
info  2020-02-10T02:28:47.590 keosd     http_plugin.cpp:625 add_handler          ] add api url: /v1/wallet/create
info  2020-02-10T02:28:47.590 keosd     http_plugin.cpp:625 add_handler          ] add api url: /v1/wallet/create_key
info  2020-02-10T02:28:47.590 keosd     http_plugin.cpp:625 add_handler          ] add api url: /v1/wallet/get_public_keys
info  2020-02-10T02:28:47.590 keosd     http_plugin.cpp:625 add_handler          ] add api url: /v1/wallet/import_key
info  2020-02-10T02:28:47.590 keosd     http_plugin.cpp:625 add_handler          ] add api url: /v1/wallet/list_keys
info  2020-02-10T02:28:47.590 keosd     http_plugin.cpp:625 add_handler          ] add api url: /v1/wallet/list_wallets
info  2020-02-10T02:28:47.590 keosd     http_plugin.cpp:625 add_handler          ] add api url: /v1/wallet/lock
info  2020-02-10T02:28:47.590 keosd     http_plugin.cpp:625 add_handler          ] add api url: /v1/wallet/lock_all
info  2020-02-10T02:28:47.590 keosd     http_plugin.cpp:625 add_handler          ] add api url: /v1/wallet/open
info  2020-02-10T02:28:47.590 keosd     http_plugin.cpp:625 add_handler          ] add api url: /v1/wallet/remove_key
info  2020-02-10T02:28:47.590 keosd     http_plugin.cpp:625 add_handler          ] add api url: /v1/wallet/set_timeout
info  2020-02-10T02:28:47.590 keosd     http_plugin.cpp:625 add_handler          ] add api url: /v1/wallet/sign_digest
info  2020-02-10T02:28:47.590 keosd     http_plugin.cpp:625 add_handler          ] add api url: /v1/wallet/sign_transaction
info  2020-02-10T02:28:47.590 keosd     http_plugin.cpp:625 add_handler          ] add api url: /v1/wallet/unlock

keosd execution check

Check whether keosd is running properly

root@2515550468dc:/omnione-testnet# ps -ef | grep keosd
UID        PID PPID C STIME TTY          TIME CMD
root        37 1 0 02:28 pts/0    00:00:00 keosd --unlock-timeout 999999999 --http-server-address 127.0.0.1:9876

Creating Wallet

Save the password to the file by creating the wallet.

root@2515550468dc:/omnione-testnet# cleos wallet create --file .keowdpw
warn  2020-02-10T02:29:20.688 keosd     wallet.cpp:223 save_wallet_file     ] saving wallet to file /root/eosio-wallet/./default.wallet
Creating wallet: default
Save password to use in the future to unlock this wallet.
Without password imported keys will not be retrievable.
saving password to .keowdpw

Check Wallet password

This command checks the password of stored wallet file.

root@2515550468dc:/omnione-testnet# cat .keowdpw
PW5JxRvMtLhmU1wbGca7LWCu1oC2A1d9m6nY5JscY6tay5sJnDdg

Check Wallet unlock

Proceed to check Wallet's unlock. Upon initial creation, it becomes unlock status by default and must be unlocked by entering a password after the restart.

root@2515550468dc:/omnione-testnet# cleos wallet list
Wallets:
[
  "default *"
]

When '*' appears after the default phrase it means it is unlocked.

To unlock please execute the following command

$ cleos wallet unlock

BP Private Key settings

Checking Private Key

Check currently owned private keys.

$ cleos wallet private_keys

Set Private Key by using the command as below with the confirmed key.

root@2515550468dc:/omnione-testnet# cleos wallet import
private key: warn  2019-11-06T07:11:13.698 thread-0  wallet.cpp:223 save_wallet_file     ] saving wallet to file /root/eosio-wallet/./default.wallet
imported private key for: EOS7J1EaxkavAPyAxXmUN57tw9V7wJEkpu4bLQ

Signature settings

Open "config.ini" file to modify the value required for the signature Modify and save YOUR_NAME, YOUR_PUB_KEY with the currently owned value.

root@2515550468dc:/omnione-testnet# vi bp_node/config/config.ini
#producer-name = YOUR_NAME
#signature-provider = YOUR_PUBKEY=KEOSD:http://127.0.0.1:9876/v1/wallet/sign_digest

(Change as below, example)
producer-name = rqhln1rzb5f2
signature-provider = EOS7J1EaxkavAPyAxXmUN57tw9V7wJEkpu4bLQD74xh8HLaWTjV3p=KEOSD:http://127.0.0.1:9876/v1/wallet/sign_dig

Modifying the script file

Open "gen_bp_start.sh" script file to delete and save some code. Below are the items to be deleted

  • --prodocer-name

  • --signature-provider

root@2515550468dc:/omnione-testnet# vi gen_bp_start.sh
#!/bin/bash
nodeos \
-e \
--genesis-json /omnione-testnet/bp_node/config/genesis.json \
--producer-name = rqhln1rzb5f2 \ <- 삭제
--signature-provider EOS7J1EaxkavAPyAxXmUN57tw9V7wJEkpu4bLQD74xh8HLaWTjV3p=KEY:5KQwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3 \ <- 삭제
--data-dir /omnione-testnet/bp_node/node_data \
--config-dir /omnione-testnet/bp_node/config >> /omnione-testnet/bp_node/node_data/nodeos.log 2>&1 & \
echo $! > eosd.pid

(Change as below, example)
#!/bin/bash
nodeos \
-e \
--genesis-json /omnione-testnet/bp_node/config/genesis.json \
--data-dir /omnione-testnet/bp_node/node_data \
--config-dir /omnione-testnet/bp_node/config >> /omnione-testnet/bp_node/node_data/nodeos.log 2>&1 & \
echo $! > eosd.pid

Executing nodeos

After proceeding all operations, nodeos can be executed.

root@2515550468dc:/omnione-testnet# ./gen_bp_start.sh

Check if running properly

Check whether nodeos is running properly through log.

root@2515550468dc:/omnione-testnet# tail -f bp_node/node_data/nodeos.log

Terminate Docker by pressing Ctrl + p or q .

Reconnecting BP Node Docker

Use command as below to reconnect BP Node.

$ sudo docker attach omntestnet_bp_you

Check local directory Block data

When performing the initial BP Node deploying operation, it is executed to share date externally so that Block data can be checked from the outside.

$ cd ~/Raonsecure/docker/testnet/omnnode-data
$ ls
blocks eosd.pid nodeos.log snapshots  state
$ tail -f nodeos.log

Block data number is increasing as it appears from the above figure. To terminate, press ctrl + c.

Last updated