From 9252f901729437a391dc05c5b30aa484b59074f3 Mon Sep 17 00:00:00 2001 From: Jon Layton Date: Tue, 3 Apr 2018 07:52:46 +0000 Subject: [PATCH] Fixes for v5 --- btcp_v5_node_setup.sh | 122 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 122 insertions(+) create mode 100755 btcp_v5_node_setup.sh diff --git a/btcp_v5_node_setup.sh b/btcp_v5_node_setup.sh new file mode 100755 index 0000000..823b188 --- /dev/null +++ b/btcp_v5_node_setup.sh @@ -0,0 +1,122 @@ +#!/bin/bash + +# Get Ubuntu Dependencies +sudo apt-get update + +sudo apt-get -y install \ + build-essential pkg-config libc6-dev m4 g++-multilib \ + autoconf libtool ncurses-dev unzip git python \ + zlib1g-dev wget bsdmainutils automake + +sudo apt-get install -y libcairo2-dev libjpeg-dev libgif-dev + +# Install npm +sudo apt-get -y install npm +# Install ZeroMQ libraries +sudo apt-get -y install libzmq3-dev + +# Install nvm (npm version manager) +wget -qO- https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash + +# Set up nvm +export NVM_DIR="$HOME/.nvm" +[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm +[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion + +# Install node v9, or v4 for <=4.0 +nvm install v9 #v4 #v9 +nvm alias default v9 +nvm use v9 #v4 #v9 + +npm uninstall -g ch4ot1c/bitcore-node +npm uninstall -g bitcore-node +npm uninstall -g BTCPrivate/bitcore +npm uninstall -g bitcore + +npm install -g npm-run-all mocha protractor +npm install -g BTCPrivate/bitcore + +# Fetch BTCP + Build from source +#./build_btcp.sh + +# -- Bitcore -- + +bitcore create btcp +#bitcore install ... +cd btcp + +# TODO set generated package.json's refs to ch4ot1c/ +npm install + +# !!! OPTIONAL [TODO present cli options] Install store-demo +#cd ~ +#git clone https://github.com/BTCPrivate/store-demo +#cd btcp-explorer/node_modules +#ln -s ~/store-demo + +# !!! OPTIONAL [TODO present cli options] Install address-watch +#cd ~ +#git clone https://github.com/BTCPrivate/address-watch +#cd btcp-explorer/node_modules +#ln -s ~/address-watch + +# !!! OPTIONAL [TODO present cli options] Install bitcore-wallet-service + + +#bitcore install ch4ot1c/insight-api ch4ot1c/insight +# (BTCPrivate/bitcore-wallet-service, BTCPrivate/store-demo, BTCPrivate/address-watch) + +# Create config file for Bitcore +cat << EOF > bitcore-node.json +{ + "network": "livenet", + "port": 8001, + "datadir": "/tmp", + "services": [ + "p2p", + "db", + "header", + "block", + "mempool", + "address", + "transaction", + "timestamp", + "fee", + "insight-api", + "insight-ui", + "web" + ], + "servicesConfig": { + "p2p": { + "peers": [ + { "ip": { "v4": "127.0.0.1" }, "port": 7933 } + ] + }, + "insight-ui": { + "apiPrefix": "api", + "routePrefix": "" + }, + "insight-api": { + "routePrefix": "api", + "disableRateLimiter": true, + "enableCache": true + }, + "fee": { + "rpc": { + "user": "local", + "pass": "local", + "host": "localhost", + "protocol": "http", + "port": 7932 + } + } + } +} +EOF + +echo "To start the daemon and all services, run:" +echo "./start.sh" +echo "\n" +echo "To view the explorer in your browser - http://server_ip:8001" +echo "For https, we recommend you route through Cloudflare." +