Skip to content

Instantly share code, notes, and snippets.

@vtshah
Created April 7, 2018 15:47
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 vtshah/094724d0ec8b631f2c1e845097ee2af2 to your computer and use it in GitHub Desktop.
Save vtshah/094724d0ec8b631f2c1e845097ee2af2 to your computer and use it in GitHub Desktop.
#!/bin/bash
echo "running update"
sudo apt-get -y update
echo "downloading ark-deployer"
git clone https://github.com/ArkEcosystem/ark-deployer.git
echo "downloading nvm"
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.8/install.sh | bash
echo "sourcing nvm and running install"
. ~/.nvm/nvm.sh
. ~/.profile
. ~/.bashrc
nvm install 8.9.1
sudo apt-get install -y jq
#Variables for installations
PUBLICIP="$(dig TXT +short o-o.myaddr.l.google.com @ns1.google.com | awk -F'"' '{ print $2}')"
GLOBALIP="0.0.0.0"
CHAINNAME=PipeCoin
DATABASENAME=ark_pipecoin
CHAINTOKEN=PIPECOIN
CHAINSYMBOL=PIP
CHAINFORGERS=51
MAXVOTESPERWALLET=1
CHAINBLOCKTIME=8
CHAINTRANSPERBLOCK=50
REWARDSTART=75600
REWARDPERBLOCK=200000000
TOTALPREMINE=2100000000000000
echo "Beginning ark node installation"
~/ark-deployer/bridgechain.sh install-node --name $CHAINNAME --database $DATABASENAME --token $CHAINTOKEN --symbol $CHAINSYMBOL --node-ip $GLOBALIP --explorer-ip $PUBLICIP --forgers $CHAINFORGERS --max-votes $MAXVOTESPERWALLET --blocktime $CHAINBLOCKTIME --transactions-per-block $CHAINTRANSPERBLOCK --reward-height-start $REWARDSTART --reward-per-block $REWARDPERBLOCK --total-premine $TOTALPREMINE --autoinstall-deps --non-interactive
echo "Start-node for the new bridgechain"
~/ark-deployer/bridgechain.sh start-node --name $CHAINNAME --non-interactive
echo "installing explorer"
~/ark-deployer/bridgechain.sh install-explorer --name $CHAINNAME --token $CHAINTOKEN --node-ip $PUBLICIP --explorer-ip $PUBLICIP --skip-deps
echo "Changing IP address in ~/ark-explorer/start-explorer.sh to the all IPs"
sed -i "s/$PUBLICIP/$GLOBALIP/g" ~/ark-explorer/start-explorer.sh
echo "Starting ark explorer"
~/ark-deployer/bridgechain.sh start-explorer
echo "Ark explorer is now started at http://$PUBLICIP:4200 - Give it a couple of minutes to start up!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment