-
Notifications
You must be signed in to change notification settings - Fork 210
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New Fedimint Docker Downloader #5043
base: master
Are you sure you want to change the base?
Conversation
docker/downloader.sh
Outdated
esac | ||
done | ||
|
||
DOCKER_COMPOSE_FILE="https://raw.githubusercontent.com/Kodylow/fedimint/kl/docker-deploy/docker/latest/${INSTALL_TYPE}/${TLS_DIR}/docker-compose.yaml" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: reminder to switch it back to fedimint right before merging
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tracking ty
Some minor things I have noticed. I like the structure of the new script. I still need to play around with it to double check the various scenarios. |
dcea8b7
to
53c238f
Compare
are you running it from inside another docker container or something? just retried locally and worked on my mac and nix boxes fine. it's looping for all the configurations to require your input match one of the enum options, if you're running as a background or outside an interactive shell that might be causing it? |
I'm running it in a digital ocean shell |
This one works, might have to remove the loop checking then, piping into bash directly doesn't start interactive, was just running the downloader.sh not the curl script,
|
Neither of those work. Doing it from my own terminal instance through ssh doesn't work either. |
f40f81b
to
b0e527d
Compare
@TonyGiorgio sorry I'm an idiot just had to move the echo out of the loop in a couple places, fixed |
dc232fd
to
4d44b98
Compare
1 more time, missing </dev/tty |
be52144
to
4ec20fa
Compare
docker/downloader.sh
Outdated
echo "Do you want to setup an xmpp chat server on this instance? [yes/no]" | ||
while true; do | ||
read -r -n 1 -p "Your choice (yes/no): " choice </dev/tty | ||
echo | ||
case $choice in | ||
y | Y) | ||
SETUP_XMPP=true | ||
break | ||
;; | ||
n | N) | ||
SETUP_XMPP=false | ||
# remove xmpp service from services list | ||
SERVICES=$(echo $SERVICES | sed -e 's/xmpp//g') | ||
# remove xmpp meta from fedimintd setup | ||
sed -i '/FM_EXTRA_DKG_META=chat_server_domain=xmpp.fedimint.my-super-host.com/d' $path | ||
# remove xmpp section from docker-compose.yaml | ||
sed -i '/### START_XMPP ###/,/### END_XMPP ###/d' $path | ||
# remove prosody volume from docker-compose.yaml | ||
sed -i '/prosody_datadir:/d' $path | ||
break | ||
;; | ||
*) | ||
echo "Invalid option. Please type 'yes' or 'no'." | ||
;; | ||
esac | ||
done |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: you're asking for 'yes' or 'no' like you do the rest, but you're accepting y
or 'n'
instead. Causing issues when the user is typing yes fast and it goes ahead and starts filling in the next prompt.
docker/downloader.sh
Outdated
read -p "Enter the Esplora URL you'd like to use to get $NETWORK_TYPE blockdata from, or click enter to use the network default: [$DEFAULT_ESPLORA_URL]: " ESPLORA_URL </dev/tty | ||
ESPLORA_URL=${ESPLORA_URL:-$DEFAULT_ESPLORA_URL} | ||
echo "Using Esplora URL: $ESPLORA_URL" | ||
|
||
# Set the esplora URL in the docker-compose file | ||
sed -i "s|FM_BITCOIN_RPC_URL=https://blockstream.info/api/|FM_BITCOIN_RPC_URL=$ESPLORA_URL|" ./docker-compose.yaml | ||
|
||
# Set the bitcoin network in the docker-compose file if not mutinynet default | ||
if [ "$NETWORK_TYPE" != "mutinynet" ]; then | ||
sed -i "s|FM_BITCOIN_NETWORK=signet|FM_BITCOIN_NETWORK=$NETWORK_TYPE|" ./docker-compose.yaml | ||
fi | ||
|
||
else # Using Bitcoin Node for Guardian blockchain data | ||
echo "You will need to provide the Bitcoin Node RPC URL to get blockchain data." | ||
read -p "Enter the RPC URL for your Bitcoin node (ex. https://mynode.m.voltageapp.io:8332): " -a bitcoin_rpc_url </dev/tty | ||
if [[ -z ${bitcoin_rpc_url[*]} ]]; then | ||
echo 'Error: You must set a Bitcoin RPC URL if you configure the guardian with an existing Bitcoin node' >&2 | ||
exit 1 | ||
fi | ||
echo "Using Bitcoin RPC URL: $bitcoin_rpc_url" | ||
|
||
# Set the bitcoin RPC URL in the docker-compose file | ||
sed -i "s|FM_BITCOIN_RPC_URL=https://blockstream.info/api/|FM_BITCOIN_RPC_URL=$bitcoin_rpc_url|" ./docker-compose.yaml | ||
fi | ||
fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Going through the esplora flow still launches the bitcoind docker container and starts syncing the chain. I think you should probably strip out or insert the bitcoind part of the docker-compose.yaml file based on the results here.
docker/downloader.sh
Outdated
if [ "$NETWORK_TYPE" != "mutinynet" ]; then | ||
sed -i "s|FM_BITCOIN_NETWORK=signet|FM_BITCOIN_NETWORK=$NETWORK_TYPE|" ./docker-compose.yaml | ||
fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for mainnet, it's bitcoin
I believe, not mainnet
. I'm getting this:
root-fedimintd-1 | For more information, try '--help'.
root-fedimintd-1 | Starting fedimintd
root-fedimintd-1 | error: invalid value 'mainnet' for '--network <NETWORK>': Unknown network (type mainnet)
New Fedimint Downloader, currently points at this branch if you want to try testing it with:
Works for Fedimint Guardians and Gateways on mutinynet and mainnet (couldn't get the testnet one working but can be a follow on)