~# cd $HOME/Bios_Boot_Node
~/Bios_Boot_Node# mkdir genesis
~/Bios_Boot_Node# cd genesis
~/Bios_Boot_Node/genesis# touch node_start.sh
~/Bios_Boot_Node/genesis# vi node_start.sh
#!/bin/bash
DATADIR=$HOME"/Bios_Boot_Node/node_data"
if [ ! -d $DATADIR ]; then
mkdir -p $DATADIR;
fi
nodeos \
--agent-name "Bios-Boot-Node" \
--producer-name "eosio" \
--genesis-json $HOME"/Bios_Boot_Node/genesis.json" \
--enable-stale-production \
--signature-provider [eosio Public Key]=KEY:[eosio Private Key] \
--data-dir $DATADIR"/data" \
--config-dir $HOME"/Bios_Boot_Node/config" \
--blocks-dir $DATADIR"/blocks" \
--http-server-address "localhost:18888" \
--p2p-listen-endpoint "0.0.0.0:19000" \
>> $DATADIR"/nodeos.log" 2>&1 & \
echo $! > $DATADIR"/nodeosd.pid"
echo /=========Node Start=========
echo View log command: tail -f $DATADIR/nodeos.log
echo ============================/
~/Bios_Boot_Node/genesis# sh node_start.sh
~# tail -f $HOME/Bios_Boot_Node/node_data/nodeos.log
~# ps -ef | grep eos
~# cleos -u http://localhost:18888 get info
~# curl http://localhost:18888/v1/chain/get_info | jq
For [eosio Public Key], [eosio Private Key], enter the Public Key which has created in the previous step.
4. Node stop
To stop genesis node, write stop.sh on the Shell script file in the directory then execute it.
~/Bios_Boot_Node/genesis# touch stop.sh
~/Bios_Boot_Node/genesis3 vi stop.sh
#!/bin/bash
DATADIR=$HOME"/Bios_Boot_Node/node_data"
if [ -f $DATADIR"/nodeosd.pid" ]; then
pid=`cat $DATADIR"/nodeosd.pid"`
echo $pid
kill $pid
rm -r $DATADIR"/nodeosd.pid"
echo -ne "Stoping Node"
while true; do
[ ! -d "/proc/$pid/fd" ] && break
echo -ne "."
sleep 1
done
echo -ne "\rNode Stopped. \n"
fi
~/Bios_Boot_Node/genesis# sh stop.sh
5. Node restart
If 'genesis node' is stopped, it cannot restart the process by using the created script from '3.bootnode henesis start'.
When above script is used, blockchain DB will be initialized and created.
To avoid, restart by using --hard-replay-blockchain option of nodeos.