私有链节点搭建

Docker环境搭建私有链


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

本地目录结构如下

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

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

启动脚本内容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

配置文件内容WaykiChain.conf

#nettype=main|test|regtest
nettype=regtest
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=1
genblocklimit=10000000000
debug=INFO
debug=ERROR
genreceipt=1

启动节点

sh bin/run-waykicoind-pri.sh

example

~/workspace/wicc/WaykiChain_pri$sh bin/run-waykicoind-pri.sh
dfc791d535b05fa273112b3c0b9319670dfaf88218649e63eddfb110828c6541
~/workspace/wicc/WaykiChain_pri$docker ps
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS                                                                 NAMES
dfc791d535b0        wicc/waykicoind     "./coind"           13 seconds ago      Up 12 seconds       8920/tcp, 0.0.0.0:1920->1920/tcp, 18920/tcp, 0.0.0.0:1968->6968/tcp   waykicoind-pri
~/workspace/wicc/WaykiChain_pri$

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

docker exec -it waykicoind-pri /bin/bash

example

~/workspace/wicc/WaykiChain_pri$docker exec -it waykicoind-pri /bin/bash
root@26fc3417a8d8:/opt/wicc# coind getinfo
{
    "version" : 2000000,
    "full_version" : "v2.0.0.0-807685d3-release-linux (2019-09-13 12:04:25 +0800)",
    "protocol_version" : 10001,
    "net_type" : "REGTEST_NET",
    "proxy" : "",
    "conf_dir" : "/root/.WaykiChain/WaykiChain.conf",
    "data_dir" : "/root/.WaykiChain/regtest",
    "block_interval" : 3,
    "genblock" : 1,
    "time_offset" : 0,
    "wallet_version" : 0,
    "wallet_balance" : 205799988.98790056,
    "miner_fee_perkb" : 0.00010000,
    "relay_fee_perkb" : 0.00001000,
    "tipblock_fuel_rate" : 100,
    "tipblock_fuel" : 0,
    "tipblock_time" : 1568374588,
    "tipblock_hash" : "d738103b170b070520c3de8c112b721e180676ebf8d9213c52a17ad5f2edb667",
    "tipblock_height" : 36,
    "syncblock_height" : 36,
    "connections" : 0,
    "errors" : ""
}
root@26fc3417a8d8:/opt/wicc#

如果返回值同上,说明私有链节点搭建成功了

导入矿工账户地址

由于当前没有矿工不会生产新区块,维基链采用DPOS共识机制, 以下提供import.sh脚本供开发者导入创世私钥并模拟投票产生矿工出块

import.sh

注意: 需要在节点运行环境下运行此脚本

