Skip to content

Commit

Permalink
Merge pull request #2 from TheTrunk/master
Browse files Browse the repository at this point in the history
v3.2.0
  • Loading branch information
TheTrunk committed Sep 3, 2019
2 parents c025a71 + 31b9c50 commit 1d15907
Show file tree
Hide file tree
Showing 8 changed files with 694 additions and 81 deletions.
19 changes: 14 additions & 5 deletions README.md
@@ -1,13 +1,22 @@
Bitcore Node ZelCash
============

A ZelCash full node for building applications and services with Node.js. A node is extensible and can be configured to run additional services. At the minimum a node has an interface to ~~[Bitcoin Core with additional indexing](https://github.com/bitpay/bitcoin/tree/0.12.1-bitcore)~~ for more advanced address queries. Additional services can be enabled to make a node more useful such as exposing new APIs, running a block explorer and wallet service.
A ZelCash full node for building applications and services with Node.js. A node is extensible and can be configured to run additional services. Additional services can be enabled to make a node more useful such as exposing new APIs, running a block explorer and wallet service.

## Explorer Guide
### Part 1. Zelcash with extended RPC functionalities
```bash
wget -qO- https://raw.githubusercontent.com/TheTrunk/bitcore-node-zelcash/master/installZelcashd.sh | bash
```
### Part 2. Latest Zelcash insight explorer = bitcore-node-zelcash with insight-api and insight-ui
```bash
wget -qO- https://raw.githubusercontent.com/TheTrunk/bitcore-node-zelcash/master/installExplorer.sh | bash
```
## Install

```bash
git clone https://github.com/TheTrunk/bitcore-node-zelcash.git
cd bitcore-node-zelcash
git clone https://github.com/TheTrunk/bitcore-node-zelcash.git
cd bitcore-node-zelcash
npm install
bitcore-node start
```
Expand Down Expand Up @@ -37,8 +46,8 @@ This will create a directory with configuration files for your node and install

There are several add-on services available to extend the functionality of Bitcore:

- [Insight API](https://github.com/TheTrunk/insight-api-zelcash)
- [Insight UI](https://github.com/TheTrunk/insight-ui-zelcash)
- [Insight API](https://github.com/TheTrunk/insight-api)
- [Insight UI](https://github.com/TheTrunk/insight-ui)

## Documentation

Expand Down
119 changes: 119 additions & 0 deletions installExplorer.sh
@@ -0,0 +1,119 @@

#!/bin/bash

# install needed dependencies
cd
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
sudo apt-get install -y nodejs
sudo apt-get install -y build-essential
sudo apt-get install -y libzmq3-dev

# MongoDB
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 2930ADAE8CAF5059EE73BB4B58712A2291FA4AD5
echo "deb http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.1 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.1.list
sudo apt-get update
sudo apt-get install -y mongodb-org
sudo systemctl enable mongod
sudo service mongod start

#bitcore-node-zelcash
cd
git clone https://github.com/TheTrunk/bitcore-node-zelcash
cd bitcore-node-zelcash
npm install
cd bin
chmod +x bitcore-node
cp ~/zelcashBitcore/src/zelcashd ~/bitcore-node-zelcash/bin
./bitcore-node create mynode
cd mynode

rm bitcore-node.json

cat << EOF > bitcore-node.json
{
"network": "livenet",
"port": 3001,
"services": [
"bitcoind",
"insight-api",
"insight-ui",
"web"
],
"messageLog": "",
"servicesConfig": {
"web": {
"disablePolling": false,
"enableSocketRPC": false
},
"bitcoind": {
"sendTxLog": "./data/pushtx.log",
"spawn": {
"datadir": "./data",
"exec": "../zelcashd",
"rpcqueue": 1000,
"rpcport": 16124,
"zmqpubrawtx": "tcp://127.0.0.1:28332",
"zmqpubhashblock": "tcp://127.0.0.1:28332"
}
},
"insight-api": {
"routePrefix": "api",
"db": {
"host": "127.0.0.1",
"port": "27017",
"database": "zelcash-api-livenet",
"user": "",
"password": ""
},
"disableRateLimiter": true
},
"insight-ui": {
"apiPrefix": "api",
"routePrefix": ""
}
}
}
EOF

cd data
cat << EOF > zelcash.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
rpcport=16124
rpcallowip=127.0.0.1
rpcuser=zelcash
rpcpassword=myzelcashpassword
uacomment=bitcore
mempoolexpiry=24
rpcworkqueue=1100
maxmempool=2000
dbcache=1000
maxtxfee=1.0
dbmaxfilesize=64
showmetrics=0
addnode=explorer.zel.cash
addnode=explorer2.zel.cash
addnode=explorer.zelcash.online
addnode=explorer.zel.zeltrez.io
EOF

cd ..
cd node_modules
git clone https://github.com/TheTrunk/insight-api
git clone https://github.com/TheTrunk/insight-ui
cd insight-api
npm install
cd ..
cd insight-ui
npm install
cd ..
cd ..

echo "Explorer is installed"
echo "Then to start explorer navigate to mynode folder and type ../bitcore-node start. Explorer will be accessible on localhost:3001"
18 changes: 18 additions & 0 deletions installZelcashd.sh
@@ -0,0 +1,18 @@
#!/bin/bash

# install needed dependencies
sudo apt-get update
sudo apt-get install \
build-essential pkg-config libc6-dev m4 g++-multilib \
autoconf libtool ncurses-dev unzip git python \
zlib1g-dev wget bsdmainutils automake curl

# zelcashBitcore
cd
git clone -b Bitcore https://github.com/zelcash/zelcash.git zelcashBitcore
cd zelcashBitcore
./zcutil/fetch-params.sh
./zcutil/build.sh -j$(nproc)
cd
echo "Zelcashd with extended RPC functionalities is prepared. Please run following command to install insight explorer for zelcash"
echo "wget -qO- https://raw.githubusercontent.com/TheTrunk/bitcore-node-zelcash/master/installExplorer.sh | bash"
5 changes: 5 additions & 0 deletions lib/node.js
Expand Up @@ -62,6 +62,11 @@ function Node(config) {
this.https = config.https;
this.httpsOptions = config.httpsOptions;
this._setNetwork(config);

this.allowedOriginRegexp = new RegExp(config.allowedOriginRegexp || '.*');

this.messageLog = config.messageLog;
log.info('messageLog ' + this.messageLog);
}

util.inherits(Node, EventEmitter);
Expand Down

0 comments on commit 1d15907

Please sign in to comment.