userChainAPIServer

command
v0.0.0-...-7258307 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 26, 2020 License: MIT Imports: 3 Imported by: 0

README

User Chain API Server

由两个模块合并而来,请看具体子模块的介绍:

构建

go get -u github.com/btccom/btcpool-go-modules/userChainAPIServer

运行

cp config.default.json config.json
$GOPATH/bin/userChainAPIServer --config config.json --logtostderr -v 2

Docker

构建

cd btcpool-go-modules/userChainAPIServer
docker build -t btcpool-user-chain-api-server -f Dockerfile ..

运行

docker run -it --rm --network=host \
  -e AvailableCoins='ubtc,btc,bcc,auto' \
  -e UserListAPI_ubtc='http://localhost:8000/userlist-ubtc.php' \
  -e UserListAPI_btc='http://localhost:8000/userlist-btc.php' \
  -e UserListAPI_bcc='http://localhost:8000/userlist-bch.php' \
  -e ZKBroker='10.0.1.176:2181,10.0.1.175:2181,10.0.1.174:2181' \
  -e ZKSwitcherWatchDir='/stratumSwitcher/btcbcc/' \
  -e EnableAPIServer='true' \
  -e APIUser='switchapi' \
  -e APIPassword='admin' \
  -e ListenAddr='0.0.0.0:8082' \
  -e EnableCronJob='true' \
  -e UserCoinMapURL='http://localhost:8000/usercoin.php' \
  -e StratumServerCaseInsensitive='true' \
  btcpool-user-chain-api-server:latest -logtostderr -v 2

# 守护进程
docker run -it --name user-chain-api-server --network=host --restart always -d \
  -e AvailableCoins='ubtc,btc,bcc,auto' \
  -e UserListAPI_ubtc='http://localhost:8000/userlist-ubtc.php' \
  -e UserListAPI_btc='http://localhost:8000/userlist-btc.php' \
  -e UserListAPI_bcc='http://localhost:8000/userlist-bch.php' \
  -e ZKBroker='10.0.1.176:2181,10.0.1.175:2181,10.0.1.174:2181' \
  -e ZKSwitcherWatchDir='/stratumSwitcher/btcbcc/' \
  -e EnableAPIServer='true' \
  -e APIUser='switchapi' \
  -e APIPassword='admin' \
  -e ListenAddr='0.0.0.0:8082' \
  -e EnableCronJob='true' \
  -e UserCoinMapURL='http://localhost:8000/usercoin.php' \
  -e StratumServerCaseInsensitive='true' \
  btcpool-user-chain-api-server:latest -logtostderr -v 2

币种auto可选,用于机枪切换,不需要实际配置到sserverchains里。sserver只需要打开机枪切换功能(auto_switch_chain)即可识别币种auto

如果需要自动注册功能,可使用如下配置:

docker run -it --name user-chain-api-server --network=host --restart always -d \
  -e AvailableCoins='ubtc,btc,bcc,auto' \
  -e UserListAPI_ubtc='http://localhost:8000/userlist-ubtc.php' \
  -e UserListAPI_btc='http://localhost:8000/userlist-autoreg.php' \
  -e UserListAPI_bcc='http://localhost:8000/userlist-bch.php' \
  -e ZKBroker='10.0.1.176:2181,10.0.1.175:2181,10.0.1.174:2181' \
  -e ZKSwitcherWatchDir='/stratumSwitcher/btcbcc/' \
  -e EnableAPIServer='true' \
  -e APIUser='switchapi' \
  -e APIPassword='admin' \
  -e ListenAddr='0.0.0.0:8082' \
  -e EnableCronJob='true' \
  -e UserCoinMapURL='http://localhost:8000/usercoin.php' \
  -e StratumServerCaseInsensitive='true' \
  -e EnableUserAutoReg="true" \
  -e ZKAutoRegWatchDir="/stratumSwitcher/btcbcc_autoreg/" \
  -e UserAutoRegAPI_IntervalSeconds=10 \
  -e UserAutoRegAPI_URL="http://localhost:8000/autoreg.php" \
  -e UserAutoRegAPI_User="" \
  -e UserAutoRegAPI_Password="" \
  -e UserAutoRegAPI_DefaultCoin="btc" \
  -e UserAutoRegAPI_PostData='{"sub_name": "{sub_name}", "region_name": "all", "currency": "btc"}' \
  btcpool-user-chain-api-server:latest -logtostderr -v 2

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL