npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

bithodl-service

v2.0.0

Published

Bitcore service to expose necessary endpoints for the BitHodl app.

Downloads

6

Readme

BitHodl Service

npm Package Build Status Coverage Status

Bitcore service to expose necessary endpoints for the BitHodl app.

Getting started

  1. Create a Bitcore node
  2. Install the BitHodl service:
$ npm install --save bithodl-service
  1. Open bitcore-node.json and set services to:
"bitcoind",
"web",
"bithodl-service"
  1. Start the node:
$ bitcored

Hacks

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);

https://github.com/bitpay/bitcore/issues/1454

API

GET /v1/public-key/:publicKey/addresses

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.

GET /v1/address/:address/utxos

Returns the unspent outputs for the given address.

Returns
Returns the unspent outputs as a JSON array.

GET /v1/fee/estimate

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
}

POST /v1/transaction

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.

Error handling

Errors are returned as JSON in the following format:

{
    "error": "<error message>"
}

Use with testnet

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.

  1. Run the Bitcore node with testnet

    Open bitcore-node.json and set network to testnet instead of livenet.

  2. Configure the BitHodl Service to use testnet

    Open node_modules/bithodl-service/src/config.js and set network to testnet instead of livenet.

  3. 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.

Contributing

Want to help us making BitHodl better? Great, but first read the CONTRIBUTING.md file for instructions.

Licensing

BitHodl is licensed under the Apache License, Version 2.0. See LICENSE for full license text.