mirror of
https://github.com/fullstack-cash/bch-api.git
synced 2026-09-22 09:12:05 -07:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a8882bd618 | ||
|
|
a6b139e0c4 | ||
|
|
5880f14e07 | ||
|
|
9bf271b4c2 | ||
|
|
82af58e8b3 | ||
|
|
6d00681d6e |
@@ -87,6 +87,15 @@ The rate limits for [api.fullstack.cash](https://api.fullstack.cash) are control
|
|||||||
|
|
||||||
- `Authorization: Token <JWT token>`
|
- `Authorization: Token <JWT token>`
|
||||||
|
|
||||||
|
### cURL example
|
||||||
|
Here is an example using curl for using the JWT token when making a call to the REST API:
|
||||||
|
|
||||||
|
```
|
||||||
|
export BCHJSTOKEN=eyJhbGciOiJ....
|
||||||
|
|
||||||
|
curl "https://bchn.fullstack.cash/v4/electrumx/balance/bitcoincash:qr69kyzha07dcecrsvjwsj4s6slnlq4r8c30lxnur3" -X GET -H "Content-Type: application/json" -H "Authorization: Token ${BCHJSTOKEN}"
|
||||||
|
```
|
||||||
|
|
||||||
## Support
|
## Support
|
||||||
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)
|
||||||
|
|||||||
@@ -16,6 +16,9 @@ const config = {
|
|||||||
whitelistRateLimit: process.env.WHITELIST_RATE_LIMIT
|
whitelistRateLimit: process.env.WHITELIST_RATE_LIMIT
|
||||||
? Number(process.env.WHITELIST_RATE_LIMIT)
|
? Number(process.env.WHITELIST_RATE_LIMIT)
|
||||||
: 10,
|
: 10,
|
||||||
|
internalRateLimit: process.env.INTERNAL_RATE_LIMIT
|
||||||
|
? Number(process.env.INTERNAL_RATE_LIMIT)
|
||||||
|
: 10,
|
||||||
pointsPerMinute: process.env.POINTS_PER_MINUTE
|
pointsPerMinute: process.env.POINTS_PER_MINUTE
|
||||||
? Number(process.env.POINTS_PER_MINUTE)
|
? Number(process.env.POINTS_PER_MINUTE)
|
||||||
: 10000,
|
: 10000,
|
||||||
|
|||||||
+1
-1
@@ -16,7 +16,7 @@
|
|||||||
"dev": "nodemon ./dist/app.js",
|
"dev": "nodemon ./dist/app.js",
|
||||||
"test": "npm run lint && npm run test-v4",
|
"test": "npm run lint && npm run test-v4",
|
||||||
"lint": "standard --env mocha --fix",
|
"lint": "standard --env mocha --fix",
|
||||||
"test-v4": "export NETWORK=mainnet && nyc --reporter=text mocha --timeout 60000 test/v4/",
|
"test-v4": "export NETWORK=mainnet && nyc --reporter=text mocha --exit --timeout 60000 test/v4/",
|
||||||
"test:integration": "mocha test/v4/integration",
|
"test:integration": "mocha test/v4/integration",
|
||||||
"test:integration:slpdb": "mocha --timeout 25000 -g '#validate2Single' test/v4/integration/slp*.js",
|
"test:integration:slpdb": "mocha --timeout 25000 -g '#validate2Single' test/v4/integration/slp*.js",
|
||||||
"coverage": "nyc report --reporter=text-lcov | coveralls",
|
"coverage": "nyc report --reporter=text-lcov | coveralls",
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ const ANON_LIMITS = config.anonRateLimit
|
|||||||
const WHITELIST_DOMAINS = config.whitelistDomains
|
const WHITELIST_DOMAINS = config.whitelistDomains
|
||||||
const WHITELIST_POINTS_TO_CONSUME = config.whitelistRateLimit
|
const WHITELIST_POINTS_TO_CONSUME = config.whitelistRateLimit
|
||||||
const POINTS_PER_MINUTE = config.pointsPerMinute
|
const POINTS_PER_MINUTE = config.pointsPerMinute
|
||||||
const INTERNAL_POINTS_TO_CONSUME = 10
|
const INTERNAL_POINTS_TO_CONSUME = config.internalRateLimit
|
||||||
|
|
||||||
class RateLimits {
|
class RateLimits {
|
||||||
constructor () {
|
constructor () {
|
||||||
|
|||||||
@@ -15,7 +15,11 @@ var NETWORK = process.env.NETWORK
|
|||||||
var LOG_MAX_SIZE = process.env.LOG_MAX_SIZE ? process.env.LOG_MAX_SIZE : '1m'
|
var LOG_MAX_SIZE = process.env.LOG_MAX_SIZE ? process.env.LOG_MAX_SIZE : '1m'
|
||||||
|
|
||||||
// Default 5 days.
|
// Default 5 days.
|
||||||
var LOG_MAX_FILES = process.env.LOG_MAX_FILES ? process.env.LOG_MAX_FILES : '5d'
|
// This was causing a problem with popularity. Creating over a gigabyte of files.
|
||||||
|
// var LOG_MAX_FILES = process.env.LOG_MAX_FILES ? process.env.LOG_MAX_FILES : '5d'
|
||||||
|
|
||||||
|
// 250 files @ 1Meg each = 250 megs
|
||||||
|
var LOG_MAX_FILES = process.env.LOG_MAX_FILES ? process.env.LOG_MAX_FILES : '250'
|
||||||
|
|
||||||
// Configure daily-rotation transport.
|
// Configure daily-rotation transport.
|
||||||
var transport = new winston.transports.DailyRotateFile({
|
var transport = new winston.transports.DailyRotateFile({
|
||||||
|
|||||||
Reference in New Issue
Block a user