lotus/scripts/deploy-bootstrapper.sh

35 lines
786 B
Bash
Raw Permalink Normal View History

2019-12-05 14:05:17 +00:00
#!/usr/bin/env bash
log() {
echo -e "\e[33m$1\e[39m"
}
host=$1
log "> Deploying bootstrap node $host"
log "Stopping lotus daemon"
ssh "$host" 'systemctl stop lotus-daemon' &
2020-07-08 10:38:59 +00:00
ssh "$host" 'systemctl stop lotus-miner' &
2019-12-05 14:05:17 +00:00
wait
ssh "$host" 'rm -rf .lotus' &
2020-07-08 10:53:04 +00:00
ssh "$host" 'rm -rf .lotusminer' &
2019-12-05 14:05:17 +00:00
scp -C lotus "${host}":/usr/local/bin/lotus &
2020-07-08 10:38:59 +00:00
scp -C lotus-miner "${host}":/usr/local/bin/lotus-miner &
2019-12-05 14:05:17 +00:00
wait
log 'Initializing repo'
ssh "$host" 'systemctl start lotus-daemon'
scp scripts/bootstrap.toml "${host}:.lotus/config.toml"
ssh "$host" "echo -e '[Metrics]\nNickname=\"Boot-$host\"' >> .lotus/config.toml"
ssh "$host" 'systemctl restart lotus-daemon'
log 'Extracting addr info'
ssh "$host" 'lotus net listen' | grep -v '/10' | grep -v '/127' >> build/bootstrap/bootstrappers.pi