Bitcore service to expose necessary endpoints for the BitHodl app.
- Create a Bitcore node
- Install the BitHodl service:
$ npm install --save bithodl-service
- Open
bitcore-node.json
and setservices
to:
"bitcoind",
"web",
"bithodl-service"
- Start the node:
$ bitcored
Bitcore Library will complain about multiple instances.
To workaround this, comment out line 12 in bithodl-service/node_modules/bitcore-lib/index.js
:
//throw new Error(message);
Scans the UTXO set for addresses matching a public key (as a DER hex encoded string). Only time locked P2SH addresses generated by BitHodl will be returned.
Returns
Returns the addresses together with UTXO data as JSON.
Returns the unspent outputs for the given address.
Returns
Returns the unspent outputs as a JSON array.
Estimates the transaction fee based on the fees from the last 3 blocks.
Returns
Returns the estimated fee per byte in satoshis, e.g.
{
"satoshisPerByte": 4
}
Broadcasts a transaction to the Bitcoin network. Body must be a serialized transaction in raw format (https://bitcoin.org/en/developer-reference#raw-transaction-format).
Returns
The txid
of the transaction.
Errors are returned as JSON in the following format:
{
"error": "<error message>"
}
During development and testing it is recommended to use the testnet network. By doing so you can use testnet coins and don't risk losing any real money. Running a testnet node is also much lighter than running a mainnet node.
-
Run the Bitcore node with testnet
Open
bitcore-node.json
and setnetwork
totestnet
instead oflivenet
. -
Configure the BitHodl Service to use testnet
Open
node_modules/bithodl-service/src/config.js
and setnetwork
totestnet
instead oflivenet
. -
Configure the BitHodl app to use testnet
You need to configure the app to use testnet and point it to your testnet node. This requires you to build and run the app yourself. Follow the instructions in the BitHodl app repo.
Want to help us making BitHodl better? Great, but first read the CONTRIBUTING.md file for instructions.
BitHodl is licensed under the Apache License, Version 2.0. See LICENSE for full license text.