Docker 部署方法请具体查看文档
~/workspace/wicc/WaykiChain_pri$tree
.
├── bin
│ └── run-waykicoind-pri.sh
├── conf
│ └── WaykiChain.conf
└── data
3 directories, 2 files
~/workspace/wicc/WaykiChain_pri$
~/workspace/wicc/WaykiChain_pri$cat bin/run-waykicoind-pri.sh
docker run --name waykicoind-pri -p 1920:18920 -p 1968:6968 \
-v `pwd`/conf/WaykiChain.conf:/root/.WaykiChain/WaykiChain.conf \
-v `pwd`/data:/root/.WaykiChain/regtest \
-v `pwd`/bin:/opt/wicc/bin \
-v `pwd`/lua:/tmp/lua \
-d wicc/waykicoind
~/workspace/wicc/WaykiChain_pri$
添加regtest=1
,指明为私有网络
~/workspace/wicc/WaykiChain_pri$cat conf/WaykiChain.conf
rpcuser=waykichain
rpcpassword=wicc@123
blockminsize=1000
zapwallettxes=0
debug=INFO
logprinttoconsole=0
logtimestamps=1
logprinttofile=1
logprintfileline=1
server=1
listen=1
uiport=4555
rpcport=6968
rpcallowip=*.*.*.*
isdbtraversal=1
disablesafemode=1
gen=1
genproclimit=1000000
rpcthreads=8
#testnet=1
debug=vm
regtest=1
~/workspace/wicc/WaykiChain_pri$
sh bin/run-waykicoind-pri.sh
启动Docker 节点进入容器后查看,发现~/.WaykiChain/regtest/
目录下有相关数据
root@4a8b9d31a5bc:/opt/wicc# ls ~/.WaykiChain/regtest/
ERROR.log INFO.log blocks database db.log debug.log syncdata vm.log wallet.dat
root@4a8b9d31a5bc:/opt/wicc#
查看是否有区块产出,高度始终为0
root@4a8b9d31a5bc:/opt/wicc# ./coind getinfo
{
"version" : 1010001,
"fullversion" : "v1.1.0.1-075db0b-release-linux (2018-12-26 15:47:51 +0800)",
"protocolversion" : 10001,
"walletversion" : 0,
"balance" : 0.00000000,
"timeoffset" : 0,
"proxy" : "",
"nettype" : "REGTEST_NET",
"chainwork" : "0000000000000000000000000000000000000000000000000000000000000000",
"tipblocktime" : 1504305600,
"paytxfee" : 0.00010000,
"relayfee" : 0.00001000,
"fuelrate" : 100,
"fuel" : 0,
"data directory" : "/root/.WaykiChain/regtest",
"tip block hash" : "ab8d8b1d11784098108df399b247a0b80049de26af1b9c775d550228351c768d",
"sync tip blocks" : 0,
"received blocks" : 0,
"connections" : 0,
"errors" : ""
}
查看当前链上用户地址,默认有一个未激活地址
root@063e31b593e0:/opt/wicc# ./coind listaddr
[
{
"addr" : "whM1dLmYb8uAPEaeCMFKrt7FJWFMdS2jKg",
"balance" : 0.00000000,
"haveminerkey" : false,
"regid" : " "
}
]
root@063e31b593e0:/opt/wicc#
{"jsonrpc":"2.0","id":"curltext","method":"importprivkey","params":["Y6J4aK6Wcs4A3Ex4HXdfjJ6ZsHpNZfjaS4B9w7xqEnmFEYMqQd13"]}
{
"result": {
"imorpt key address": "wLKf2NqwtHk3BfzK5wMDfbKYN1SC3weyR4"
},
"error": null,
"id": "curltext"
}
{"jsonrpc":"2.0","id":"curltext","method":"listaddr"}
{
"result": [
{
"addr": "wLKf2NqwtHk3BfzK5wMDfbKYN1SC3weyR4",
"balance": 207900000,
"haveminerkey": false,
"regid": "0-1"
},
{
"addr": "whM1dLmYb8uAPEaeCMFKrt7FJWFMdS2jKg",
"balance": 0,
"haveminerkey": false,
"regid": " "
}
],
"error": null,
"id": "curltext"
}
{"jsonrpc":"2.0","id":"curltext","method":"listaddr"}
{
"result": [
{
"addr": "wLKf2NqwtHk3BfzK5wMDfbKYN1SC3weyR4",
"balance": 207900000,
"haveminerkey": false,
"regid": "0-1"
},
{
"addr": "wNDue1jHcgRSioSDL4o1AzXz3D72gCMkP6",
"balance": 0,
"haveminerkey": false,
"regid": "0-2"
},
{
"addr": "wNuJM44FPC5NxearNLP98pg295VqP7hsqu",
"balance": 0,
"haveminerkey": false,
"regid": "0-3"
},
{
"addr": "wP64X59EoRmeq2M5GrJ23UVttE9uxnuoFa",
"balance": 0,
"haveminerkey": false,
"regid": "0-4"
},
{
"addr": "wQewSbKL5kAfpwnrivSiCcaiFffgNva4uB",
"balance": 0,
"haveminerkey": false,
"regid": "0-5"
},
{
"addr": "wQquTWgzNzLtjUV4Du57p9YAEGdKvgXs9t",
"balance": 0,
"haveminerkey": false,
"regid": "0-6"
},
{
"addr": "wRQwgYkPNe1oX9Ts3cfuQ4KerqiV2e8gqM",
"balance": 0,
"haveminerkey": false,
"regid": "0-7"
},
{
"addr": "wSjMDgKWHC2MzrUamhJtyyR2FTtw8oMUfx",
"balance": 0,
"haveminerkey": false,
"regid": "0-8"
},
{
"addr": "wSms4pZnNe7bxjouLxUXQLowc7JqtNps94",
"balance": 0,
"haveminerkey": false,
"regid": "0-9"
},
{
"addr": "wT75mYY9C8xgqVgXquBmEfRmAXPDpJHU62",
"balance": 0,
"haveminerkey": false,
"regid": "0-10"
},
{
"addr": "wUt89R4bjD3Ca6Vb7mk18oGsVtSTCxJu2q",
"balance": 0,
"haveminerkey": false,
"regid": "0-11"
},
{
"addr": "wVTUdfEaeAAVSuXKrmMyqQXH5j5Z9oGmTt",
"balance": 0,
"haveminerkey": false,
"regid": "0-12"
},
{
"addr": "whM1dLmYb8uAPEaeCMFKrt7FJWFMdS2jKg",
"balance": 0,
"haveminerkey": false,
"regid": " "
}
],
"error": null,
"id": "curltext"
}
root@063e31b593e0:/opt/wicc# ./coind getinfo
{
"version" : 1010001,
"fullversion" : "v1.1.0.1-075db0b-release-linux (2018-12-26 15:47:51 +0800)",
"protocolversion" : 10001,
"walletversion" : 0,
"balance" : 207900000.00000000,
"timeoffset" : 0,
"proxy" : "",
"nettype" : "REGTEST_NET",
"chainwork" : "00000000000000000000000000000000000000000000000000000000000005b1",
"tipblocktime" : 1547210618,
"paytxfee" : 0.00010000,
"relayfee" : 0.00001000,
"fuelrate" : 1,
"fuel" : 0,
"data directory" : "/root/.WaykiChain/regtest",
"tip block hash" : "35c4a3df2ea4f83c0935340a3e5061d9b638ca553255f5fd02ed41a8a973b331",
"sync tip blocks" : 1457,
"received blocks" : 1457,
"connections" : 0,
"errors" : ""
}
root@063e31b593e0:/opt/wicc#
导入的私钥对应地址默认已激活,都已有regid,只有regid = 0-1
账户中有余额
调用 sendtoaddress
方法转账
{"jsonrpc":"2.0","method":"sendtoaddress","params":["wLKf2NqwtHk3BfzK5wMDfbKYN1SC3weyR4","wNDue1jHcgRSioSDL4o1AzXz3D72gCMkP6",100000],"id":168141569}
{
"result": {
"hash": "a5ac442befdb231a434f1466d62b534e0bd0b09aeabf84d37aa9bf5e22329ca3"
},
"error": null,
"id": 168141569
}
等待区块确认后,查询 目的地址 wNDue1jHcgRSioSDL4o1AzXz3D72gCMkP6
余额
{"jsonrpc":"2.0","id":"curltext","method":"getbalance","params":["wNDue1jHcgRSioSDL4o1AzXz3D72gCMkP6"]}
{
"result": {
"balance": 0.001
},
"error": null,
"id": "curltext"
}
根据交易hash通过方法 gettxdetail
查询交易详情
{"jsonrpc":"2.0","id":"curltext","method":"gettxdetail","params":["a5ac442befdb231a434f1466d62b534e0bd0b09aeabf84d37aa9bf5e22329ca3"]}
{
"result": {
"hash": "a5ac442befdb231a434f1466d62b534e0bd0b09aeabf84d37aa9bf5e22329ca3",
"txtype": "COMMON_TX",
"ver": 1,
"regid": "0-1",
"addr": "wLKf2NqwtHk3BfzK5wMDfbKYN1SC3weyR4",
"desregid": "0-2",
"desaddr": "wNDue1jHcgRSioSDL4o1AzXz3D72gCMkP6",
"money": 100000,
"fees": 10000,
"height": 1528,
"Contract": "",
"blockhash": "78df397f91dc047ca35c5bd8b69dbfea8f01007fdb62d7aeec4c5db640da8bc6",
"confirmHeight": 1530,
"confirmedtime": 1547211348,
"rawtx": "03018a78020001020002cd10858c200046304402202ecc804efc56dbdc834df40d7510b03dc2f3d28b4fec43eb1b0f978d54f9ad7e02204cbc27e13741d67241eec05aa7326812b187558b57c149472bb0f6539f23c22c"
},
"error": null,
"id": "curltext"
}
1、本次钱包一次性导入11个矿工节点,出块正常,矿工节点边界值待确定
2、出块时间间隔调整