第五步:导入账户
unlocked >>> import_key "nathan" 5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3 true
如果运行中出现错误,检查bitshares-core目录下的witness_node_data_dir下的config.ini
# Endpoint for P2P node to listen on
# p2p-endpoint =
# P2P nodes to connect to on startup (may specify multiple times)
# seed-node =
# JSON array of P2P nodes to connect to on startup
# seed-nodes =
# Pairs of [BLOCK_NUM,BLOCK_ID] that should be enforced as checkpoints.
# checkpoint =
# Endpoint for websocket RPC to listen on
rpc-endpoint = 127.0.0.1:8090# Endpoint for TLS websocket RPC to listen on
# rpc-tls-endpoint =
# The TLS certificate file for this server
# server-pem =
# Password for this certificate
# server-pem-password =
# File to read Genesis State from
# genesis-json =
# Block signing key to use for init witnesses, overrides genesis file
# dbg-init-key =
# JSON file specifying API permissions
# api-access =
# Enable block production, even if the chain is stale.
enable-stale-production = false
# Percent of witnesses (0-99) that must be participating in order to produce blocks
required-participation = false
# ID of witness controlled by this node (e.g. "1.6.5", quotes are required, may specify multiple times)
# witness-id =
# Tuple of [PublicKey, WIF private key] (may specify multiple times)
private-key = ["PUBLICKEYHERE","PRIVATEKEYHERE"]# Account ID to track history for (may specify multiple times)
# track-account =
# Track market history by grouping orders into buckets of equal size measured in seconds specified as a JSON array of numbers
bucket-size = [15,60,300,3600,86400]
# How far back in time to track history for each bucket size, measured in the number of buckets (default: 1000)
history-per-size = 1000
# declare an appender named "stderr" that writes messages to the console
[log.console_appender.stderr]
stream=std_error
# declare an appender named "p2p" that writes messages to p2p.log
[log.file_appender.p2p]
filename=logs/p2p/p2p.log
# filename can be absolute or relative to this config file
# route any messages logged to the default logger to the "stderr" logger we
# declared above, if they are info level are higher
[logger.default]
level=info
appenders=stderr
# route messages sent to the "p2p" logger to the p2p appender declared above
[logger.p2p]
level=debug
appenders=p2p
第六步:升级账户
unlocked >>> upgrade_account my-account true
unlocked >>> create_witness my-account "
http://witness.bar.com/" true
第七步:让大家投票
自己投自己unlocked >>> vote_for_witness my-account my-account true true
自己投nathan unlocked >>> vote_for_witness nathan my-account true true
第八步:运行见证人
找见证人id和私钥
unlocked >>> get_witness my-account
{
"id": "1.6.10",
"witness_account": "1.2.16",
"signing_key": "GPH7vQ7GmRSJfDHxKdBmWMeDMFENpmHWKn99J457BNApiX1T5TNM8",
}
unlocked >>> dump_private_keys
[[
...
],[
"GPH7vQ7GmRSJfDHxKdBmWMeDMFENpmHWKn99J457BNApiX1T5TNM8",
"5JGi7DM7J8fSTizZ4D9roNgd8dUc5pirUe9taxYCUUsnvQ4zCaQ"
]
]
重新运行witness_node
./witness_node --rpc-endpoint=0.0.0.0:8090 --enable-stale-production --witness-id \""1.6.0"\" \""1.6.1"\" \""1.6.2"\" \""1.6.3"\" \""1.6.4"\" \""1.6.5"\" \""1.6.6"\" \""1.6.7"\" \""1.6.8"\" \""1.6.9"\" \""1.6.10"\" --private-key "[\"GPH7vQ7GmRSJfDHxKdBmWMeDMFENpmHWKn99J457BNApiX1T5TNM8\", \"5JGi7DM7J8fSTizZ4D9roNgd8dUc5pirUe9taxYCUUsnvQ4zCaQ\"]"错了,这是测试链的
正确的是:
./witness_node -s 104.200.28.117:61705 --rpc-endpoint=127.0.0.1:8090 --witness-id '"你的见证人序列号"' --private-key '["账户公钥", "账户activkey"]' --replay-blockchain
一个非常特殊的IP:0.0.0.0 这个IP相当于java中的this,代表当前设备的IP。
特殊的IP地址段:
127.x.x.x
这是大家最熟悉不过的本地loopback地址,在windows和linux上等价于localhost。
我们习惯于使用127.0.0.1,实际上,
如果你在命令行下ping 127.0.0.1-127.255.255.254之间的任意地址,结果都是一样的,它们是等价的。
背后的秘密就在与0.0.0.0这个IP,他可以代表本机的所有IP地址,
但这个IP并不是真是存在的,我们ping不通它
本机ip、127.0.0.1和0.0.0.0区别
http://www.2cto.com/net/201310/253427.html例如:
./witness_node -s 104.200.28.117:61705 --rpc-endpoint=127.0.0.1:8090 --witness-id '"1.6.69"' --private-key '["BTSertyugfdutruytiS71MtyGrZkvvtyiyttTWyiyt1", "5triytiytritriytiytiv8DnZuFrytiytVytiytf7ryiuT"]' --replay-blockchain
或者
./witness_node --rpc-endpoint=127.0.0.1:8090 \
--witness-id '"1.6.10"' \
--private-key '["GPH7vQ7GmRSJfDHxKdBmWMeDMFENpmHWKn99J457BNApiX1T5TNM8", "5JGi7DM7J8fSTizZ4D9roNgd8dUc5pirUe9taxYCUUsnvQ4zCaQ"]'
How To become an active witness in BitShares 2.0
https://github.com/cryptonomex/graphene/wiki/How%20to%20become%20an%20active%20witness%20in%20BitShares%202.0In case it may be helpful, here is the whole procedure I have used:
https://bitsharestalk.org/index.php/topic,18751.375.html