From e59c5284b6af48bc022829491b1f39d8fad30e99 Mon Sep 17 00:00:00 2001 From: Stefan Bussemaker <56066664+kad-busses@users.noreply.github.com> Date: Tue, 27 Jul 2021 14:06:21 +0200 Subject: [PATCH] create multichain.conf for 'normal' node (#25) --- multichain.sh | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/multichain.sh b/multichain.sh index 72c10eb..6f0897e 100644 --- a/multichain.sh +++ b/multichain.sh @@ -20,16 +20,12 @@ 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 @@ -37,7 +33,21 @@ start_main_node () { 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 \ @@ -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 \