name=wiccuser
passworld=wicc1000
# 导入矿工节点
curl -u  $name:$passworld -d '{"jsonrpc":"2.0","id":"curltext","method":"importprivkey","params":["Y6J4aK6Wcs4A3Ex4HXdfjJ6ZsHpNZfjaS4B9w7xqEnmFEYMqQd13"]}' -H 'content-type:application/json;' http://127.0.0.1:6968
curl -u  $name:$passworld -d '{"jsonrpc":"2.0","id":"curltext","method":"importprivkey","params":["Y5F2GraTdQqMbYrV6MG78Kbg4QE8p4B2DyxMdLMH7HmDNtiNmcbM"]}' -H 'content-type:application/json;' http://127.0.0.1:6968
curl -u  $name:$passworld -d '{"jsonrpc":"2.0","id":"curltext","method":"importprivkey","params":["Y7HWKeTHFnCxyTMtCEE6tVkqBzXoN1Yjxcx5Rs8j2dsSSvPxvF7p"]}' -H 'content-type:application/json;' http://127.0.0.1:6968
curl -u  $name:$passworld -d '{"jsonrpc":"2.0","id":"curltext","method":"importprivkey","params":["Y871eB5Xiss2ugKWQRb4nmMhKTnmXAEyUqBimTCupogzoSTVCSU9"]}' -H 'content-type:application/json;' http://127.0.0.1:6968
curl -u  $name:$passworld -d '{"jsonrpc":"2.0","id":"curltext","method":"importprivkey","params":["Y9cAUsEhfsihbePnCYYCETpN1PVovqTMX4kauKRsZ9ERdz1uumeK"]}' -H 'content-type:application/json;' http://127.0.0.1:6968
curl -u  $name:$passworld -d '{"jsonrpc":"2.0","id":"curltext","method":"importprivkey","params":["Y4unEjiFk1YJQi1jaT3deY4t9Hm1eSk9usCam35LcN85cUA2QmZ5"]}' -H 'content-type:application/json;' http://127.0.0.1:6968
curl -u  $name:$passworld -d '{"jsonrpc":"2.0","id":"curltext","method":"importprivkey","params":["Y5XKsR95ymf2pEyuhDPLtuvioHRo6ogDDNnaf4YU91ABvLb68QBU"]}' -H 'content-type:application/json;' http://127.0.0.1:6968
curl -u  $name:$passworld -d '{"jsonrpc":"2.0","id":"curltext","method":"importprivkey","params":["Y7diE8BXuwTkjSzgdZMnKNhzYGrU8oSk31anJ1mwipSCcnPakzTA"]}' -H 'content-type:application/json;' http://127.0.0.1:6968
curl -u  $name:$passworld -d '{"jsonrpc":"2.0","id":"curltext","method":"importprivkey","params":["YCjoCrtGEvMPZDLzBoY9GP3r7pqWa5mgzUxqAsVub6xnUVBwQHxE"]}' -H 'content-type:application/json;' http://127.0.0.1:6968
curl -u  $name:$passworld -d '{"jsonrpc":"2.0","id":"curltext","method":"importprivkey","params":["Y6bKBN4ZKBNHJZpQpqE7y7TC1QpdT32YtAjw4Me9Bvgo47b5ivPY"]}' -H 'content-type:application/json;' http://127.0.0.1:6968
curl -u  $name:$passworld -d '{"jsonrpc":"2.0","id":"curltext","method":"importprivkey","params":["Y8G5MwTFVsqj1FvkqFDEENzUBn4yu4Ds83HkeSYP9SkjLba7xQFX"]}' -H 'content-type:application/json;' http://127.0.0.1:6968
curl -u  $name:$passworld -d '{"jsonrpc":"2.0","id":"curltext","method":"importprivkey","params":["YAq1NTUKiYPhV9wq3xBNCxYZfjGPMtZpEPA4sEoXPU1pppdjSAka"]}' -H 'content-type:application/json;' http://127.0.0.1:6968
# 导入创世块私钥
curl -u  $name:$passworld -d '{"jsonrpc":"2.0","id":"curltext","method":"importprivkey","params":["Y6KfDubxttSA7xgn7EHMu2wj89f4HSre7dwCj8CUh5Wcgh29D5V9"]}' -H 'content-type:application/json;' http://127.0.0.1:6968
curl -u  $name:$passworld -d '{"jsonrpc":"2.0","id":"curltext","method":"importprivkey","params":["Y4wCLRJ3XzuogkspJbxQkGW9rbVz5ZHqQAn79SwNaPnKWsUiy4nd"]}' -H 'content-type:application/json;' http://127.0.0.1:6968

