stack-orchestrator/app/data/config/fixturenet-lotus/setup-node.sh
prathamesh0 333797b0c3
Lotus stack usability improvements (#489)
* move health check inside startup script

* remove pre-built genesis

* move health check inside startup script

* remove pre-built genesis

* Use hardcoded paths for Lotus node data directories

* Persist proof parameters

* Write out miner node's multiaddr with docker network IP

* Enable Lotus ETH RPC API and bind to all available interfaces

* Fund a known account

---------

Co-authored-by: iskay <ikay@lakeheadu.ca>
Co-authored-by: Ian Kay <ian@knowable.vc>
2023-08-09 17:24:47 +05:30

30 lines
818 B
Bash

#!/bin/bash
lotus --version
# Loop until the daemon is started
echo "Waiting for miner to share peering info..."
while [ ! -f /root/.lotus-shared/miner.addr ]; do
sleep 5
done
echo "Resuming..."
# if not already initialized
if [ ! -f $LOTUS_PATH/config.toml ]; then
# init node config
mkdir $LOTUS_PATH
lotus config default > $LOTUS_PATH/config.toml
# add bootstrap peer info if available
if [ -f /root/.lotus-shared/miner.addr ]; then
MINER_ADDR=\"$(cat /root/.lotus-shared/miner.addr)\"
# add bootstrap peer id to config file
sed -i "/^\[Libp2p\]/a \ \ BootstrapPeers = [$MINER_ADDR]" $LOTUS_PATH/config.toml
else
echo "Bootstrap peer info not found, unable to configure. Manual peering will be required."
fi
fi
# start node
lotus daemon --genesis=/root/.lotus-shared/devgen.car