节点接入主网mainnet

Docker 环境接入主网 mainnet


在参考build节点镜像 for Docker配置文件说明

本地目录结构如下

~/workspace/wicc/WaykiChain_mainnet$tree
.
├── bin
│   └── run-waykicoind-main.sh
└── conf
    └── WaykiChain.conf

2 directories, 2 files
~/workspace/wicc/WaykiChain_mainnet$

启动脚本内容 run-waykicoind-main.sh

docker run --name waykicoind-mainnet -p 8920:8920 -p 6968:6968 \
  -v `pwd`/conf/WaykiChain.conf:/root/.WaykiChain/WaykiChain.conf \
  -v `pwd`/data:/root/.WaykiChain/main \
  -v `pwd`/bin:/opt/wicc/bin \
  -v `pwd`/lua:/tmp/lua \
  -d wicc/waykicoind

配置文件内容WaykiChain.conf

#nettype=main|test|regtest
nettype=main
rpcserver=1
rpcallowip=0.0.0.0/0
rpcport=6968
rpcuser=wiccuser
rpcpassword=wicc1000
rpcthreads=8
logprinttoconsole=0
logprinttofile=1
logprintfileline=1
logtimestamps=1
listen=1
disablesafemode=1
genblock=0
genblocklimit=10000000000
debug=INFO
debug=ERROR
genreceipt=0

启动Docker节点

sh bin/run-waykicoind-main.sh

example

~/workspace/wicc/WaykiChain_mainnet$sh bin/run-waykicoind-main.sh
6594c134fb1fafa5804a86c8b4c03603830339029439ea2d4d41724e4716c502
~/workspace/wicc/WaykiChain_mainnet$docker ps
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS                                                                 NAMES
6594c134fb1f        wicc/waykicoind     "./coind"           5 seconds ago       Up 4 seconds        0.0.0.0:6968->6968/tcp, 8920/tcp, 0.0.0.0:8920->8920/tcp             waykicoind-mainnet
~/workspace/wicc/WaykiChain_mainnet$

检查docker中节点是否正常运行

docker exec -it waykicoind-mainnet /bin/bash

example

~/workspace/wicc/WaykiChain_mainnet$docker exec -it 284cb238ac8a /bin/bash
root@6594c134fb1f:/opt/wicc# coind getinfo
{
    "version" : 2000000,
    "full_version" : "v2.0.0.0-95cbcce-release-linux (2019-09-10 18:08:41 +0800)",
    "protocol_version" : 10001,
    "net_type" : "MAIN_NET",
    "proxy" : "",
    "conf_dir" : "/root/.WaykiChain/WaykiChain.conf",
    "data_dir" : "/root/.WaykiChain/mainnet",
    "block_interval" : 3,
    "genblock" : 1,
    "time_offset" : 0,
    "connections" : 6,
    "errors" : "",
    "wallet_version" : 0,
    "wallet_balance" : 0.00000000,
    "miner_fee_perkb" : 0.00010000,
    "relay_fee_perkb" : 0.00001000,
    "tipblock_fuel_rate" : 1,
    "tipblock_fuel" : 0,
    "tipblock_time" : 1568375169,
    "tipblock_hash" : "4a115a848c6e9b0a6de5ad21f049cc94c34881270a9d1e2cbd5443596673185f",
    "tipblock_height" : 81724,
    "syncblock_height" : 81724
}
root@6594c134fb1f:/opt/wicc#

如果返回值同上,说明节点接入主网mainnet成功了,耐心等待区块同步吧!

本地环境接入主网 mainnet


在参考本地build配置文件说明

本地目录/opt/wicc结构如下

root@ubuntu:/opt/wicc# ls
coind  WaykiChain  WaykiChain.conf
root@ubuntu:/opt/wicc#

配置文件内容WaykiChain.conf

#nettype=main|test|regtest
nettype=main
rpcserver=1
rpcallowip=0.0.0.0/0
rpcport=6968
rpcuser=wiccuser
rpcpassword=wicc1000
rpcthreads=8
logprinttoconsole=0
logprinttofile=1
logprintfileline=1
logtimestamps=1
listen=1
disablesafemode=1
genblock=0
genblocklimit=10000000000
debug=INFO
debug=ERROR
genreceipt=0

启动节点

命令如下

./coind -datadir=.

example

root@ubuntu:/opt/wicc# ./coind -datadir=.
WaykiChain version v1.1.1.1-b7f1563-release-linux (2019-01-18 16:18:40 +0800)
Using OpenSSL version OpenSSL 1.0.1f 6 Jan 2014
Using Lua version Lua 5.3.1
Using Boost version 1.54
Using Level DB version 1.17
Using Berkeley DB version Berkeley DB 4.8.30: (April  9, 2010)
Startup time: 2019-01-21 07:38:06
Default data directory /root/.WaykiChain
Using data directory /opt/wicc/./main
Using at most 125 connections (      1024 file descriptors available)

检查节点运行是否正常

节点启动后,在新终端窗口运行以下命令确认节点运行是否正常

./coind -datadir=. getinfo

example

root@ubuntu:/opt/wicc# ./coind -datadir=. getinfo
{
    "version" : 2000000,
    "full_version" : "v2.0.0.0-95cbcce-release-linux (2019-09-10 18:08:41 +0800)",
    "protocol_version" : 10001,
    "net_type" : "MAIN_NET",
    "proxy" : "",
    "conf_dir" : "/root/.WaykiChain/WaykiChain.conf",
    "data_dir" : "/root/.WaykiChain/mainnet",
    "block_interval" : 3,
    "genblock" : 1,
    "time_offset" : 0,
    "connections" : 6,
    "errors" : "",
    "wallet_version" : 0,
    "wallet_balance" : 0.00000000,
    "miner_fee_perkb" : 0.00010000,
    "relay_fee_perkb" : 0.00001000,
    "tipblock_fuel_rate" : 1,
    "tipblock_fuel" : 0,
    "tipblock_time" : 1568375169,
    "tipblock_hash" : "4a115a848c6e9b0a6de5ad21f049cc94c34881270a9d1e2cbd5443596673185f",
    "tipblock_height" : 81724,
    "syncblock_height" : 81724
}
root@ubuntu:/opt/wicc#

如果返回值同上,说明节点接入主网mainnet成功了,耐心等待区块同步吧!