Skip to content
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

Draft
wants to merge 14 commits into
base: master
Choose a base branch
from

Conversation

Kodylow
Copy link
Member

@Kodylow Kodylow commented Apr 19, 2024

New Fedimint Downloader, currently points at this branch if you want to try testing it with:

curl -sSL https://raw.githubusercontent.com/Kodylow/fedimint/kl/docker-deploy/docker/downloader.sh | bash

Works for Fedimint Guardians and Gateways on mutinynet and mainnet (couldn't get the testnet one working but can be a follow on)

image

@Kodylow Kodylow requested review from a team as code owners April 19, 2024 23:07
esac
done

DOCKER_COMPOSE_FILE="https://raw.githubusercontent.com/Kodylow/fedimint/kl/docker-deploy/docker/latest/${INSTALL_TYPE}/${TLS_DIR}/docker-compose.yaml"
Copy link
Contributor

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

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tracking ty

docker/gateway/tls/docker-compose.yaml Outdated Show resolved Hide resolved
docker/guardian/tls/docker-compose.yaml Outdated Show resolved Hide resolved
docker/gateway/tls/docker-compose.yaml Outdated Show resolved Hide resolved
docker/guardian/tls/docker-compose.yaml Show resolved Hide resolved
@TonyGiorgio
Copy link
Contributor

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.

@Kodylow Kodylow force-pushed the kl/docker-deploy branch 2 times, most recently from dcea8b7 to 53c238f Compare April 24, 2024 07:31
@TonyGiorgio
Copy link
Contributor

I ran this and it went into an infinite loop at the beginning.

Screenshot 2024-05-04 at 5 23 56 PM

@Kodylow
Copy link
Member Author

Kodylow commented May 5, 2024

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?

@TonyGiorgio
Copy link
Contributor

I'm running it in a digital ocean shell

@Kodylow
Copy link
Member Author

Kodylow commented May 5, 2024

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,

curl -sSL https://raw.githubusercontent.com/Kodylow/fedimint/kl/docker-deploy/docker/downloader.sh > downloader.sh && chmod +x downloader.sh && ./downloader.sh

@TonyGiorgio
Copy link
Contributor

Neither of those work. Doing it from my own terminal instance through ssh doesn't work either.

@Kodylow Kodylow force-pushed the kl/docker-deploy branch 2 times, most recently from f40f81b to b0e527d Compare May 5, 2024 01:29
@Kodylow
Copy link
Member Author

Kodylow commented May 5, 2024

@TonyGiorgio sorry I'm an idiot just had to move the echo out of the loop in a couple places, fixed

@TonyGiorgio
Copy link
Contributor

TonyGiorgio commented May 5, 2024

right after typing the first yes

Screenshot 2024-05-04 at 8 43 11 PM

@Kodylow Kodylow force-pushed the kl/docker-deploy branch 2 times, most recently from dc232fd to 4d44b98 Compare May 5, 2024 01:48
@Kodylow
Copy link
Member Author

Kodylow commented May 5, 2024

1 more time, missing </dev/tty

@TonyGiorgio
Copy link
Contributor

After saying yes to the alpha disclaimer

Screenshot 2024-05-04 at 8 51 11 PM

@Kodylow Kodylow marked this pull request as draft May 5, 2024 01:57
@Kodylow Kodylow force-pushed the kl/docker-deploy branch 3 times, most recently from be52144 to 4ec20fa Compare May 5, 2024 02:03
Comment on lines 313 to 339
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
Copy link
Contributor

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.

Comment on lines 565 to 624
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
Copy link
Contributor

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.

Comment on lines 573 to 575
if [ "$NETWORK_TYPE" != "mutinynet" ]; then
sed -i "s|FM_BITCOIN_NETWORK=signet|FM_BITCOIN_NETWORK=$NETWORK_TYPE|" ./docker-compose.yaml
fi
Copy link
Contributor

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants