-
Notifications
You must be signed in to change notification settings - Fork 66
Run With Docker
Simple and fast setup of CocosBcx Node on Docker is also available.
- Docker Docker 17.05 or higher is required
- docker-compose version >= 1.10.0
- Curl (any version you like)
- Python (any version you like)
- CPU: 4 cores or more
- Memory: 16GB or more
- Disk: 500GB or more
- Network: access to Internet with port tcp: 8049,8050
By default, /mnt/witness
is going to mount as the data volume, you might change the path to suit your needs. We refer to $PREFIX hereafter.
You can automatically deploy a full node with the following command
curl https://raw.githubusercontent.com/Cocos-BCX/cocos-bcx-node-bin/master/fullnode/mainnet/v1.1.4.1/build_chain.sh | bash
To start,stop or restart the node,you could execute follow command:
## start
docker start witness
## stop
docker stop witness
## restart
docker restart witness
Warning:Make sure $PREFIX is "/mnt/witness".
For some users who cannot download build.sh,should first create dir wintess/config
under mnt,then download config.ini and genesis.json under witness/config.
If you have already run previous version of witness
, make sure the old data has been purged or just backup data and then remove it:
rm -rf $PREFIX/config
or
tar -cvzf data.tar.gz $PREFIX
rm -rf $PREFIX/config
## get genesis and config
## Attention:if you have add any config option in config file,just copy it back
curl -fsSL "https://raw.githubusercontent.com/Cocos-BCX/cocos-bcx-node-bin/master/fullnode/mainnet/v1.0.9/config/genesis.json" -o $PREFIX/config/genesis.json
## get witness config
curl -fsSL "https://raw.githubusercontent.com/Cocos-BCX/cocos-bcx-node-bin/master/fullnode/mainnet/v1.0.9/config/config.ini" -o $PREFIX/config/config.ini
docker pull cocosbcx/cocos-mainnet:latest
docker run -itd --restart=always \
--name witness -v $PWD/config:/root/witness/config \
-v $PWD/COCOS_BCX_DATABASE:/root/witness/COCOS_BCX_DATABASE \
-v $PWD/logs:/root/witness/logs -p 8049:8049 \
-p 8050:8050 cocosbcx/cocos-mainnet:latest
wscat -c ws://127.0.0.1:8090
docker pull cocosbcx/cocos-mainnet:latest
docker stop witness && docker rm witness
If you don't need witness afterwards, you can stop the witness service using
docker-compose stop witness
docker-compose start witness
Installation - FAQ - API - Docker - Websocket Subscriptions - Blockchain Objects -