-
Notifications
You must be signed in to change notification settings - Fork 2
/
zclassic_explorer_2.sh
76 lines (63 loc) · 1.93 KB
/
zclassic_explorer_2.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#!/bin/bash
WHO=$(whoami)
# install npm v4
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm
nvm install v4
# install ZeroMQ libraries
sudo apt-get -y install libzmq3-dev
# install bitcore (branched and patched from https://github.com/z-classic/bitcore-node-zclassic.git)
npm install z-classic/bitcore-node-zclassic
# create bitcore node
./node_modules/bitcore-node-zclassic/bin/bitcore-node create zclassic-explorer
cd zclassic-explorer
# install patched insight api/ui (branched and patched from https://github.com/z-classic/insight-api-zclassic & https://github.com/z-classic/insight-ui-zclassic)
../node_modules/bitcore-node-zclassic/bin/bitcore-node install z-classic/insight-api-zclassic z-classic/insight-ui-zclassic
# create bitcore config file for bitcore and zcashd/zclassicd
# REPLACE "datadir" and "exec" with actual values of "/home/user"
cat << EOF > bitcore-node.json
{
"network": "mainnet",
"port": 3001,
"services": [
"bitcoind",
"insight-api-zclassic",
"insight-ui-zclassic",
"web"
],
"servicesConfig": {
"bitcoind": {
"spawn": {
"datadir": "/home/ubuntu/j62/.zclassic",
"exec": "/home/ubuntu/j62/zclassic/src/zcashd"
}
},
"insight-ui-zclassic": {
"apiPrefix": "api"
},
"insight-api-zclassic": {
"routePrefix": "api"
}
}
}
EOF
# create zcash.conf
cat << EOF > data/zclassic.conf
server=1
whitelist=127.0.0.1
txindex=1
addressindex=1
timestampindex=1
spentindex=1
zmqpubrawtx=tcp://127.0.0.1:28332
zmqpubhashblock=tcp://127.0.0.1:28332
rpcallowip=127.0.0.1
rpcuser=bitcoin
rpcpassword=local321
uacomment=bitcore
showmetrics=1
maxconnections=1000
EOF
echo "Start the block explorer, open in your browser http://server_ip:3001"
echo "Run the following line as one line of commands to start the block explorer"
echo "nvm use v4; cd zclassic-explorer; ./node_modules/bitcore-node-zclassic/bin/bitcore-node start"