Created
April 8, 2015 08:17
-
-
Save jorisbontje/a09bbd771d29fd175ef9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -x | |
# fix time drift | |
boot2docker ssh sudo ntpclient -s -h pool.ntp.org | |
DOCKER_IP=$(boot2docker ip) | |
DOCKER_IMAGE=cppeth | |
DOCKER_NAME=moveth | |
#PEER_NODE=poc-8.ethdev.com | |
PEER_NODE=kobigurk.dyndns.org | |
# created shared ethdata data-only container | |
ETHDATA=`docker inspect ethdata` | |
if [ $? -eq 0 ] | |
then | |
echo "ethdata already exists" | |
else | |
echo "creating ethdata data-only container" | |
docker run -d -v /.ethereum --name ethdata busybox echo "Data-only container for eth" | |
fi | |
docker run -d --name $DOCKER_NAME --volumes-from ethdata -p 30303 -p 8080 $DOCKER_IMAGE eth --client-name $DOCKER_NAME --json-rpc --mining on -v 4 --bootstrap -peers 8 --local-networking -f | |
ETH_JSONRPC_PORT=$(docker port $DOCKER_NAME 8080 | cut -d ':' -f 2) | |
ETH_JSONRPC_URI="http://${DOCKER_IP}:${ETH_JSONRPC_PORT}" | |
echo "ETH_JSONRPC_URI=${ETH_JSONRPC_URI}" | |
echo "Tunneling eth JSONRPC to 127.0.0.1:8080" | |
boot2docker ssh -N -L 8080:127.0.0.1:`docker port $DOCKER_NAME 8080|cut -f 2 -d:` watch & | |
echo $! > ~/.eth-jsonrpc-tunnel.pid |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
docker kill moveth | |
docker rm moveth | |
if [ -e ~/.eth-jsonrpc-tunnel.pid ]; then | |
echo "Killing JSONRPC tunnel" | |
PID=`cat ~/.eth-jsonrpc-tunnel.pid` | |
kill -- -$(ps -o pgid= $PID | grep -o [0-9]*) | |
rm ~/.eth-jsonrpc-tunnel.pid | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment