Skip to content

Instantly share code, notes, and snippets.

@compleatang
Created March 6, 2015 17:18
Show Gist options
  • Save compleatang/f73daffa67122ac3a28f to your computer and use it in GitHub Desktop.
Save compleatang/f73daffa67122ac3a28f to your computer and use it in GitHub Desktop.
#!/bin/sh
echo ""
echo ""
echo "Fetching the Chain."
cd ~/.decerver/dapps/helloworld/contracts
epm fetch --checkout --name helloworld ${REMOTE_HOST:=hw-workshop-7a0afb95-1.compleatang.cont.tutum.io}:${FETCH_PORT:=15256}
epm --log 5 deploy
echo "The chain has been fetched and checked out."
echo ""
echo ""
echo "Setting Defaults"
epm config key_session:${KEY_SESSION:=key_session} \
local_host:${LOCAL_HOST:=0.0.0.0} \
local_port:${LOCAL_PORT:=15254} \
max_peers:${MAX_PEERS:=10}
echo ""
echo ""
echo "Setting the Key File"
if [ -z "$KEY_FILE" ]
then
echo "No key file given."
else
echo "Using the given key file."
epm config key_file:${KEY_FILE}
fi
echo ""
echo ""
echo "Setting Connection."
epm config remote_host:${REMOTE_HOST:=hw-workshop-7a0afb95-1.compleatang.cont.tutum.io} remote_port:${REMOTE_PORT:=15254} use_seed:true
epm config log_level:${LOG_LEVEL:=3}
# Now we need to tell the DApp about our chain and then we’re ready to VRoom.
blockchain_id=$(epm plop chainid)
root_contract=$(epm plop vars | cut -d : -f 2)
peer_server_address="hw-workshop-7a0afb95-1.compleatang.cont.tutum.io:15254"
cd ~/.decerver/dapps/helloworld
mv package.json /tmp/
jq '.module_dependencies[0].data |= . * {peer_server_address: "'$peer_server_address'", blockchain_id: "'$blockchain_id'", root_contract: "'$root_contract'"}' /tmp/package.json \
> package.json
echo ""
echo ""
echo "Configuring package.json"
echo "blockchain_id: $blockchain_id"
echo "root_contract: $root_contract"
echo "peer_server_address: ${REMOTE_HOST:=hw-workshop-7a0afb95-1.compleatang.cont.tutum.io}:${REMOTE_PORT:=15254}"
echo "package.json"
cat package.json
echo ""
echo ""
echo "Starting up! (Wheeeeeee says the marmot)"
echo ""
echo ""
sleep 5 && curl http://localhost:3000/admin/switch/helloworld &
decerver
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment