Remove ip address hardcode. Fixes #959

This commit is contained in:
Michael Vines 2018-09-06 11:41:35 -07:00
parent 5a57d9b5d9
commit e175c9dea9
2 changed files with 8 additions and 4 deletions

View File

@ -173,8 +173,11 @@ find_leader() {
# Select leader from the Snap configuration
leader_ip=$(snapctl get leader-ip)
if [[ -z $leader_ip ]]; then
# Assume public testnet by default
leader_ip=35.227.93.37 # testnet.solana.com
leader=testnet.solana.com
leader_ip=$(dig +short "${leader%:*}" | head -n1)
if [[ -z $leader_ip ]]; then
usage "Error: unable to resolve IP address for $leader"
fi
fi
leader=$leader_ip
leader_address=$leader_ip:8001

View File

@ -124,10 +124,11 @@ parts:
mkdir -p $SNAPCRAFT_PART_INSTALL/scripts/
cp -av scripts/* $SNAPCRAFT_PART_INSTALL/scripts/
# TODO: build curl,rsync/multilog from source instead of sneaking it in from the host
# system...
# TODO: build curl,dig,rsync/multilog from source instead of sneaking it
# in from the host system...
set -x
mkdir -p $SNAPCRAFT_PART_INSTALL/bin
cp -av /usr/bin/curl $SNAPCRAFT_PART_INSTALL/bin/
cp -av /usr/bin/dig $SNAPCRAFT_PART_INSTALL/bin/
cp -av /usr/bin/multilog $SNAPCRAFT_PART_INSTALL/bin/
cp -av /usr/bin/rsync $SNAPCRAFT_PART_INSTALL/bin/