# 解决投票修改无法出块的问题
# submitsendtx
curl -u  $name:$passworld -d '{"jsonrpc":"2.0","id":"curltext","method":"submitsendtx", "params": ["0-1", "0-2",  "WICC:22000000000000:sawi","WICC:100001:sawi"] }' -H 'Content-Type: application/json;' http://127.0.0.1:6968
curl -u  $name:$passworld -d '{"jsonrpc":"2.0","id":"curltext","method":"submitsendtx", "params": ["0-1", "0-3",  "WICC:10000000000:sawi","WICC:100001:sawi"] }' -H 'Content-Type: application/json;' http://127.0.0.1:6968
curl -u  $name:$passworld -d '{"jsonrpc":"2.0","id":"curltext","method":"submitsendtx", "params": ["0-1", "0-4",  "WICC:10000000000:sawi","WICC:100001:sawi"] }' -H 'Content-Type: application/json;' http://127.0.0.1:6968
curl -u  $name:$passworld -d '{"jsonrpc":"2.0","id":"curltext","method":"submitsendtx", "params": ["0-1", "0-5",  "WICC:10000000000:sawi","WICC:100001:sawi"] }' -H 'Content-Type: application/json;' http://127.0.0.1:6968
curl -u  $name:$passworld -d '{"jsonrpc":"2.0","id":"curltext","method":"submitsendtx", "params": ["0-1", "0-6",  "WICC:10000000000:sawi","WICC:100001:sawi"] }' -H 'Content-Type: application/json;' http://127.0.0.1:6968
curl -u  $name:$passworld -d '{"jsonrpc":"2.0","id":"curltext","method":"submitsendtx", "params": ["0-1", "0-7",  "WICC:10000000000:sawi","WICC:100001:sawi"] }' -H 'Content-Type: application/json;' http://127.0.0.1:6968
curl -u  $name:$passworld -d '{"jsonrpc":"2.0","id":"curltext","method":"submitsendtx", "params": ["0-1", "0-8",  "WICC:10000000000:sawi","WICC:100001:sawi"] }' -H 'Content-Type: application/json;' http://127.0.0.1:6968
curl -u  $name:$passworld -d '{"jsonrpc":"2.0","id":"curltext","method":"submitsendtx", "params": ["0-1", "0-9",  "WICC:10000000000:sawi","WICC:100001:sawi"] }' -H 'Content-Type: application/json;' http://127.0.0.1:6968
curl -u  $name:$passworld -d '{"jsonrpc":"2.0","id":"curltext","method":"submitsendtx", "params": ["0-1", "0-10", "WICC:10000000000:sawi","WICC:100001:sawi"] }' -H 'Content-Type: application/json;' http://127.0.0.1:6968
curl -u  $name:$passworld -d '{"jsonrpc":"2.0","id":"curltext","method":"submitsendtx", "params": ["0-1", "0-11", "WICC:10000000000:sawi","WICC:100001:sawi"] }' -H 'Content-Type: application/json;' http://127.0.0.1:6968
curl -u  $name:$passworld -d '{"jsonrpc":"2.0","id":"curltext","method":"submitsendtx", "params": ["0-1", "0-12", "WICC:10000000000:sawi","WICC:100001:sawi"] }' -H 'Content-Type: application/json;' http://127.0.0.1:6968

sleep 20
# 投票
curl -u  $name:$passworld -d '{"jsonrpc":"2.0","id":"curltext","method":"submitdelegatevotetx", "params": [ "0-2", [{"delegate":"0-2", "votes":100000000}], 10000 ] }' -H 'Content-Type: application/json;' http://127.0.0.1:6968
curl -u  $name:$passworld -d '{"jsonrpc":"2.0","id":"curltext","method":"submitdelegatevotetx", "params": [ "0-3", [{"delegate":"0-3", "votes":100000000}], 10000 ] }' -H 'Content-Type: application/json;' http://127.0.0.1:6968
curl -u  $name:$passworld -d '{"jsonrpc":"2.0","id":"curltext","method":"submitdelegatevotetx", "params": [ "0-4", [{"delegate":"0-4", "votes":100000000}], 10000 ] }' -H 'Content-Type: application/json;' http://127.0.0.1:6968
curl -u  $name:$passworld -d '{"jsonrpc":"2.0","id":"curltext","method":"submitdelegatevotetx", "params": [ "0-5", [{"delegate":"0-5", "votes":100000000}], 10000 ] }' -H 'Content-Type: application/json;' http://127.0.0.1:6968
curl -u  $name:$passworld -d '{"jsonrpc":"2.0","id":"curltext","method":"submitdelegatevotetx", "params": [ "0-6", [{"delegate":"0-6", "votes":100000000}], 10000 ] }' -H 'Content-Type: application/json;' http://127.0.0.1:6968
curl -u  $name:$passworld -d '{"jsonrpc":"2.0","id":"curltext","method":"submitdelegatevotetx", "params": [ "0-7", [{"delegate":"0-7", "votes":100000000}], 10000 ] }' -H 'Content-Type: application/json;' http://127.0.0.1:6968
curl -u  $name:$passworld -d '{"jsonrpc":"2.0","id":"curltext","method":"submitdelegatevotetx", "params": [ "0-8", [{"delegate":"0-8", "votes":100000000}], 10000 ] }' -H 'Content-Type: application/json;' http://127.0.0.1:6968
curl -u  $name:$passworld -d '{"jsonrpc":"2.0","id":"curltext","method":"submitdelegatevotetx", "params": [ "0-9", [{"delegate":"0-9", "votes":100000000}], 10000 ] }' -H 'Content-Type: application/json;' http://127.0.0.1:6968
curl -u  $name:$passworld -d '{"jsonrpc":"2.0","id":"curltext","method":"submitdelegatevotetx", "params": [ "0-10", [{"delegate":"0-10", "votes":100000000}], 10000 ] }' -H 'Content-Type: application/json;' http://127.0.0.1:6968
curl -u  $name:$passworld -d '{"jsonrpc":"2.0","id":"curltext","method":"submitdelegatevotetx", "params": [ "0-11", [{"delegate":"0-11", "votes":100000000}], 10000 ] }' -H 'Content-Type: application/json;' http://127.0.0.1:6968
curl -u  $name:$passworld -d '{"jsonrpc":"2.0","id":"curltext","method":"submitdelegatevotetx", "params": [ "0-12", [{"delegate":"0-12", "votes":100000000}], 10000 ] }' -H 'Content-Type: application/json;' http://127.0.0.1:6968

