2019-07-07 13:16:10 -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
|
|
|
|
|
|
|
|
|
|
# Which network are you using?
|
|
|
|
|
export NETWORK=mainnet
|
|
|
|
|
#export NETWORK=testnet
|
2020-03-30 18:56:49 -07:00
|
|
|
|
2019-12-08 08:28:00 -08:00
|
|
|
# Full node
|
2021-01-11 16:22:27 -08:00
|
|
|
export RPC_IP=172.17.0.1:8332
|
|
|
|
|
export RPC_BASEURL=http://$RPC_IP/
|
2019-07-07 13:16:10 -07:00
|
|
|
export RPC_USERNAME=bitcoin
|
|
|
|
|
export RPC_PASSWORD=password
|
|
|
|
|
|
2019-12-08 08:28:00 -08:00
|
|
|
# SLPDB
|
2021-02-11 13:54:00 -08:00
|
|
|
export SLPDB_PASS_GP=somelongpassword
|
2020-03-30 18:56:49 -07:00
|
|
|
export SLPDB_URL=http://172.17.0.1:12300/
|
2021-01-11 16:22:27 -08:00
|
|
|
# Use the same address as SLPDB_URL if you don't have a separate whitelist server.
|
2021-02-11 13:54:00 -08:00
|
|
|
export SLPDB_PASS_WL=somelongpassword
|
2021-01-11 16:22:27 -08:00
|
|
|
export SLPDB_WHITELIST_URL=http://172.17.0.1: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/
|
2019-07-07 13:16:10 -07:00
|
|
|
|
2020-11-20 08:36:34 -08:00
|
|
|
# Mainnet Fulcrum / ElectrumX
|
2022-01-17 15:28:28 -08:00
|
|
|
export FULCRUM_URL=172.17.0.1
|
|
|
|
|
export FULCRUM_PORT=50002
|
2021-10-27 08:31:03 -07:00
|
|
|
export FULCRUM_API=http://172.17.0.1:3001/v1/
|
2020-11-20 08:36:34 -08:00
|
|
|
|
|
|
|
|
# Redis DB - Used for rate limiting
|
2020-02-07 17:55:30 -08:00
|
|
|
export REDIS_PORT=6379
|
|
|
|
|
export REDIS_HOST=172.17.0.1
|
|
|
|
|
|
2020-04-05 08:11:57 -07:00
|
|
|
# JWT Token Secret
|
2021-01-11 16:22:27 -08:00
|
|
|
# This is used to verify JWT tokens generated with jwt-bch-api:
|
|
|
|
|
# https://github.com/Permissionless-Software-Foundation/jwt-bch-api
|
2020-04-05 08:11:57 -07:00
|
|
|
export TOKENSECRET=somelongsecretvalue
|
|
|
|
|
|
2020-11-08 17:13:03 -08:00
|
|
|
# So that bch-api can call bch-js locally.
|
2022-01-17 15:22:08 -08:00
|
|
|
export LOCAL_RESTURL=http://127.0.0.1:3000/v5/
|
2020-11-08 17:13:03 -08:00
|
|
|
|
2021-01-11 16:22:27 -08:00
|
|
|
# Basic Authentication password
|
|
|
|
|
export PRO_PASS=somerandomepassword:someotherrandompassword:aThirdPassword
|
|
|
|
|
|
|
|
|
|
# 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
|
|
|
|
|
|
2021-10-27 08:09:46 -07:00
|
|
|
# Disable rate limits
|
2021-10-27 08:31:03 -07:00
|
|
|
export DO_NOT_USE_RATE_LIMITS=1
|
2021-10-27 08:09:46 -07:00
|
|
|
|
2021-01-11 16:22:27 -08:00
|
|
|
# Rate Limits. Numbers are divided into 1000. e.g. 1000 / 50 = 20 RPM for ANON.
|
|
|
|
|
# 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=50
|
|
|
|
|
# 10 = 100 RPM
|
|
|
|
|
export WHITELIST_RATE_LIMIT=10
|
2020-11-08 17:13:03 -08:00
|
|
|
|
2021-02-11 13:54:00 -08: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
|
|
|
|
|
|
2022-01-17 15:22:08 -08:00
|
|
|
# (Optional) bcash full node
|
2021-10-27 08:31:03 -07:00
|
|
|
export BCASH_SERVER=http://localhost:3002/
|
|
|
|
|
|
2022-01-17 15:22:08 -08:00
|
|
|
# psf-slp-indexer
|
|
|
|
|
#export SLP_INDEXER_API=https://psf-slp-indexer.fullstack.cash/
|
|
|
|
|
export SLP_INDEXER_API=http://172.17.0.1:5010/
|
|
|
|
|
|
2019-07-07 13:16:10 -07:00
|
|
|
npm start
|