Created
May 29, 2020 22:17
-
-
Save laser/5635a7dc9c27f6348cd7ee739813044f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -x | |
public_ip=$(curl -m 5 http://169.254.169.254/latest/meta-data/public-ipv4 || echo "127.0.0.1") | |
daemon_multiaddr=$(lotus net listen | grep 127 | sed -En "s/127\.0\.0\.1/${public_ip}/p") | |
miner_multiaddr=$(lotus-storage-miner net listen | grep 127 | sed -En "s/127\.0\.0\.1/${public_ip}/p") | |
miner_id=$(lotus-storage-miner info | grep Miner | cut -d ' ' -f2) | |
cd $(mktemp -d) | |
printf '{"daemon_multiaddr": "%s", "miner_multiaddr": "%s", "miner_id": "%s"}' $daemon_multiaddr $miner_multiaddr $miner_id > ./publish.json | |
python -m SimpleHTTPServer ${publish_port} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment