GithubHelp home page GithubHelp logo

insight-api's Introduction

insight-api's People

Contributors

abbshr avatar bechi avatar braydonf avatar cmgustavo avatar devlo avatar eordano avatar eveiv avatar gasteve avatar igarciaes avatar ionux avatar isocolsky avatar jl2035 avatar kleetus avatar koirikivi avatar lordhelmut avatar maraoz avatar martindale avatar matiu avatar nitsujlangston avatar periodic1236 avatar pnagurny avatar ralphtheninja avatar raucao avatar rhoop avatar rktoomey avatar slavik0329 avatar slush0 avatar updatesthepoolist avatar wtogami avatar yemel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

insight-api's Issues

Double Spent transaction confirmation count incorrect

Insight correctly describes the side chain's block confirmation's as -1, but the double spent transaction still displays as 0 confirmations which is incorrect. Bitcoind displays -1 for both.

Double Spent Transaction:

{
   "blockhash":"00000000d82425bec4d3913e38c7a1eff9bd9d6d642ba96069357f3e99cbef49",
   "confirmations":0,
   "fees":0.0001,
   "firstSeenTs":1398481807,
   "locktime":0,
   "size":191,
   "txid":"ac57d36dfad57f8f50161c9a53343d43c59e794b3a15f817331d8b7d0cad63be",
   "valueIn":0.2,
   "valueOut":0.1999,
   "version":1,
   "vin":[
      {
         "addr":"mixcPWgNCuxgAQvUEzkxKMXXD7yMnAg6QD",
         "doubleSpentIndex":0,
         "doubleSpentTxID":"09e223139179fa4e9e92fecfae41f24e95c1376b1baa2bd605c2e6edea7ad3d8",
         "n":0,
         "scriptSig":{
            "asm":"304402203e3ac6142b0b7fe0a6534ff9545f5573d7b061d14c00bd2abe338f383fa3bea60220758a594c2a5b2418130362a2548873e492ea1f0a8b258fea3bad07b683c980dc01 02a2cb4aaeb007c8ad198ffdc8f53cf0721513538f87b858ff2093870bd1ef1c83"
         },
         "sequence":4294967295,
         "txid":"aba01e01a47c0e8279e2ab8a33baa79f41a6a3bccbbb9d035859768acd753a78",
         "value":0.2,
         "valueSat":20000000,
         "vout":0
      }
   ],
   "vout":[
      {
         "n":0,
         "scriptPubKey":{
            "addresses":[
               "miShQsLDndhQDSRyxTm6aQriLdJxAspuao"
            ],
            "asm":"OP_DUP OP_HASH160 201a4a4b61c5eaf6b2b92e7dd0c524ccde4b81fb OP_EQUALVERIFY OP_CHECKSIG",
            "reqSigs":1,
            "type":"pubkeyhash"
         },
         "value":0.1999
      }
   ]
}

Side-Chain Block:

{
   "bits":"1d00ffff",
   "chainwork":"00000000000000000000000000000000000000000000000007cf2b15b9d4ba2e",
   "confirmations":-1,
   "difficulty":1,
   "hash":"00000000d82425bec4d3913e38c7a1eff9bd9d6d642ba96069357f3e99cbef49",
   "height":226637,
   "isMainChain":false,
   "merkleroot":"e0185824cfbef395c407f807adf3424b0e0b31285fff2d90335eaff3d533a350",
   "nonce":1221014208,
   "previousblockhash":"0000000049ddec5f54ab1b6ff730f9e2119fa5ee476f362365dd1e803ad8ef65",
   "reward":25,
   "size":380,
   "time":1398481788,
   "tx":[
      "3ae9b9abe09b7573aef64ebe2fdbff87a3c21c610faab61e9e87d0b807f22368",
      "ac57d36dfad57f8f50161c9a53343d43c59e794b3a15f817331d8b7d0cad63be"
   ],
   "version":2
}

Crash: TypeError: Object #<Sync> has no method 'setBlockHeight'

insight-api hacked to use -regtest instead of -testnet crashes upon reorg. This strongly suggests it would similarly crash upon reorg on testnet or livenet.

[p2p_sync] Handle block: 000067d97590474b4bcda4e1581002749240c64f9765d061e8a6421e60600c58 (allowReorgs: true)
[p2p_sync] Orphan block received. Triggering sync
info: Previous TIP is now orphan. Back to:00001c8dff69cf521b88fab2694450503b2a8f64344fc155e1acf0d2794595b6

/home/warren/work/insight/node_modules/insight-bitcore-api/lib/HistoricSync.js:205
            self.sync.setBlockHeight(oldtip, -1, cb);
                      ^
TypeError: Object #<Sync> has no method 'setBlockHeight'
    at /home/warren/work/insight/node_modules/insight-bitcore-api/lib/HistoricSync.js:205:23
    at /home/warren/work/insight/node_modules/insight-bitcore-api/lib/BlockDb.js:288:14
    at /home/warren/work/insight/node_modules/insight-bitcore-api/lib/BlockDb.js:228:12
    at /home/warren/work/insight/node_modules/insight-bitcore-api/node_modules/levelup/lib/levelup.js:205:7

insight, insight-api and bitcore wired to use regtest when configured to use testnet
https://github.com/slickage/insight/commits/regtesthack
https://github.com/slickage/insight-api/commits/regtesthack
https://github.com/slickage/bitcore/commits/regtesthack

insight-api crashes on specific tx on testnet

running this on testnet, transaction cbf8330731db53ed0b0e9a5b92e291d648e2ee6a29426aa29650246148c3998b
I get this:

