-
Notifications
You must be signed in to change notification settings - Fork 639
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
98 changed files
with
10,951 additions
and
12,638 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,10 @@ | ||
dist: trusty | ||
sudo: false | ||
language: node_js | ||
env: | ||
- CXX=g++-4.8 CC=gcc-4.8 | ||
addons: | ||
apt: | ||
sources: | ||
- ubuntu-toolchain-r-test | ||
packages: | ||
- g++-4.8 | ||
- gcc-4.8 | ||
- libzmq3-dev | ||
node_js: | ||
- "v0.10.25" | ||
- "v0.12.7" | ||
- "v4" | ||
- 8 | ||
script: | ||
- npm run regtest | ||
- npm run test | ||
- npm run coverage | ||
- npm run jshint | ||
after_success: | ||
- npm run coveralls | ||
- npm run coveralls |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{ | ||
"network": "livenet", | ||
"port": 3001, | ||
"datadir": "/tmp", | ||
"services": [ | ||
"p2p", | ||
"db", | ||
"header", | ||
"block", | ||
"transaction", | ||
"timestamp", | ||
"mempool", | ||
"address" | ||
], | ||
"servicesConfig": { | ||
"p2p": { | ||
"peers": [ | ||
{ "ip": { "v4": "<some trusted full node>" } } | ||
] | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
'use strict'; | ||
|
||
var levelup = require('levelup'); | ||
var leveldown = require('leveldown'); | ||
var Encoding = require('../lib/services/address/encoding'); | ||
var dbPath = '/Users/chrisk/.bwdb/bitcore-node.db'; | ||
var bitcore = require('bitcore-lib'); | ||
var db = levelup(dbPath, {keyEncoding: 'binary', valueEncoding: 'binary'}); | ||
|
||
var prefix = new Buffer('0002', 'hex'); | ||
var encoding = new Encoding(prefix); | ||
var address = '1MfDRRVVKXUe5KNVZzu8CBzUZDHTTYZM94'; | ||
var addressLength = new Buffer(1); | ||
addressLength.writeUInt8(address.length); | ||
|
||
//var startBuffer = prefix; | ||
//var endBuffer = Buffer.concat([prefix, new Buffer('ff', 'hex')]); | ||
|
||
//var startBuffer = Buffer.concat([prefix, addressLength, new Buffer(address, 'utf8'), new Buffer('00', 'hex')]); | ||
//var endBuffer = Buffer.concat([prefix, addressLength, new Buffer(address, 'utf8'), new Buffer('01', 'hex')]); | ||
var start = Buffer.concat([prefix, new Buffer('0437cd7f8525ceed2324359c2d0ba26006d92d856a9c20fa0241106ee5a597c9', 'hex')]); | ||
var end = Buffer.concat([prefix, new Buffer('0437cd7f8525ceed2324359c2d0ba26006d92d856a9c20fa0241106ee5a597c9', 'hex'), new Buffer('01', 'hex')]); | ||
var stream = db.createReadStream({ | ||
gte: start, | ||
lt: end | ||
}); | ||
stream.on('data', function(data) { | ||
var txkey = data.key.slice(2).toString('hex'); | ||
var height = data.value.readUInt32BE(); | ||
var timestamp = data.value.readDoubleBE(4); | ||
var inputValues = []; | ||
var inputValuesLength = data.value.readUInt16BE(12); | ||
for(var i = 0; i < inputValuesLength / 8; i++) { | ||
inputValues.push(buffer.readDoubleBE(i * 8 + 14)); | ||
} | ||
var transaction = new bitcore.Transaction(data.value.slice(inputValues.length * 8 + 14)); | ||
transaction.__height = height; | ||
transaction.__inputValues = inputValues; | ||
transaction.__timestamp = timestamp; | ||
//console.log(txkey, transaction.toObject()); | ||
console.log(data.value); | ||
console.log(transaction.__height, transaction.__inputValues, transaction.__timestamp); | ||
//console.log(data.key.toString('hex'), data.value.toString('hex')); | ||
}); | ||
|
||
stream.on('end', function() { | ||
console.log('end'); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/bin/bash | ||
|
||
# helper script to run bwdb and/or restart it | ||
|
||
# execute thie script and then simply tail /tmp/bwdb-out | ||
# e.g. ./contrib/restart_bwdb.sh && tail -f /tmp/bwdb-out | ||
|
||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | ||
pkill -2 -x bitcore | ||
wait | ||
exec $DIR/../bin/bitcore-node start >> /tmp/bwdb-out 2>&1 & |
Oops, something went wrong.