pkg: rename to hsd.
This commit is contained in:
parent
4f04d92f08
commit
a03fcd1a23
157 changed files with 656 additions and 680 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
|
@ -1,6 +1,6 @@
|
|||
node_modules/
|
||||
docs/reference/
|
||||
docker_data/
|
||||
browser/hsk*
|
||||
browser/hsd*
|
||||
package-lock.json
|
||||
npm-debug.log
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ docs/
|
|||
docker_data/
|
||||
test/
|
||||
node_modules/
|
||||
browser/hsk*
|
||||
browser/hsd*
|
||||
package-lock.json
|
||||
npm-debug.log
|
||||
lib/covenants/names.json
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
# HSK Release Notes & Changelog
|
||||
# HSD Release Notes & Changelog
|
||||
|
||||
## v0.0.0
|
||||
|
||||
|
|
|
|||
74
README.md
74
README.md
|
|
@ -1,14 +1,14 @@
|
|||
# HSKD
|
||||
# HSD
|
||||
|
||||
**HSKD** is an implementation of the [Handshake][handshake] Protocol.
|
||||
**HSD** is an implementation of the [Handshake][handshake] Protocol.
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ git clone git://github.com/handshake-org/hskd.git
|
||||
$ cd hskd
|
||||
$ git clone git://github.com/handshake-org/hsd.git
|
||||
$ cd hsd
|
||||
$ npm install
|
||||
$ ./bin/hskd
|
||||
$ ./bin/hsd
|
||||
```
|
||||
|
||||
See the [Beginner's Guide][guide] for more in-depth installation instructions.
|
||||
|
|
@ -58,22 +58,22 @@ com. 86400 IN NS c.gtld-servers.net.
|
|||
|
||||
### Unbound support
|
||||
|
||||
HSKD currently has a built-in recursive resolver written in javascript,
|
||||
however, for the best performance and best DNS conformance, HSKD also includes
|
||||
HSD currently has a built-in recursive resolver written in javascript,
|
||||
however, for the best performance and best DNS conformance, HSD also includes
|
||||
native bindings to `libunbound` -- to make use of this, be sure to have
|
||||
`unbound` installed on your system _before_ installing `hskd`.
|
||||
`unbound` installed on your system _before_ installing `hsd`.
|
||||
|
||||
### Booting with a local recursive and authoritative nameserver
|
||||
|
||||
By default HSKD will listen on an authoritative and recursive nameserver (ports
|
||||
By default HSD will listen on an authoritative and recursive nameserver (ports
|
||||
`15359` and `15360` respectively). To configure this:
|
||||
|
||||
``` bash
|
||||
# Have the authoritative server listen on port 5300.
|
||||
$ hskd --ns-port 5300
|
||||
$ hsd --ns-port 5300
|
||||
|
||||
# Have the recursive server listen on port 53.
|
||||
$ hskd --rs-host 0.0.0.0 --rs-port 53 # Warning: public!
|
||||
$ hsd --rs-host 0.0.0.0 --rs-port 53 # Warning: public!
|
||||
```
|
||||
|
||||
Your localhost should now be diggable:
|
||||
|
|
@ -85,22 +85,22 @@ $ dig @127.0.0.1 -p 5300 org +dnssec
|
|||
|
||||
### Mining
|
||||
|
||||
To mine with getwork on a GPU, HSKD should be used in combination with
|
||||
[hsk-miner] and [hsk-client].
|
||||
To mine with getwork on a GPU, HSD should be used in combination with
|
||||
[hs-miner] and [hs-client].
|
||||
|
||||
``` bash
|
||||
# To boot and listen publicly on the HTTP server...
|
||||
# Optionally pass in a custom coinbase address.
|
||||
$ hskd --http-host '::' --api-key 'hunter2' \
|
||||
$ hsd --http-host '::' --api-key 'hunter2' \
|
||||
--coinbase-address 'ts1qsu62stru80svj5xk6mescy65v0lhg8xxtweqsr'
|
||||
```
|
||||
|
||||
Once HSKD is running, we can run [hsk-miner] on a machine with a CUDA-capable
|
||||
Once HSD is running, we can run [hs-miner] on a machine with a CUDA-capable
|
||||
GPU and point it at our full node.
|
||||
|
||||
``` bash
|
||||
$ hsk-miner --rpc-host 'my-ip-address' \
|
||||
--rpc-user bitcoinrpc --rpc-pass 'hunter2'
|
||||
$ hs-miner --rpc-host 'my-ip-address' \
|
||||
--rpc-user handshakerpc --rpc-pass 'hunter2'
|
||||
```
|
||||
|
||||
### Auctions
|
||||
|
|
@ -108,7 +108,7 @@ $ hsk-miner --rpc-host 'my-ip-address' \
|
|||
First we should look at the current status of a name we want.
|
||||
|
||||
``` bash
|
||||
$ hsk-cli rpc getnameinfo handshake
|
||||
$ hsd-cli rpc getnameinfo handshake
|
||||
```
|
||||
|
||||
Once we know the name is available, we can send an "open transaction", this is
|
||||
|
|
@ -118,7 +118,7 @@ the auction's state is inserted into the [urkel] tree.
|
|||
|
||||
``` bash
|
||||
# Attempt to open bidding for `handshake`.
|
||||
$ hwallet-cli rpc sendopen handshake
|
||||
$ hsw-cli rpc sendopen handshake
|
||||
```
|
||||
|
||||
Using `getnameinfo` we can check to see when bidding will begin. Once the
|
||||
|
|
@ -128,7 +128,7 @@ conceal our true bid.
|
|||
``` bash
|
||||
# Send a bid of 5 coins, with a lockup value of 10 coins.
|
||||
# These units are in HNS (1 HNS = 1,000,000 dollarydoos).
|
||||
$ hwallet-cli rpc sendbid handshake 5 10
|
||||
$ hsw-cli rpc sendbid handshake 5 10
|
||||
```
|
||||
|
||||
After the appropriate amount of time has passed, (1 day in the case of
|
||||
|
|
@ -136,25 +136,25 @@ testnet), we should reveal our bid.
|
|||
|
||||
``` bash
|
||||
# Reveal our bid for `handshake`.
|
||||
$ hwallet-cli rpc sendreveal handshake
|
||||
$ hsw-cli rpc sendreveal handshake
|
||||
```
|
||||
|
||||
We can continue monitoring the status, now with the wallet's version of
|
||||
getnameinfo:
|
||||
|
||||
``` bash
|
||||
$ hwallet-cli rpc getnameinfo handshake
|
||||
$ hsw-cli rpc getnameinfo handshake
|
||||
# To see other bids and reveals
|
||||
$ hwallet-cli rpc getauctioninfo handshake
|
||||
$ hsw-cli rpc getauctioninfo handshake
|
||||
```
|
||||
|
||||
If we end up losing, we can redeem our money from the covenant with
|
||||
`$ hwallet-cli rpc sendredeem handshake`.
|
||||
`$ hsw-cli rpc sendredeem handshake`.
|
||||
|
||||
If we won, we can now register and update the name using `sendupdate`.
|
||||
|
||||
``` bash
|
||||
$ hwallet-cli rpc sendupdate handshake \
|
||||
$ hsw-cli rpc sendupdate handshake \
|
||||
'{"ttl":172800,"ns":["ns1.example.com.@1.2.3.4"]}'
|
||||
```
|
||||
|
||||
|
|
@ -163,7 +163,7 @@ Note that the `ns` field's `domain@ip` format symbolizes glue.
|
|||
Expiration on testnet is around 30 days, so be sure to send a renewal soon!
|
||||
|
||||
``` bash
|
||||
$ hwallet-cli rpc sendrenewal handshake
|
||||
$ hsw-cli rpc sendrenewal handshake
|
||||
```
|
||||
|
||||
### RPC Calls
|
||||
|
|
@ -173,7 +173,7 @@ RPC.
|
|||
|
||||
#### Node Calls
|
||||
|
||||
All node calls should be made with `$ hsk-cli rpc [call] [arguments...]`.
|
||||
All node calls should be made with `$ hsd-cli rpc [call] [arguments...]`.
|
||||
|
||||
- `getnameinfo [name]` - Returns name and auction status.
|
||||
- `getnameresource [name]` - Returns parsed DNS-style resource.
|
||||
|
|
@ -183,7 +183,7 @@ All node calls should be made with `$ hsk-cli rpc [call] [arguments...]`.
|
|||
|
||||
#### Wallet Calls
|
||||
|
||||
All wallet calls should be made with `$ hwallet-cli rpc [call] [arguments...]`.
|
||||
All wallet calls should be made with `$ hsw-cli rpc [call] [arguments...]`.
|
||||
|
||||
- `getbids [name]` - List own bids on a name.
|
||||
- `getauctions` - List all watched auctions and their statuses.
|
||||
|
|
@ -241,7 +241,7 @@ First, we need to create a TXT record which we will sign in our zone (say we
|
|||
own example.com for instance):
|
||||
|
||||
``` bash
|
||||
$ hwallet-cli rpc createclaim example
|
||||
$ hsw-cli rpc createclaim example
|
||||
{
|
||||
"name": "example",
|
||||
"target": "example.com.",
|
||||
|
|
@ -279,7 +279,7 @@ Once our proof is published on the DNS layer, we can use `sendclaim` to crawl
|
|||
the relevant zones and create the proof.
|
||||
|
||||
``` bash
|
||||
$ hwallet-cli rpc sendclaim example
|
||||
$ hsw-cli rpc sendclaim example
|
||||
```
|
||||
|
||||
This will create and broadcast the proof to all of your peers, ultimately
|
||||
|
|
@ -291,7 +291,7 @@ Once the claim has reached maturity, you are able to bypass the auction process
|
|||
by calling `sendupdate` on your claimed name.
|
||||
|
||||
``` bash
|
||||
$ hwallet-cli rpc sendupdate example \
|
||||
$ hsw-cli rpc sendupdate example \
|
||||
'{"ttl":3600,"canonical":"icanhazip.com."}'
|
||||
```
|
||||
|
||||
|
|
@ -314,7 +314,7 @@ $ bns-prove -x -K /path/to/keys example.com. \
|
|||
The above will output a hex string which can then be passed to the RPC:
|
||||
|
||||
``` bash
|
||||
$ hsk-cli rpc sendrawclaim 'hex-string'
|
||||
$ hsd-cli rpc sendrawclaim 'hex-string'
|
||||
```
|
||||
|
||||
## Support
|
||||
|
|
@ -323,7 +323,7 @@ Join us on [freenode][freenode] in the [#handshake][irc] channel.
|
|||
|
||||
## Disclaimer
|
||||
|
||||
HSKD does not guarantee you against theft or lost funds due to bugs, mishaps,
|
||||
HSD does not guarantee you against theft or lost funds due to bugs, mishaps,
|
||||
or your own incompetence. You and you alone are responsible for securing your
|
||||
money.
|
||||
|
||||
|
|
@ -340,12 +340,12 @@ all code is your original work. `</legalese>`
|
|||
See LICENSE for more info.
|
||||
|
||||
[handshake]: https://handshake.org/
|
||||
[guide]: https://github.com/handshake-org/hskd/blob/master/docs/Beginner's-Guide.md
|
||||
[guide]: https://github.com/handshake-org/hsd/blob/master/docs/Beginner's-Guide.md
|
||||
[freenode]: https://freenode.net/
|
||||
[irc]: irc://irc.freenode.net/handshake
|
||||
[changelog]: https://github.com/handshake-org/hskd/blob/master/CHANGELOG.md
|
||||
[changelog]: https://github.com/handshake-org/hsd/blob/master/CHANGELOG.md
|
||||
[hnsd]: https://github.com/handshake-org/hnsd
|
||||
[hsk-miner]: https://github.com/handshake-org/hsk-miner
|
||||
[hsk-client]: https://github.com/handshake-org/hsk-client
|
||||
[hs-miner]: https://github.com/handshake-org/hs-miner
|
||||
[hs-client]: https://github.com/handshake-org/hs-client
|
||||
[urkel]: https://github.com/handshake-org/urkel
|
||||
[bns]: https://github.com/bcoin-org/bns
|
||||
|
|
|
|||
8
bin/cli
8
bin/cli
|
|
@ -3,12 +3,12 @@
|
|||
'use strict';
|
||||
|
||||
console.error('%s%s',
|
||||
'Warning: The `hsk cli` interface is deprecated.\n',
|
||||
'Please use `hsk-cli` ($ npm install bclient).');
|
||||
'Warning: The `hsd cli` interface is deprecated.\n',
|
||||
'Please use `hsd-cli` ($ npm install bclient).');
|
||||
|
||||
if (process.argv.length > 2 && process.argv[2] === 'wallet') {
|
||||
process.argv.splice(2, 1); // Evil hack.
|
||||
require('hsk-client/bin/hwallet-cli');
|
||||
require('hs-client/bin/hsw-cli');
|
||||
} else {
|
||||
require('hsk-client/bin/hsk-cli');
|
||||
require('hs-client/bin/hsd-cli');
|
||||
}
|
||||
|
|
|
|||
6
bin/node
6
bin/node
|
|
@ -2,12 +2,12 @@
|
|||
|
||||
'use strict';
|
||||
|
||||
process.title = 'hskd';
|
||||
process.title = 'hsd';
|
||||
|
||||
if (process.argv.indexOf('--help') !== -1
|
||||
|| process.argv.indexOf('-h') !== -1) {
|
||||
console.error('See the hskd wiki at:');
|
||||
console.error('https://github.com/handshake-org/hskd/wiki.');
|
||||
console.error('See the hsd wiki at:');
|
||||
console.error('https://github.com/handshake-org/hsd/wiki.');
|
||||
process.exit(1);
|
||||
throw new Error('Could not exit.');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,12 +2,12 @@
|
|||
|
||||
'use strict';
|
||||
|
||||
process.title = 'hskd';
|
||||
process.title = 'hsd';
|
||||
|
||||
if (process.argv.indexOf('--help') !== -1
|
||||
|| process.argv.indexOf('-h') !== -1) {
|
||||
console.error('See the hskd wiki at:');
|
||||
console.error('https://github.com/handshake-org/hskd/wiki.');
|
||||
console.error('See the hsd wiki at:');
|
||||
console.error('https://github.com/handshake-org/hsd/wiki.');
|
||||
process.exit(1);
|
||||
throw new Error('Could not exit.');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
'use strict';
|
||||
|
||||
process.title = 'hwallet';
|
||||
process.title = 'hsw';
|
||||
|
||||
if (process.argv.indexOf('--help') !== -1
|
||||
|| process.argv.indexOf('-h') !== -1) {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
# Sample hsk config file (~/.hsk/hsk.conf)
|
||||
# Sample hsd config file (~/.hsd/hsd.conf)
|
||||
|
||||
#
|
||||
# Options
|
||||
|
|
@ -10,7 +10,7 @@
|
|||
# Node
|
||||
#
|
||||
|
||||
prefix: ~/.hsk
|
||||
prefix: ~/.hsd
|
||||
db: leveldb
|
||||
max-files: 64
|
||||
cache-size: 100
|
||||
|
|
@ -79,7 +79,7 @@ host: ::
|
|||
# public-host: 1.2.3.4
|
||||
# public-port: 12038
|
||||
|
||||
# Brontide Identity Key (see also ~/.hsk/key)
|
||||
# Brontide Identity Key (see also ~/.hsd/key)
|
||||
identity-key: 74b4147957813b62cc8987f2b711ddb31f8cb46dcbf71502033da66053c8780a
|
||||
|
||||
# Always try to connect to these nodes.
|
||||
|
|
@ -92,7 +92,7 @@ identity-key: 74b4147957813b62cc8987f2b711ddb31f8cb46dcbf71502033da66053c8780a
|
|||
# Miner
|
||||
#
|
||||
|
||||
coinbase-flags: mined by hsk
|
||||
coinbase-flags: mined by hsd
|
||||
# coinbase-address: hs1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqrfy4d0
|
||||
preverify: false
|
||||
max-block-weight: 4000000
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/*!
|
||||
* chain.js - blockchain management for hsk
|
||||
* chain.js - blockchain management for hsd
|
||||
* Copyright (c) 2017-2018, Christopher Jeffrey (MIT License).
|
||||
* https://github.com/handshake-org/hskd
|
||||
* https://github.com/handshake-org/hsd
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/*!
|
||||
* chaindb.js - blockchain data management for hsk
|
||||
* chaindb.js - blockchain data management for hsd
|
||||
* Copyright (c) 2017-2018, Christopher Jeffrey (MIT License).
|
||||
* https://github.com/handshake-org/hskd
|
||||
* https://github.com/handshake-org/hsd
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/*!
|
||||
* chainentry.js - chainentry object for hsk
|
||||
* chainentry.js - chainentry object for hsd
|
||||
* Copyright (c) 2017-2018, Christopher Jeffrey (MIT License).
|
||||
* https://github.com/handshake-org/hskd
|
||||
* https://github.com/handshake-org/hsd
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
|
@ -23,11 +23,7 @@ const ZERO = new BN(0);
|
|||
|
||||
/**
|
||||
* Chain Entry
|
||||
* Represents an entry in the chain. Unlike
|
||||
* other bitcoin fullnodes, we store the
|
||||
* chainwork _with_ the entry in order to
|
||||
* avoid reading the entire chain index on
|
||||
* boot and recalculating the chainworks.
|
||||
* Represents an entry in the chain.
|
||||
* @alias module:blockchain.ChainEntry
|
||||
* @property {Hash} hash
|
||||
* @property {Number} version
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/*!
|
||||
* common.js - bitcoin constants for hsk
|
||||
* common.js - chain constants for hsd
|
||||
* Copyright (c) 2017-2018, Christopher Jeffrey (MIT License).
|
||||
* https://github.com/handshake-org/hskd
|
||||
* https://github.com/handshake-org/hsd
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/*!
|
||||
* blockchain/index.js - blockchain for hsk
|
||||
* blockchain/index.js - blockchain for hsd
|
||||
* Copyright (c) 2017-2018, Christopher Jeffrey (MIT License).
|
||||
* https://github.com/handshake-org/hskd
|
||||
* https://github.com/handshake-org/hsd
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/*!
|
||||
* layout.js - blockchain data layout for hsk
|
||||
* layout.js - blockchain data layout for hsd
|
||||
* Copyright (c) 2017-2018, Christopher Jeffrey (MIT License).
|
||||
* https://github.com/handshake-org/hskd
|
||||
* https://github.com/handshake-org/hsd
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/*!
|
||||
* amount.js - amount object for hsk
|
||||
* amount.js - amount object for hsd
|
||||
* Copyright (c) 2017-2018, Christopher Jeffrey (MIT License).
|
||||
* https://github.com/handshake-org/hskd
|
||||
* https://github.com/handshake-org/hsd
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/*!
|
||||
* btc/index.js - high-level btc objects for hsk
|
||||
* btc/index.js - high-level btc objects for hsd
|
||||
* Copyright (c) 2017-2018, Christopher Jeffrey (MIT License).
|
||||
* https://github.com/handshake-org/hskd
|
||||
* https://github.com/handshake-org/hsd
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/**
|
||||
* uri.js - bitcoin uri parsing for hsk
|
||||
* uri.js - handshake uri parsing for hsd
|
||||
* Copyright (c) 2017-2018, Christopher Jeffrey (MIT License).
|
||||
* https://github.com/handshake-org/hskd
|
||||
* https://github.com/handshake-org/hsd
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
|
@ -13,7 +13,7 @@ const pkg = require('../pkg');
|
|||
|
||||
/**
|
||||
* URI
|
||||
* Represents a bitcoin URI.
|
||||
* Represents a handshake URI.
|
||||
* @alias module:btc.URI
|
||||
* @property {Address} address
|
||||
* @property {Amount} amount
|
||||
|
|
@ -24,7 +24,7 @@ const pkg = require('../pkg');
|
|||
|
||||
class URI {
|
||||
/**
|
||||
* Create a bitcoin URI.
|
||||
* Create a handshake URI.
|
||||
* @alias module:btc.URI
|
||||
* @constructor
|
||||
* @param {Object|String} options
|
||||
|
|
@ -187,7 +187,7 @@ class URI {
|
|||
}
|
||||
|
||||
/**
|
||||
* Inspect bitcoin uri.
|
||||
* Inspect handshake uri.
|
||||
* @returns {String}
|
||||
*/
|
||||
|
||||
|
|
@ -200,7 +200,7 @@ class URI {
|
|||
* Helpers
|
||||
*/
|
||||
|
||||
class BitcoinQuery {
|
||||
class HandshakeQuery {
|
||||
constructor() {
|
||||
this.amount = null;
|
||||
this.label = null;
|
||||
|
|
@ -211,7 +211,7 @@ class BitcoinQuery {
|
|||
|
||||
function parsePairs(str) {
|
||||
const parts = str.split('&');
|
||||
const data = new BitcoinQuery();
|
||||
const data = new HandshakeQuery();
|
||||
|
||||
let size = 0;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/*!
|
||||
* coinentry.js - coin entry object for hsk
|
||||
* coinentry.js - coin entry object for hsd
|
||||
* Copyright (c) 2017-2018, Christopher Jeffrey (MIT License).
|
||||
* https://github.com/handshake-org/hskd
|
||||
* https://github.com/handshake-org/hsd
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/*!
|
||||
* coins.js - coins object for hsk
|
||||
* coins.js - coins object for hsd
|
||||
* Copyright (c) 2017-2018, Christopher Jeffrey (MIT License).
|
||||
* https://github.com/handshake-org/hskd
|
||||
* https://github.com/handshake-org/hsd
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/*!
|
||||
* coinview.js - coin viewpoint object for hsk
|
||||
* coinview.js - coin viewpoint object for hsd
|
||||
* Copyright (c) 2017-2018, Christopher Jeffrey (MIT License).
|
||||
* https://github.com/handshake-org/hskd
|
||||
* https://github.com/handshake-org/hsd
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/*!
|
||||
* compress.js - coin compressor for hsk
|
||||
* compress.js - coin compressor for hsd
|
||||
* Copyright (c) 2017-2018, Christopher Jeffrey (MIT License).
|
||||
* https://github.com/handshake-org/hskd
|
||||
* https://github.com/handshake-org/hsd
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
|
@ -54,7 +54,7 @@ function sizeOutput(output) {
|
|||
|
||||
/**
|
||||
* Compress value using an exponent. Takes advantage of
|
||||
* the fact that many bitcoin values are divisible by 10.
|
||||
* the fact that many values are divisible by 10.
|
||||
* @see https://github.com/btcsuite/btcd/blob/master/blockchain/compress.go
|
||||
* @param {Amount} value
|
||||
* @returns {Number}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/*!
|
||||
* coins/index.js - utxo management for hsk
|
||||
* coins/index.js - utxo management for hsd
|
||||
* Copyright (c) 2017-2018, Christopher Jeffrey (MIT License).
|
||||
* https://github.com/handshake-org/hskd
|
||||
* https://github.com/handshake-org/hsd
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/*!
|
||||
* undocoins.js - undocoins object for hsk
|
||||
* undocoins.js - undocoins object for hsd
|
||||
* Copyright (c) 2017-2018, Christopher Jeffrey (MIT License).
|
||||
* https://github.com/handshake-org/hskd
|
||||
* https://github.com/handshake-org/hsd
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/*!
|
||||
* namedelta.js - name deltas for hsk
|
||||
* namedelta.js - name deltas for hsd
|
||||
* Copyright (c) 2017-2018, Christopher Jeffrey (MIT License).
|
||||
* https://github.com/handshake-org/hskd
|
||||
* https://github.com/handshake-org/hsd
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/*!
|
||||
* namestate.js - name states for hsk
|
||||
* namestate.js - name states for hsd
|
||||
* Copyright (c) 2017-2018, Christopher Jeffrey (MIT License).
|
||||
* https://github.com/handshake-org/hskd
|
||||
* https://github.com/handshake-org/hsd
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/*!
|
||||
* ownership.js - DNSSEC ownership proofs for hskd
|
||||
* ownership.js - DNSSEC ownership proofs for hsd
|
||||
* Copyright (c) 2018, Christopher Jeffrey (MIT License).
|
||||
* https://github.com/handshake-org/hskd
|
||||
* https://github.com/handshake-org/hsd
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/*!
|
||||
* rules.js - covenant rules for hsk
|
||||
* rules.js - covenant rules for hsd
|
||||
* Copyright (c) 2017-2018, Christopher Jeffrey (MIT License).
|
||||
* https://github.com/handshake-org/hskd
|
||||
* https://github.com/handshake-org/hsd
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
|
@ -173,7 +173,7 @@ rules.hashBinary = function hashBinary(name) {
|
|||
};
|
||||
|
||||
/**
|
||||
* Verify a domain name meets HSK requirements.
|
||||
* Verify a domain name meets handshake requirements.
|
||||
* @param {String|Buffer} name
|
||||
* @returns {Boolean}
|
||||
*/
|
||||
|
|
@ -185,7 +185,7 @@ rules.verifyName = function verifyName(name) {
|
|||
};
|
||||
|
||||
/**
|
||||
* Verify a domain name meets HSK requirements.
|
||||
* Verify a domain name meets handshake requirements.
|
||||
* @param {String} name
|
||||
* @returns {Boolean}
|
||||
*/
|
||||
|
|
@ -232,7 +232,7 @@ rules.verifyString = function verifyString(str) {
|
|||
};
|
||||
|
||||
/**
|
||||
* Verify a domain name meets HSK requirements.
|
||||
* Verify a domain name meets handshake requirements.
|
||||
* @param {Buffer} name
|
||||
* @returns {Boolean}
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/*!
|
||||
* compress.js - record compression for hsk
|
||||
* compress.js - record compression for hsd
|
||||
* Copyright (c) 2017-2018, Christopher Jeffrey (MIT License).
|
||||
* https://github.com/handshake-org/hskd
|
||||
* https://github.com/handshake-org/hsd
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/*!
|
||||
* key.js - dnssec key for hsk
|
||||
* key.js - dnssec key for hsd
|
||||
* Copyright (c) 2017-2018, Christopher Jeffrey (MIT License).
|
||||
* https://github.com/handshake-org/hskd
|
||||
* https://github.com/handshake-org/hsd
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/*!
|
||||
* records.js - hsk records for hsk
|
||||
* records.js - hns records for hsd
|
||||
* Copyright (c) 2017-2018, Christopher Jeffrey (MIT License).
|
||||
* https://github.com/handshake-org/hskd
|
||||
* https://github.com/handshake-org/hsd
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/*!
|
||||
* resource.js - hsk resource for hsk
|
||||
* resource.js - hns resource for hsd
|
||||
* Copyright (c) 2017-2018, Christopher Jeffrey (MIT License).
|
||||
* https://github.com/handshake-org/hskd
|
||||
* https://github.com/handshake-org/hsd
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
|
@ -947,7 +947,7 @@ class Resource extends Struct {
|
|||
rr.ttl = this.ttl;
|
||||
rr.data = rd;
|
||||
|
||||
rd.txt.push('hsk:tor');
|
||||
rd.txt.push('hns:tor');
|
||||
|
||||
for (const host of this.hosts) {
|
||||
if (host.isTor())
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/*!
|
||||
* dns.js - dns server for hsk
|
||||
* dns.js - dns server for hsd
|
||||
* Copyright (c) 2017-2018, Christopher Jeffrey (MIT License).
|
||||
* https://github.com/handshake-org/hskd
|
||||
* https://github.com/handshake-org/hsd
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/*!
|
||||
* common.js - common functions for hd
|
||||
* Copyright (c) 2017-2018, Christopher Jeffrey (MIT License).
|
||||
* https://github.com/handshake-org/hskd
|
||||
* https://github.com/handshake-org/hsd
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/*!
|
||||
* hd.js - hd keys for hsk
|
||||
* hd.js - hd keys for hsd
|
||||
* Copyright (c) 2017-2018, Christopher Jeffrey (MIT License).
|
||||
* https://github.com/handshake-org/hskd
|
||||
* https://github.com/handshake-org/hsd
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/*!
|
||||
* hd/index.js - hd keys for hsk
|
||||
* hd/index.js - hd keys for hsd
|
||||
* Copyright (c) 2017-2018, Christopher Jeffrey (MIT License).
|
||||
* https://github.com/handshake-org/hskd
|
||||
* https://github.com/handshake-org/hsd
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/*!
|
||||
* mnemonic.js - hd mnemonics for hsk
|
||||
* mnemonic.js - hd mnemonics for hsd
|
||||
* Copyright (c) 2017-2018, Christopher Jeffrey (MIT License).
|
||||
* https://github.com/handshake-org/hskd
|
||||
* https://github.com/handshake-org/hsd
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/*!
|
||||
* nfkd-compat.js - unicode normalization for hsk
|
||||
* nfkd-compat.js - unicode normalization for hsd
|
||||
* Copyright (c) 2017-2018, Christopher Jeffrey (MIT License).
|
||||
* https://github.com/handshake-org/hskd
|
||||
* https://github.com/handshake-org/hsd
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/*!
|
||||
* nfkd.js - unicode normalization for hsk
|
||||
* nfkd.js - unicode normalization for hsd
|
||||
* Copyright (c) 2017-2018, Christopher Jeffrey (MIT License).
|
||||
* https://github.com/handshake-org/hskd
|
||||
* https://github.com/handshake-org/hsd
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/*!
|
||||
* private.js - hd private keys for hsk
|
||||
* private.js - hd private keys for hsd
|
||||
* Copyright (c) 2017-2018, Christopher Jeffrey (MIT License).
|
||||
* https://github.com/handshake-org/hskd
|
||||
* https://github.com/handshake-org/hsd
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/*!
|
||||
* public.js - hd public keys for hsk
|
||||
* public.js - hd public keys for hsd
|
||||
* Copyright (c) 2017-2018, Christopher Jeffrey (MIT License).
|
||||
* https://github.com/handshake-org/hskd
|
||||
* https://github.com/handshake-org/hsd
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/*!
|
||||
* wordlist.js - wordlists for hsk
|
||||
* wordlist.js - wordlists for hsd
|
||||
* Copyright (c) 2017-2018, Christopher Jeffrey (MIT License).
|
||||
* https://github.com/handshake-org/hskd
|
||||
* https://github.com/handshake-org/hsd
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/*!
|
||||
* wordlist.js - wordlists for hsk
|
||||
* wordlist.js - wordlists for hsd
|
||||
* Copyright (c) 2017-2018, Christopher Jeffrey (MIT License).
|
||||
* https://github.com/handshake-org/hskd
|
||||
* https://github.com/handshake-org/hsd
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/*!
|
||||
* index.js - wordlists for hsk
|
||||
* index.js - wordlists for hsd
|
||||
* Copyright (c) 2017-2018, Christopher Jeffrey (MIT License).
|
||||
* https://github.com/handshake-org/hskd
|
||||
* https://github.com/handshake-org/hsd
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
|
|
|||
124
lib/hsd-browser.js
Normal file
124
lib/hsd-browser.js
Normal file
|
|
@ -0,0 +1,124 @@
|
|||
/*!
|
||||
* hsd.js - a javascript handshake library.
|
||||
* Copyright (c) 2017-2018, Christopher Jeffrey (MIT License).
|
||||
* https://github.com/handshake-org/hsd
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* An HSD "environment" which exposes all
|
||||
* constructors for primitives, the blockchain,
|
||||
* mempool, wallet, etc. It also exposes a
|
||||
* global worker pool.
|
||||
*
|
||||
* @exports hsd
|
||||
* @type {Object}
|
||||
*/
|
||||
|
||||
const hsd = exports;
|
||||
|
||||
/**
|
||||
* Set the default network.
|
||||
* @param {String} network
|
||||
*/
|
||||
|
||||
hsd.set = function set(network) {
|
||||
hsd.Network.set(network);
|
||||
return hsd;
|
||||
};
|
||||
|
||||
/*
|
||||
* Expose
|
||||
*/
|
||||
|
||||
// Blockchain
|
||||
hsd.blockchain = require('./blockchain');
|
||||
hsd.Chain = require('./blockchain/chain');
|
||||
hsd.ChainEntry = require('./blockchain/chainentry');
|
||||
|
||||
// BTC
|
||||
hsd.btc = require('./btc');
|
||||
hsd.Amount = require('./btc/amount');
|
||||
hsd.URI = require('./btc/uri');
|
||||
|
||||
// Coins
|
||||
hsd.coins = require('./coins');
|
||||
hsd.Coins = require('./coins/coins');
|
||||
hsd.CoinEntry = require('./coins/coinentry');
|
||||
hsd.CoinView = require('./coins/coinview');
|
||||
|
||||
// HD
|
||||
hsd.hd = require('./hd');
|
||||
hsd.HDPrivateKey = require('./hd/private');
|
||||
hsd.HDPublicKey = require('./hd/public');
|
||||
hsd.Mnemonic = require('./hd/mnemonic');
|
||||
|
||||
// Mempool
|
||||
hsd.mempool = require('./mempool');
|
||||
hsd.Fees = require('./mempool/fees');
|
||||
hsd.Mempool = require('./mempool/mempool');
|
||||
hsd.MempoolEntry = require('./mempool/mempoolentry');
|
||||
|
||||
// Miner
|
||||
hsd.mining = require('./mining');
|
||||
hsd.Miner = require('./mining/miner');
|
||||
|
||||
// Net
|
||||
hsd.net = require('./net');
|
||||
hsd.packets = require('./net/packets');
|
||||
hsd.Peer = require('./net/peer');
|
||||
hsd.Pool = require('./net/pool');
|
||||
|
||||
// Node
|
||||
hsd.node = require('./node');
|
||||
hsd.Node = require('./node/node');
|
||||
hsd.FullNode = require('./node/fullnode');
|
||||
hsd.SPVNode = require('./node/spvnode');
|
||||
|
||||
// Primitives
|
||||
hsd.primitives = require('./primitives');
|
||||
hsd.Address = require('./primitives/address');
|
||||
hsd.Block = require('./primitives/block');
|
||||
hsd.Coin = require('./primitives/coin');
|
||||
hsd.Headers = require('./primitives/headers');
|
||||
hsd.Input = require('./primitives/input');
|
||||
hsd.InvItem = require('./primitives/invitem');
|
||||
hsd.KeyRing = require('./primitives/keyring');
|
||||
hsd.MerkleBlock = require('./primitives/merkleblock');
|
||||
hsd.MTX = require('./primitives/mtx');
|
||||
hsd.Outpoint = require('./primitives/outpoint');
|
||||
hsd.Output = require('./primitives/output');
|
||||
hsd.TX = require('./primitives/tx');
|
||||
|
||||
// Protocol
|
||||
hsd.protocol = require('./protocol');
|
||||
hsd.consensus = require('./protocol/consensus');
|
||||
hsd.Network = require('./protocol/network');
|
||||
hsd.networks = require('./protocol/networks');
|
||||
hsd.policy = require('./protocol/policy');
|
||||
|
||||
// Script
|
||||
hsd.script = require('./script');
|
||||
hsd.Opcode = require('./script/opcode');
|
||||
hsd.Program = require('./script/program');
|
||||
hsd.Script = require('./script/script');
|
||||
hsd.ScriptNum = require('./script/scriptnum');
|
||||
hsd.SigCache = require('./script/sigcache');
|
||||
hsd.Stack = require('./script/stack');
|
||||
hsd.Witness = require('./script/witness');
|
||||
|
||||
// Utils
|
||||
hsd.utils = require('./utils');
|
||||
hsd.util = require('./utils/util');
|
||||
|
||||
// Wallet
|
||||
hsd.wallet = require('./wallet');
|
||||
hsd.WalletDB = require('./wallet/walletdb');
|
||||
|
||||
// Workers
|
||||
hsd.workers = require('./workers');
|
||||
hsd.WorkerPool = require('./workers/workerpool');
|
||||
|
||||
// Package Info
|
||||
hsd.pkg = require('./pkg');
|
||||
145
lib/hsd.js
Normal file
145
lib/hsd.js
Normal file
|
|
@ -0,0 +1,145 @@
|
|||
/*!
|
||||
* hsd.js - a javascript handshake library.
|
||||
* Copyright (c) 2017-2018, Christopher Jeffrey (MIT License).
|
||||
* https://github.com/handshake-org/hsd
|
||||
*/
|
||||
|
||||
/* eslint prefer-arrow-callback: "off" */
|
||||
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* An hsd "environment" which exposes all
|
||||
* constructors for primitives, the blockchain,
|
||||
* mempool, wallet, etc. It also exposes a
|
||||
* global worker pool.
|
||||
*
|
||||
* @exports hsd
|
||||
* @type {Object}
|
||||
*/
|
||||
|
||||
const hsd = exports;
|
||||
|
||||
/**
|
||||
* Define a module for lazy loading.
|
||||
* @param {String} name
|
||||
* @param {String} path
|
||||
*/
|
||||
|
||||
hsd.define = function define(name, path) {
|
||||
let cache = null;
|
||||
Object.defineProperty(hsd, name, {
|
||||
get() {
|
||||
if (!cache)
|
||||
cache = require(path);
|
||||
return cache;
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Set the default network.
|
||||
* @param {String} network
|
||||
*/
|
||||
|
||||
hsd.set = function set(network) {
|
||||
hsd.Network.set(network);
|
||||
return hsd;
|
||||
};
|
||||
|
||||
/*
|
||||
* Expose
|
||||
*/
|
||||
|
||||
// Blockchain
|
||||
hsd.define('blockchain', './blockchain');
|
||||
hsd.define('Chain', './blockchain/chain');
|
||||
hsd.define('ChainEntry', './blockchain/chainentry');
|
||||
|
||||
// BTC
|
||||
hsd.define('btc', './btc');
|
||||
hsd.define('Amount', './btc/amount');
|
||||
hsd.define('URI', './btc/uri');
|
||||
|
||||
// Coins
|
||||
hsd.define('coins', './coins');
|
||||
hsd.define('Coins', './coins/coins');
|
||||
hsd.define('CoinEntry', './coins/coinentry');
|
||||
hsd.define('CoinView', './coins/coinview');
|
||||
|
||||
// HD
|
||||
hsd.define('hd', './hd');
|
||||
hsd.define('HDPrivateKey', './hd/private');
|
||||
hsd.define('HDPublicKey', './hd/public');
|
||||
hsd.define('Mnemonic', './hd/mnemonic');
|
||||
|
||||
// Mempool
|
||||
hsd.define('mempool', './mempool');
|
||||
hsd.define('Fees', './mempool/fees');
|
||||
hsd.define('Mempool', './mempool/mempool');
|
||||
hsd.define('MempoolEntry', './mempool/mempoolentry');
|
||||
|
||||
// Miner
|
||||
hsd.define('mining', './mining');
|
||||
hsd.define('Miner', './mining/miner');
|
||||
|
||||
// Net
|
||||
hsd.define('net', './net');
|
||||
hsd.define('packets', './net/packets');
|
||||
hsd.define('Peer', './net/peer');
|
||||
hsd.define('Pool', './net/pool');
|
||||
|
||||
// Node
|
||||
hsd.define('node', './node');
|
||||
hsd.define('Node', './node/node');
|
||||
hsd.define('FullNode', './node/fullnode');
|
||||
hsd.define('SPVNode', './node/spvnode');
|
||||
|
||||
// Primitives
|
||||
hsd.define('primitives', './primitives');
|
||||
hsd.define('Address', './primitives/address');
|
||||
hsd.define('Block', './primitives/block');
|
||||
hsd.define('Coin', './primitives/coin');
|
||||
hsd.define('Headers', './primitives/headers');
|
||||
hsd.define('Input', './primitives/input');
|
||||
hsd.define('InvItem', './primitives/invitem');
|
||||
hsd.define('KeyRing', './primitives/keyring');
|
||||
hsd.define('MerkleBlock', './primitives/merkleblock');
|
||||
hsd.define('MTX', './primitives/mtx');
|
||||
hsd.define('Outpoint', './primitives/outpoint');
|
||||
hsd.define('Output', './primitives/output');
|
||||
hsd.define('TX', './primitives/tx');
|
||||
|
||||
// Protocol
|
||||
hsd.define('protocol', './protocol');
|
||||
hsd.define('consensus', './protocol/consensus');
|
||||
hsd.define('Network', './protocol/network');
|
||||
hsd.define('networks', './protocol/networks');
|
||||
hsd.define('policy', './protocol/policy');
|
||||
|
||||
// Script
|
||||
hsd.define('script', './script');
|
||||
hsd.define('Opcode', './script/opcode');
|
||||
hsd.define('Program', './script/program');
|
||||
hsd.define('Script', './script/script');
|
||||
hsd.define('ScriptNum', './script/scriptnum');
|
||||
hsd.define('SigCache', './script/sigcache');
|
||||
hsd.define('Stack', './script/stack');
|
||||
hsd.define('Witness', './script/witness');
|
||||
|
||||
// Utils
|
||||
hsd.define('utils', './utils');
|
||||
hsd.define('util', './utils/util');
|
||||
|
||||
// Wallet
|
||||
hsd.define('wallet', './wallet');
|
||||
hsd.define('Path', './wallet/path');
|
||||
hsd.define('WalletKey', './wallet/walletkey');
|
||||
hsd.define('WalletDB', './wallet/walletdb');
|
||||
|
||||
// Workers
|
||||
hsd.define('workers', './workers');
|
||||
hsd.define('WorkerPool', './workers/workerpool');
|
||||
|
||||
// Package Info
|
||||
hsd.define('pkg', './pkg');
|
||||
|
|
@ -1,124 +0,0 @@
|
|||
/*!
|
||||
* hsk.js - a javascript bitcoin library.
|
||||
* Copyright (c) 2017-2018, Christopher Jeffrey (MIT License).
|
||||
* https://github.com/handshake-org/hskd
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* An HSK "environment" which exposes all
|
||||
* constructors for primitives, the blockchain,
|
||||
* mempool, wallet, etc. It also exposes a
|
||||
* global worker pool.
|
||||
*
|
||||
* @exports hsk
|
||||
* @type {Object}
|
||||
*/
|
||||
|
||||
const hsk = exports;
|
||||
|
||||
/**
|
||||
* Set the default network.
|
||||
* @param {String} network
|
||||
*/
|
||||
|
||||
hsk.set = function set(network) {
|
||||
hsk.Network.set(network);
|
||||
return hsk;
|
||||
};
|
||||
|
||||
/*
|
||||
* Expose
|
||||
*/
|
||||
|
||||
// Blockchain
|
||||
hsk.blockchain = require('./blockchain');
|
||||
hsk.Chain = require('./blockchain/chain');
|
||||
hsk.ChainEntry = require('./blockchain/chainentry');
|
||||
|
||||
// BTC
|
||||
hsk.btc = require('./btc');
|
||||
hsk.Amount = require('./btc/amount');
|
||||
hsk.URI = require('./btc/uri');
|
||||
|
||||
// Coins
|
||||
hsk.coins = require('./coins');
|
||||
hsk.Coins = require('./coins/coins');
|
||||
hsk.CoinEntry = require('./coins/coinentry');
|
||||
hsk.CoinView = require('./coins/coinview');
|
||||
|
||||
// HD
|
||||
hsk.hd = require('./hd');
|
||||
hsk.HDPrivateKey = require('./hd/private');
|
||||
hsk.HDPublicKey = require('./hd/public');
|
||||
hsk.Mnemonic = require('./hd/mnemonic');
|
||||
|
||||
// Mempool
|
||||
hsk.mempool = require('./mempool');
|
||||
hsk.Fees = require('./mempool/fees');
|
||||
hsk.Mempool = require('./mempool/mempool');
|
||||
hsk.MempoolEntry = require('./mempool/mempoolentry');
|
||||
|
||||
// Miner
|
||||
hsk.mining = require('./mining');
|
||||
hsk.Miner = require('./mining/miner');
|
||||
|
||||
// Net
|
||||
hsk.net = require('./net');
|
||||
hsk.packets = require('./net/packets');
|
||||
hsk.Peer = require('./net/peer');
|
||||
hsk.Pool = require('./net/pool');
|
||||
|
||||
// Node
|
||||
hsk.node = require('./node');
|
||||
hsk.Node = require('./node/node');
|
||||
hsk.FullNode = require('./node/fullnode');
|
||||
hsk.SPVNode = require('./node/spvnode');
|
||||
|
||||
// Primitives
|
||||
hsk.primitives = require('./primitives');
|
||||
hsk.Address = require('./primitives/address');
|
||||
hsk.Block = require('./primitives/block');
|
||||
hsk.Coin = require('./primitives/coin');
|
||||
hsk.Headers = require('./primitives/headers');
|
||||
hsk.Input = require('./primitives/input');
|
||||
hsk.InvItem = require('./primitives/invitem');
|
||||
hsk.KeyRing = require('./primitives/keyring');
|
||||
hsk.MerkleBlock = require('./primitives/merkleblock');
|
||||
hsk.MTX = require('./primitives/mtx');
|
||||
hsk.Outpoint = require('./primitives/outpoint');
|
||||
hsk.Output = require('./primitives/output');
|
||||
hsk.TX = require('./primitives/tx');
|
||||
|
||||
// Protocol
|
||||
hsk.protocol = require('./protocol');
|
||||
hsk.consensus = require('./protocol/consensus');
|
||||
hsk.Network = require('./protocol/network');
|
||||
hsk.networks = require('./protocol/networks');
|
||||
hsk.policy = require('./protocol/policy');
|
||||
|
||||
// Script
|
||||
hsk.script = require('./script');
|
||||
hsk.Opcode = require('./script/opcode');
|
||||
hsk.Program = require('./script/program');
|
||||
hsk.Script = require('./script/script');
|
||||
hsk.ScriptNum = require('./script/scriptnum');
|
||||
hsk.SigCache = require('./script/sigcache');
|
||||
hsk.Stack = require('./script/stack');
|
||||
hsk.Witness = require('./script/witness');
|
||||
|
||||
// Utils
|
||||
hsk.utils = require('./utils');
|
||||
hsk.util = require('./utils/util');
|
||||
|
||||
// Wallet
|
||||
hsk.wallet = require('./wallet');
|
||||
hsk.WalletDB = require('./wallet/walletdb');
|
||||
|
||||
// Workers
|
||||
hsk.workers = require('./workers');
|
||||
hsk.WorkerPool = require('./workers/workerpool');
|
||||
|
||||
// Package Info
|
||||
hsk.pkg = require('./pkg');
|
||||
145
lib/hskd.js
145
lib/hskd.js
|
|
@ -1,145 +0,0 @@
|
|||
/*!
|
||||
* hsk.js - a javascript bitcoin library.
|
||||
* Copyright (c) 2017-2018, Christopher Jeffrey (MIT License).
|
||||
* https://github.com/handshake-org/hskd
|
||||
*/
|
||||
|
||||
/* eslint prefer-arrow-callback: "off" */
|
||||
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* An hsk "environment" which exposes all
|
||||
* constructors for primitives, the blockchain,
|
||||
* mempool, wallet, etc. It also exposes a
|
||||
* global worker pool.
|
||||
*
|
||||
* @exports hsk
|
||||
* @type {Object}
|
||||
*/
|
||||
|
||||
const hsk = exports;
|
||||
|
||||
/**
|
||||
* Define a module for lazy loading.
|
||||
* @param {String} name
|
||||
* @param {String} path
|
||||
*/
|
||||
|
||||
hsk.define = function define(name, path) {
|
||||
let cache = null;
|
||||
Object.defineProperty(hsk, name, {
|
||||
get() {
|
||||
if (!cache)
|
||||
cache = require(path);
|
||||
return cache;
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Set the default network.
|
||||
* @param {String} network
|
||||
*/
|
||||
|
||||
hsk.set = function set(network) {
|
||||
hsk.Network.set(network);
|
||||
return hsk;
|
||||
};
|
||||
|
||||
/*
|
||||
* Expose
|
||||
*/
|
||||
|
||||
// Blockchain
|
||||
hsk.define('blockchain', './blockchain');
|
||||
hsk.define('Chain', './blockchain/chain');
|
||||
hsk.define('ChainEntry', './blockchain/chainentry');
|
||||
|
||||
// BTC
|
||||
hsk.define('btc', './btc');
|
||||
hsk.define('Amount', './btc/amount');
|
||||
hsk.define('URI', './btc/uri');
|
||||
|
||||
// Coins
|
||||
hsk.define('coins', './coins');
|
||||
hsk.define('Coins', './coins/coins');
|
||||
hsk.define('CoinEntry', './coins/coinentry');
|
||||
hsk.define('CoinView', './coins/coinview');
|
||||
|
||||
// HD
|
||||
hsk.define('hd', './hd');
|
||||
hsk.define('HDPrivateKey', './hd/private');
|
||||
hsk.define('HDPublicKey', './hd/public');
|
||||
hsk.define('Mnemonic', './hd/mnemonic');
|
||||
|
||||
// Mempool
|
||||
hsk.define('mempool', './mempool');
|
||||
hsk.define('Fees', './mempool/fees');
|
||||
hsk.define('Mempool', './mempool/mempool');
|
||||
hsk.define('MempoolEntry', './mempool/mempoolentry');
|
||||
|
||||
// Miner
|
||||
hsk.define('mining', './mining');
|
||||
hsk.define('Miner', './mining/miner');
|
||||
|
||||
// Net
|
||||
hsk.define('net', './net');
|
||||
hsk.define('packets', './net/packets');
|
||||
hsk.define('Peer', './net/peer');
|
||||
hsk.define('Pool', './net/pool');
|
||||
|
||||
// Node
|
||||
hsk.define('node', './node');
|
||||
hsk.define('Node', './node/node');
|
||||
hsk.define('FullNode', './node/fullnode');
|
||||
hsk.define('SPVNode', './node/spvnode');
|
||||
|
||||
// Primitives
|
||||
hsk.define('primitives', './primitives');
|
||||
hsk.define('Address', './primitives/address');
|
||||
hsk.define('Block', './primitives/block');
|
||||
hsk.define('Coin', './primitives/coin');
|
||||
hsk.define('Headers', './primitives/headers');
|
||||
hsk.define('Input', './primitives/input');
|
||||
hsk.define('InvItem', './primitives/invitem');
|
||||
hsk.define('KeyRing', './primitives/keyring');
|
||||
hsk.define('MerkleBlock', './primitives/merkleblock');
|
||||
hsk.define('MTX', './primitives/mtx');
|
||||
hsk.define('Outpoint', './primitives/outpoint');
|
||||
hsk.define('Output', './primitives/output');
|
||||
hsk.define('TX', './primitives/tx');
|
||||
|
||||
// Protocol
|
||||
hsk.define('protocol', './protocol');
|
||||
hsk.define('consensus', './protocol/consensus');
|
||||
hsk.define('Network', './protocol/network');
|
||||
hsk.define('networks', './protocol/networks');
|
||||
hsk.define('policy', './protocol/policy');
|
||||
|
||||
// Script
|
||||
hsk.define('script', './script');
|
||||
hsk.define('Opcode', './script/opcode');
|
||||
hsk.define('Program', './script/program');
|
||||
hsk.define('Script', './script/script');
|
||||
hsk.define('ScriptNum', './script/scriptnum');
|
||||
hsk.define('SigCache', './script/sigcache');
|
||||
hsk.define('Stack', './script/stack');
|
||||
hsk.define('Witness', './script/witness');
|
||||
|
||||
// Utils
|
||||
hsk.define('utils', './utils');
|
||||
hsk.define('util', './utils/util');
|
||||
|
||||
// Wallet
|
||||
hsk.define('wallet', './wallet');
|
||||
hsk.define('Path', './wallet/path');
|
||||
hsk.define('WalletKey', './wallet/walletkey');
|
||||
hsk.define('WalletDB', './wallet/walletdb');
|
||||
|
||||
// Workers
|
||||
hsk.define('workers', './workers');
|
||||
hsk.define('WorkerPool', './workers/workerpool');
|
||||
|
||||
// Package Info
|
||||
hsk.define('pkg', './pkg');
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
/*!
|
||||
* claimentry.js - claim entry object for hsk
|
||||
* claimentry.js - claim entry object for hsd
|
||||
* Copyright (c) 2017-2018, Christopher Jeffrey (MIT License).
|
||||
* https://github.com/handshake-org/hskd
|
||||
* https://github.com/handshake-org/hsd
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/*!
|
||||
* contractstate.js - mempool contract-state handling for hskd
|
||||
* contractstate.js - mempool contract-state handling for hsd
|
||||
* Copyright (c) 2017-2018, Christopher Jeffrey (MIT License).
|
||||
* https://github.com/handshake-org/hskd
|
||||
* https://github.com/handshake-org/hsd
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/*!
|
||||
* fees.js - fee estimation for hsk
|
||||
* fees.js - fee estimation for hsd
|
||||
* Copyright (c) 2017-2018, Christopher Jeffrey (MIT License).
|
||||
* https://github.com/handshake-org/hskd
|
||||
* https://github.com/handshake-org/hsd
|
||||
* Ported from:
|
||||
* https://github.com/bitcoin/bitcoin/blob/master/src/policy/fees.cpp
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/*!
|
||||
* mempool/index.js - mempool for hsk
|
||||
* mempool/index.js - mempool for hsd
|
||||
* Copyright (c) 2017-2018, Christopher Jeffrey (MIT License).
|
||||
* https://github.com/handshake-org/hskd
|
||||
* https://github.com/handshake-org/hsd
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/*!
|
||||
* layout.js - mempool data layout for hsk
|
||||
* layout.js - mempool data layout for hsd
|
||||
* Copyright (c) 2017-2018, Christopher Jeffrey (MIT License).
|
||||
* https://github.com/handshake-org/hskd
|
||||
* https://github.com/handshake-org/hsd
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/*!
|
||||
* mempool.js - mempool for hsk
|
||||
* mempool.js - mempool for hsd
|
||||
* Copyright (c) 2017-2018, Christopher Jeffrey (MIT License).
|
||||
* https://github.com/handshake-org/hskd
|
||||
* https://github.com/handshake-org/hsd
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/*!
|
||||
* mempoolentry.js - mempool entry object for hsk
|
||||
* mempoolentry.js - mempool entry object for hsd
|
||||
* Copyright (c) 2017-2018, Christopher Jeffrey (MIT License).
|
||||
* https://github.com/handshake-org/hskd
|
||||
* https://github.com/handshake-org/hsd
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/*!
|
||||
* common.js - mining utils
|
||||
* Copyright (c) 2017-2018, Christopher Jeffrey (MIT License).
|
||||
* https://github.com/handshake-org/hskd
|
||||
* https://github.com/handshake-org/hsd
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/*!
|
||||
* cpuminer.js - inefficient cpu miner for hsk (because we can)
|
||||
* cpuminer.js - inefficient cpu miner for hsd (because we can)
|
||||
* Copyright (c) 2017-2018, Christopher Jeffrey (MIT License).
|
||||
* https://github.com/handshake-org/hskd
|
||||
* https://github.com/handshake-org/hsd
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/*!
|
||||
* mining/index.js - mining infrastructure for hsk
|
||||
* mining/index.js - mining infrastructure for hsd
|
||||
* Copyright (c) 2017-2018, Christopher Jeffrey (MIT License).
|
||||
* https://github.com/handshake-org/hskd
|
||||
* https://github.com/handshake-org/hsd
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/*!
|
||||
* mine.js - mining function for hsk
|
||||
* mine.js - mining function for hsd
|
||||
* Copyright (c) 2017-2018, Christopher Jeffrey (MIT License).
|
||||
* https://github.com/handshake-org/hskd
|
||||
* https://github.com/handshake-org/hsd
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/*!
|
||||
* miner.js - block generator for hsk
|
||||
* miner.js - block generator for hsd
|
||||
* Copyright (c) 2017-2018, Christopher Jeffrey (MIT License).
|
||||
* https://github.com/handshake-org/hskd
|
||||
* https://github.com/handshake-org/hsd
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
|
@ -23,14 +23,14 @@ const {BlockEntry, BlockClaim} = BlockTemplate;
|
|||
|
||||
/**
|
||||
* Miner
|
||||
* A bitcoin miner and block generator.
|
||||
* A handshake miner and block generator.
|
||||
* @alias module:mining.Miner
|
||||
* @extends EventEmitter
|
||||
*/
|
||||
|
||||
class Miner extends EventEmitter {
|
||||
/**
|
||||
* Create a bitcoin miner.
|
||||
* Create a handshake miner.
|
||||
* @constructor
|
||||
* @param {Object} options
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/*!
|
||||
* template.js - block template object for hsk
|
||||
* template.js - block template object for hsd
|
||||
* Copyright (c) 2017-2018, Christopher Jeffrey (MIT License).
|
||||
* https://github.com/handshake-org/hskd
|
||||
* https://github.com/handshake-org/hsd
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/*!
|
||||
* bip152.js - compact block object for hsk
|
||||
* bip152.js - compact block object for hsd
|
||||
* Copyright (c) 2017-2018, Christopher Jeffrey (MIT License).
|
||||
* https://github.com/handshake-org/hskd
|
||||
* https://github.com/handshake-org/hsd
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ const ZERO_PUB = Buffer.alloc(33, 0x00);
|
|||
const EMPTY = Buffer.alloc(0);
|
||||
|
||||
const PROTOCOL_NAME = 'Noise_XK_secp256k1_ChaChaPoly_SHA256';
|
||||
const PROLOGUE = 'hsk';
|
||||
const PROLOGUE = 'hns';
|
||||
const ROTATION_INTERVAL = 1000;
|
||||
const VERSION = 0;
|
||||
const HEADER_SIZE = 20;
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/*!
|
||||
* common.js - p2p constants for hsk
|
||||
* common.js - p2p constants for hsd
|
||||
* Copyright (c) 2017-2018, Christopher Jeffrey (MIT License).
|
||||
* https://github.com/handshake-org/hskd
|
||||
* https://github.com/handshake-org/hsd
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/*!
|
||||
* framer.js - packet framer for hsk
|
||||
* framer.js - packet framer for hsd
|
||||
* Copyright (c) 2017-2018, Christopher Jeffrey (MIT License).
|
||||
* https://github.com/handshake-org/hskd
|
||||
* https://github.com/handshake-org/hsd
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/*!
|
||||
* hostlist.js - address management for hsk
|
||||
* hostlist.js - address management for hsd
|
||||
* Copyright (c) 2017-2018, Christopher Jeffrey (MIT License).
|
||||
* https://github.com/handshake-org/hskd
|
||||
* https://github.com/handshake-org/hsd
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/*!
|
||||
* net/index.js - p2p for hsk
|
||||
* net/index.js - p2p for hsd
|
||||
* Copyright (c) 2017-2018, Christopher Jeffrey (MIT License).
|
||||
* https://github.com/handshake-org/hskd
|
||||
* https://github.com/handshake-org/hsd
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/*!
|
||||
* netaddress.js - network address object for hsk
|
||||
* netaddress.js - network address object for hsd
|
||||
* Copyright (c) 2017-2018, Christopher Jeffrey (MIT License).
|
||||
* https://github.com/handshake-org/hskd
|
||||
* https://github.com/handshake-org/hsd
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/*!
|
||||
* packets.js - packets for hsk
|
||||
* packets.js - packets for hsd
|
||||
* Copyright (c) 2017-2018, Christopher Jeffrey (MIT License).
|
||||
* https://github.com/handshake-org/hskd
|
||||
* https://github.com/handshake-org/hsd
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/*!
|
||||
* parser.js - packet parser for hsk
|
||||
* parser.js - packet parser for hsd
|
||||
* Copyright (c) 2017-2018, Christopher Jeffrey (MIT License).
|
||||
* https://github.com/handshake-org/hskd
|
||||
* https://github.com/handshake-org/hsd
|
||||
*/
|
||||
|
||||
/* eslint nonblock-statement-body-position: "off" */
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/*!
|
||||
* peer.js - peer object for hsk
|
||||
* peer.js - peer object for hsd
|
||||
* Copyright (c) 2017-2018, Christopher Jeffrey (MIT License).
|
||||
* https://github.com/handshake-org/hskd
|
||||
* https://github.com/handshake-org/hsd
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/*!
|
||||
* pool.js - peer management for hsk
|
||||
* pool.js - peer management for hsd
|
||||
* Copyright (c) 2017-2018, Christopher Jeffrey (MIT License).
|
||||
* https://github.com/handshake-org/hskd
|
||||
* https://github.com/handshake-org/hsd
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/*!
|
||||
* seeds.js - seeds for hsk
|
||||
* seeds.js - seeds for hsd
|
||||
* Copyright (c) 2017, Christopher Jeffrey (MIT License).
|
||||
* https://github.com/handshake-org/hskd
|
||||
* https://github.com/handshake-org/hsd
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/*!
|
||||
* fullnode.js - full node for hsk
|
||||
* fullnode.js - full node for hsd
|
||||
* Copyright (c) 2017-2018, Christopher Jeffrey (MIT License).
|
||||
* https://github.com/handshake-org/hskd
|
||||
* https://github.com/handshake-org/hsd
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
|
@ -303,9 +303,7 @@ class FullNode extends Node {
|
|||
}
|
||||
|
||||
/**
|
||||
* Broadcast a transaction (note that this will _not_ be verified
|
||||
* by the mempool - use with care, lest you get banned from
|
||||
* bitcoind nodes).
|
||||
* Broadcast a transaction.
|
||||
* @param {TX|Block|Claim} item
|
||||
* @returns {Promise}
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/*!
|
||||
* server.js - http server for hsk
|
||||
* server.js - http server for hsd
|
||||
* Copyright (c) 2017-2018, Christopher Jeffrey (MIT License).
|
||||
* https://github.com/handshake-org/hskd
|
||||
* https://github.com/handshake-org/hsd
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/*!
|
||||
* node/index.js - node for hsk
|
||||
* node/index.js - node for hsd
|
||||
* Copyright (c) 2017-2018, Christopher Jeffrey (MIT License).
|
||||
* https://github.com/handshake-org/hskd
|
||||
* https://github.com/handshake-org/hsd
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/*!
|
||||
* node.js - node object for hsk
|
||||
* node.js - node object for hsd
|
||||
* Copyright (c) 2017-2018, Christopher Jeffrey (MIT License).
|
||||
* https://github.com/handshake-org/hskd
|
||||
* https://github.com/handshake-org/hsd
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/*!
|
||||
* rpc.js - bitcoind-compatible json rpc for hsk.
|
||||
* rpc.js - bitcoind-compatible json rpc for hsd.
|
||||
* Copyright (c) 2017-2018, Christopher Jeffrey (MIT License).
|
||||
* https://github.com/handshake-org/hskd
|
||||
* https://github.com/handshake-org/hsd
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
|
@ -79,7 +79,7 @@ const errs = {
|
|||
const MAGIC_STRING = `${pkg.currency} signed message:\n`;
|
||||
|
||||
/**
|
||||
* Bitcoin RPC
|
||||
* Handshake RPC
|
||||
* @alias module:http.RPC
|
||||
* @extends bweb.RPC
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/*!
|
||||
* spvnode.js - spv node for hsk
|
||||
* spvnode.js - spv node for hsd
|
||||
* Copyright (c) 2017-2018, Christopher Jeffrey (MIT License).
|
||||
* https://github.com/handshake-org/hskd
|
||||
* https://github.com/handshake-org/hsd
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
|
@ -280,9 +280,7 @@ class SPVNode extends Node {
|
|||
}
|
||||
|
||||
/**
|
||||
* Broadcast a transaction (note that this will _not_ be verified
|
||||
* by the mempool - use with care, lest you get banned from
|
||||
* bitcoind nodes).
|
||||
* Broadcast a transaction.
|
||||
* @param {TX|Block} item
|
||||
* @returns {Promise}
|
||||
*/
|
||||
|
|
@ -296,9 +294,7 @@ class SPVNode extends Node {
|
|||
}
|
||||
|
||||
/**
|
||||
* Broadcast a transaction (note that this will _not_ be verified
|
||||
* by the mempool - use with care, lest you get banned from
|
||||
* bitcoind nodes).
|
||||
* Broadcast a transaction.
|
||||
* @param {TX} tx
|
||||
* @returns {Promise}
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/*!
|
||||
* pkg.js - package constants
|
||||
* Copyright (c) 2017-2018, Christopher Jeffrey (MIT License).
|
||||
* https://github.com/handshake-org/hskd
|
||||
* https://github.com/handshake-org/hsd
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
|
@ -14,7 +14,7 @@ const pkg = exports;
|
|||
* @default
|
||||
*/
|
||||
|
||||
pkg.name = 'hskd';
|
||||
pkg.name = 'hsd';
|
||||
|
||||
/**
|
||||
* Project Name
|
||||
|
|
@ -22,7 +22,7 @@ pkg.name = 'hskd';
|
|||
* @default
|
||||
*/
|
||||
|
||||
pkg.core = 'hskd';
|
||||
pkg.core = 'hsd';
|
||||
|
||||
/**
|
||||
* Organization Name
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/*!
|
||||
* abstractblock.js - abstract block object for hsk
|
||||
* abstractblock.js - abstract block object for hsd
|
||||
* Copyright (c) 2017-2018, Christopher Jeffrey (MIT License).
|
||||
* https://github.com/handshake-org/hskd
|
||||
* https://github.com/handshake-org/hsd
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/*!
|
||||
* address.js - address object for hsk
|
||||
* address.js - address object for hsd
|
||||
* Copyright (c) 2017-2018, Christopher Jeffrey (MIT License).
|
||||
* https://github.com/handshake-org/hskd
|
||||
* https://github.com/handshake-org/hsd
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/*!
|
||||
* block.js - block object for hsk
|
||||
* block.js - block object for hsd
|
||||
* Copyright (c) 2017-2018, Christopher Jeffrey (MIT License).
|
||||
* https://github.com/handshake-org/hskd
|
||||
* https://github.com/handshake-org/hsd
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
|
@ -323,9 +323,7 @@ class Block extends AbstractBlock {
|
|||
|
||||
/**
|
||||
* Convert the block to an object suitable
|
||||
* for JSON serialization. Note that the hashes
|
||||
* will be reversed to abide by bitcoind's legacy
|
||||
* of little-endian uint256s.
|
||||
* for JSON serialization.
|
||||
* @param {Network} network
|
||||
* @param {CoinView} view
|
||||
* @param {Number} height
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/*!
|
||||
* claim.js - DNSSEC ownership proofs for hskd
|
||||
* claim.js - DNSSEC ownership proofs for hsd
|
||||
* Copyright (c) 2018, Christopher Jeffrey (MIT License).
|
||||
* https://github.com/handshake-org/hskd
|
||||
* https://github.com/handshake-org/hsd
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/*!
|
||||
* coin.js - coin object for hsk
|
||||
* coin.js - coin object for hsd
|
||||
* Copyright (c) 2017-2018, Christopher Jeffrey (MIT License).
|
||||
* https://github.com/handshake-org/hskd
|
||||
* https://github.com/handshake-org/hsd
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
|
@ -202,9 +202,7 @@ class Coin extends Output {
|
|||
|
||||
/**
|
||||
* Convert the coin to an object suitable
|
||||
* for JSON serialization. Note that the hash
|
||||
* will be reversed to abide by bitcoind's legacy
|
||||
* of little-endian uint256s.
|
||||
* for JSON serialization.
|
||||
* @param {Network} network
|
||||
* @param {Boolean} minimal
|
||||
* @returns {Object}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/*!
|
||||
* covenant.js - covenant object for hsk
|
||||
* covenant.js - covenant object for hsd
|
||||
* Copyright (c) 2017-2018, Christopher Jeffrey (MIT License).
|
||||
* https://github.com/handshake-org/hskd
|
||||
* https://github.com/handshake-org/hsd
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/*!
|
||||
* headers.js - headers object for hsk
|
||||
* headers.js - headers object for hsd
|
||||
* Copyright (c) 2017-2018, Christopher Jeffrey (MIT License).
|
||||
* https://github.com/handshake-org/hskd
|
||||
* https://github.com/handshake-org/hsd
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
|
@ -125,9 +125,7 @@ class Headers extends AbstractBlock {
|
|||
|
||||
/**
|
||||
* Convert the block to an object suitable
|
||||
* for JSON serialization. Note that the hashes
|
||||
* will be reversed to abide by bitcoind's legacy
|
||||
* of little-endian uint256s.
|
||||
* for JSON serialization.
|
||||
* @param {Network} network
|
||||
* @param {CoinView} view
|
||||
* @param {Number} height
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/*!
|
||||
* primitives/index.js - bitcoin primitives for hsk
|
||||
* primitives/index.js - handshake primitives for hsd
|
||||
* Copyright (c) 2017-2018, Christopher Jeffrey (MIT License).
|
||||
* https://github.com/handshake-org/hskd
|
||||
* https://github.com/handshake-org/hsd
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/*!
|
||||
* input.js - input object for hsk
|
||||
* input.js - input object for hsd
|
||||
* Copyright (c) 2017-2018, Christopher Jeffrey (MIT License).
|
||||
* https://github.com/handshake-org/hskd
|
||||
* https://github.com/handshake-org/hsd
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
|
@ -166,9 +166,7 @@ class Input extends bio.Struct {
|
|||
|
||||
/**
|
||||
* Convert the input to an object suitable
|
||||
* for JSON serialization. Note that the hashes
|
||||
* will be reversed to abide by bitcoind's legacy
|
||||
* of little-endian uint256s.
|
||||
* for JSON serialization.
|
||||
* @param {Network} network
|
||||
* @param {Coin} coin
|
||||
* @returns {Object}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/*!
|
||||
* invitem.js - inv item object for hsk
|
||||
* invitem.js - inv item object for hsd
|
||||
* Copyright (c) 2017-2018, Christopher Jeffrey (MIT License).
|
||||
* https://github.com/handshake-org/hskd
|
||||
* https://github.com/handshake-org/hsd
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/*!
|
||||
* keyring.js - keyring object for hsk
|
||||
* keyring.js - keyring object for hsd
|
||||
* Copyright (c) 2017-2018, Christopher Jeffrey (MIT License).
|
||||
* https://github.com/handshake-org/hskd
|
||||
* https://github.com/handshake-org/hsd
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
|
@ -231,7 +231,7 @@ class KeyRing extends bio.Struct {
|
|||
}
|
||||
|
||||
/**
|
||||
* Convert key to a CBitcoinSecret.
|
||||
* Convert key to a secret.
|
||||
* @param {(Network|NetworkType)?} network
|
||||
* @returns {Base58String}
|
||||
*/
|
||||
|
|
@ -254,7 +254,7 @@ class KeyRing extends bio.Struct {
|
|||
}
|
||||
|
||||
/**
|
||||
* Inject properties from serialized CBitcoinSecret.
|
||||
* Inject properties from serialized secret.
|
||||
* @private
|
||||
* @param {Base58String} secret
|
||||
* @param {(Network|NetworkType)?} network
|
||||
|
|
@ -276,7 +276,7 @@ class KeyRing extends bio.Struct {
|
|||
}
|
||||
|
||||
/**
|
||||
* Instantiate a keyring from a serialized CBitcoinSecret.
|
||||
* Instantiate a keyring from a serialized secret.
|
||||
* @param {Base58String} secret
|
||||
* @param {(Network|NetworkType)?} network
|
||||
* @returns {KeyRing}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/*!
|
||||
* memblock.js - memblock block object for hsk
|
||||
* memblock.js - memblock block object for hsd
|
||||
* Copyright (c) 2017-2018, Christopher Jeffrey (MIT License).
|
||||
* https://github.com/handshake-org/hskd
|
||||
* https://github.com/handshake-org/hsd
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/*!
|
||||
* merkleblock.js - merkleblock object for hsk
|
||||
* merkleblock.js - merkleblock object for hsd
|
||||
* Copyright (c) 2017-2018, Christopher Jeffrey (MIT License).
|
||||
* https://github.com/handshake-org/hskd
|
||||
* https://github.com/handshake-org/hsd
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
|
@ -363,9 +363,7 @@ class MerkleBlock extends AbstractBlock {
|
|||
|
||||
/**
|
||||
* Convert the block to an object suitable
|
||||
* for JSON serialization. Note that the hashes
|
||||
* will be reversed to abide by bitcoind's legacy
|
||||
* of little-endian uint256s.
|
||||
* for JSON serialization.
|
||||
* @param {Network} network
|
||||
* @param {CoinView} view
|
||||
* @param {Number} height
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/*!
|
||||
* mtx.js - mutable transaction object for hsk
|
||||
* mtx.js - mutable transaction object for hsd
|
||||
* Copyright (c) 2017-2018, Christopher Jeffrey (MIT License).
|
||||
* https://github.com/handshake-org/hskd
|
||||
* https://github.com/handshake-org/hsd
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/*!
|
||||
* outpoint.js - outpoint object for hsk
|
||||
* outpoint.js - outpoint object for hsd
|
||||
* Copyright (c) 2017-2018, Christopher Jeffrey (MIT License).
|
||||
* https://github.com/handshake-org/hskd
|
||||
* https://github.com/handshake-org/hsd
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
|
@ -198,9 +198,7 @@ class Outpoint extends bio.Struct {
|
|||
|
||||
/**
|
||||
* Convert the outpoint to an object suitable
|
||||
* for JSON serialization. Note that the hash
|
||||
* will be reversed to abide by bitcoind's legacy
|
||||
* of little-endian uint256s.
|
||||
* for JSON serialization.
|
||||
* @returns {Object}
|
||||
*/
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/*!
|
||||
* output.js - output object for hsk
|
||||
* output.js - output object for hsd
|
||||
* Copyright (c) 2017-2018, Christopher Jeffrey (MIT License).
|
||||
* https://github.com/handshake-org/hskd
|
||||
* https://github.com/handshake-org/hsd
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/*!
|
||||
* tx.js - transaction object for hsk
|
||||
* tx.js - transaction object for hsd
|
||||
* Copyright (c) 2017-2018, Christopher Jeffrey (MIT License).
|
||||
* https://github.com/handshake-org/hskd
|
||||
* https://github.com/handshake-org/hsd
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
|
@ -1673,9 +1673,7 @@ class TX extends bio.Struct {
|
|||
|
||||
/**
|
||||
* Convert the transaction to an object suitable
|
||||
* for JSON serialization. Note that the hashes
|
||||
* will be reversed to abide by bitcoind's legacy
|
||||
* of little-endian uint256s.
|
||||
* for JSON serialization.
|
||||
* @param {Network} network
|
||||
* @param {CoinView} view
|
||||
* @param {ChainEntry} entry
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/*!
|
||||
* txmeta.js - extended transaction object for hsk
|
||||
* txmeta.js - extended transaction object for hsd
|
||||
* Copyright (c) 2017-2018, Christopher Jeffrey (MIT License).
|
||||
* https://github.com/handshake-org/hskd
|
||||
* https://github.com/handshake-org/hsd
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue