mirror of
https://github.com/fullstack-cash/bch-api.git
synced 2026-09-21 16:52:04 -07:00
fix(README): Updating README
This commit is contained in:
@@ -24,34 +24,19 @@ Both bch-api and bch-js are part of the [Cash Stack](https://cashstack.info).
|
|||||||
Have questions? Need help? Join our community support:
|
Have questions? Need help? Join our community support:
|
||||||
- [Telegram channel](https://t.me/bch_js_toolkit)
|
- [Telegram channel](https://t.me/bch_js_toolkit)
|
||||||
|
|
||||||
## Features
|
|
||||||
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](https://github.com/Permissionless-Software-Foundation/jwt-bch-api) and [this front end](https://github.com/Permissionless-Software-Foundation/jwt-bch-frontend). 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.
|
|
||||||
|
|
||||||
## Live Demo
|
|
||||||
You can test a live demo of the REST API by running the
|
|
||||||
[bch-js examples](https://github.com/Permissionless-Software-Foundation/bch-js-examples).
|
|
||||||
Rate limits are 20 requests per minute, but you can increase them to 100 with a [paid account](https://fullstack.cash/pricing).
|
|
||||||
You can bootstrap your own REST API server by downloading and installing the infrastructure listed on the [CashStrap](https://fullstack.cash/cashstrap) page.
|
|
||||||
|
|
||||||
### Configure bch-js
|
### Configure bch-js
|
||||||
The live servers can be used by [bch-js](https://github.com/Permissionless-Software-Foundation/bch-js) by settings the `restURL` config property to one of these servers:
|
The live servers can be used by [bch-js](https://github.com/Permissionless-Software-Foundation/bch-js) by settings the `restURL` config property to one of these servers:
|
||||||
|
|
||||||
- BCHN Mainnet REST API server: https://bchn.fullstack.cash/v4/
|
- BCH Mainnet REST API server: https://bchn.fullstack.cash/v5/
|
||||||
- ABC Mainnet REST API server: https://abc.fullstack.cash/v4/
|
- eCash Mainnet REST API server: https://abc.fullstack.cash/v5/
|
||||||
- Testnet3 REST API server: https://testnet3.fullstack.cash/v4/
|
|
||||||
- Check server status: https://metrics.fullstack.cash
|
- Check server status: https://metrics.fullstack.cash
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
There are two installation paths, depending if you want a *development* or
|
There are two installation paths, depending if you want a *development* or
|
||||||
*production* environment. You'll also need to set up the underlying infrastructure
|
*production* environment. You'll also need to set up the underlying infrastructure
|
||||||
described on [this page](https://psfoundation.cash/blog/cash-stack).
|
described on [CashStack.info](https://cashstack.info).
|
||||||
|
|
||||||
This code targets the Ubuntu 18.04 LTS Linux OS or higher.
|
This hardware target for this software is a PC running Ubuntu 18.04 LTS Linux OS or higher.
|
||||||
|
|
||||||
### Development
|
### Development
|
||||||
This is a standard node.js project. The installation is as follows:
|
This is a standard node.js project. The installation is as follows:
|
||||||
@@ -76,7 +61,7 @@ For a production environment, a Docker container is provided in the
|
|||||||
containers target the Ubuntu 18.04 LTS Linux OS.
|
containers target the Ubuntu 18.04 LTS Linux OS.
|
||||||
|
|
||||||
- Install Docker and Docker Compose by following the commands on
|
- Install Docker and Docker Compose by following the commands on
|
||||||
[this Dev Ops page](https://troutsblog.com/research/dev-ops/overview).
|
[this Dev Ops page](https://bafybeidpuq6pgpryd22wwykhqh2etw44pzofuncm5ldczk5v733tkwk55y.ipfs.dweb.link/docs/dev-ops/overview).
|
||||||
|
|
||||||
- Customize the [bash script](docker/mainnet/start-local-mainnet.sh) for your
|
- Customize the [bash script](docker/mainnet/start-local-mainnet.sh) for your
|
||||||
installation.
|
installation.
|
||||||
@@ -90,7 +75,13 @@ installation.
|
|||||||
`docker-compose up`
|
`docker-compose up`
|
||||||
|
|
||||||
## Rate Limits
|
## Rate Limits
|
||||||
The rate limits for [api.fullstack.cash](https://api.fullstack.cash) are controlled by a JWT token. You can increase your rate limits by [purchasing a JWT token](https://https://fullstack.cash). If you're using bch-js, [check the readme for instructions on increasing rate limits](https://github.com/Permissionless-Software-Foundation/bch-js#api-key). For interacting with bch-api directly, you can then include the JWT token in the HTTP header like this:
|
Rate limiting of the REST API can be controlled in three different ways:
|
||||||
|
- JWT tokens for individual users
|
||||||
|
- Basic Authentication tokens for company-wide usage.
|
||||||
|
- Whitelisting for specific domain names
|
||||||
|
|
||||||
|
### JWT Tokens
|
||||||
|
The rate limits for [api.fullstack.cash](https://api.fullstack.cash) are controlled by a JWT token. You can increase your rate limits by [purchasing a JWT token](https://fullstack.cash). If you're using bch-js, [check the readme for instructions on increasing rate limits](https://github.com/Permissionless-Software-Foundation/bch-js#api-key). For interacting with bch-api directly, you can then include the JWT token in the HTTP header like this:
|
||||||
|
|
||||||
- `Authorization: Token <JWT token>`
|
- `Authorization: Token <JWT token>`
|
||||||
|
|
||||||
@@ -103,12 +94,24 @@ export BCHJSTOKEN=eyJhbGciOiJ....
|
|||||||
curl "https://bchn.fullstack.cash/v4/electrumx/balance/bitcoincash:qr69kyzha07dcecrsvjwsj4s6slnlq4r8c30lxnur3" -X GET -H "Content-Type: application/json" -H "Authorization: Token ${BCHJSTOKEN}"
|
curl "https://bchn.fullstack.cash/v4/electrumx/balance/bitcoincash:qr69kyzha07dcecrsvjwsj4s6slnlq4r8c30lxnur3" -X GET -H "Content-Type: application/json" -H "Authorization: Token ${BCHJSTOKEN}"
|
||||||
```
|
```
|
||||||
|
|
||||||
## Support
|
### Basic Authentication
|
||||||
Have questions? Need help? Join our community support
|
For private installations, Basic Authentication can be used to give everyone in an organization access to higher rate limits, while restricting use by the public. More than one Basic Authentication password can be generated by using the colon `:` to separate entries in the `PRO_PASS` environment variable. See the [bash script](docker/mainnet/start-local-mainnet.sh) for an example.
|
||||||
[Telegram channel](https://t.me/bch_js_toolkit)
|
|
||||||
|
|
||||||
## IPFS
|
### Whitelists
|
||||||
Copies of this repository will occasionally be uploaded and hosted on [IPFS](https://ipfs.io):
|
Website domain names can be added to the `WHITELIST_DOMAINS` environment variable. Multiple domains can be separated with a comma `,`. Any web app making a request from that domain will be granted top-level rate limits.
|
||||||
|
|
||||||
|
## Donate
|
||||||
|
|
||||||
|
The open source software is developed and maintained by the [Permissionless Software Foundation](https://psfoundation.cash). If this library provides value to you, please consider making a donation to support the PSF developers:
|
||||||
|
|
||||||
|
<div align="center">
|
||||||
|
<img src="./psf-burn-qr.png" />
|
||||||
|
<p>bitcoincash:qqsrke9lh257tqen99dkyy2emh4uty0vky9y0z0lsr</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
## Censorship Resistance
|
||||||
|
Copies of this repository will occasionally be uploaded and hosted on the Filecoin blockchain, [IPFS](https://ipfs.io), and the [Radicle](https://radicle.xyz) p2p network.
|
||||||
|
|
||||||
- v1.25.1: [QmXFzFJHenymhReDc9oGAxbpmvK2fJYnisQ2pJn3gGyKKX](https://ipfs.io/ipfs/QmXFzFJHenymhReDc9oGAxbpmvK2fJYnisQ2pJn3gGyKKX)
|
- v1.25.1: [QmXFzFJHenymhReDc9oGAxbpmvK2fJYnisQ2pJn3gGyKKX](https://ipfs.io/ipfs/QmXFzFJHenymhReDc9oGAxbpmvK2fJYnisQ2pJn3gGyKKX)
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
|
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 14 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 2.0 KiB |
+4
-14
@@ -1,7 +1,7 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# Docker containers for the below infrastructure is described here:
|
# Docker containers for the below infrastructure is described here:
|
||||||
# https://psfoundation.cash/blog/cash-stack
|
# https://CashStack.info
|
||||||
# Pre-synced databases can be downloaded on the CashStrap page:
|
# Pre-synced databases can be downloaded on the CashStrap page:
|
||||||
# https://fullstack.cash/cashstrap
|
# https://fullstack.cash/cashstrap
|
||||||
|
|
||||||
@@ -20,20 +20,10 @@ export RPC_PASSWORD=password
|
|||||||
# double spends.
|
# double spends.
|
||||||
#export RPC_SENDURL=http://$RPC_IP/
|
#export RPC_SENDURL=http://$RPC_IP/
|
||||||
|
|
||||||
# SLPDB
|
# psf-slp-indxer
|
||||||
export SLPDB_PASS_GP=somelongpassword
|
export SLP_INDEXER_API=http://<ip>:<port>/
|
||||||
export SLPDB_URL=http://<SLPDB IP>:12300/
|
|
||||||
# Use the same address as SLPDB_URL if you don't have a separate whitelist server.
|
|
||||||
export SLPDB_PASS_WL=somelongpassword
|
|
||||||
export SLPDB_WHITELIST_URL=http://<SLPDB IP>:12300/
|
|
||||||
# slp-api alternative SLP validator using slp-validate:
|
|
||||||
# https://github.com/Permissionless-Software-Foundation/slp-api
|
|
||||||
export SLP_API_URL=http://10.0.0.5:5001/
|
|
||||||
|
|
||||||
# Mainnet Fulcrum / ElectrumX
|
# Mainnet Fulcrum / ElectrumX
|
||||||
export FULCRUM_URL=192.168.0.6
|
|
||||||
export FULCRUM_PORT=50002
|
|
||||||
# Fulcrum API (used for /v5+ routes)
|
|
||||||
export FULCRUM_API=http://172.17.0.1:3001/v1/
|
export FULCRUM_API=http://172.17.0.1:3001/v1/
|
||||||
|
|
||||||
# Redis DB - Used for rate limiting - customize to your own Redis installation.
|
# Redis DB - Used for rate limiting - customize to your own Redis installation.
|
||||||
@@ -46,7 +36,7 @@ export REDIS_HOST=172.17.0.1
|
|||||||
export TOKENSECRET=somelongpassword
|
export TOKENSECRET=somelongpassword
|
||||||
|
|
||||||
# So that bch-api can call bch-js locally.
|
# So that bch-api can call bch-js locally.
|
||||||
export LOCAL_RESTURL=http://127.0.0.1:3000/v4/
|
export LOCAL_RESTURL=http://127.0.0.1:3000/v5/
|
||||||
|
|
||||||
# Basic Authentication password
|
# Basic Authentication password
|
||||||
export PRO_PASS=somerandomepassword:someotherrandompassword:aThirdPassword
|
export PRO_PASS=somerandomepassword:someotherrandompassword:aThirdPassword
|
||||||
|
|||||||
Reference in New Issue
Block a user