#解决高度 10 之后才可以提交新特性交易
sleep 100
# 矿工 0-2 先抵押21w WICC再进行喂价
curl -u  $name:$passworld -d '{"jsonrpc": "1.0", "id":"curltest", "method": "submitcoinstaketx", "params": ["0-2", "WICC", 21000000000000] }' -H 'Content-Type: application/json;' http://127.0.0.1:6968

sleep 5
curl -u  $name:$passworld -d '{"jsonrpc": "1.0", "id":"curltest", "method": "submitpricefeedtx", "params": ["0-2", [{"coin": "WICC", "currency": "USD", "price": 12500000}]] }' -H 'Content-Type: application/json;' http://127.0.0.1:6968

sleep 5
curl -u  $name:$passworld -d '{"jsonrpc": "1.0", "id":"curltest", "method": "submitcdpstaketx", "params": ["0-1", "WICC:16000000:wi", "WUSD:1000000:wi"] }' -H 'Content-Type: application/json;' http://127.0.0.1:6968

维基链DPOS共识机制每3s生成一个区块,过一段时间可查看区块高度增长。

本地环境搭建私有链


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

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

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

配置文件内容WaykiChain.conf

#nettype=main|test|regtest
nettype=regtest
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=1
genblocklimit=10000000000
debug=INFO
debug=ERROR
genreceipt=1

启动节点

命令如下

./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 03:13:08
Default data directory /root/.WaykiChain
Using data directory /opt/wicc/./regtest
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-807685d3-release-linux (2019-09-13 12:04:25 +0800)",
    "protocol_version" : 10001,
    "net_type" : "REGTEST_NET",
    "proxy" : "",
    "conf_dir" : "/root/.WaykiChain/WaykiChain.conf",
    "data_dir" : "/root/.WaykiChain/regtest",
    "block_interval" : 3,
    "genblock" : 1,
    "time_offset" : 0,
    "wallet_version" : 0,
    "wallet_balance" : 205799988.98790056,
    "miner_fee_perkb" : 0.00010000,
    "relay_fee_perkb" : 0.00001000,
    "tipblock_fuel_rate" : 100,
    "tipblock_fuel" : 0,
    "tipblock_time" : 1568374588,
    "tipblock_hash" : "d738103b170b070520c3de8c112b721e180676ebf8d9213c52a17ad5f2edb667",
    "tipblock_height" : 36,
    "syncblock_height" : 36,
    "connections" : 0,
    "errors" : ""
}
root@ubuntu:/opt/wicc#

如果返回值同上,说明私有链节点搭建成功了

导入矿工账户地址

由于当前没有矿工不会生产新区块,维基链采用DPOS共识机制, 以下提供import.sh脚本供开发者导入创世私钥并模拟投票产生矿工出块

