Zcash-ify

This commit is contained in:
str4d 2016-08-28 19:27:43 +12:00 committed by Jack Grigg
parent 95bcad836c
commit 48a1a17f10
11 changed files with 30 additions and 26 deletions

View File

@ -1,6 +1,6 @@
# Insight API
A Bitcoin blockchain REST and web socket API service for [Bitcore Node](https://github.com/bitpay/bitcore-node).
A Zcash blockchain REST and web socket API service for [Bitcore Node](https://github.com/bitpay/bitcore-node).
This is a backend-only service. If you're looking for the web frontend application, take a look at https://github.com/bitpay/insight-ui.
@ -10,7 +10,7 @@ This is a backend-only service. If you're looking for the web frontend applicati
npm install -g bitcore-node@latest
bitcore-node create mynode
cd mynode
bitcore-node install insight-api
bitcore-node install insight-api-zcash
bitcore-node start
```
@ -20,7 +20,7 @@ The API endpoints will be available by default at: `http://localhost:3001/insigh
- [Bitcore Node 3.x](https://github.com/bitpay/bitcore-node)
**Note:** You can use an existing Bitcoin data directory, however `txindex`, `addressindex`, `timestampindex` and `spentindex` needs to be set to true in `bitcoin.conf`, as well as a few other additional fields.
**Note:** You can use an existing Zcash data directory, however `txindex`, `addressindex`, `timestampindex` and `spentindex` needs to be set to true in `zcash.conf`, as well as a few other additional fields.
## Notes on Upgrading from v0.3
@ -69,8 +69,8 @@ There are a few changes to the `GET` endpoint for `/addr/[:address]`:
Some additional general notes:
- The transaction history for an address will be sorted in block order
- The response for the `/sync` endpoint does not include `startTs` and `endTs` as the sync is no longer relevant as indexes are built in bitcoind.
- The endpoint for `/peer` is no longer relevant connection to bitcoind is via ZMQ.
- The response for the `/sync` endpoint does not include `startTs` and `endTs` as the sync is no longer relevant as indexes are built in zcashd.
- The endpoint for `/peer` is no longer relevant connection to zcashd is via ZMQ.
- `/tx` endpoint results will now include block height, and spentTx related fields will be set to `null` if unspent.
- `/block` endpoint results does not include `confirmations` and will include `poolInfo`.
@ -89,7 +89,7 @@ The `/tx/<txid>` endpoint JSON response will not include the following fields on
object.
- `spentTs`
The `/status?q=getTxOutSetInfo` method has also been removed due to the query being very slow and locking bitcoind.
The `/status?q=getTxOutSetInfo` method has also been removed due to the query being very slow and locking zcashd.
Plug-in support for Insight API is also no longer available, as well as the endpoints:
- `/email/retrieve`
@ -364,7 +364,7 @@ POST response:
/insight-api/peer
```
### Status of the Bitcoin Network
### Status of the Zcash Network
```
/insight-api/status?q=xxx
```
@ -409,7 +409,7 @@ Sample output:
}
```
`<bitcoinAddress>`: new transaction concerning <bitcoinAddress> received from network. This event is published in the `<bitcoinAddress>` room.
`<zcashAddress>`: new transaction concerning <zcashAddress> received from network. This event is published in the `<zcashAddress>` room.
`status`: every 1% increment on the sync task, this event will be triggered. This event is published in the `sync` room.

View File

@ -1,6 +1,6 @@
'use strict';
var bitcore = require('bitcore-lib');
var bitcore = require('bitcore-lib-zcash');
var async = require('async');
var TxController = require('./transactions');
var Common = require('./common');

View File

@ -1,7 +1,7 @@
'use strict';
var async = require('async');
var bitcore = require('bitcore-lib');
var bitcore = require('bitcore-lib-zcash');
var _ = bitcore.deps._;
var pools = require('../pools.json');
var BN = bitcore.crypto.BN;

View File

@ -14,7 +14,7 @@ var UtilsController = require('./utils');
var CurrencyController = require('./currency');
var RateLimiter = require('./ratelimiter');
var morgan = require('morgan');
var bitcore = require('bitcore-lib');
var bitcore = require('bitcore-lib-zcash');
var _ = bitcore.deps._;
var $ = bitcore.util.preconditions;
var Transaction = bitcore.Transaction;

View File

@ -1,8 +1,8 @@
'use strict';
var bitcore = require('bitcore-lib');
var bitcore = require('bitcore-lib-zcash');
var _ = bitcore.deps._;
var Message = require('bitcore-message');
var Message = require('bitcore-message-zcash');
var Common = require('./common');
function MessagesController(node) {

View File

@ -1,6 +1,6 @@
'use strict';
var bitcore = require('bitcore-lib');
var bitcore = require('bitcore-lib-zcash');
var _ = bitcore.deps._;
var $ = bitcore.util.preconditions;
var Common = require('./common');

View File

@ -1,8 +1,8 @@
{
"name": "insight-api",
"description": "A Bitcoin blockchain REST and web socket API service for Bitcore Node.",
"name": "insight-api-zcash",
"description": "A Zcash blockchain REST and web socket API service for Bitcore Node.",
"version": "0.4.3",
"repository": "git://github.com/bitpay/insight-api.git",
"repository": "git://github.com/str4d/insight-api-zcash.git",
"contributors": [
{
"name": "Gustavo Cortez",
@ -35,18 +35,22 @@
{
"name": "Braydon Fuller",
"email": "braydon@bitpay.com"
},
{
"name": "Jack Grigg",
"email": "jack@z.cash"
}
],
"bugs": {
"url": "https://github.com/bitpay/insight-api/issues"
"url": "https://github.com/str4d/insight-api-zcash/issues"
},
"homepage": "https://github.com/bitpay/insight-api",
"homepage": "https://github.com/str4d/insight-api-zcash",
"license": "MIT",
"keywords": [
"insight",
"insight api",
"blockchain",
"bitcoin api",
"zcash api",
"blockchain api",
"json",
"bitcore"
@ -61,8 +65,8 @@
"bitcoreNode": "lib",
"dependencies": {
"async": "*",
"bitcore-lib": "^0.13.7",
"bitcore-message": "^1.0.1",
"bitcore-lib-zcash": "str4d/bitcore-lib-zcash",
"bitcore-message-zcash": "str4d/bitcore-message-zcash",
"body-parser": "^1.13.3",
"compression": "^1.6.1",
"lodash": "^2.4.1",

View File

@ -3,7 +3,7 @@ var sinon = require('sinon');
var should = require('should');
var AddressController = require('../lib/addresses');
var _ = require('lodash');
var bitcore = require('bitcore-lib');
var bitcore = require('bitcore-lib-zcash');
var txinfos = {
totalCount: 2,

View File

@ -3,7 +3,7 @@
var should = require('should');
var sinon = require('sinon');
var BlockController = require('../lib/blocks');
var bitcore = require('bitcore-lib');
var bitcore = require('bitcore-lib-zcash');
var _ = require('lodash');
var blocks = require('./data/blocks.json');

View File

@ -3,7 +3,7 @@
var should = require('should');
var sinon = require('sinon');
var MessagesController = require('../lib/messages');
var bitcore = require('bitcore-lib');
var bitcore = require('bitcore-lib-zcash');
var _ = require('lodash');
describe('Messages', function() {

View File

@ -1,7 +1,7 @@
'use strict';
var should = require('should');
var sinon = require('sinon');
var bitcore = require('bitcore-lib');
var bitcore = require('bitcore-lib-zcash');
var TxController = require('../lib/transactions');
var _ = require('lodash');