diff --git a/README.md b/README.md index 3657b3d..82da0b1 100755 --- a/README.md +++ b/README.md @@ -116,7 +116,7 @@ The constructor can take the following attributes: - `user`: JSON-RPC username (**required**) - `pass`: JSON-RPC password (**required**) - `peer`: P2P settings - - `host`: Peer IP to connect to (**optional.** default: 127.0.0.1) + - `host`: Peer IP to connect to (**optional.** default: same as `rpc.host`) - `chain`: Chain definition (optional. strongly recommended) - `prune`: automatically prune the oldest `.tx` file inside the `chain` folder when the number of files exceeds `prune`. - `path`: the path to store the chain files in diff --git a/index.js b/index.js index bf989d9..782fdfe 100755 --- a/index.js +++ b/index.js @@ -34,7 +34,7 @@ class Bitwork { // PEER let m = new Messages({ Block: bsv.Block, BlockHeader: bsv.BlockHeader, Transaction: bsv.Transaction, MerkleBlock: bsv.MerkleBlock }) - let g = Object.assign({ host: "127.0.0.1", messages: m }, (gene && gene.peer ? gene.peer : {})) + let g = Object.assign({ host: rpcconfig.host, messages: m }, (gene && gene.peer ? gene.peer : {})) this.peer = new Peer(g) this.peer.on("disconnect", function() { console.log("disconnected") }) this.peer.on("error", function(e) { console.log("Err", e) })