In my private multi-node blockchain. There are 4 nodes. One genesis (only receives blocks) and Others (Produce and receive blocks). All nodes share the same genesis.json
file. Inside genesis.json
I have set the genesis node public key as the initial_key
. All Nodes run nodeos
with their respective keys using:
#!/bin/bash
DATADIR="./blockchain"
if [ ! -d $DATADIR ]; then
mkdir -p $DATADIR; fi;
nodeos \
--genesis-json $DATADIR"/../../genesis.json" \
--signature-provider NODEPUBKEY=KEY:NODEPRIVKEY\
--plugin eosio::producer_plugin \
--plugin eosio::producer_api_plugin \
--plugin eosio::chain_plugin \
--plugin eosio::chain_api_plugin \
--plugin eosio::http_plugin \
--plugin eosio::history_api_plugin \
--plugin eosio::history_plugin \
--plugin eosio::net_api_plugin \
--plugin eosio::net_plugin \
--data-dir $DATADIR"/data" \
--blocks-dir $DATADIR"/blocks" \
--config-dir $DATADIR"/config" \
--producer-name eosio \
--http-server-address genesisip:8889 \
--p2p-listen-endpoint genesisip:8888 \
--access-control-allow-origin=* \
--contracts-console \
--http-validate-host=false \
--verbose-http-errors \
--enable-stale-production \
--p2p-peer-address peer1IP:8888 \
--p2p-peer-address peer2IP:8888 \
--p2p-peer-address peer3IP:8888 \
--max-transaction-time 1000 \
--filter-on=* \
>> $DATADIR"/nodeos.log" 2>&1 & \
echo $! > $DATADIR"/eosd.pid":8888 \
Now I connect blockchain through EosSharp API. API is using the private key of the genesis node whose public key is set as an initial_key
in genesis.json
to sign transactions. My question is if I want to do transactions using the Peer3 private key, then do I need to change the initial_key
as a public key of Peer3? Because currently, Web API is giving exception "UnAuthorised" for the key other than genesis.