Skip to content

Instantly share code, notes, and snippets.

@Sjors
Created August 26, 2018 09:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Sjors/fda9b601e9464f61332ac6490f487c0a to your computer and use it in GitHub Desktop.
Save Sjors/fda9b601e9464f61332ac6490f487c0a to your computer and use it in GitHub Desktop.
Bitcoin Core remote dev
testnet=1
[main]
[test]
server=1
rpcpassword=bitcoin
rpcuser=bitcoin
# This builds bitcoind on remote machine and starts it. It then forwards the RPC port so you use bitcoin-cli locally.
# Doesn't work with QT. Only works if remote and host architecture match (otherwise compile bitcoin-cli locally or cross compile it).
# Usage:
# * clone bitcoin into e.g. ~/dev-remote/bitcoin on the remote server
# * CONFIGURE=1 ../
# (set CONFIGURE=0 to skip ./autogen.sh and ./configure)
#!/bin/bash
set -ue
REMOTE_SERVER=remote-server
REMOTE_PATH=dev-remote/bitcoin
LOCAL=~/dev/bitcoind
HOST=x86_64-apple-darwin17.7.0
rsync -va $LOCAL/ $REMOTE_SERVER:$REMOTE_PATH --filter=':- .gitignore' \
--exclude .git \
--exclude build_msvc \
--exclude src/qt
if [ $CONFIGURE -eq "1" ]; then
ssh $REMOTE_SERVER "export PATH=$PATH:/usr/local/bin && cd $REMOTE_PATH && \
cd depends &&
NO_QT=1 make -j5 &&
./configure --prefix=`pwd`/depends/x86_64-apple-darwin17.7.0 --without-gui --disable-bench --with-miniupnpc=no"
fi
ssh $REMOTE_SERVER "export PATH=$PATH:/usr/local/bin && cd $REMOTE_PATH && \
make -j5"
rsync -av $REMOTE_SERVER:$REMOTE_PATH/src/bitcoin-cli ~/dev/bitcoind/src
ssh -t -L 18332:localhost:18332 $REMOTE_SERVER "cd $REMOTE_PATH && src/bitcoind"
ssh -t $REMOTE_SERVER "export PATH=$PATH:/usr/local/bin && cd $REMOTE_PATH && make check && test/functional/test_runner.py"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment