Skip to content

Commit

Permalink
Zcash-ify
Browse files Browse the repository at this point in the history
  • Loading branch information
str4d committed Aug 29, 2016
1 parent 95bcad8 commit 48a1a17
Show file tree
Hide file tree
Showing 11 changed files with 30 additions and 26 deletions.
16 changes: 8 additions & 8 deletions README.md
@@ -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.

Expand All @@ -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
```

Expand All @@ -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

Expand Down Expand Up @@ -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`.

Expand All @@ -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`
Expand Down Expand Up @@ -364,7 +364,7 @@ POST response:
/insight-api/peer
```

### Status of the Bitcoin Network
### Status of the Zcash Network
```
/insight-api/status?q=xxx
```
Expand Down Expand Up @@ -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.

Expand Down
2 changes: 1 addition & 1 deletion lib/addresses.js
@@ -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');
Expand Down
2 changes: 1 addition & 1 deletion lib/blocks.js
@@ -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;
Expand Down
2 changes: 1 addition & 1 deletion lib/index.js
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions lib/messages.js
@@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion lib/transactions.js
@@ -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');
Expand Down
20 changes: 12 additions & 8 deletions package.json
@@ -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",
Expand Down Expand Up @@ -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"
Expand All @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion test/addresses.js
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion test/blocks.js
Expand Up @@ -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');
Expand Down
2 changes: 1 addition & 1 deletion test/messages.js
Expand Up @@ -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() {
Expand Down
2 changes: 1 addition & 1 deletion test/transactions.js
@@ -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');

Expand Down

0 comments on commit 48a1a17

Please sign in to comment.