import.sh

注意: 需要在节点运行环境下运行此脚本

name=wiccuser
passworld=wicc1000
# 导入矿工节点
curl -u  $name:$passworld -d '{"jsonrpc":"2.0","id":"curltext","method":"importprivkey","params":["Y6J4aK6Wcs4A3Ex4HXdfjJ6ZsHpNZfjaS4B9w7xqEnmFEYMqQd13"]}' -H 'content-type:application/json;' http://127.0.0.1:6968
curl -u  $name:$passworld -d '{"jsonrpc":"2.0","id":"curltext","method":"importprivkey","params":["Y5F2GraTdQqMbYrV6MG78Kbg4QE8p4B2DyxMdLMH7HmDNtiNmcbM"]}' -H 'content-type:application/json;' http://127.0.0.1:6968
curl -u  $name:$passworld -d '{"jsonrpc":"2.0","id":"curltext","method":"importprivkey","params":["Y7HWKeTHFnCxyTMtCEE6tVkqBzXoN1Yjxcx5Rs8j2dsSSvPxvF7p"]}' -H 'content-type:application/json;' http://127.0.0.1:6968
curl -u  $name:$passworld -d '{"jsonrpc":"2.0","id":"curltext","method":"importprivkey","params":["Y871eB5Xiss2ugKWQRb4nmMhKTnmXAEyUqBimTCupogzoSTVCSU9"]}' -H 'content-type:application/json;' http://127.0.0.1:6968
curl -u  $name:$passworld -d '{"jsonrpc":"2.0","id":"curltext","method":"importprivkey","params":["Y9cAUsEhfsihbePnCYYCETpN1PVovqTMX4kauKRsZ9ERdz1uumeK"]}' -H 'content-type:application/json;' http://127.0.0.1:6968
curl -u  $name:$passworld -d '{"jsonrpc":"2.0","id":"curltext","method":"importprivkey","params":["Y4unEjiFk1YJQi1jaT3deY4t9Hm1eSk9usCam35LcN85cUA2QmZ5"]}' -H 'content-type:application/json;' http://127.0.0.1:6968
curl -u  $name:$passworld -d '{"jsonrpc":"2.0","id":"curltext","method":"importprivkey","params":["Y5XKsR95ymf2pEyuhDPLtuvioHRo6ogDDNnaf4YU91ABvLb68QBU"]}' -H 'content-type:application/json;' http://127.0.0.1:6968
curl -u  $name:$passworld -d '{"jsonrpc":"2.0","id":"curltext","method":"importprivkey","params":["Y7diE8BXuwTkjSzgdZMnKNhzYGrU8oSk31anJ1mwipSCcnPakzTA"]}' -H 'content-type:application/json;' http://127.0.0.1:6968
curl -u  $name:$passworld -d '{"jsonrpc":"2.0","id":"curltext","method":"importprivkey","params":["YCjoCrtGEvMPZDLzBoY9GP3r7pqWa5mgzUxqAsVub6xnUVBwQHxE"]}' -H 'content-type:application/json;' http://127.0.0.1:6968
curl -u  $name:$passworld -d '{"jsonrpc":"2.0","id":"curltext","method":"importprivkey","params":["Y6bKBN4ZKBNHJZpQpqE7y7TC1QpdT32YtAjw4Me9Bvgo47b5ivPY"]}' -H 'content-type:application/json;' http://127.0.0.1:6968
curl -u  $name:$passworld -d '{"jsonrpc":"2.0","id":"curltext","method":"importprivkey","params":["Y8G5MwTFVsqj1FvkqFDEENzUBn4yu4Ds83HkeSYP9SkjLba7xQFX"]}' -H 'content-type:application/json;' http://127.0.0.1:6968
curl -u  $name:$passworld -d '{"jsonrpc":"2.0","id":"curltext","method":"importprivkey","params":["YAq1NTUKiYPhV9wq3xBNCxYZfjGPMtZpEPA4sEoXPU1pppdjSAka"]}' -H 'content-type:application/json;' http://127.0.0.1:6968
# 导入创世块私钥
curl -u  $name:$passworld -d '{"jsonrpc":"2.0","id":"curltext","method":"importprivkey","params":["Y6KfDubxttSA7xgn7EHMu2wj89f4HSre7dwCj8CUh5Wcgh29D5V9"]}' -H 'content-type:application/json;' http://127.0.0.1:6968
curl -u  $name:$passworld -d '{"jsonrpc":"2.0","id":"curltext","method":"importprivkey","params":["Y4wCLRJ3XzuogkspJbxQkGW9rbVz5ZHqQAn79SwNaPnKWsUiy4nd"]}' -H 'content-type:application/json;' http://127.0.0.1:6968