/Users/shachar/work/insight/node_modules/insight-bitcore-api/lib/TransactionDb.js:224
            ret.multipleSpentAttempts.each(function(mul) {
                                      ^
TypeError: Object [object Object],[object Object] has no method 'each'
    at /Users/shachar/work/insight/node_modules/insight-bitcore-api/lib/TransactionDb.js:224:39
    at ReadStream.<anonymous> (/Users/shachar/work/insight/node_modules/insight-bitcore-api/lib/TransactionDb.js:333:16)
    at ReadStream.EventEmitter.emit (events.js:92:17)
    at /Users/shachar/work/insight/node_modules/insight-bitcore-api/node_modules/levelup/node_modules/readable-stream/lib/_stream_readable.js:942:16
    at process._tickCallback (node.js:415:13)

ret.multipleSpentAttempts is the proud container of the following:

[ { txid: '58f57e82897db6416e2314985b8eb9876d4a069ae5646220c3c60ce7e37b71f7',
    index: undefined },
  { txid: 'cbf8330731db53ed0b0e9a5b92e291d648e2ee6a29426aa29650246148c3998b',
    index: 0 } ]

any ideas what causes this, before I started debugging the project's code?

UPDATE: re-indexing the dat file database made this issue go away. ideas?

[historic_sync] Aborted / Critical Error, unable to sync

On first run I am getting this error:

[historic_sync] ERROR: NEED_SYNC Ignoring block with non existing prev:00000000000069cf03c847d7d1d58b44474021b31dc65a8e83fd3a08e60a768c
[historic_sync] ABORTED with error: NEED_SYNC Ignoring block with non existing prev:00000000000069cf03c847d7d1d58b44474021b31dc65a8e83fd3a08e60a768c

When I run util/sync.js -D I get:

Deleting Sync DB...
Counting connected blocks. This could take some minutes
[historic_sync] Seeking file to:000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f
[historic_sync] Got 0 blocks in current DB, out of 291297 block at bitcoind
[historic_sync] bitcoind dataDir configured...importing blocks from .dat files
[historic_sync] First file index: 0
[historic_sync] Starting from: 000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f
[historic_sync] status: [0%]
Reading Blockfile /root/.bitcoin/blocks/blk00000.dat [128 MB]
[historic_sync] status: [0%]
Moving forward to file:/root/.bitcoin/blocks/blk00001.dat
Reading Blockfile /root/.bitcoin/blocks/blk00001.dat [128 MB]
[historic_sync] ERROR: NEED_SYNC Ignoring block with non existing prev:00000000000069cf03c847d7d1d58b44474021b31dc65a8e83fd3a08e60a768c
CRITICAL ERROR: { status: 'error',
blockChainHeight: 291297,
syncPercentage: '0.001',
syncedBlocks: 2,
syncTipHash: undefined,
error: 'NEED_SYNC Ignoring block with non existing prev:00000000000069cf03c847d7d1d58b44474021b31dc65a8e83fd3a08e60a768c',
type: 'from .dat Files',
startTs: 1395225069374,
endTs: null }

in transaction view page, add its contained block information in "Summary" section

This information is very useful. When view a tx, we want to know it is included in which block. It is better to be displayed in "Summary" section of the tx view page. like:

http://blockexplorer.com/tx/f8bf1e886d6ba6e4927acf861cf5ab3e62af2d50a6b011427f0369fa3e058eb2
or
https://blockchain.info/tx/f8bf1e886d6ba6e4927acf861cf5ab3e62af2d50a6b011427f0369fa3e058eb2

Now in insight, we have to click the "(+)" button, then click "BlockHash", then on the block view page , we know the block height.

ERROR: Bad genesis block. Network mismatch between Insight and bitcoind? Insight is configured for:regtest

In an attempt to make sense of all this stuff, I have been running a bitcoin-qt regtest network in an ubuntu virtualbox.

I am trying to setup Insight (http://github.com/bitpay/insight) as a blockchain explorer to work with my regtest network.

I have gotten Insight to work on my host computer with the livenet, but when attempting to run it with my regtest network with:

INSIGHT_NETWORK=regtest BITCOIND_USER=rpcuser BITCOIND_PASS=rpcpassword npm start

I get the following error:

[historic_sync] ERROR: Bad genesis block. Network mismatch between Insight and bitcoind? Insight is configured for:regtest

In the insight directory, I have attempted to add my regtest network definition to node_modules/insight-bitcore-api/node_modules/bitcore/networks.js

exports.regtest = {
name: 'regtest',
addressVersion: 0x6f,
magic: hex('0b110907'),
genesisBlock: {
height: 0,
nonce: 2,
version: 1,
hash: hex('0f9188f13cb7b2c71f2a335e3a4fc328bf5beb436012afca590b1a11466e2206'),
prev_hash: buffertools.fill(new Buffer(32), 0),
timestamp: 1296688602,
merkle_root: hex('4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b'),
bits: 207fffff,
},
genesisBlockTx: module.exports.livenet.genesisBlockTx,
proofOfWorkLimit: module.exports.livenet.proofOfWorkLimit,
checkpoints: [], // need to put checkput blocks here
addressPubkey: 111,
addressScript: 196,
keySecret: 239,
};

Which I have tried adapting from the other network definitions, and from issuing the following commands on my regtest bitcoin-qt console:

getblockhash 0

0f9188f13cb7b2c71f2a335e3a4fc328bf5beb436012afca590b1a11466e2206

getblock 0f9188f13cb7b2c71f2a335e3a4fc328bf5beb436012afca590b1a11466e2206

{
"hash" : "0f9188f13cb7b2c71f2a335e3a4fc328bf5beb436012afca590b1a11466e2206",
"confirmations" : 1440,
"size" : 285,
"height" : 0,
"version" : 1,
"merkleroot" : "4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b",
"tx" : [
"4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b"
],
"time" : 1296688602,
"nonce" : 2,
"bits" : "207fffff",
"difficulty" : 0.00000000,
"chainwork" : "0000000000000000000000000000000000000000000000000000000000000002",
"nextblockhash" : "0000581e0f63f734c0f6345c69e727d58a0bea7247c492326abe2b08a2d83820"
}

Historic Sync failing during initial sync [testnet]

I'm trying to sync the insight database for a testnet instance and the sync process crashes at about 80% through.

I've tried util/sync.js -D and it always crashes at the same point in the sync.

It seems like this is happening in a multisig transaction (from the stacktrace below):
bitcore/lib/Address.js:122
Almost certainly this one
http://test.insight.is/tx/2c63aa814701cef5dbd4bbaddab3fea9117028f2434dddcdab8339141e9b14d1

I'm afraid that's as far as I could get debugging this issue.

The stack trace from the error is:

insight server listening on port 3001 in production mode
info: Resuming sync from block: 00000000a0dff26bb4a33874a8ddcbb06b4ab8fce787e6bd7319e05ede36ab55 #204625
info: Seeking file to:00000000a0dff26bb4a33874a8ddcbb06b4ab8fce787e6bd7319e05ede36ab55
Reading Blockfile /home/ubuntu/.bitcoin/testnet3/blocks/blk00003.dat [127 MB]
... [some p2p_sync messages] ...
        FOUND Starting Block!
info: Got 204625 blocks in current DB, out of 258500 block at bitcoind
info: bitcoind dataDir configured...importing blocks from .dat files
info: First file index: 3
info: Starting from:  00000000a0dff26bb4a33874a8ddcbb06b4ab8fce787e6bd7319e05ede36ab55
info: status: [79.159%]

crypto.js:209
  this._binding.update(data, encoding);
                ^
TypeError: Not a string or buffer
    at Hash.update (crypto.js:209:17)
    at exports.sha256 (/home/ubuntu/insight-api/node_modules/bitcore/util/util.js:14:49)
    at Object.exports.sha256ripe160 (/home/ubuntu/insight-api/node_modules/bitcore/util/util.js:55:18)
    at new Address.fromScriptPubKey (/home/ubuntu/insight-api/node_modules/bitcore/lib/Address.js:122:33)
    at /home/ubuntu/insight-api/lib/TransactionDb.js:509:19
    at Array.map (native)
    at TransactionDb.getStandardizedTx (/home/ubuntu/insight-api/lib/TransactionDb.js:505:21)
    at /home/ubuntu/insight-api/lib/HistoricSync.js:139:30
    at Array.map (native)
    at HistoricSync.getStandardizedBlock (/home/ubuntu/insight-api/lib/HistoricSync.js:138:20)
    at /home/ubuntu/insight-api/lib/HistoricSync.js:154:22

Floating point errors

Why does insight appear to use floating-point arithmetic? A large number of transactions report slightly incorrect value out and fees through the API.

For a sample, take a look at some transactions sent to 1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa:
http://live.insight.is/tx/af89341e1a66ad71147f28903a8e6c18f8e7557d2da3843c08362ea75d2c3be7
http://live.insight.is/tx/ba226c2d03dc55d01987fe584e5f0997852d23054c8534bc7def9ffe121386bf

The value out and fees are off by 1 satoshi in opposing directions. I hope we can agree that financial software should not have such errors.

Edit: This transaction has a single output but the value out is also off by 1 satoshi?

http://live.insight.is/tx/f289b73ff15abf1775bbfe27c1800f3b6a90b3a1dc3be1e2beadd71495507da8

"bits" from RPC != "bits" from BlockExtractor

I think this is an inconsistency that could (should?) be fixed, or at least I'd like to see it fixed.
The problem is, I can't wrap my head around this, so I'm also a bit curious ;-)

with getBlockFromRPC the "bits" is "1900b3aa".
with getBlockFromFile the "bits" is "419476394".

the bitcore util.calcDifficulty(419476394) results in the proper difficulty ...
I got as far as to realise that "1900b3aa" is hex for "419476394" and that if I do parseInt("1900b3aa", 16) I will get "419476394", which will thus result in the proper difficulty ...

but I can't think of a way to handle these 2 different values in the code when I switch between getBlockFromRPC and getBlockFromFile...
I think these 2 should be consistent and I guess the "bits" returned from getBlockFromFile should be hex instead of an int right?

changing Block.parse in bitcore to this.bits = parser.buffer(4); instead of this.bits = parser.word32le(); turns the bits into the hex, but breaking the API in bitcore would suck so it would at this point be better to convert the int back to hex in getBlockFromRPC I guess ...

Also, that still doesn't allow you to convert hex -> difficulty properly with the bitcore.util.util ...

RangeError: length > kMaxLength

I am getting the following error after launching insight-api:

   info  - socket.io started
insight server listening on port 3000 in production mode
Counting connected blocks. This could take some minutes
[historic_sync] Seeking file to:000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f
[historic_sync] Got 0 blocks in current DB, out of 293067 block at bitcoind
[historic_sync] bitcoind dataDir configured...importing blocks from .dat files
[historic_sync] First file index: 0
[historic_sync] Starting from:  000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f
[historic_sync] status: [0%]
Reading Blockfile /data/bitcoin/blocks/blk00000.dat [2000 MB]

buffer.js:194
      this.parent = new SlowBuffer(this.length);
                    ^
RangeError: length > kMaxLength
    at new Buffer (buffer.js:194:21)
    at BlockExtractor.readCurrentFileSync (/opt/insight-api/lib/BlockExtractor.js:79:16)
    at /opt/insight-api/lib/BlockExtractor.js:103:16
    at Object.async.whilst (/opt/insight-api/node_modules/async/lib/async.js:628:13)
    at /opt/insight-api/lib/BlockExtractor.js:97:13
    at /opt/insight-api/node_modules/async/lib/async.js:560:21
    at /opt/insight-api/node_modules/async/lib/async.js:233:13
    at iterate (/opt/insight-api/node_modules/async/lib/async.js:140:13)
    at async.eachSeries (/opt/insight-api/node_modules/async/lib/async.js:156:9)
    at _asyncMap (/opt/insight-api/node_modules/async/lib/async.js:232:9)

I'm using bitcoind 0.9.0 and node v0.10.26 on Ubuntu 12.04.

Related SO question: http://stackoverflow.com/questions/12978169/rangeerror-length-kmaxlength-while-reading-massive-text-file-with-nodejs

periodic crash: "Cannot read property 'hex' of undefined"

We have insight running on mainnet in production. Periodically (every 5 to 10 minutes, maybe?) it will crash with the error below (and then be restarted, as we have it running via upstart). We're running with commit '55ce11e8fc390907bf9e10378a6fb02008cc76d2'. I could always try reinstalling insight/copying over the DB from another node, but I wanted to better try to understand the problem first, if it's something legitimate:

^[[90mGET /api/addr/1Fuqe8n9Z8ZjSri7DBUq9hMszyuRTfBPoe/ ^[[32m200 ^[[90m1ms - 257b^[[0m
^[[90mGET /api/addr/1Fuqe8n9Z8ZjSri7DBUq9hMszyuRTfBPoe/utxo/ ^[[32m200 ^[[90m1ms - 2b^[[0m
^[[90mGET /api/addr/1Nvcb74ERaiUFSVfbBARTSbvDUB2ywv2BT/ ^[[32m200 ^[[90m1ms - 257b^[[0m
^[[90mGET /api/addr/1Nvcb74ERaiUFSVfbBARTSbvDUB2ywv2BT/utxo/ ^[[32m200 ^[[90m1ms - 2b^[[0m
[p2p_sync] Handle tx: bdc5520a9ac70c8d9dca5f4917eeda54334f819440d90ec498e05dc2dd8e985a
[p2p_sync] Handle tx: b52ec1e0d56ff194d6d765f29d5199f44da35e1d53f8324aa7d13ff0f91ccdd0
^[[90mGET /api/status?q=getInfo ^[[32m200 ^[[90m1ms - 260b^[[0m
^[[90mGET /api/addr/1UbiMtSn5CuKfPSZJq56Eb3MZEx8AMr4Q/ ^[[32m200 ^[[90m6ms^[[0m

/home/xcp/insight-api/app/models/Address.js:96
        var scriptPubKey = self._getScriptPubKey(info.hex, txItem.index);
                                                     ^
TypeError: Cannot read property 'hex' of undefined
    at /home/xcp/insight-api/app/models/Address.js:96:54
    at /home/xcp/insight-api/lib/TransactionDb.js:269:23
    at /home/xcp/insight-api/lib/Rpc.js:64:40
    at IncomingMessage.<anonymous> (/home/xcp/insight-api/node_modules/bitcore/RpcClient.js:189:7)
    at IncomingMessage.EventEmitter.emit (events.js:117:20)
    at _stream_readable.js:920:16
    at process._tickCallback (node.js:415:13)
info: socket.io started
insight server listening on port 3000 in development mode
Counting connected blocks. This could take some minutes
[historic_sync] Resuming sync from block:00000000000000005050b2c537fa4ecfc8f930309c76a7ac14ea8c8e3106d662
[historic_sync] Got 294986 blocks in current DB, out of 294967 block at bitcoind
[historic_sync] syncing from RPC (slow)
[historic_sync] Starting from:  00000000000000005050b2c537fa4ecfc8f930309c76a7ac14ea8c8e3106d662
[historic_sync] status: [100%]
Done Syncing { status: 'finished',
  blockChainHeight: 294967,
  syncPercentage: 100,
  syncedBlocks: 294987,
  syncTipHash: undefined,
  error: null,
  type: 'from RPC calls',
  startTs: 1397062307287,
  endTs: 1397062307300 }
[historic_sync] status: [100%]
{ '0': 'connecting to 127.0.0.1:8333' }
{ '0': 'connected to 127.0.0.1:8333' }
[p2p_sync] Connected to 1 peer
[p2p_sync] Handle tx: 5ef341e90c24462dd9327edf7bea0a2c84d91ac0a041bdbd6cd7bebe1b5f18d9

Sync issue

Whilst trying to get this working with an altcoin I've noticed something strange that I cant get my head around.

my network.js is edited and its running on livenet it passes the genesis block inspection but only imports 1 block. When looking at this block that's imported by outputting it whilst running the sync I can see that the has is incorrect and is actually a hash from the testnet 'require('fs').writeFileSync(blockInfo.hash +'.json',JSON.stringify(blockInfo,null,4));' is the code I used to export blocks to there own .json files. The has returned is 21eab79603c0488450739ceae141a36ef866ff62dced0baa4bb0a4154a697732 but the code says that it seeked to the correct hash Seeking file to:000009fd0df2d6808d99c67f5c27d0ba9054e9cf5c28a671e8232bb07a665165.

Any input as to where its getting the testnet hash from ? I've actually completly removed the testnet hash from the networks.js and it still does it.
Jimmy06

I'd like to add that import from RPC works and streams fine until something causes an issue and all blocks from when the issue occured are orphend. Re-syncing the database again threw RPC solves it but is rather annoying

insight-api npm install error

  • os env : ubuntu 12.04.4 LTS
  • node version: v0.10.25
  • npm version: 1.3.24
  • node-gyp has been installed

after cloning the repository 'insight-api', I run npm install ,but it reports some errors.

  1. sometimes npm reports as follow:

    
    npm ERR! Error: EACCES, mkdir '/home/ran/tmp/npm-30627-8PamCnmn'
    npm ERR!  { [Error: EACCES, mkdir '/home/ran/tmp/npm-30627-8PamCnmn']
    npm ERR!   errno: 3,
    npm ERR!   code: 'EACCES',
    npm ERR!   path: '/home/ran/tmp/npm-30627-8PamCnmn',
    npm ERR!   parent: 'insight-bitcore-api' }
    npm ERR! 
    npm ERR! Please try running this command again as root/Administrator.
    
    npm ERR! System Linux 3.2.0-29-generic
    npm ERR! command "/usr/local/bin/node" "/usr/local/bin/npm" "install"
    npm ERR! cwd /home/ran/external/insight-api
    npm ERR! node -v v0.10.25
    npm ERR! npm -v 1.3.24
    npm ERR! path /home/ran/tmp/npm-30627-8PamCnmn
    npm ERR! code EACCES
    npm ERR! errno 3
    npm ERR! stack Error: EACCES, mkdir '/home/ran/tmp/npm-30627-8PamCnmn'
    
    
  2. and sometimes it reports these:

    
    npm ERR! Error: shasum check failed for /home/ran/tmp/npm-31265-5iPrbr1P/1396961074011-0.16875168518163264/tmp.tgz
    npm ERR! Expected: 7146a3900533064ca799d5e792f4e480ee0e82bc
    npm ERR! Actual:   d10f3ade83418ae11075fe5202dbf2624de1d72f
    npm ERR! From:     https://registry.npmjs.org/moment/-/moment-2.5.1.tgz
    npm ERR!     at /usr/local/lib/node_modules/npm/node_modules/sha/index.js:38:8
    npm ERR!     at ReadStream.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/sha/index.js:85:7)
    npm ERR!     at ReadStream.EventEmitter.emit (events.js:117:20)
    npm ERR!     at _stream_readable.js:920:16
    npm ERR!     at process._tickCallback (node.js:415:13)
    npm ERR! If you need help, you may report this *entire* log,
    npm ERR! including the npm and node versions, at:
    npm ERR!     <http://github.com/isaacs/npm/issues>
    
    npm ERR! System Linux 3.2.0-29-generic
    npm ERR! command "/usr/local/bin/node" "/usr/local/bin/npm" "install"
    npm ERR! cwd /home/ran/external/insight-api
    npm ERR! node -v v0.10.25
    npm ERR! npm -v 1.3.24
    npm http 200 https://registry.npmjs.org/async
    npm ERR! registry error parsing json
    
    
  3. or these:


    >[email protected] install /home/ran/external/insight-api/node_modules/leveldown
    >node-gyp rebuild

    gyp: /home/ran/.node-gyp/0.10.25/common.gypi not found (cwd: /home/ran/external/insight-api/node_modules/leveldown) while reading includes of binding.gyp
    gyp ERR! configure error 
    gyp ERR! stack Error: `gyp` failed with exit code: 1
    gyp ERR! stack     at ChildProcess.onCpExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:337:16)
    gyp ERR! stack     at ChildProcess.EventEmitter.emit (events.js:98:17)
    gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:797:12)
    gyp ERR! System Linux 3.2.0-29-generic
    gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
    gyp ERR! cwd /home/ran/external/insight-api/node_modules/leveldown
    gyp ERR! node -v v0.10.25
    gyp ERR! node-gyp -v v0.12.2
    gyp ERR! not ok 

It seems to be a lot of problems during the Installing process, and I had installed much times, whether npm install or sudo npm install was failed :(

RangeError: Maximum call stack size exceeded

the sync process finish fine, but the message is unfriendly (or is an error)

..........
info: status: [99.987%]

REORG Triggered, tip mismatch

info: NEW TIP: 000000000bad3a701ce755096e187c5a63a9abe05a7ab4ede8d37aaeefcee36d NEED REORG (old tip: 000000000f25ddef45461fef3dacb3fc531159c251310c3b1e60ba2607b3e35d #245379)
info: # Reorg Case 1) OldNext: 000000000f25ddef45461fef3dacb3fc531159c251310c3b1e60ba2607b3e35d NewHeight: 245379
info: Unconfirming 1 Txs

REORG Triggered, tip mismatch

info: NEW TIP: 000000000001fe4ee06edcd05b5d64ea4d9ff8f666570bd33dc53d0bda780905 NEED REORG (old tip: 000000000bad3a701ce755096e187c5a63a9abe05a7ab4ede8d37aaeefcee36d #245379)
info: # Reorg Case 2)
info: Found yBlock: 000000000000bdf04dc801fc020fa2f2d7e10f3b098142f8f3e1e9e4ca945d48 #245378
info: Confirming 1 Txs
info: Unconfirming 1 Txs

buffer.js:0
(function (exports, require, module, __filename, __dirname) { // Copyright Joy
^
RangeError: Maximum call stack size exceeded

Blocks not ordered correctly, wrong timestamps

Hi

First of all, thanks for the great project!

Please see this screenshot. You can see that from block 291291 downwards, the blocks are all in the wrong order by block number, and all have practically the same timestamp (which is used for ordering).

The timestamps seem to coincide with the time of the syncing / catching up with bitcoind.

When I open the block detail page, the correct block timestamp is shown (the one stored in the block binary blob).

I have too little knowledge of the codebase yet to fix this myself. The correct behaviour should be that the blocks should always be ordered by the block height, not a timestamp. Also, the additional timestamp recorded (time of syncing of the block) seems unnecessary. Why does it exist?

Thank you.

npm start errors.

reinstalled insight now it doesn't work.

/insight/node_modules/insight-bitcore-api/lib/Rpc.js:7
var RpcClient = require('bitcore/RpcClient').class(),
^
TypeError: Object function RpcClient(opts) {
opts = opts || {};
this.host = opts.host || '127.0.0.1';
this.port = opts.port || 8332;
this.user = opts.user || 'user';
this.pass = opts.pass || 'pass';
this.protocol = (opts.protocol == 'http') ? http : https;
this.batchedCalls = null;
this.disableAgent = opts.disableAgent || false;
} has no method 'class'

npm ERR! [email protected] start: INSIGHT_PUBLIC_PATH=public node node_modules/insight-bitcore-api/insight. js
npm ERR! Exit status 8
npm ERR!
npm ERR! Failed at the [email protected] start script.
npm ERR! This is most likely a problem with the insight-bitcore package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! INSIGHT_PUBLIC_PATH=public node node_modules/insight-bitcore-api/insight.js
npm ERR! You can get their info via:
npm ERR! npm owner ls insight-bitcore
npm ERR! There is likely additional logging output above.
npm ERR! System Linux 3.2.0-56-generic-pae
npm ERR! command "/usr/bin/node" "/usr/bin/npm" "start"
npm ERR! cwd /xxx/xxx/insight
npm ERR! node -v v0.10.26
npm ERR! npm -v 1.4.3
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /xxx/xxx/insight/npm-debug.log
npm ERR! not ok code 0

Enhance address balance calculation

Probably using a optimized leveldb schema.

Related to #10

The current schema does not scale well for address with ~10000+ transactions like
1dice8EMZmqKvrGE4Qc9bUFf9PX3xaYDp

This should be taken in account also:
#31

TypeError: Cannot read property 'isCoinBase' of undefined

[p2p_sync] Handle block: 00000000000000003960a0a373d0a4ad46dd363174e3f572e0577e1bae52a6d2 (allowReorgs: true)
[p2p_sync] Orphan block received. Triggering sync
Counting connected blocks. This could take some minutes
[p2p_sync] Handle tx: ead4966ed414382b0209841c6a12cd89a9614d1c92d7ef7535be252e2164ff15
[p2p_sync] Handle tx: 05cc82aac649e47232191f59925f7f64fd344ba4f946450f96940386e7970d8e
[p2p_sync] Handle tx: 38fa8f3402a4b1840c67e3c2737a2d193e56b7e8a7d9f87a61d9ebdbad4825a7
[p2p_sync] Handle tx: 2c8f7618e7afcb20c8db064f5f9dc5e66772bc0f58ba2354575c0e4204cbf77f
[p2p_sync] Handle tx: d8d2e5f124527ace6809f888969418c5cc76a618d794a6e691d286905c6d0dd5
[p2p_sync] Handle tx: b6df45796c31c005d0a59bbed96393967c97364d217e63c2a13b9ae1e3c28fc7
[p2p_sync] Handle tx: d882d337253a088982efe5d6f43db95265e3c05bfd3c8d727c01b09fa4f7bf34
[p2p_sync] Handle tx: b44a74015a2c260f83b0b4eabf5792454860ca594ebc19044e1f302282be4c0b
[p2p_sync] Handle tx: cba2e00b58e9b7c95a7fa0b21ecce3374b8419f60610e0590a378f908898cd85

/home/btc/insight/node_modules/insight-bitcore-api/lib/BlockDb.js:169
    if (a.isCoinBase) {
         ^
TypeError: Cannot read property 'isCoinBase' of undefined
    at /home/btc/insight/node_modules/insight-bitcore-api/lib/BlockDb.js:169:10
    at /home/btc/insight/node_modules/insight-bitcore-api/lib/TransactionDb.js:258:16
    at TransactionDb._fillSpent (/home/btc/insight/node_modules/insight-bitcore-api/lib/TransactionDb.js:162:21)
    at /home/btc/insight/node_modules/insight-bitcore-api/lib/TransactionDb.js:257:12
    at TransactionDb._fillOutpoints (/home/btc/insight/node_modules/insight-bitcore-api/lib/TransactionDb.js:185:40)
    at /home/btc/insight/node_modules/insight-bitcore-api/lib/TransactionDb.js:256:10
    at /home/btc/insight/node_modules/insight-bitcore-api/lib/Rpc.js:64:40
    at IncomingMessage.<anonymous> (/home/btc/insight/node_modules/insight-bitcore-api/node_modules/bitcore/RpcClient.js:189:7)
    at IncomingMessage.EventEmitter.emit (events.js:117:20)
    at _stream_readable.js:920:16
npm ERR! weird error 8
npm ERR! not ok code 0

Possible to add limit-type parameter to /addr/ and /addr/utxo calls?

Hi, I have several situations where:
a) I just want to get balance information for a particular address and do not care about a list of the transaction hashes
and b) I want to get a list of utxos, but be able to limit the number returned

Both of these are for speed/performance reasons...e.g. consider something like
/addr/mzPkw5EdvHCntC2hrhRXSqwHLHpLWzSZiL on testnet...it takes at least 6 or so seconds to return that query on my server (and the utxo query for that address takes like 10-13 seconds).

For /addr/ABCD it would be good to have a query argument such as ?transactions=0, which would return the address without transaction listing

For /addr/ABCD/utxo, it would be good to have query argument such as ?limit=30, which would limit the number of utxos returned

If you don't have the time to do this and think it is a good idea, I'd be happy to add the feature.

Missing address info, and a crash

I tried hooking up insight-api to a private testnet instance, and it doesn't show any information for the address after it's synchronized:

$ bitcoind sendtoaddress mnjyvqvUi3BoqfE1GQrKVt6UTqTw9RyAyU 1
$ curl http://127.0.0.1:3001/api/addr/mnjyvqvUi3BoqfE1GQrKVt6UTqTw9RyAyU
{"balanceSat":0,"totalReceivedSat":0,"totalSentSat":0,"unconfirmedBalanceSat":0,"txApperances":0,"unconfirmedTxApperances":0,"transactions":[],"addrStr":"mnjyvqvUi3BoqfE1GQrKVt6UTqTw9RyAyU","totalSent":0,"balance":0,"totalReceived":0,"unconfirmedBalance":0}

When I try to look for it via watchonly it works:

bitcoind -datadir=1 importaddress mnjyvqvUi3BoqfE1GQrKVt6UTqTw9RyAyU derp true
bitcoind -datadir=1 listunspent 0 1

[    {
        "txid" : "b6f10dc2e330029259125137ecc3a21a30f9c06d65d9df31625c38f3802bc3b9",
        "vout" : 1,
        "address" : "mnjyvqvUi3BoqfE1GQrKVt6UTqTw9RyAyU",
        "account" : "derp",
        "scriptPubKey" : "76a9144f3fa6f9adad31613645f47225e9abe2144ee3ed88ac",
        "amount" : 1.00000000,
        "confirmations" : 0,
        "spendable" : false
    }
]

When I try to restart insight, it crashes:

~/code/insight-api $ BITCOIND_HOST=162.243.232.141 BITCOIND_P2P_PORT=19001 BITCOIND_PORT=19011 BITCOIND_USER=getthelump BITCOIND_PASS=outtahere INSIGHT_NETWORK=testnet node insight.js
   info  - socket.io started
insight server listening on port 3001 in development mode
Counting connected blocks. This could take some minutes

assert.js:92
  throw new assert.AssertionError({
        ^
AssertionError: "undefined" == true
    at async.doWhilst.self.startBlock (/Users/kyledrake/code/insight-api/lib/HistoricSync.js:248:13)
    at /Users/kyledrake/code/insight-api/node_modules/async/lib/async.js:636:17
    at /Users/kyledrake/code/insight-api/lib/HistoricSync.js:235:22
    at /Users/kyledrake/code/insight-api/lib/BlockDb.js:189:32
    at /Users/kyledrake/code/insight-api/lib/Rpc.js:89:42
    at IncomingMessage.<anonymous> (/Users/kyledrake/code/insight-api/node_modules/bitcore/RpcClient.js:190:9)
    at IncomingMessage.EventEmitter.emit (events.js:117:20)
    at _stream_readable.js:920:16
    at process._tickCallback (node.js:415:13)

You can use the same server I used, because it's our public private testnet http://faucet.coinpunk.com

[historic_sync] ERROR: Method not found

When starting insight.js, I'm getting the following error:

nfo: socket.io started
insight server listening on port 3000 in production mode
[historic_sync] ERROR: Method not found
{ '0': 'connecting to 127.0.0.1:8333' }
{ '0': 'connected to 127.0.0.1:8333' }
[p2p_sync] Connected to 1 peer

Also, all the addresses I look up in the API are shown as never seen before and have a 0 balance:

http://192.168.1.101:3000/api/addr/1CjPR7Z5ZSyWk6WtXvSFgkptmpoi4UM9BC

{
"balanceSat": 0,
"totalReceivedSat": 0,
"totalSentSat": 0,
"unconfirmedBalanceSat": 0,
"txApperances": 0,
"unconfirmedTxApperances": 0,
"transactions": [],
"addrStr": "1CjPR7Z5ZSyWk6WtXvSFgkptmpoi4UM9BC",
"totalSent": 0,
"balance": 0,
"totalReceived": 0,
"unconfirmedBalance": 0
}

Feature / Enable usage of altcoin

Usage of an altcoin (RIE coin for example) results in: Bad genesis block. Network mismatch between Insight and bitcoind? Insight is configured for:testnet

node insight.js ... Aborted (core dumped)

This is my first time trying to run insight-api in ubuntu 14.04 under node v0.10.22. Has anyone seen this?

$ node insight.js
node: ../deps/leveldb/leveldb-1.14.0/db/version_set.cc:772: void leveldb::VersionSet::Builder::MaybeAddFile(leveldb::Version_, int, leveldb::FileMetaData_): Assertion `vset_->icmp_.Compare((*files)[files->size()-1]->largest, f->smallest) < 0' failed.
Aborted (core dumped)

This is my environment:
nvm install 0.10; nvm use 0.10
git clone https://github.com/bitpay/insight-api.git && cd insight-api
npm install # -> http://pastebin.com/7npxWXVt

here is a comment in the code before line 772:
// Must not overlap
assert(vset_->icmp_.Compare((*files)[files->size()-1]->largest,
f->smallest) < 0);

[p2p_sync] Error in handle Block: [object Object]

I've got a bunch of those errors:

info: socket.io started
insight server listening on port 3000 in production mode
{ '0': [Error: Could not connect to bitcoin via RPC: connect ECONNREFUSED] }
[historic_sync] ERROR: Could not connect to bitcoin via RPC: connect ECONNREFUSED
{ '0': 'connecting to 127.0.0.1:8333' }
{ '0': 'connected to 127.0.0.1:8333' }
[p2p_sync] Connected to 1 peer

(some more logs here)

[p2p_sync] Handle block: 0000000002274dde8f09a85f7359478c61d81797506a2d1ab63e8760edafb686 (allowReorgs: false)

[p2p_sync] Error in handle Block: [object Object]
[p2p_sync] Error in handle Block: [object Object]
[p2p_sync] Error in handle Block: [object Object]
[p2p_sync] Error in handle Block: [object Object]
(lots of this)

Note that I believe my bitcoind is still not done downloading the blockchain. Is that the issue? If it is, is there any way to programmatically wait for the blockchain to be done before launching insight.js (I'm trying to build a Dockerfile)?

I'm launching insight with this script:

bitcoind -datadir='/data/bitcoin' -daemon
cd /opt/insight-api/
export INSIGHT_NETWORK="livenet"
export NODE_ENV="production"
export BITCOIND_DATADIR="/data/bitcoin"
node insight.js

and I copied /opt/insight-api/etc/bitcoind/bitcoin-livenet.conf to /data/bitcoin/bitcoin.conf.

http://192.168.1.101:3000/api/sync returns:

{
"status": "error",
"syncPercentage": "NaN",
"error": "Could not connect to bitcoin via RPC: connect ECONNREFUSED"
}

http://192.168.1.101:3000/api/peer returns:

{
"connected": true,
"host": "127.0.0.1",
"port": "8333"
}

Crash: RangeError: Buffer length (0) must be a multiple of size (0)

[historic_sync] status: [99.679%]
GET /api/block/00000000000000002a7ad54a6640b5a7041909409e3aea92203360fbc63919ee 200 37ms - 633b
[p2p_sync] Handle tx: f42144956d927b2e76755304717065f1d0682f7fd37e3d50173ab21a86780584
[p2p_sync] Handle tx: a08a32d08f6bfd2e4cf37dddf686d1f298323cb9a34885099cb5a9302a57f5d8
[p2p_sync] Handle tx: e44fd66ac7f8601a4bc18c06bc54b13db44dcc00517bb1745cb55ddd8efb116b
[p2p_sync] Handle tx: 34efa80ddcb84714a81543647bc51bc7227d149789439c705ee93abbff47f1f5
[p2p_sync] Handle tx: 4e1a95ece38e55d1987fbf554073d04a28c4514496029be16f9251eeec67188d
[p2p_sync] Handle tx: db1208daf70d06881a892bcfb58203b1705ec34dd0aeb0a62f7832ac8ebbb52d
[p2p_sync] Handle tx: c849f6dde59e2c826622193da9baa5f03c54929e6ec05693f29ba17ec05f92a9
[p2p_sync] Handle tx: 1db2e4d6d472e7e0ce44bbb637b5160d219ea0554ea46b689278d6bf2e606ac7
[p2p_sync] Handle tx: 6f814b0b3bdfab0f3ae292881d8062fa594548c7654be3114bcea093bbd971af
[p2p_sync] Handle tx: 5da11adcfa4ea9b3d60503e70893c73edb53bae536dc20131fc331540a666dfc
[p2p_sync] Handle tx: da432f996b3e03ed151c90bdfd033b45f56afb72f7c4529e654632e6d51800f2
[p2p_sync] Handle tx: b4a8c83225d6bf12b74dba77701d3e6f273dabec01883f47380307c0ec8e96fc
GET /api/block/00000000000000002a7ad54a6640b5a7041909409e3aea92203360fbc63919ee 200 29ms - 633b
[p2p_sync] Handle tx: 85a553f742a7c93ca41e6246f96258404cc6f8d9412815a069167af56fbc2cdf

/home/btc/insight/node_modules/insight-bitcore-api/node_modules/bignum/index.js:329
        throw new RangeError('Buffer length (' + buf.length + ')'
              ^
RangeError: Buffer length (0) must be a multiple of size (0)
    at Function.BigNum.fromBuffer (/home/btc/insight/node_modules/insight-bitcore-api/node_modules/bignum/index.js:329:15)
    at exports.valueToBigInt (/home/btc/insight/node_modules/insight-bitcore-api/node_modules/bitcore/util/util.js:101:19)
    at Object.exports.formatValue (/home/btc/insight/node_modules/insight-bitcore-api/node_modules/bitcore/util/util.js:235:15)
    at /home/btc/insight/node_modules/insight-bitcore-api/node_modules/bitcore/Transaction.js:587:19
    at Array.map (native)
    at Transaction.getStandardizedObject (/home/btc/insight/node_modules/insight-bitcore-api/node_modules/bitcore/Transaction.js:583:24)
    at /home/btc/insight/node_modules/insight-bitcore-api/node_modules/bitcore/Block.js:577:15
    at Array.map (native)
    at Block.getStandardizedObject (/home/btc/insight/node_modules/insight-bitcore-api/node_modules/bitcore/Block.js:576:15)
    at /home/btc/insight/node_modules/insight-bitcore-api/lib/HistoricSync.js:138:19
    at /home/btc/insight/node_modules/insight-bitcore-api/lib/BlockExtractor.js:150:12
npm ERR! weird error 8
npm ERR! not ok code 0

Reorg Handling is Broken

180dc13

  • Double spent transactions from the orphaned block cannot be queried.
  • Earlier versions of Insight would successfully serve double spent transactions, although they had confirmations: 0 instead of -1 as bitcoind gettransaction would do. -1 is correct.
  • The orphaned block is considered to be in the Main chain.
    //TODO can we get this from RPC .height?
    self.getHeight(hash, function(err, height) {
      if (err) return cb(err);

      info.isMainChain = height ? true : false;

Error: Could not found block when insight is running

REORG Triggered, tip mismatch

info: NEW TIP: 00000000000f600610512237ae57557e95cb69f1f740e3699d4551d0365f51f7 NEED REORG (old tip: 00000000000509da5a2126434e3d4c30145e43059b4cc2bbe9cf3a91975ccee1 #256615)

/Users/gustavo/Documents/github/insight-api/lib/Sync.js:135
if (err) throw err;
^
Error: Could not found block:00000000000af726a3a26d18a1fffaef4994374081c90099fea95782b111c0c0
at /Users/gustavo/Documents/github/insight-api/lib/Sync.js:180:33
at /Users/gustavo/Documents/github/insight-api/lib/BlockDb.js:228:12
at dispatchError (/Users/gustavo/Documents/github/insight-api/node_modules/levelup/lib/util.js:130:7)
at /Users/gustavo/Documents/github/insight-api/node_modules/levelup/lib/levelup.js:197:14

TotalReceived is inconsistent between blockchain APIs

https://bitcointalk.org/index.php?topic=523396.0

Please have a read of the thread and consider which implementation is most correct (preferably post your ideas in the thread as this is a discussion to be had with the bitcoin community rather than the insight-api community).

"The value reported depends whether amounts sent from the address to itself are counted as received amounts or not. Some services count it, some don't."

Currently insight-api does count amounts sent from the address to itself in totalReceived.

I hacked together a way to get the alternative value (ie not counting amounts sent to itself) into insight-api, and found it to involve a fair bit of extra code and database hits.

I know the simple solution is to say 'insight-api is already right' and not change anything, but I think this is worth discussion, especially given the talk about schema changes in #27 - one of the ways I considered to reduce the hackiness was to potentially modify the schema (obviously not something I was going to dive into on a whim).

This inconsistency means it's impossible to aggregate multiple sources of third-party blockchain data for the totalReceived address property.

Fields for "raw" asm in /api/tx/:hash

When I do request for tx info such as http://live.bitcore.io/api/tx/d5f65ee80147b4bcc70b75e4bbf2d7382021b871bd8867ef8fa525ef50864882

I see "asm" fields like for example:

(scriptSig)

"asm":"3045022072ba61305fe7cb542d142b8f3299a7b10f9ea61f6ffaab5dca8142601869d53c0221009a8027ed79eb3b9bc13577ac2853269323434558528c6b6a7e542be46e7e9a8201 047a2d177c0f3626fc68c53610b0270fa6156181f46586c679ba6a88b34c6f4874686390b4d92e5769fbb89c8050b984f4ec0b257a0e5c4ff8bd3b035a51709503"

and

(scriptPubKey)

"asm":"OP_DUP OP_HASH160 24a56db43cf6f2b02e838ea493f95d8d60474231 OP_EQUALVERIFY OP_CHECKSIG"

We would like to have fields for "raw" asm (not interpreted scripts), i.e. for these two cases:

(scriptSig)

"asm_raw":"483045022072ba61305fe7cb542d142b8f3299a7b10f9ea61f6ffaab5dca8142601869d53c0221009a8027ed79eb3b9bc13577ac2853269323434558528c6b6a7e542be46e7e9a820141047a2d177c0f3626fc68c53610b0270fa6156181f46586c679ba6a88b34c6f4874686390b4d92e5769fbb89c8050b984f4ec0b257a0e5c4ff8bd3b035a51709503"

and

(scriptPubKey)

"asm_raw":"76a91424a56db43cf6f2b02e838ea493f95d8d6047423188ac"

Otherwise we'd need to translate opcodes back to their binary form in order to get serialized script fields.

// cc @slush0

Unspent transactions endpoint

Does the Insight API offer an unspent transactions endpoint?

I can list the transactions linked with an address and there is a doubleSpentTxID but nothing that tells me if the transaction has been spent already if I am not mistaken.

I am looking for something similar to Blockchain.info's unspent endpoint but can loop over all transactions from a given address as well if there is no dedicated enpoint.

Thank you.

bitcore fail on npm update

1863 verbose from cache /storage/insight-api/node_modules/bitcore/package.json
21864 info preuninstall [email protected]
21865 info uninstall [email protected]
21866 verbose true,/storage/insight-api/node_modules,/storage/insight-api/node_modules unbuild [email protected]
21867 info postuninstall [email protected]
21868 error Error: invalid version: 3001.0001.0000-dev-harmony-fb
21868 error at validVersion (/usr/lib/nodejs/read-package-json/read-json.js:573:40)
21868 error at final (/usr/lib/nodejs/read-package-json/read-json.js:323:23)
21868 error at /usr/lib/nodejs/read-package-json/read-json.js:139:33
21868 error at cb (/usr/lib/nodejs/slide/lib/async-map.js:48:11)
21868 error at /usr/lib/nodejs/read-package-json/read-json.js:251:40
21868 error at fs.js:268:14
21868 error at /usr/lib/nodejs/graceful-fs/graceful-fs.js:103:5
21868 error at Object.oncomplete (fs.js:107:15)
21869 error If you need help, you may report this log at:
21869 error http://bugs.debian.org/npm
21869 error or use
21869 error reportbug --attach /storage/insight-api/npm-debug.log npm
21870 error System Linux 3.11.0-20-generic
21871 error command "/usr/bin/nodejs" "/usr/bin/npm" "update"
21872 error cwd /storage/insight-api
21873 error node -v v0.10.15
21874 error npm -v 1.2.18
21875 verbose exit [ 1, true ]

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.