diff --git a/README.md b/README.md index 9eaf9ee..02d68a9 100644 --- a/README.md +++ b/README.md @@ -9,12 +9,14 @@ the [rest.bitcoin.com](https://github.com/Bitcoin-com/rest.bitcoin.com) reposito The purpose of this code is to create a REST API server that provides a common interface for working with a Bitcoin Cash full node and various indexers. -This repository is intended to be paired with my alternative implementation -of [BITBOX SDK](https://github.com/Bitcoin-com/bitbox-sdk): -[bch-js](https://github.com/christroutner/bch-js), and is part of the product -offering at [bchjs.cash](https://bchjs.cash). +This repository is intended to be paired with [bch-js](https://github.com/christroutner/bch-js), +an npm JavaScript library, and an alternative implementation +of [BITBOX SDK](https://github.com/Bitcoin-com/bitbox-sdk). -- [API Documentation](https://bchjs.cash/bch-api/index.html) +Both bch-api and bch-js are part of the +[full stack of BCH software](https://troutsblog.com/research/bitcoin-cash/how-to-bch-full-stack-developer). + +- [API Documentation](https://api.bchjs.cash/docs/) - Video: [Basic Concepts](https://www.youtube.com/watch?v=o0FfW5rZPFs) - Video: [Application Stack](https://youtu.be/8w0CpQ8oydA) - [bchjs.cash](https://bchjs.cash): Buy a turn-key REST API microserver. @@ -25,8 +27,11 @@ Have questions? Need help? Join our community support ## Features The following features set this repository apart from rest.bitcoin.com: -- Address balance and UTXO queries for [Blockbook](https://github.com/trezor/blockbook) and [Bitcore](https://github.com/bitpay/bitcore/tree/master/packages/bitcore-node) added. -- Rate limits are set to 10 RPM by default, and 60 RPM if Basic Authentiction header is used. +- Address balance and UTXO queries use the [Blockbook](https://github.com/trezor/blockbook) +indexer instead of Insight. +- Fine grain access is controlled with a JWT token using +[this back end auth server](https://github.com/Permissionless-Software-Foundation/jwt-bch-api) and [this front end](https://github.com/Permissionless-Software-Foundation/jwt-bch-frontend). +- Default rate limits are set to 3 RPM for anonymous connections, up to 100 RPM for a full-access JWT token is used. - Typescript removed and ES8 JavaScript used instead. - npm audit run on all dependencies. - [Greenkeeper](https://greenkeeper.io/) implemented for automatic dependency management @@ -34,15 +39,16 @@ and security updates. ## Live Demo You can test a live demo of the REST API by running the -[bch-js examples](https://github.com/christroutner/bch-js/tree/master/examples). -Rate limits are 10 requests per minute. This is fast enough to try out the examples +[bch-js examples](https://github.com/Permissionless-Software-Foundation/bch-js-examples). +Rate limits are 3 requests per minute, but you can increase them to 10 with a free +account at [account.bchjs.cash](https://account.bchjs.cash). +This is fast enough to try out the examples but these servers are not intended as a freemium service. You can run your own REST server by purchasing the hard drive at [bchjs.cash](https://bchjs.cash). -- Mainnet REST API server: http://decatur.hopto.org:12400/v3/ - - Check server status: http://decatur.hopto.org:12401 -- Testnet REST API server: http://decatur.hopto.org:13400/v3/ - - Check server status: http://decatur.hopto.org:13401 +- Mainnet REST API server: https://api.bchjs.cash/v3/ +- Testnet REST API server: https://tapi.bchjs.cash/v3/ +- Check server status: https://metrics.bchjs.cash ## Installation There are two installation paths, depending if you want a *development* or diff --git a/docker/mainnet/start-local-mainnet.sh b/docker/mainnet/start-local-mainnet.sh index c9a3809..6573614 100755 --- a/docker/mainnet/start-local-mainnet.sh +++ b/docker/mainnet/start-local-mainnet.sh @@ -1,6 +1,6 @@ #!/bin/bash -# Harddrive Mainnet full node +# Full node export RPC_BASEURL=http://172.17.0.1:8332/ export RPC_USERNAME=bitcoin export RPC_PASSWORD=password @@ -8,17 +8,11 @@ export ZEROMQ_PORT=28332 export ZEROMQ_URL=172.17.0.1 export NETWORK=mainnet -# Team DO QA Testnet Insight Server -export BITCOINCOM_BASEURL=http://172.17.0.1:12100/api/ - -# Testnet SLPDB -#export SLPDB_URL=https://slpdb.bchdata.cash/ +# SLPDB +#export SLPDB_URL=https://slpdb.bitcoin.com/ export SLPDB_URL=http://172.17.0.1:12300/ -# Testnet Bitcore Node API -export BITCORE_URL=http://172.17.0.1:12200/ - -# Testnet Blockbook +# Blockbook Indexer export BLOCKBOOK_URL=https://172.17.0.1:9131/ # Allow node.js to make network calls to https using self-signed certificate. export NODE_TLS_REJECT_UNAUTHORIZED=0 diff --git a/docker/testnet/start-local-testnet.sh b/docker/testnet/start-local-testnet.sh index 71a4741..3a2e033 100755 --- a/docker/testnet/start-local-testnet.sh +++ b/docker/testnet/start-local-testnet.sh @@ -1,6 +1,6 @@ #!/bin/bash -# Harddrive Mainnet full node +# Full node export RPC_BASEURL=http://172.17.0.1:18332/ export RPC_USERNAME=bitcoin export RPC_PASSWORD=password @@ -8,17 +8,11 @@ export ZEROMQ_PORT=38332 export ZEROMQ_URL=172.17.0.1 export NETWORK=testnet -# Team DO QA Testnet Insight Server -export BITCOINCOM_BASEURL=http://172.17.0.1:13100/api/ - -# Testnet SLPDB -#export SLPDB_URL=https://slpdb.bchdata.cash/ +# SLPDB +#export SLPDB_URL=https://tslpdb.bitcoin.com/ export SLPDB_URL=http://172.17.0.1:13300/ -# Testnet Bitcore Node API -export BITCORE_URL=http://172.17.0.1:13200/ - -# Testnet Blockbook +# Blockbook export BLOCKBOOK_URL=https://172.17.0.1:19131/ # Allow node.js to make network calls to https using self-signed certificate. export NODE_TLS_REJECT_UNAUTHORIZED=0 diff --git a/start-dev-example.sh b/start-dev-example.sh index 50934c5..4d0ae09 100755 --- a/start-dev-example.sh +++ b/start-dev-example.sh @@ -1,21 +1,15 @@ #!/bin/bash -# Harddrive Mainnet full node +# Full node export RPC_BASEURL=http://:8332/ export RPC_USERNAME= export RPC_PASSWORD= export NETWORK=mainnet -# Team DO QA Testnet Insight Server -export BITCOINCOM_BASEURL=http://:12100/api/ - -# Testnet SLPDB +# SLPDB export SLPDB_URL=http://:12300/ -# Testnet Bitcore Node API -export BITCORE_URL=http://:12200/ - -# Testnet Blockbook +# Blockbook export BLOCKBOOK_URL=https://:9131/ # Allow node.js to make network calls to https using self-signed certificate. export NODE_TLS_REJECT_UNAUTHORIZED=0