Skip to content
This repository has been archived by the owner on Dec 14, 2023. It is now read-only.

Commit

Permalink
create multichain.conf for 'normal' node (#25)
Browse files Browse the repository at this point in the history
  • Loading branch information
kad-busses authored Jul 27, 2021
1 parent bdf686a commit e59c528
Showing 1 changed file with 21 additions and 8 deletions.
29 changes: 21 additions & 8 deletions multichain.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,24 +20,34 @@ init_chain() {
IFS='|' read -ra KV <<< "${!KV[0]}"
sed -i "s/^${KV[0]}.*/${KV[0]} = ${KV[1]}/" /data/$CHAINNAME/params.dat
done
}

start_main_node () {
echo "Start main node with chain: $CHAINNAME."

if [ ! -d /data/$CHAINNAME ]; then
init_chain
fi

cat /data/$CHAINNAME/params.dat
}

create_multichain_conf() {
echo "create multichain conf"

cat << EOF > /data/$CHAINNAME/multichain.conf
rpcuser=$RPC_USER
rpcpassword=$RPC_PASSWORD
rpcallowip=$RPC_ALLOW_IP
rpcport=$RPC_PORT
EOF

cp /data/$CHAINNAME/multichain.conf /data/multichain.conf
cat /data/$CHAINNAME/multichain.conf
}

start_main_node () {
echo "Start main node with chain: $CHAINNAME."

if [ ! -d /data/$CHAINNAME ]; then
init_chain
fi

create_multichain_conf

echo "Conf created"

exec multichaind $CHAINNAME \
-txindex \
Expand All @@ -55,6 +65,9 @@ start_node () {

echo "Start node with existing chain: $CHAINNAME from $IP:$NETWORK_PORT"

mkdir -p /data/$CHAINNAME
create_multichain_conf

exec multichaind $CHAINNAME@$IP:$NETWORK_PORT \
-txindex \
-shrinkdebugfilesize \
Expand Down

0 comments on commit e59c528

Please sign in to comment.