scripts: separate miner deploy from node deploy

This commit is contained in:
Łukasz Magiera 2019-10-15 04:11:11 +02:00
parent 75680ae502
commit f19108454a
2 changed files with 24 additions and 20 deletions

View File

@ -2,24 +2,6 @@
HOST=$1
# upload binaries
# TODO: destroy
ssh "$HOST" 'systemctl stop lotus-storage-miner'
ssh "$HOST" 'systemctl stop lotus-daemon'
ssh "$HOST" 'mkdir -p .lotus .lotusstorage' &
scp "./lotus" "$HOST:/usr/local/bin" &
scp "./lotus-storage-miner" "$HOST:/usr/local/bin" &
scp -C scripts/daemon.service "${HOST}:/etc/systemd/system/lotus-daemon.service" &
scp -C scripts/sminer.service "${HOST}:/etc/systemd/system/lotus-storage-miner.service" &
wait
ssh "$HOST" 'systemctl daemon-reload'
ssh "$HOST" 'systemctl start lotus-daemon' &
ssh "$HOST" 'systemctl start lotus-storage-miner' &
wait
ssh "$HOST" 'lotus wallet new bls > addr'
ssh "$HOST" 'curl http://147.75.80.29:777/sendcoll?address=$(cat addr)' &
ssh "$HOST" 'curl http://147.75.80.29:777/sendcoll?address=$(cat addr)' &
@ -27,9 +9,8 @@ ssh "$HOST" 'curl http://147.75.80.29:777/send?address=$(cat addr)' &
wait
echo "SYNC WAIT"
sleep 30
ssh "$HOST" 'lotus sync wait'
ssh "$HOST" 'lotus-storage-miner init --owner=$(cat addr)'
ssh "$HOST" 'systemctl start lotus-storage-miner' &
# setup miner actor

23
scripts/deploy-node.sh Executable file
View File

@ -0,0 +1,23 @@
#!/usr/bin/env bash
HOST=$1
# upload binaries
# TODO: destroy
ssh "$HOST" 'systemctl stop lotus-storage-miner'
ssh "$HOST" 'systemctl stop lotus-daemon'
ssh "$HOST" 'mkdir -p .lotus .lotusstorage' &
scp "./lotus" "$HOST:/usr/local/bin" &
scp "./lotus-storage-miner" "$HOST:/usr/local/bin" &
scp -C scripts/daemon.service "${HOST}:/etc/systemd/system/lotus-daemon.service" &
scp -C scripts/sminer.service "${HOST}:/etc/systemd/system/lotus-storage-miner.service" &
wait
ssh "$HOST" 'systemctl daemon-reload'
ssh "$HOST" 'systemctl start lotus-daemon' &
wait
# setup miner actor