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

Need more clarity on setting up the workshop #5

Open
rrybarczyk opened this issue Jul 12, 2024 · 4 comments
Open

Need more clarity on setting up the workshop #5

rrybarczyk opened this issue Jul 12, 2024 · 4 comments
Assignees
Labels
bug Something isn't working documentation Improvements or additions to documentation

Comments

@rrybarczyk
Copy link
Collaborator

Background

The README.md currently shows how to setup the block explorer aspect of the workshop (electrs and mempool.space). However there is a bit more to the setup than just these things.

Problem

The README.md does not clearly note that the Blockchain Explorer contents are for workshop setup and does not include useful details like:

  • Required installs.
  • Where to find the signet Genesis node/which bitcoin fork to run.
  • The bitcoin.conf contents.

I also ran into an issue with the mempool.space docker-compose.yml CORE_RPC_HOST variable.

Solution

Create docs/setup.md to host a complete instruction set to setup the workshop.

@rrybarczyk rrybarczyk self-assigned this Jul 12, 2024
@rrybarczyk rrybarczyk added documentation Improvements or additions to documentation bug Something isn't working labels Jul 12, 2024
@rrybarczyk
Copy link
Collaborator Author

This signet-genesis-node.sh was found in the ~/sv2-workshop on the SRI VM. Would be good to commit this:

#!/bin/bash

# Check if the environment variables are set
if [ -z "$BITCOIND" ] || [ -z "$BITCOIN_CLI" ] || [ -z "$BITCOIN_UTIL" ] || [ -z "$BITCOIN_DATA_DIR" ] || [ -z "$MINER" ]; then
  echo "Please make sure all environment variables (BITCOIND, BITCOIN_CLI, BITCOIN_UTIL, BITCOIN_DATA_DIR, MINER) are properly set. Exiting."
  exit 1
fi

# Check if the specific port is in use
if lsof -i :38332 | grep -q LISTEN; then
  echo "Port 38332 is already being used, which means there's probably a bitcoind already running in signet mode. Exiting."
  exit 1
fi

echo "This script is about to erase some contents of the provided BITCOIN_DATA_DIR. Do you want to continue? (yes/no)"
read -r user_input

if [ "$user_input" != "yes" ]; then
  echo "User did not consent. Exiting."
  exit 1
fi

rm -rf $BITCOIN_DATA_DIR/signet
rm -rf $BITCOIN_DATA_DIR/bitcoin.conf

cat << EOF > $BITCOIN_DATA_DIR/bitcoin.conf
[signet]
prune=0
txindex=1
server=1
rpcallowip=0.0.0.0/0
rpcbind=0.0.0.0
rpcuser=mempool
rpcpassword=mempool
# OP_TRUE
signetchallenge=51
EOF

echo "starting bitcoind in daemon mode..."
$BITCOIND -signet -datadir=$BITCOIN_DATA_DIR -fallbackfee=0.01 -daemon -sv2 -sv2port=38442

sleep 1

echo "creating a genesis wallet"
$BITCOIN_CLI -signet -datadir=$BITCOIN_DATA_DIR createwallet genesis

echo "mining some initial blocks"
for ((i=1; i<=16; i++))
do
  $MINER --cli="$BITCOIN_CLI -signet -datadir=$BITCOIN_DATA_DIR" generate --grind-cmd="$BITCOIN_UTIL grind" --address="tb1qmrv47upgrdd0f8rw62rwdtpd8r6qrn8kh7tj5f" --nbits=1d00ffff
done

echo "script finalized... running getblockchaininfo as the last step"
$BITCOIN_CLI -signet -datadir=$BITCOIN_DATA_DIR getblockchaininfo

@rrybarczyk
Copy link
Collaborator Author

To get the slides up and accessible at http://75.119.150.111:8888/html/sv2-workshop.html:

  • Log into the SRI VPS
  • Create a new tmux session
  • cd ~/sv2-workshop
  • Start the server: python -m http.server 8888

@rrybarczyk
Copy link
Collaborator Author

In the mempool.space README.md instructions, change:

docker-compose up

to

cd docker/
docker-compose up

@plebhash
Copy link
Collaborator

plebhash commented Nov 28, 2024

thanks to the help of our great Docker expert @Shourya742 , we were able to get a stable deployment on Ubuntu environments via f635ee8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants