diff --git a/.gitignore b/.gitignore index 2cce3fff..583f0148 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,6 @@ node_modules/ docs/reference/ docker_data/ -browser/hsk* +browser/hsd* package-lock.json npm-debug.log diff --git a/.npmignore b/.npmignore index 80e23885..7ebf9395 100644 --- a/.npmignore +++ b/.npmignore @@ -4,7 +4,7 @@ docs/ docker_data/ test/ node_modules/ -browser/hsk* +browser/hsd* package-lock.json npm-debug.log lib/covenants/names.json diff --git a/CHANGELOG.md b/CHANGELOG.md index 94936b82..53e27d37 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -# HSK Release Notes & Changelog +# HSD Release Notes & Changelog ## v0.0.0 diff --git a/README.md b/README.md index 67407d0d..fee5e0c2 100644 --- a/README.md +++ b/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. `` 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 diff --git a/bin/cli b/bin/cli index 0cff3dfa..04f59d7b 100755 --- a/bin/cli +++ b/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'); } diff --git a/bin/hskd b/bin/hsd similarity index 100% rename from bin/hskd rename to bin/hsd diff --git a/bin/hwallet b/bin/hsw similarity index 100% rename from bin/hwallet rename to bin/hsw diff --git a/bin/node b/bin/node index 3c608fb5..bcc61dfa 100755 --- a/bin/node +++ b/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.'); } diff --git a/bin/spvnode b/bin/spvnode index f1cd3740..3e4bbe3c 100755 --- a/bin/spvnode +++ b/bin/spvnode @@ -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.'); } diff --git a/bin/wallet b/bin/wallet index a68fd4bc..eca5c7c7 100755 --- a/bin/wallet +++ b/bin/wallet @@ -2,7 +2,7 @@ 'use strict'; -process.title = 'hwallet'; +process.title = 'hsw'; if (process.argv.indexOf('--help') !== -1 || process.argv.indexOf('-h') !== -1) { diff --git a/etc/sample.conf b/etc/sample.conf index 7d23ef77..01534e1a 100644 --- a/etc/sample.conf +++ b/etc/sample.conf @@ -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 diff --git a/lib/blockchain/chain.js b/lib/blockchain/chain.js index 9d25e908..ab5181bb 100644 --- a/lib/blockchain/chain.js +++ b/lib/blockchain/chain.js @@ -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'; diff --git a/lib/blockchain/chaindb.js b/lib/blockchain/chaindb.js index c5344a52..2659cb21 100644 --- a/lib/blockchain/chaindb.js +++ b/lib/blockchain/chaindb.js @@ -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'; diff --git a/lib/blockchain/chainentry.js b/lib/blockchain/chainentry.js index 7f9898d6..8c0c5f4a 100644 --- a/lib/blockchain/chainentry.js +++ b/lib/blockchain/chainentry.js @@ -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 diff --git a/lib/blockchain/common.js b/lib/blockchain/common.js index 6c7c6603..80b8f162 100644 --- a/lib/blockchain/common.js +++ b/lib/blockchain/common.js @@ -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'; diff --git a/lib/blockchain/index.js b/lib/blockchain/index.js index 4ccb033d..e0994b9c 100644 --- a/lib/blockchain/index.js +++ b/lib/blockchain/index.js @@ -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'; diff --git a/lib/blockchain/layout.js b/lib/blockchain/layout.js index e5c3dd8e..b0625272 100644 --- a/lib/blockchain/layout.js +++ b/lib/blockchain/layout.js @@ -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'; diff --git a/lib/btc/amount.js b/lib/btc/amount.js index 3c6baf6b..c291ef35 100644 --- a/lib/btc/amount.js +++ b/lib/btc/amount.js @@ -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'; diff --git a/lib/btc/index.js b/lib/btc/index.js index d3405194..a098c64a 100644 --- a/lib/btc/index.js +++ b/lib/btc/index.js @@ -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'; diff --git a/lib/btc/uri.js b/lib/btc/uri.js index 66b6fed6..acbd88ba 100644 --- a/lib/btc/uri.js +++ b/lib/btc/uri.js @@ -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; diff --git a/lib/coins/coinentry.js b/lib/coins/coinentry.js index 3b475fde..3a578519 100644 --- a/lib/coins/coinentry.js +++ b/lib/coins/coinentry.js @@ -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'; diff --git a/lib/coins/coins.js b/lib/coins/coins.js index d986dffa..d543196c 100644 --- a/lib/coins/coins.js +++ b/lib/coins/coins.js @@ -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'; diff --git a/lib/coins/coinview.js b/lib/coins/coinview.js index 900f4f26..9cf99fa0 100644 --- a/lib/coins/coinview.js +++ b/lib/coins/coinview.js @@ -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'; diff --git a/lib/coins/compress.js b/lib/coins/compress.js index aff6e484..282db09d 100644 --- a/lib/coins/compress.js +++ b/lib/coins/compress.js @@ -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} diff --git a/lib/coins/index.js b/lib/coins/index.js index 93654d58..63b2ba39 100644 --- a/lib/coins/index.js +++ b/lib/coins/index.js @@ -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'; diff --git a/lib/coins/undocoins.js b/lib/coins/undocoins.js index 8aa2c459..f60fffa8 100644 --- a/lib/coins/undocoins.js +++ b/lib/coins/undocoins.js @@ -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'; diff --git a/lib/covenants/namedelta.js b/lib/covenants/namedelta.js index b6e3d7bb..bbb700b3 100644 --- a/lib/covenants/namedelta.js +++ b/lib/covenants/namedelta.js @@ -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'; diff --git a/lib/covenants/namestate.js b/lib/covenants/namestate.js index 63a89e2d..96bcfb64 100644 --- a/lib/covenants/namestate.js +++ b/lib/covenants/namestate.js @@ -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'; diff --git a/lib/covenants/ownership.js b/lib/covenants/ownership.js index f1c7104e..2c1f6f66 100644 --- a/lib/covenants/ownership.js +++ b/lib/covenants/ownership.js @@ -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'; diff --git a/lib/covenants/rules.js b/lib/covenants/rules.js index b017c447..088bb867 100644 --- a/lib/covenants/rules.js +++ b/lib/covenants/rules.js @@ -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} */ diff --git a/lib/dns/compress.js b/lib/dns/compress.js index 43a2e4e7..32074a45 100644 --- a/lib/dns/compress.js +++ b/lib/dns/compress.js @@ -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'; diff --git a/lib/dns/key.js b/lib/dns/key.js index ce37f0a7..24ba74dc 100644 --- a/lib/dns/key.js +++ b/lib/dns/key.js @@ -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'; diff --git a/lib/dns/records.js b/lib/dns/records.js index 21b6061a..a9a014f3 100644 --- a/lib/dns/records.js +++ b/lib/dns/records.js @@ -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'; diff --git a/lib/dns/resource.js b/lib/dns/resource.js index d13fdbdd..1942d9bc 100644 --- a/lib/dns/resource.js +++ b/lib/dns/resource.js @@ -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()) diff --git a/lib/dns/server.js b/lib/dns/server.js index e9841382..b5d8929a 100644 --- a/lib/dns/server.js +++ b/lib/dns/server.js @@ -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'; diff --git a/lib/hd/common.js b/lib/hd/common.js index ef43b8f7..507f6608 100644 --- a/lib/hd/common.js +++ b/lib/hd/common.js @@ -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'; diff --git a/lib/hd/hd.js b/lib/hd/hd.js index 504bf6e9..554b1f10 100644 --- a/lib/hd/hd.js +++ b/lib/hd/hd.js @@ -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'; diff --git a/lib/hd/index.js b/lib/hd/index.js index e58837cc..ecc3fb4f 100644 --- a/lib/hd/index.js +++ b/lib/hd/index.js @@ -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'; diff --git a/lib/hd/mnemonic.js b/lib/hd/mnemonic.js index 28344c2b..40a0b18a 100644 --- a/lib/hd/mnemonic.js +++ b/lib/hd/mnemonic.js @@ -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'; diff --git a/lib/hd/nfkd-compat.js b/lib/hd/nfkd-compat.js index 45908d23..dae3a7ce 100644 --- a/lib/hd/nfkd-compat.js +++ b/lib/hd/nfkd-compat.js @@ -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'; diff --git a/lib/hd/nfkd.js b/lib/hd/nfkd.js index e054a733..87303914 100644 --- a/lib/hd/nfkd.js +++ b/lib/hd/nfkd.js @@ -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'; diff --git a/lib/hd/private.js b/lib/hd/private.js index bec32cfd..ec2b96c2 100644 --- a/lib/hd/private.js +++ b/lib/hd/private.js @@ -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'; diff --git a/lib/hd/public.js b/lib/hd/public.js index 8e8d8b0c..889a1b19 100644 --- a/lib/hd/public.js +++ b/lib/hd/public.js @@ -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'; diff --git a/lib/hd/wordlist-browser.js b/lib/hd/wordlist-browser.js index a0693dbb..7da24136 100644 --- a/lib/hd/wordlist-browser.js +++ b/lib/hd/wordlist-browser.js @@ -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'; diff --git a/lib/hd/wordlist.js b/lib/hd/wordlist.js index 625a4210..88243e2e 100644 --- a/lib/hd/wordlist.js +++ b/lib/hd/wordlist.js @@ -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'; diff --git a/lib/hd/words/index.js b/lib/hd/words/index.js index faaa7dd4..919bce94 100644 --- a/lib/hd/words/index.js +++ b/lib/hd/words/index.js @@ -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'; diff --git a/lib/hsd-browser.js b/lib/hsd-browser.js new file mode 100644 index 00000000..09ce0473 --- /dev/null +++ b/lib/hsd-browser.js @@ -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'); diff --git a/lib/hsd.js b/lib/hsd.js new file mode 100644 index 00000000..c13dc521 --- /dev/null +++ b/lib/hsd.js @@ -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'); diff --git a/lib/hskd-browser.js b/lib/hskd-browser.js deleted file mode 100644 index e21703b8..00000000 --- a/lib/hskd-browser.js +++ /dev/null @@ -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'); diff --git a/lib/hskd.js b/lib/hskd.js deleted file mode 100644 index fe85003e..00000000 --- a/lib/hskd.js +++ /dev/null @@ -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'); diff --git a/lib/mempool/claimentry.js b/lib/mempool/claimentry.js index effc2bf4..4a22a12e 100644 --- a/lib/mempool/claimentry.js +++ b/lib/mempool/claimentry.js @@ -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'; diff --git a/lib/mempool/contractstate.js b/lib/mempool/contractstate.js index 7df899e1..2b14c8bd 100644 --- a/lib/mempool/contractstate.js +++ b/lib/mempool/contractstate.js @@ -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'; diff --git a/lib/mempool/fees.js b/lib/mempool/fees.js index 7415fc40..ef89c315 100644 --- a/lib/mempool/fees.js +++ b/lib/mempool/fees.js @@ -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 */ diff --git a/lib/mempool/index.js b/lib/mempool/index.js index 97565152..f33ef30c 100644 --- a/lib/mempool/index.js +++ b/lib/mempool/index.js @@ -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'; diff --git a/lib/mempool/layout.js b/lib/mempool/layout.js index f09a1cd3..5f483c1e 100644 --- a/lib/mempool/layout.js +++ b/lib/mempool/layout.js @@ -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'; diff --git a/lib/mempool/mempool.js b/lib/mempool/mempool.js index 2b4633e7..d76883da 100644 --- a/lib/mempool/mempool.js +++ b/lib/mempool/mempool.js @@ -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'; diff --git a/lib/mempool/mempoolentry.js b/lib/mempool/mempoolentry.js index 1bd84d6e..6749543b 100644 --- a/lib/mempool/mempoolentry.js +++ b/lib/mempool/mempoolentry.js @@ -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'; diff --git a/lib/mining/common.js b/lib/mining/common.js index 79fe2904..e145ec26 100644 --- a/lib/mining/common.js +++ b/lib/mining/common.js @@ -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'; diff --git a/lib/mining/cpuminer.js b/lib/mining/cpuminer.js index 6f7b2d30..1bca6653 100644 --- a/lib/mining/cpuminer.js +++ b/lib/mining/cpuminer.js @@ -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'; diff --git a/lib/mining/index.js b/lib/mining/index.js index 4976f6ea..de5cc168 100644 --- a/lib/mining/index.js +++ b/lib/mining/index.js @@ -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'; diff --git a/lib/mining/mine.js b/lib/mining/mine.js index 50f3f1d1..11de720a 100644 --- a/lib/mining/mine.js +++ b/lib/mining/mine.js @@ -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'; diff --git a/lib/mining/miner.js b/lib/mining/miner.js index 06f80a0c..98aa12a3 100644 --- a/lib/mining/miner.js +++ b/lib/mining/miner.js @@ -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 */ diff --git a/lib/mining/template.js b/lib/mining/template.js index e9d39dda..75a0ec23 100644 --- a/lib/mining/template.js +++ b/lib/mining/template.js @@ -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'; diff --git a/lib/net/bip152.js b/lib/net/bip152.js index 5fd3a784..242cb1ce 100644 --- a/lib/net/bip152.js +++ b/lib/net/bip152.js @@ -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'; diff --git a/lib/net/brontide.js b/lib/net/brontide.js index b263f04d..3931bf90 100644 --- a/lib/net/brontide.js +++ b/lib/net/brontide.js @@ -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; diff --git a/lib/net/common.js b/lib/net/common.js index f0c54788..60fbcd9d 100644 --- a/lib/net/common.js +++ b/lib/net/common.js @@ -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'; diff --git a/lib/net/framer.js b/lib/net/framer.js index 9f066fdc..b46c15ef 100644 --- a/lib/net/framer.js +++ b/lib/net/framer.js @@ -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'; diff --git a/lib/net/hostlist.js b/lib/net/hostlist.js index 40f2f44d..f59bdd6b 100644 --- a/lib/net/hostlist.js +++ b/lib/net/hostlist.js @@ -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'; diff --git a/lib/net/index.js b/lib/net/index.js index 26d04cb3..5e357201 100644 --- a/lib/net/index.js +++ b/lib/net/index.js @@ -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'; diff --git a/lib/net/netaddress.js b/lib/net/netaddress.js index 9ee5a4d0..9eb5b86b 100644 --- a/lib/net/netaddress.js +++ b/lib/net/netaddress.js @@ -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'; diff --git a/lib/net/packets.js b/lib/net/packets.js index 343ba21d..870decdd 100644 --- a/lib/net/packets.js +++ b/lib/net/packets.js @@ -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'; diff --git a/lib/net/parser.js b/lib/net/parser.js index d50c9483..dbbbd9d8 100644 --- a/lib/net/parser.js +++ b/lib/net/parser.js @@ -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" */ diff --git a/lib/net/peer.js b/lib/net/peer.js index 96851854..f63ccf61 100644 --- a/lib/net/peer.js +++ b/lib/net/peer.js @@ -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'; diff --git a/lib/net/pool.js b/lib/net/pool.js index c6e7319c..8f61d4eb 100644 --- a/lib/net/pool.js +++ b/lib/net/pool.js @@ -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'; diff --git a/lib/net/seeds/index.js b/lib/net/seeds/index.js index 6b7f5d5b..0cbe450f 100644 --- a/lib/net/seeds/index.js +++ b/lib/net/seeds/index.js @@ -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'; diff --git a/lib/node/fullnode.js b/lib/node/fullnode.js index 73bf467e..6ea87561 100644 --- a/lib/node/fullnode.js +++ b/lib/node/fullnode.js @@ -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} */ diff --git a/lib/node/http.js b/lib/node/http.js index 9e804533..ee2572a9 100644 --- a/lib/node/http.js +++ b/lib/node/http.js @@ -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'; diff --git a/lib/node/index.js b/lib/node/index.js index bf2be9d2..477da1aa 100644 --- a/lib/node/index.js +++ b/lib/node/index.js @@ -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'; diff --git a/lib/node/node.js b/lib/node/node.js index b87ebc26..d5d5b9a3 100644 --- a/lib/node/node.js +++ b/lib/node/node.js @@ -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'; diff --git a/lib/node/rpc.js b/lib/node/rpc.js index 66ba6217..c1a17c36 100644 --- a/lib/node/rpc.js +++ b/lib/node/rpc.js @@ -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 */ diff --git a/lib/node/spvnode.js b/lib/node/spvnode.js index 3acf120a..52458541 100644 --- a/lib/node/spvnode.js +++ b/lib/node/spvnode.js @@ -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} */ diff --git a/lib/pkg.js b/lib/pkg.js index 4e07d5dc..f9a4f4d7 100644 --- a/lib/pkg.js +++ b/lib/pkg.js @@ -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 diff --git a/lib/primitives/abstractblock.js b/lib/primitives/abstractblock.js index 9a4b8689..77e354d1 100644 --- a/lib/primitives/abstractblock.js +++ b/lib/primitives/abstractblock.js @@ -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'; diff --git a/lib/primitives/address.js b/lib/primitives/address.js index 5938f123..d8517576 100644 --- a/lib/primitives/address.js +++ b/lib/primitives/address.js @@ -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'; diff --git a/lib/primitives/block.js b/lib/primitives/block.js index ba44569c..44e3f7aa 100644 --- a/lib/primitives/block.js +++ b/lib/primitives/block.js @@ -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 diff --git a/lib/primitives/claim.js b/lib/primitives/claim.js index a6e9631d..851aa85f 100644 --- a/lib/primitives/claim.js +++ b/lib/primitives/claim.js @@ -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'; diff --git a/lib/primitives/coin.js b/lib/primitives/coin.js index 859abb42..f406b0d4 100644 --- a/lib/primitives/coin.js +++ b/lib/primitives/coin.js @@ -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} diff --git a/lib/primitives/covenant.js b/lib/primitives/covenant.js index 69bc2829..8ab7a5c6 100644 --- a/lib/primitives/covenant.js +++ b/lib/primitives/covenant.js @@ -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'; diff --git a/lib/primitives/headers.js b/lib/primitives/headers.js index 2fedf5ea..53ea8b43 100644 --- a/lib/primitives/headers.js +++ b/lib/primitives/headers.js @@ -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 diff --git a/lib/primitives/index.js b/lib/primitives/index.js index bc22ab43..07fac976 100644 --- a/lib/primitives/index.js +++ b/lib/primitives/index.js @@ -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'; diff --git a/lib/primitives/input.js b/lib/primitives/input.js index c6da8d89..22aa90b3 100644 --- a/lib/primitives/input.js +++ b/lib/primitives/input.js @@ -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} diff --git a/lib/primitives/invitem.js b/lib/primitives/invitem.js index 2edea541..dcf21395 100644 --- a/lib/primitives/invitem.js +++ b/lib/primitives/invitem.js @@ -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'; diff --git a/lib/primitives/keyring.js b/lib/primitives/keyring.js index b23e8848..b9ce0e7b 100644 --- a/lib/primitives/keyring.js +++ b/lib/primitives/keyring.js @@ -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} diff --git a/lib/primitives/memblock.js b/lib/primitives/memblock.js index 739db0ee..2c4ce68f 100644 --- a/lib/primitives/memblock.js +++ b/lib/primitives/memblock.js @@ -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'; diff --git a/lib/primitives/merkleblock.js b/lib/primitives/merkleblock.js index e7cb5967..af0e5a3f 100644 --- a/lib/primitives/merkleblock.js +++ b/lib/primitives/merkleblock.js @@ -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 diff --git a/lib/primitives/mtx.js b/lib/primitives/mtx.js index 3e93f8e5..ce2c27a2 100644 --- a/lib/primitives/mtx.js +++ b/lib/primitives/mtx.js @@ -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'; diff --git a/lib/primitives/outpoint.js b/lib/primitives/outpoint.js index 8a31c897..ba8ab6c9 100644 --- a/lib/primitives/outpoint.js +++ b/lib/primitives/outpoint.js @@ -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} */ diff --git a/lib/primitives/output.js b/lib/primitives/output.js index 0b2f5c3b..bcdd15be 100644 --- a/lib/primitives/output.js +++ b/lib/primitives/output.js @@ -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'; diff --git a/lib/primitives/tx.js b/lib/primitives/tx.js index c2f58efc..7a7be08a 100644 --- a/lib/primitives/tx.js +++ b/lib/primitives/tx.js @@ -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 diff --git a/lib/primitives/txmeta.js b/lib/primitives/txmeta.js index 66eabc18..6da8b602 100644 --- a/lib/primitives/txmeta.js +++ b/lib/primitives/txmeta.js @@ -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'; diff --git a/lib/protocol/consensus.js b/lib/protocol/consensus.js index 61caceb9..975ff1b3 100644 --- a/lib/protocol/consensus.js +++ b/lib/protocol/consensus.js @@ -1,7 +1,7 @@ /*! - * consensus.js - consensus constants and helpers for hsk + * consensus.js - consensus constants and helpers for hsd * Copyright (c) 2017-2018, Christopher Jeffrey (MIT License). - * https://github.com/handshake-org/hskd + * https://github.com/handshake-org/hsd */ 'use strict'; diff --git a/lib/protocol/errors.js b/lib/protocol/errors.js index 98d4461d..e0ddbd26 100644 --- a/lib/protocol/errors.js +++ b/lib/protocol/errors.js @@ -1,7 +1,7 @@ /*! - * errors.js - error objects for hsk + * errors.js - error 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'; diff --git a/lib/protocol/index.js b/lib/protocol/index.js index 0f419c02..b667ccba 100644 --- a/lib/protocol/index.js +++ b/lib/protocol/index.js @@ -1,7 +1,7 @@ /*! - * protocol/index.js - protocol constants for hsk + * protocol/index.js - protocol 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'; diff --git a/lib/protocol/merkle.js b/lib/protocol/merkle.js index 7ebf83cb..1c1888d3 100644 --- a/lib/protocol/merkle.js +++ b/lib/protocol/merkle.js @@ -1,7 +1,7 @@ /*! - * merkle.js - merkle trees for hskd + * merkle.js - merkle trees for hsd * Copyright (c) 2018, Christopher Jeffrey (MIT License). - * https://github.com/handshake-org/hskd + * https://github.com/handshake-org/hsd */ 'use strict'; diff --git a/lib/protocol/network.js b/lib/protocol/network.js index 3569fa3d..9a032236 100644 --- a/lib/protocol/network.js +++ b/lib/protocol/network.js @@ -1,7 +1,7 @@ /*! - * network.js - network object for hsk + * network.js - network 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'; @@ -372,7 +372,7 @@ Network.simnet = null; * Set initial network. */ -Network.set(process.env.HSKD_NETWORK || 'main'); +Network.set(process.env.HSD_NETWORK || 'main'); /* * Helpers diff --git a/lib/protocol/networks.js b/lib/protocol/networks.js index 9d48d64e..604dc419 100644 --- a/lib/protocol/networks.js +++ b/lib/protocol/networks.js @@ -1,7 +1,7 @@ /*! - * network.js - bitcoin networks for hsk + * network.js - handshake networks for hsd * Copyright (c) 2017-2018, Christopher Jeffrey (MIT License). - * https://github.com/handshake-org/hskd + * https://github.com/handshake-org/hsd */ /* eslint no-implicit-coercion: "off" */ diff --git a/lib/protocol/policy.js b/lib/protocol/policy.js index b7d864cf..589ffef7 100644 --- a/lib/protocol/policy.js +++ b/lib/protocol/policy.js @@ -1,7 +1,7 @@ /*! - * policy.js - bitcoin constants for hsk + * policy.js - handshake 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'; diff --git a/lib/protocol/timedata.js b/lib/protocol/timedata.js index f0f3280e..a6945159 100644 --- a/lib/protocol/timedata.js +++ b/lib/protocol/timedata.js @@ -1,7 +1,7 @@ /*! - * timedata.js - time management for hsk + * timedata.js - time 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'; diff --git a/lib/script/common.js b/lib/script/common.js index b88bb666..4fc6704f 100644 --- a/lib/script/common.js +++ b/lib/script/common.js @@ -1,7 +1,7 @@ /*! - * common.js - common script functions for hsk + * common.js - common script functions for hsd * Copyright (c) 2017-2018, Christopher Jeffrey (MIT License). - * https://github.com/handshake-org/hskd + * https://github.com/handshake-org/hsd */ 'use strict'; diff --git a/lib/script/index.js b/lib/script/index.js index f16064c9..e493c855 100644 --- a/lib/script/index.js +++ b/lib/script/index.js @@ -1,7 +1,7 @@ /*! - * script/index.js - bitcoin scripting for hsk + * script/index.js - handshake scripting for hsd * Copyright (c) 2017-2018, Christopher Jeffrey (MIT License). - * https://github.com/handshake-org/hskd + * https://github.com/handshake-org/hsd */ 'use strict'; diff --git a/lib/script/opcode.js b/lib/script/opcode.js index 20ca6eeb..9ec15ef4 100644 --- a/lib/script/opcode.js +++ b/lib/script/opcode.js @@ -1,7 +1,7 @@ /*! - * opcode.js - opcode object for hsk + * opcode.js - opcode 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'; diff --git a/lib/script/script.js b/lib/script/script.js index 823880bf..45d6e2f2 100644 --- a/lib/script/script.js +++ b/lib/script/script.js @@ -1,7 +1,7 @@ /*! - * script.js - script interpreter for hsk + * script.js - script interpreter for hsd * Copyright (c) 2017-2018, Christopher Jeffrey (MIT License). - * https://github.com/handshake-org/hskd + * https://github.com/handshake-org/hsd */ 'use strict'; diff --git a/lib/script/scripterror.js b/lib/script/scripterror.js index 6d46406b..1ba91ea3 100644 --- a/lib/script/scripterror.js +++ b/lib/script/scripterror.js @@ -1,7 +1,7 @@ /*! - * scripterror.js - script error for hsk + * scripterror.js - script error for hsd * Copyright (c) 2017-2018, Christopher Jeffrey (MIT License). - * https://github.com/handshake-org/hskd + * https://github.com/handshake-org/hsd */ 'use strict'; diff --git a/lib/script/scriptnum.js b/lib/script/scriptnum.js index 3e0c4a43..2c91dd6c 100644 --- a/lib/script/scriptnum.js +++ b/lib/script/scriptnum.js @@ -1,7 +1,7 @@ /*! - * scriptnum.js - script number object for hsk. + * scriptnum.js - script number object for hsd. * Copyright (c) 2017, Christopher Jeffrey (MIT License). - * https://github.com/handshake-org/hskd + * https://github.com/handshake-org/hsd */ 'use strict'; diff --git a/lib/script/sigcache.js b/lib/script/sigcache.js index 8b849e0d..f256cfd2 100644 --- a/lib/script/sigcache.js +++ b/lib/script/sigcache.js @@ -1,7 +1,7 @@ /*! - * sigcache.js - signature cache for hsk + * sigcache.js - signature cache for hsd * Copyright (c) 2017-2018, Christopher Jeffrey (MIT License). - * https://github.com/handshake-org/hskd + * https://github.com/handshake-org/hsd */ 'use strict'; diff --git a/lib/script/stack.js b/lib/script/stack.js index 771d841c..06ccf184 100644 --- a/lib/script/stack.js +++ b/lib/script/stack.js @@ -1,7 +1,7 @@ /*! - * stack.js - stack object for hsk + * stack.js - stack 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'; diff --git a/lib/script/witness.js b/lib/script/witness.js index 4f6c5941..a862f539 100644 --- a/lib/script/witness.js +++ b/lib/script/witness.js @@ -1,7 +1,7 @@ /*! - * witness.js - witness object for hsk + * witness.js - witness 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'; diff --git a/lib/utils/binary.js b/lib/utils/binary.js index 83f2ecb6..ad3b19ab 100644 --- a/lib/utils/binary.js +++ b/lib/utils/binary.js @@ -1,7 +1,7 @@ /*! - * binary.js - binary search utils for hsk + * binary.js - binary search utils for hsd * Copyright (c) 2017-2018, Christopher Jeffrey (MIT License). - * https://github.com/handshake-org/hskd + * https://github.com/handshake-org/hsd */ 'use strict'; diff --git a/lib/utils/fixed.js b/lib/utils/fixed.js index 37a39959..5c3eee09 100644 --- a/lib/utils/fixed.js +++ b/lib/utils/fixed.js @@ -1,7 +1,7 @@ /*! * fixed.js - fixed number parsing * Copyright (c) 2017, Christopher Jeffrey (MIT License). - * https://github.com/handshake-org/hskd + * https://github.com/handshake-org/hsd */ 'use strict'; diff --git a/lib/utils/index.js b/lib/utils/index.js index d324c09e..c6e75569 100644 --- a/lib/utils/index.js +++ b/lib/utils/index.js @@ -1,7 +1,7 @@ /*! - * utils/index.js - utils for hsk + * utils/index.js - utils for hsd * Copyright (c) 2017-2018, Christopher Jeffrey (MIT License). - * https://github.com/handshake-org/hskd + * https://github.com/handshake-org/hsd */ 'use strict'; diff --git a/lib/utils/util.js b/lib/utils/util.js index b5b42541..e2647179 100644 --- a/lib/utils/util.js +++ b/lib/utils/util.js @@ -1,7 +1,7 @@ /*! - * util.js - utils for hsk + * util.js - utils for hsd * Copyright (c) 2017-2018, Christopher Jeffrey (MIT License). - * https://github.com/handshake-org/hskd + * https://github.com/handshake-org/hsd */ 'use strict'; diff --git a/lib/wallet/account.js b/lib/wallet/account.js index 55491e41..2240bfea 100644 --- a/lib/wallet/account.js +++ b/lib/wallet/account.js @@ -1,7 +1,7 @@ /*! - * account.js - account object for hsk + * account.js - account 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'; diff --git a/lib/wallet/client.js b/lib/wallet/client.js index 96ccbb16..dcf57710 100644 --- a/lib/wallet/client.js +++ b/lib/wallet/client.js @@ -1,13 +1,13 @@ /*! * client.js - http client for wallets * Copyright (c) 2017-2018, Christopher Jeffrey (MIT License). - * https://github.com/handshake-org/hskd + * https://github.com/handshake-org/hsd */ 'use strict'; const assert = require('bsert'); -const {NodeClient} = require('hsk-client'); +const {NodeClient} = require('hs-client'); const TX = require('../primitives/tx'); const NameState = require('../covenants/namestate'); diff --git a/lib/wallet/common.js b/lib/wallet/common.js index acbaba11..367f4b26 100644 --- a/lib/wallet/common.js +++ b/lib/wallet/common.js @@ -1,7 +1,7 @@ /*! * common.js - commonly required functions for wallet. * Copyright (c) 2017-2018, Christopher Jeffrey (MIT License). - * https://github.com/handshake-org/hskd + * https://github.com/handshake-org/hsd */ 'use strict'; diff --git a/lib/wallet/http.js b/lib/wallet/http.js index a29da3ed..1b83a43c 100644 --- a/lib/wallet/http.js +++ b/lib/wallet/http.js @@ -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'; diff --git a/lib/wallet/index.js b/lib/wallet/index.js index 532f11b0..1db68cda 100644 --- a/lib/wallet/index.js +++ b/lib/wallet/index.js @@ -1,7 +1,7 @@ /*! - * wallet/index.js - wallet for hsk + * wallet/index.js - wallet for hsd * Copyright (c) 2017-2018, Christopher Jeffrey (MIT License). - * https://github.com/handshake-org/hskd + * https://github.com/handshake-org/hsd */ 'use strict'; diff --git a/lib/wallet/layout.js b/lib/wallet/layout.js index 4823a701..39ead942 100644 --- a/lib/wallet/layout.js +++ b/lib/wallet/layout.js @@ -1,7 +1,7 @@ /*! * layout.js - data layout for wallets * Copyright (c) 2017-2018, Christopher Jeffrey (MIT License). - * https://github.com/handshake-org/hskd + * https://github.com/handshake-org/hsd */ 'use strict'; diff --git a/lib/wallet/masterkey.js b/lib/wallet/masterkey.js index 14b9d898..fd38d99f 100644 --- a/lib/wallet/masterkey.js +++ b/lib/wallet/masterkey.js @@ -1,7 +1,7 @@ /*! - * masterkey.js - master bip32 key object for hsk + * masterkey.js - master bip32 key 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'; diff --git a/lib/wallet/node.js b/lib/wallet/node.js index ccce91c2..0f96cbe0 100644 --- a/lib/wallet/node.js +++ b/lib/wallet/node.js @@ -1,7 +1,7 @@ /*! - * server.js - wallet server for hsk + * server.js - wallet 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'; @@ -27,7 +27,7 @@ class WalletNode extends Node { */ constructor(options) { - super(pkg.name, 'wallet.conf', 'wallet.log', options); + super(pkg.name, 'hsw.conf', 'wallet.log', options); this.opened = false; diff --git a/lib/wallet/nodeclient.js b/lib/wallet/nodeclient.js index 8b7b88bd..c5a7ab11 100644 --- a/lib/wallet/nodeclient.js +++ b/lib/wallet/nodeclient.js @@ -1,7 +1,7 @@ /*! - * nodeclient.js - node client for hsk + * nodeclient.js - node client for hsd * Copyright (c) 2017-2018, Christopher Jeffrey (MIT License). - * https://github.com/handshake-org/hskd + * https://github.com/handshake-org/hsd */ 'use strict'; diff --git a/lib/wallet/nullclient.js b/lib/wallet/nullclient.js index 948e115c..abc30f26 100644 --- a/lib/wallet/nullclient.js +++ b/lib/wallet/nullclient.js @@ -1,7 +1,7 @@ /*! - * nullclient.js - node client for hsk + * nullclient.js - node client for hsd * Copyright (c) 2017-2018, Christopher Jeffrey (MIT License). - * https://github.com/handshake-org/hskd + * https://github.com/handshake-org/hsd */ 'use strict'; diff --git a/lib/wallet/path.js b/lib/wallet/path.js index 5a2a82f8..711bf716 100644 --- a/lib/wallet/path.js +++ b/lib/wallet/path.js @@ -1,7 +1,7 @@ /*! * path.js - path object for wallets * Copyright (c) 2017-2018, Christopher Jeffrey (MIT License). - * https://github.com/handshake-org/hskd + * https://github.com/handshake-org/hsd */ 'use strict'; diff --git a/lib/wallet/plugin.js b/lib/wallet/plugin.js index bb326c51..93f54f6c 100644 --- a/lib/wallet/plugin.js +++ b/lib/wallet/plugin.js @@ -1,7 +1,7 @@ /*! - * plugin.js - wallet plugin for hsk + * plugin.js - wallet plugin for hsd * Copyright (c) 2017-2018, Christopher Jeffrey (MIT License). - * https://github.com/handshake-org/hskd + * https://github.com/handshake-org/hsd */ 'use strict'; @@ -34,7 +34,7 @@ class Plugin extends EventEmitter { super(); this.config = node.config.filter('wallet'); - this.config.open('wallet.conf'); + this.config.open('hsw.conf'); this.network = node.network; this.logger = node.logger; diff --git a/lib/wallet/records.js b/lib/wallet/records.js index 8f2df85b..88d1bbfb 100644 --- a/lib/wallet/records.js +++ b/lib/wallet/records.js @@ -1,7 +1,7 @@ /*! * records.js - walletdb records * Copyright (c) 2017-2018, Christopher Jeffrey (MIT License). - * https://github.com/handshake-org/hskd + * https://github.com/handshake-org/hsd */ 'use strict'; diff --git a/lib/wallet/rpc.js b/lib/wallet/rpc.js index 7e1f590f..73d3bb2f 100644 --- a/lib/wallet/rpc.js +++ b/lib/wallet/rpc.js @@ -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'; diff --git a/lib/wallet/txdb.js b/lib/wallet/txdb.js index c35c4bbe..f9db40a4 100644 --- a/lib/wallet/txdb.js +++ b/lib/wallet/txdb.js @@ -1,7 +1,7 @@ /*! * txdb.js - persistent transaction pool * Copyright (c) 2017-2018, Christopher Jeffrey (MIT License). - * https://github.com/handshake-org/hskd + * https://github.com/handshake-org/hsd */ 'use strict'; diff --git a/lib/wallet/wallet.js b/lib/wallet/wallet.js index f9d0cec0..58094b88 100644 --- a/lib/wallet/wallet.js +++ b/lib/wallet/wallet.js @@ -1,7 +1,7 @@ /*! - * wallet.js - wallet object for hsk + * wallet.js - wallet 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'; diff --git a/lib/wallet/walletdb.js b/lib/wallet/walletdb.js index 0ead1bbb..9577f7e0 100644 --- a/lib/wallet/walletdb.js +++ b/lib/wallet/walletdb.js @@ -1,7 +1,7 @@ /*! * walletdb.js - storage for wallets * Copyright (c) 2017-2018, Christopher Jeffrey (MIT License). - * https://github.com/handshake-org/hskd + * https://github.com/handshake-org/hsd */ 'use strict'; diff --git a/lib/wallet/walletkey.js b/lib/wallet/walletkey.js index 370f71a8..a8c1e988 100644 --- a/lib/wallet/walletkey.js +++ b/lib/wallet/walletkey.js @@ -1,7 +1,7 @@ /*! - * walletkey.js - walletkey object for hsk + * walletkey.js - walletkey 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'; diff --git a/lib/workers/child-browser.js b/lib/workers/child-browser.js index eb026fdf..e4ea8440 100644 --- a/lib/workers/child-browser.js +++ b/lib/workers/child-browser.js @@ -1,7 +1,7 @@ /*! - * child.js - child processes for hsk + * child.js - child processes for hsd * Copyright (c) 2017-2018, Christopher Jeffrey (MIT License). - * https://github.com/handshake-org/hskd + * https://github.com/handshake-org/hsd */ 'use strict'; diff --git a/lib/workers/child.js b/lib/workers/child.js index 057f4f92..26275f09 100644 --- a/lib/workers/child.js +++ b/lib/workers/child.js @@ -1,7 +1,7 @@ /*! - * child.js - child processes for hsk + * child.js - child processes for hsd * Copyright (c) 2017-2018, Christopher Jeffrey (MIT License). - * https://github.com/handshake-org/hskd + * https://github.com/handshake-org/hsd */ 'use strict'; diff --git a/lib/workers/framer.js b/lib/workers/framer.js index 7e891827..c8d3c7e8 100644 --- a/lib/workers/framer.js +++ b/lib/workers/framer.js @@ -1,7 +1,7 @@ /*! - * workers.js - worker processes for hsk + * workers.js - worker processes for hsd * Copyright (c) 2017-2018, Christopher Jeffrey (MIT License). - * https://github.com/handshake-org/hskd + * https://github.com/handshake-org/hsd */ 'use strict'; diff --git a/lib/workers/index.js b/lib/workers/index.js index a397156c..e30f5b3f 100644 --- a/lib/workers/index.js +++ b/lib/workers/index.js @@ -1,7 +1,7 @@ /*! - * workers/index.js - workers for hsk + * workers/index.js - workers for hsd * Copyright (c) 2017-2018, Christopher Jeffrey (MIT License). - * https://github.com/handshake-org/hskd + * https://github.com/handshake-org/hsd */ 'use strict'; diff --git a/lib/workers/jobs.js b/lib/workers/jobs.js index 5855f9c4..53baa854 100644 --- a/lib/workers/jobs.js +++ b/lib/workers/jobs.js @@ -1,7 +1,7 @@ /*! - * jobs.js - worker jobs for hsk + * jobs.js - worker jobs for hsd * Copyright (c) 2017-2018, Christopher Jeffrey (MIT License). - * https://github.com/handshake-org/hskd + * https://github.com/handshake-org/hsd */ 'use strict'; diff --git a/lib/workers/master.js b/lib/workers/master.js index a480bace..8b5ecf61 100644 --- a/lib/workers/master.js +++ b/lib/workers/master.js @@ -1,7 +1,7 @@ /*! - * master.js - master process for hsk + * master.js - master process for hsd * Copyright (c) 2017-2018, Christopher Jeffrey (MIT License). - * https://github.com/handshake-org/hskd + * https://github.com/handshake-org/hsd */ 'use strict'; @@ -76,9 +76,9 @@ class Master extends EventEmitter { */ setEnv(env) { - this.color = env.HSKD_WORKER_ISTTY === '1'; - this.set(env.HSKD_WORKER_NETWORK); - ownership.ignore = env.HSKD_WORKER_IGNORE === '1'; + this.color = env.HSD_WORKER_ISTTY === '1'; + this.set(env.HSD_WORKER_NETWORK); + ownership.ignore = env.HSD_WORKER_IGNORE === '1'; } /** diff --git a/lib/workers/packets.js b/lib/workers/packets.js index 8c8e5cc1..03855a91 100644 --- a/lib/workers/packets.js +++ b/lib/workers/packets.js @@ -1,7 +1,7 @@ /*! - * packets.js - worker packets for hsk + * packets.js - worker 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'; diff --git a/lib/workers/parent-browser.js b/lib/workers/parent-browser.js index b7ce3210..7368a3dc 100644 --- a/lib/workers/parent-browser.js +++ b/lib/workers/parent-browser.js @@ -1,7 +1,7 @@ /*! - * parent.js - worker processes for hsk + * parent.js - worker processes for hsd * Copyright (c) 2017-2018, Christopher Jeffrey (MIT License). - * https://github.com/handshake-org/hskd + * https://github.com/handshake-org/hsd */ 'use strict'; diff --git a/lib/workers/parent.js b/lib/workers/parent.js index bc970155..657dfc6a 100644 --- a/lib/workers/parent.js +++ b/lib/workers/parent.js @@ -1,7 +1,7 @@ /*! - * parent.js - worker processes for hsk + * parent.js - worker processes for hsd * Copyright (c) 2017-2018, Christopher Jeffrey (MIT License). - * https://github.com/handshake-org/hskd + * https://github.com/handshake-org/hsd */ 'use strict'; diff --git a/lib/workers/parser.js b/lib/workers/parser.js index 82d00c2f..025cc1b1 100644 --- a/lib/workers/parser.js +++ b/lib/workers/parser.js @@ -1,7 +1,7 @@ /*! - * parser.js - worker parser for hsk + * parser.js - worker parser for hsd * Copyright (c) 2017-2018, Christopher Jeffrey (MIT License). - * https://github.com/handshake-org/hskd + * https://github.com/handshake-org/hsd */ 'use strict'; diff --git a/lib/workers/worker.js b/lib/workers/worker.js index 29e96595..35584d93 100644 --- a/lib/workers/worker.js +++ b/lib/workers/worker.js @@ -1,7 +1,7 @@ /*! - * worker.js - worker thread/process for hsk + * worker.js - worker thread/process for hsd * Copyright (c) 2017-2018, Christopher Jeffrey (MIT License). - * https://github.com/handshake-org/hskd + * https://github.com/handshake-org/hsd */ 'use strict'; diff --git a/lib/workers/workerpool.js b/lib/workers/workerpool.js index dde24c9a..856ae202 100644 --- a/lib/workers/workerpool.js +++ b/lib/workers/workerpool.js @@ -1,7 +1,7 @@ /*! - * workerpool.js - worker processes for hsk + * workerpool.js - worker processes for hsd * Copyright (c) 2017-2018, Christopher Jeffrey (MIT License). - * https://github.com/handshake-org/hskd + * https://github.com/handshake-org/hsd */ /* eslint no-nested-ternary: "off" */ @@ -45,7 +45,7 @@ class WorkerPool extends EventEmitter { this.enabled = false; this.size = getCores(); this.timeout = 120000; - this.file = process.env.HSKD_WORKER_FILE || 'worker.js'; + this.file = process.env.HSD_WORKER_FILE || 'worker.js'; this.children = new Map(); this.uid = 0; @@ -435,11 +435,11 @@ class Worker extends EventEmitter { }); this.sendEnv({ - HSKD_WORKER_NETWORK: Network.type, - HSKD_WORKER_ISTTY: process.stdout + HSD_WORKER_NETWORK: Network.type, + HSD_WORKER_ISTTY: process.stdout ? (process.stdout.isTTY ? '1' : '0') : '0', - HSKD_WORKER_IGNORE: ownership.ignore ? '1' : '0' + HSD_WORKER_IGNORE: ownership.ignore ? '1' : '0' }); } diff --git a/package.json b/package.json index 13a2f697..e00a616d 100644 --- a/package.json +++ b/package.json @@ -1,20 +1,20 @@ { - "name": "hskd", + "name": "hsd", "version": "0.0.0", "private": true, "description": "Cryptocurrency bike-shed", "license": "MIT", - "repository": "git://github.com/handshake-org/hskd.git", - "homepage": "https://github.com/handshake-org/hskd", + "repository": "git://github.com/handshake-org/hsd.git", + "homepage": "https://github.com/handshake-org/hsd", "bugs": { - "url": "https://github.com/handshake-org/hskd/issues" + "url": "https://github.com/handshake-org/hsd/issues" }, "author": "Christopher Jeffrey ", "keywords": [ - "hsk", "blockchain", "cryptocurrency", "handshake", + "hns", "wallet" ], "engines": { @@ -48,7 +48,7 @@ "bupnp": "~0.2.2", "bval": "~0.1.2", "bweb": "~0.1.3", - "hsk-client": "~0.0.0", + "hs-client": "~0.0.0", "mrmr": "~0.1.1", "n64": "~0.2.1", "urkel": "~0.4.2" @@ -57,11 +57,11 @@ "eslint": "^5.1.0", "mocha": "^5.2.0" }, - "main": "./lib/hskd.js", + "main": "./lib/hsd.js", "bin": { - "hskd": "./bin/hskd", - "hskd-node": "./bin/node", - "hskd-spvnode": "./bin/spvnode" + "hsd": "./bin/hsd", + "hsd-node": "./bin/node", + "hsd-spvnode": "./bin/spvnode" }, "scripts": { "lint": "eslint $(cat .eslintfiles) || exit 0", @@ -78,6 +78,6 @@ "./lib/hd/wordlist": "./lib/hd/wordlist-browser.js", "./lib/workers/child": "./lib/workers/child-browser.js", "./lib/workers/parent": "./lib/workers/parent-browser.js", - "./lib/hskd": "./lib/hskd-browser.js" + "./lib/hsd": "./lib/hsd-browser.js" } } diff --git a/test/http-test.js b/test/http-test.js index 9c2d2e7a..6f58c8cf 100644 --- a/test/http-test.js +++ b/test/http-test.js @@ -22,7 +22,7 @@ const node = new FullNode({ plugins: [require('../lib/wallet/plugin')] }); -const {NodeClient, WalletClient} = require('hsk-client'); +const {NodeClient, WalletClient} = require('hs-client'); const nclient = new NodeClient({ port: network.rpcPort, diff --git a/test/util/memwallet.js b/test/util/memwallet.js index 7e089d1b..34c52b43 100644 --- a/test/util/memwallet.js +++ b/test/util/memwallet.js @@ -1,7 +1,7 @@ /*! - * memwallet.js - in-memory wallet object for hsk + * memwallet.js - in-memory wallet object for hsd * Copyright (c) 2014-2016, Christopher Jeffrey (MIT License). - * https://github.com/handshake-org/hskd + * https://github.com/handshake-org/hsd */ 'use strict'; diff --git a/webpack.app.js b/webpack.app.js index c19cf0bf..f9cfc471 100644 --- a/webpack.app.js +++ b/webpack.app.js @@ -23,10 +23,10 @@ module.exports = { }, plugins: [ new webpack.DefinePlugin({ - 'process.env.HSKD_NETWORK': - str(env.HSKD_NETWORK || 'main'), - 'process.env.HSKD_WORKER_FILE': - str(env.HSKD_WORKER_FILE || '/hskd-worker.js') + 'process.env.HSD_NETWORK': + str(env.HSD_NETWORK || 'main'), + 'process.env.HSD_WORKER_FILE': + str(env.HSD_WORKER_FILE || '/hsd-worker.js') }), new UglifyJsPlugin() ] diff --git a/webpack.browser.js b/webpack.browser.js index 52f909f7..1af36182 100644 --- a/webpack.browser.js +++ b/webpack.browser.js @@ -9,11 +9,11 @@ const env = process.env; module.exports = { target: 'web', entry: { - 'hskd': './lib/hskd', - 'hskd-worker': './lib/workers/worker' + 'hsd': './lib/hsd', + 'hsd-worker': './lib/workers/worker' }, output: { - library: 'hskd', + library: 'hsd', libraryTarget: 'umd', path: Path.join(__dirname, 'browser'), filename: '[name].js' @@ -25,10 +25,10 @@ module.exports = { }, plugins: [ new webpack.DefinePlugin({ - 'process.env.HSKD_NETWORK': - str(env.HSKD_NETWORK || 'main'), - 'process.env.HSKD_WORKER_FILE': - str(env.HSKD_WORKER_FILE || '/hskd-worker.js') + 'process.env.HSD_NETWORK': + str(env.HSD_NETWORK || 'main'), + 'process.env.HSD_WORKER_FILE': + str(env.HSD_WORKER_FILE || '/hsd-worker.js') }), new UglifyJsPlugin() ] diff --git a/webpack.compat.js b/webpack.compat.js index a29427ff..585a3096 100644 --- a/webpack.compat.js +++ b/webpack.compat.js @@ -9,11 +9,11 @@ const env = process.env; module.exports = { target: 'web', entry: { - 'hskd': './lib/hskd', - 'hskd-worker': './lib/workers/worker' + 'hsd': './lib/hsd', + 'hsd-worker': './lib/workers/worker' }, output: { - library: 'hskd', + library: 'hsd', libraryTarget: 'umd', path: Path.join(__dirname, 'browser'), filename: '[name].js' @@ -31,10 +31,10 @@ module.exports = { }, plugins: [ new webpack.DefinePlugin({ - 'process.env.HSKD_NETWORK': - str(env.HSKD_NETWORK || 'main'), - 'process.env.HSKD_WORKER_FILE': - str(env.HSKD_WORKER_FILE || '/hskd-worker.js') + 'process.env.HSD_NETWORK': + str(env.HSD_NETWORK || 'main'), + 'process.env.HSD_WORKER_FILE': + str(env.HSD_WORKER_FILE || '/hsd-worker.js') }), new UglifyJsPlugin() ]