Files
bch-api/start-dev-example.sh
T

77 lines
2.5 KiB
Bash
Raw Permalink Normal View History

2020-07-27 21:25:31 -07:00
#!/bin/bash
2021-01-11 16:22:27 -08:00
# Docker containers for the below infrastructure is described here:
# https://psfoundation.cash/blog/cash-stack
# Pre-synced databases can be downloaded on the CashStrap page:
# https://fullstack.cash/cashstrap
2021-01-11 15:33:45 -08:00
# Which network are you using?
2020-07-27 21:25:31 -07:00
export NETWORK=mainnet
2021-01-11 15:33:45 -08:00
#export NETWORK=testnet
# Full node
export RPC_IP=<ip>:8332
export RPC_BASEURL=http://$RPC_IP/
export RPC_USERNAME=bitcoin
export RPC_PASSWORD=password
2020-07-27 21:25:31 -07:00
# (optional) If load-balancing multiple full nodes, it's best to pick a single
# one for broadcasting transactions to the network. Prevents accidental
# double spends.
#export RPC_SENDURL=http://$RPC_IP/
2020-07-27 21:25:31 -07:00
# SLPDB
export SLPDB_PASS_GP=somelongpassword
2020-07-27 21:25:31 -07:00
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/
2020-07-27 21:25:31 -07:00
# 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/
2020-07-27 21:25:31 -07:00
2021-01-11 16:22:27 -08:00
# Redis DB - Used for rate limiting - customize to your own Redis installation.
export REDIS_PORT=6379
export REDIS_HOST=172.17.0.1
2021-01-11 15:33:45 -08:00
# JWT Token Secret
# This is used to verify JWT tokens generated with jwt-bch-api:
# https://github.com/Permissionless-Software-Foundation/jwt-bch-api
2020-07-27 21:25:31 -07:00
export TOKENSECRET=somelongpassword
2020-11-08 17:04:17 -08:00
# So that bch-api can call bch-js locally.
2021-01-11 16:22:27 -08:00
export LOCAL_RESTURL=http://127.0.0.1:3000/v4/
2020-11-08 17:04:17 -08:00
2020-11-11 07:48:40 -08:00
# Basic Authentication password
export PRO_PASS=somerandomepassword:someotherrandompassword:aThirdPassword
2020-11-08 17:04:17 -08:00
2021-01-11 15:33:45 -08:00
# Whitelisted domains. Automatically give pro-tier rate limit access to apps
# that originate froma domain on the whitelist.
export WHITELIST_DOMAINS=fullstack.cash,psfoundation.cash,torlist.cash
# Uncomment the line below if you do not want to use rate limits
#export export DO_NOT_USE_RATE_LIMITS=1
# Rate Limits. Numbers are divided into 1000. e.g. 10000 / 500 = 20 RPM for ANON.
2021-01-11 15:33:45 -08:00
# Requests use the ANON rate limit if they fail to pass in a JWT token.
# ANON = 20 requests per minute (RPM)
export ANON_RATE_LIMIT=500
# 10 = 1000 RPM
export WHITELIST_RATE_LIMIT=100
2021-01-11 15:33:45 -08:00
2021-01-13 07:51:08 -06:00
# Set logging parameters
#1m means no more than 1 megabyte
export LOG_MAX_SIZE=1m
#5d means store no more than 5 days
export LOG_MAX_FILES=5d
# (Optional) if using a bcash node, set this variable. Otherwise leave it as-is.
export BCASH_SERVER=http://localhost
2020-07-27 21:25:31 -07:00
npm start