This is a REST API server, written in node.js JavaScript, using Express.js framework. 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. See this article to learn about the 'Cash Stack'. Visit FullStack.cash, sign up for a free account, and use this REST API right away with the bch-js JavaScript library.
Deprecation Warning: This repository has been moved to the Permissionless Software Foundation bch-api repository. This repository is deprecated. @chris.troutner/bch-api v1.0.0 is the last version published from this repository. @psf/bch-api v1.1.0+ is the continuation of the library.
This is a fork and alternative implementation of the rest.bitcoin.com repository. 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. See this article to learn about the 'Cash Stack'. Visit FullStack.cash, sign up for a free account, and use this REST API right away with the bch-js JavaScript library.
Both bch-api and bch-js are part of the 'Cash Stack' full stack of BCH software.
Have questions? Need help? Join our community support: Telegram channel
The following features set this repository apart from rest.bitcoin.com:
- Fine grain access is controlled with a JWT token using this back end auth server and this front end. Can be used to monetize access to the REST API.
- Typescript removed and ES8 JavaScript used instead.
npm audit fix
frequently run to fix dependencies.
You can test a live demo of the REST API by running the bch-js examples. Rate limits are 20 requests per minute, but you can increase them to 100 with a paid account. You can bootstrap your own REST API server by downloading and installing the infrastructure listed on the CashStrap page.
The live servers can be used by bch-js by settings the restURL
config property to one of these servers:
- BCHN Mainnet REST API server: https://bchn.fullstack.cash/v4/
- ABC Mainnet REST API server: https://abc.fullstack.cash/v4/
- Testnet3 REST API server: https://testnet3.fullstack.cash/v4/
- Check server status: https://metrics.fullstack.cash
There are two installation paths, depending if you want a development or production environment. You'll also need to set up the underlying infrastructure described on this page.
This code targets the Ubuntu 18.04 LTS Linux OS or higher.
This is a standard node.js project. The installation is as follows:
- Clone this repository:
git clone https://github.com/Permissionless-Software-Foundation/bch-api && cd bch-api
- Install dependencies:
npm install
- Customize the start-dev-example.sh shell script to point to the required infrastructure. Start the bch-api REST API by running this script:
./start-dev-example.sh
For a production environment, a Docker container is provided in the docker directory. One for mainnet and one for testnet. Again, these containers target the Ubuntu 18.04 LTS Linux OS.
-
Install Docker and Docker Compose by following the commands on this Dev Ops page.
-
Customize the bash script for your installation.
-
Build the Docker container with:
docker-compose build --no-cache
- Run the Docker container with:
docker-compose up
Have questions? Need help? Join our community support Telegram channel
Copies of this repository will occasionally be uploaded and hosted on IPFS:
MIT a