Initial commit of Full Node

all current code is forked from bitcore2
This commit is contained in:
Ryan X. Charles 2014-09-28 18:33:54 -07:00
parent f54edfb618
commit 8b0b30e226
6 changed files with 65 additions and 67 deletions

2
.gitignore vendored
View File

@ -1,5 +1,5 @@
*.swp *.swp
coverage coverage
node_modules node_modules
browser/bitcore.js browser/fullnode.js
browser/tests.js browser/tests.js

View File

@ -1,10 +1,10 @@
This software is licensed under the MIT License. This software is licensed under the MIT License.
Copyright (c) 2014 BitPay Inc.
Parts of this software are based on privsec
Copyright (c) 2014 Ryan X. Charles <ryanxcharles@gmail.com> Copyright (c) 2014 Ryan X. Charles <ryanxcharles@gmail.com>
Parts of this software are based on bitcore
Copyright (c) 2014 BitPay Inc.
Parts of this software are based on BitcoinJS Parts of this software are based on BitcoinJS
Copyright (c) 2011 Stefan Thomas <justmoon@members.fsf.org> Copyright (c) 2011 Stefan Thomas <justmoon@members.fsf.org>

View File

@ -1,15 +1,13 @@
bitcore2 Full Node
======== =========
Bitcore 2 is a rewrite of bitcore. It is alpha quality. It will ultimately be Full Node is a javascript implementation of bitcoin, forked from bitcore,
merged into upstream bitcore. intended to satisfy certain goals:
Our goals:
1) Support ease-of-use by being internally consistent. It should not be 1) Support ease-of-use by being internally consistent. It should not be
necessary to read the source code of a class or function to know how to use it. necessary to read the source code of a class or function to know how to use it.
I.e., where in old bitcore a "privkey" might be anything from a buffer to a hex I.e., where in bitcore a "privkey" might be anything from a buffer to a hex
string to a key to a private key object, in bitcore 2 "privkey" is the same string to a key to a private key object, in fullnode "privkey" is the same
type of object always and everywhere. type of object always and everywhere.
2) Have 100% test coverage so that the library is known to be reliable. 2) Have 100% test coverage so that the library is known to be reliable.
@ -23,12 +21,12 @@ formats such as transactions and blocks.
lib/. All BIPs are correctly implemented and saved as BIPxx.js in lib/ (since lib/. All BIPs are correctly implemented and saved as BIPxx.js in lib/ (since
that is their standard name). Any non-standard features (such as SINs and that is their standard name). Any non-standard features (such as SINs and
stealth addresses) are placed in the lib/expmt/ folder and are accessible at stealth addresses) are placed in the lib/expmt/ folder and are accessible at
bitcore.expmt. Once they are standardized and given a BIP, they are renamed and fullnode.expmt. Once they are standardized and given a BIP, they are renamed and
placed in lib/. placed in lib/.
5) It is always possible to create a new object without using "new". 5) It is always possible to create a new object without using "new".
6) Compatible with browserify (i.e., using require('bitcore/lib/message') 6) Compatible with browserify (i.e., using require('fullnode/lib/message')
should work both in node, and be automatically work in the browser with used in should work both in node, and be automatically work in the browser with used in
conjunction with browserify). conjunction with browserify).

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/bin/bash
browserify index.js -o browser/bitcore.js browserify index.js -o browser/fullnode.js
ls test/*.js | xargs browserify -o browser/tests.js ls test/*.js | xargs browserify -o browser/tests.js

View File

@ -1,56 +1,56 @@
var bitcore = module.exports; var fullnode = module.exports;
//main bitcoin library //main bitcoin library
bitcore.Address = require('./lib/address'); fullnode.Address = require('./lib/address');
bitcore.Base58 = require('./lib/base58'); fullnode.Base58 = require('./lib/base58');
bitcore.Base58Check = require('./lib/base58check'); fullnode.Base58Check = require('./lib/base58check');
bitcore.BIP32 = require('./lib/bip32'); fullnode.BIP32 = require('./lib/bip32');
bitcore.Block = require('./lib/block'); fullnode.Block = require('./lib/block');
bitcore.Blockheader = require('./lib/blockheader'); fullnode.Blockheader = require('./lib/blockheader');
bitcore.BN = require('./lib/bn'); fullnode.BN = require('./lib/bn');
bitcore.BufferReader = require('./lib/bufferreader'); fullnode.BufferReader = require('./lib/bufferreader');
bitcore.BufferWriter = require('./lib/bufferwriter'); fullnode.BufferWriter = require('./lib/bufferwriter');
bitcore.Constants = require('./lib/constants'); fullnode.Constants = require('./lib/constants');
bitcore.ECDSA = require('./lib/ecdsa'); fullnode.ECDSA = require('./lib/ecdsa');
bitcore.Hash = require('./lib/hash'); fullnode.Hash = require('./lib/hash');
bitcore.KDF = require('./lib/kdf'); fullnode.KDF = require('./lib/kdf');
bitcore.Keypair = require('./lib/keypair'); fullnode.Keypair = require('./lib/keypair');
bitcore.Message = require('./lib/message'); fullnode.Message = require('./lib/message');
bitcore.Opcode = require('./lib/opcode'); fullnode.Opcode = require('./lib/opcode');
bitcore.Point = require('./lib/point'); fullnode.Point = require('./lib/point');
bitcore.Privkey = require('./lib/privkey'); fullnode.Privkey = require('./lib/privkey');
bitcore.Pubkey = require('./lib/pubkey'); fullnode.Pubkey = require('./lib/pubkey');
bitcore.Random = require('./lib/random'); fullnode.Random = require('./lib/random');
bitcore.Script = require('./lib/script'); fullnode.Script = require('./lib/script');
bitcore.Signature = require('./lib/signature'); fullnode.Signature = require('./lib/signature');
bitcore.Transaction = require('./lib/transaction'); fullnode.Transaction = require('./lib/transaction');
bitcore.Txin = require('./lib/txin'); fullnode.Txin = require('./lib/txin');
bitcore.Txout = require('./lib/txout'); fullnode.Txout = require('./lib/txout');
bitcore.Varint = require('./lib/varint'); fullnode.Varint = require('./lib/varint');
//experimental, nonstandard, or unstable features //experimental, nonstandard, or unstable features
bitcore.expmt = {}; fullnode.expmt = {};
bitcore.expmt.AES = require('./lib/expmt/aes'); fullnode.expmt.AES = require('./lib/expmt/aes');
bitcore.expmt.AESCBC = require('./lib/expmt/aescbc'); fullnode.expmt.AESCBC = require('./lib/expmt/aescbc');
bitcore.expmt.CBC = require('./lib/expmt/cbc'); fullnode.expmt.CBC = require('./lib/expmt/cbc');
bitcore.expmt.ECIES = require('./lib/expmt/ecies'); fullnode.expmt.ECIES = require('./lib/expmt/ecies');
bitcore.expmt.StealthAddress = require('./lib/expmt/stealthaddress'); fullnode.expmt.StealthAddress = require('./lib/expmt/stealthaddress');
bitcore.expmt.Stealthkey = require('./lib/expmt/stealthkey'); fullnode.expmt.Stealthkey = require('./lib/expmt/stealthkey');
bitcore.expmt.StealthMessage = require('./lib/expmt/stealthmessage'); fullnode.expmt.StealthMessage = require('./lib/expmt/stealthmessage');
bitcore.expmt.StealthTx = require('./lib/expmt/stealthtx'); fullnode.expmt.StealthTx = require('./lib/expmt/stealthtx');
//dependencies, subject to change //dependencies, subject to change
bitcore.deps = {}; fullnode.deps = {};
bitcore.deps.aes = require('aes'); fullnode.deps.aes = require('aes');
bitcore.deps.bnjs = require('bn.js'); fullnode.deps.bnjs = require('bn.js');
bitcore.deps.bs58 = require('bs58'); fullnode.deps.bs58 = require('bs58');
bitcore.deps.Buffer = Buffer; fullnode.deps.Buffer = Buffer;
bitcore.deps.elliptic = require('elliptic'); fullnode.deps.elliptic = require('elliptic');
bitcore.deps.hashjs = require('hash.js'); fullnode.deps.hashjs = require('hash.js');
bitcore.deps.sha512 = require('sha512'); fullnode.deps.sha512 = require('sha512');
//bitcore.scriptexec = require('lib/scriptexec'); //fullnode.scriptexec = require('lib/scriptexec');
//bitcore.tx = require('lib/tx'); //fullnode.tx = require('lib/tx');
//bitcore.txpartial = require('lib/txpartial'); //fullnode.txpartial = require('lib/txpartial');
//bitcore.bip70 = require('lib/bip70'); //fullnode.bip70 = require('lib/bip70');

View File

@ -1,7 +1,8 @@
{ {
"name": "bitcore2", "name": "fullnode",
"version": "0.0.0", "version": "0.0.0",
"description": "Bitcoin library.", "description": "Bitcoin library, CLI and API.",
"author": "Ryan X. Charles <ryanxcharles@gmail.com>",
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {
"test": "mocha" "test": "mocha"
@ -59,7 +60,7 @@
], ],
"repository": { "repository": {
"type": "git", "type": "git",
"url": "https://github.com/ryanxcharles/bitcore2.git" "url": "https://github.com/ryanxcharles/fullnode.git"
}, },
"dependencies": { "dependencies": {
"aes": "=0.1.0", "aes": "=0.1.0",
@ -74,6 +75,5 @@
"mocha": "~1.21.0", "mocha": "~1.21.0",
"browserify": "~5.9.1" "browserify": "~5.9.1"
}, },
"author": "Ryan X. Charles <ryanxcharles@gmail.com>",
"license": "MIT" "license": "MIT"
} }