# 解决投票修改无法出块的问题
# submitsendtx
curl -u  $name:$passworld -d '{"jsonrpc":"2.0","id":"curltext","method":"submitsendtx", "params": ["0-1", "0-2",  "WICC:22000000000000:sawi","WICC:100001:sawi"] }' -H 'Content-Type: application/json;' http://127.0.0.1:6968
curl -u  $name:$passworld -d '{"jsonrpc":"2.0","id":"curltext","method":"submitsendtx", "params": ["0-1", "0-3",  "WICC:10000000000:sawi","WICC:100001:sawi"] }' -H 'Content-Type: application/json;' http://127.0.0.1:6968
curl -u  $name:$passworld -d '{"jsonrpc":"2.0","id":"curltext","method":"submitsendtx", "params": ["0-1", "0-4",  "WICC:10000000000:sawi","WICC:100001:sawi"] }' -H 'Content-Type: application/json;' http://127.0.0.1:6968
curl -u  $name:$passworld -d '{"jsonrpc":"2.0","id":"curltext","method":"submitsendtx", "params": ["0-1", "0-5",  "WICC:10000000000:sawi","WICC:100001:sawi"] }' -H 'Content-Type: application/json;' http://127.0.0.1:6968
curl -u  $name:$passworld -d '{"jsonrpc":"2.0","id":"curltext","method":"submitsendtx", "params": ["0-1", "0-6",  "WICC:10000000000:sawi","WICC:100001:sawi"] }' -H 'Content-Type: application/json;' http://127.0.0.1:6968
curl -u  $name:$passworld -d '{"jsonrpc":"2.0","id":"curltext","method":"submitsendtx", "params": ["0-1", "0-7",  "WICC:10000000000:sawi","WICC:100001:sawi"] }' -H 'Content-Type: application/json;' http://127.0.0.1:6968
curl -u  $name:$passworld -d '{"jsonrpc":"2.0","id":"curltext","method":"submitsendtx", "params": ["0-1", "0-8",  "WICC:10000000000:sawi","WICC:100001:sawi"] }' -H 'Content-Type: application/json;' http://127.0.0.1:6968
curl -u  $name:$passworld -d '{"jsonrpc":"2.0","id":"curltext","method":"submitsendtx", "params": ["0-1", "0-9",  "WICC:10000000000:sawi","WICC:100001:sawi"] }' -H 'Content-Type: application/json;' http://127.0.0.1:6968
curl -u  $name:$passworld -d '{"jsonrpc":"2.0","id":"curltext","method":"submitsendtx", "params": ["0-1", "0-10", "WICC:10000000000:sawi","WICC:100001:sawi"] }' -H 'Content-Type: application/json;' http://127.0.0.1:6968
curl -u  $name:$passworld -d '{"jsonrpc":"2.0","id":"curltext","method":"submitsendtx", "params": ["0-1", "0-11", "WICC:10000000000:sawi","WICC:100001:sawi"] }' -H 'Content-Type: application/json;' http://127.0.0.1:6968
curl -u  $name:$passworld -d '{"jsonrpc":"2.0","id":"curltext","method":"submitsendtx", "params": ["0-1", "0-12", "WICC:10000000000:sawi","WICC:100001:sawi"] }' -H 'Content-Type: application/json;' http://127.0.0.1:6968

sleep 20
# 投票
curl -u  $name:$passworld -d '{"jsonrpc":"2.0","id":"curltext","method":"submitdelegatevotetx", "params": [ "0-2", [{"delegate":"0-2", "votes":100000000}], 10000 ] }' -H 'Content-Type: application/json;' http://127.0.0.1:6968
curl -u  $name:$passworld -d '{"jsonrpc":"2.0","id":"curltext","method":"submitdelegatevotetx", "params": [ "0-3", [{"delegate":"0-3", "votes":100000000}], 10000 ] }' -H 'Content-Type: application/json;' http://127.0.0.1:6968
curl -u  $name:$passworld -d '{"jsonrpc":"2.0","id":"curltext","method":"submitdelegatevotetx", "params": [ "0-4", [{"delegate":"0-4", "votes":100000000}], 10000 ] }' -H 'Content-Type: application/json;' http://127.0.0.1:6968
curl -u  $name:$passworld -d '{"jsonrpc":"2.0","id":"curltext","method":"submitdelegatevotetx", "params": [ "0-5", [{"delegate":"0-5", "votes":100000000}], 10000 ] }' -H 'Content-Type: application/json;' http://127.0.0.1:6968
curl -u  $name:$passworld -d '{"jsonrpc":"2.0","id":"curltext","method":"submitdelegatevotetx", "params": [ "0-6", [{"delegate":"0-6", "votes":100000000}], 10000 ] }' -H 'Content-Type: application/json;' http://127.0.0.1:6968
curl -u  $name:$passworld -d '{"jsonrpc":"2.0","id":"curltext","method":"submitdelegatevotetx", "params": [ "0-7", [{"delegate":"0-7", "votes":100000000}], 10000 ] }' -H 'Content-Type: application/json;' http://127.0.0.1:6968
curl -u  $name:$passworld -d '{"jsonrpc":"2.0","id":"curltext","method":"submitdelegatevotetx", "params": [ "0-8", [{"delegate":"0-8", "votes":100000000}], 10000 ] }' -H 'Content-Type: application/json;' http://127.0.0.1:6968
curl -u  $name:$passworld -d '{"jsonrpc":"2.0","id":"curltext","method":"submitdelegatevotetx", "params": [ "0-9", [{"delegate":"0-9", "votes":100000000}], 10000 ] }' -H 'Content-Type: application/json;' http://127.0.0.1:6968
curl -u  $name:$passworld -d '{"jsonrpc":"2.0","id":"curltext","method":"submitdelegatevotetx", "params": [ "0-10", [{"delegate":"0-10", "votes":100000000}], 10000 ] }' -H 'Content-Type: application/json;' http://127.0.0.1:6968
curl -u  $name:$passworld -d '{"jsonrpc":"2.0","id":"curltext","method":"submitdelegatevotetx", "params": [ "0-11", [{"delegate":"0-11", "votes":100000000}], 10000 ] }' -H 'Content-Type: application/json;' http://127.0.0.1:6968
curl -u  $name:$passworld -d '{"jsonrpc":"2.0","id":"curltext","method":"submitdelegatevotetx", "params": [ "0-12", [{"delegate":"0-12", "votes":100000000}], 10000 ] }' -H 'Content-Type: application/json;' http://127.0.0.1:6968

#解决高度 10 之后才可以提交新特性交易
sleep 100
# 矿工 0-2 先抵押21w WICC再进行喂价
curl -u  $name:$passworld -d '{"jsonrpc": "1.0", "id":"curltest", "method": "submitcoinstaketx", "params": ["0-2", "WICC", 21000000000000] }' -H 'Content-Type: application/json;' http://127.0.0.1:6968

sleep 5
curl -u  $name:$passworld -d '{"jsonrpc": "1.0", "id":"curltest", "method": "submitpricefeedtx", "params": ["0-2", [{"coin": "WICC", "currency": "USD", "price": 12500000}]] }' -H 'Content-Type: application/json;' http://127.0.0.1:6968

sleep 5
curl -u  $name:$passworld -d '{"jsonrpc": "1.0", "id":"curltest", "method": "submitcdpstaketx", "params": ["0-1", "WICC:16000000:wi", "WUSD:1000000:wi"] }' -H 'Content-Type: application/json;' http://127.0.0.1:6968

维基链DPOS共识机制每3s生成一个区块,过一段时间可查看区块高度增长。