新手问答 本地搭建的三个出块节点环境分叉了,导致无法发布交易 ,报错:Transaction's reference block did not match. Is this transaction from a different fork?

gk5 · 2018年11月05日 · 最后由 gk5 回复于 2018年11月05日 · 139 次阅读

{"code":500,"message":"Internal Service Error","error":{"code":3040007,"name":"invalid_ref_block_exception","what":"Invalid Reference Block","details":[{"message":"Transaction's reference block did not match. Is this transaction from a different fork?","file":"controller.cpp","line_number":1833,"method":"validate_tapos"},{"message":"","file":"controller.cpp","line_number":1834,"method":"validate_tapos"}]}}

下面是我的搭建流程: 首先启动创世节点eosio eosio nodes 192.168.1.60:8000 keosd 192.168.1.60:8889

eosio nodes 192.168.1.60:8000 p2p-listen-endpoint = 192.168.1.60:9860 出块节点 test1 nodes 192.168.1.37:8001 p2p-listen-endpoint = 192.168.1.60:9837 test2 nodes 192.168.1.38:8002 p2p-listen-endpoint = 192.168.1.60:9838 test3 nodes 192.168.1.41:8003 p2p-listen-endpoint = 192.168.1.60:9841

p2p-listen-endpoint = 192.168.1.60:9860 p2p-peer-address = 192.168.1.37:9837 p2p-peer-address = 192.168.1.38:9838 p2p-peer-address = 192.168.1.41:9841 eosio 启动nodeos服务

./nodeos -e -p eosio --data-dir ./data --config-dir ./config --plugin eosio::chain_api_plugin --plugin eosio::history_api_plugin --verbose-http-errors --max-transaction-time=1000 --contracts-console --filter-on "*"
启动keosd服务 ./keosd --plugin eosio::wallet_api_plugin

加载BIOS合约 用于管理链上的堆栈和非堆栈资源,通过确认用户持有的token控制资源分配,包括带宽、CPU以及内存资源。 ./cleos -u http://192.168.1.60:8000 set contract eosio /home/lsf/eos/build/contracts/eosio.bios -p [email protected] 用eosio的秘钥对创建以下9个账户 eosio.bpay:矿工获取出块奖励的临时代管账户,增发EOS的1%的25%会先转到这个账户 eosio.msig:多重签名管理的账户 eosio.names:靓号账户拍卖管理的账户 eosio.ram:内存买卖管理的账户 eosio.ramfee:内存买卖收取手续费的账户,按照每笔交易5%的费率收取手续费 eosio.saving:增发EOS临时存放账户,增发总量 5%,其中80%放在此账户,另外 20%再分成25%和75%,分别给eosio.bpay和eosio.vpay eosio.stake:管理EOS抵押的账户 eosio.token:发行和管理token的账户 eosio.vpay:矿工按照获得投票多少比例获取奖励的临时代管账户,增发EOS的1%的75%会先转到这个账户 创建合约账户和系统子账户

部署eosio.token合约 ./cleos -u http://192.168.1.60:8000 set contract eosio.token /home/lsf/eos/build/contracts/eosio.token -p [email protected]

发币 ./cleos -u http://192.168.1.60:8000 push action eosio.token create '[ "eosio", "1000000000.0000 SYS"]' -p [email protected] 分配代币 ./cleos -u http://192.168.1.60:8000 push action eosio.token issue '[ "eosio", "1000000000.0000 SYS", "init" ]' -p [email protected] 部署eosio.system合约 ./cleos -u http://192.168.1.60:8000 set contract eosio /home/lsf/eos/build/contracts/eosio.system -p [email protected]
创建账户 test1

test2

test3

user1

user2

user3

启动test1节点 config.ini http-server-address = 192.168.1.37:8001 p2p-listen-endpoint = 192.168.1.37:9837 p2p-peer-address = 192.168.1.60:9860 p2p-peer-address = 192.168.1.38:9838 p2p-peer-address = 192.168.1.41:9841

producer-name = test1 signature-provider = =KEY:
--replay-blockchain –hard-replay-blockchain nohup ./nodeos -e -p test1 --data-dir ./data --config-dir ./config --plugin eosio::chain_api_plugin --plugin eosio::history_api_plugin --verbose-http-errors --max-transaction-time=1000 --replay-blockchain –hard-replay-blockchain --contracts-console --filter-on "*" & 启动test2节点 config.ini http-server-address = 192.168.1.38:8002 p2p-listen-endpoint = 192.168.1.38:9838 p2p-peer-address = 192.168.1.60:9860 p2p-peer-address = 192.168.1.37:9837 p2p-peer-address = 192.168.1.41:9841

producer-name = test2 signature-provider = = –replay-blockchain –hard-replay-blockchain nohup ./nodeos -e -p test2 --data-dir ./data --config-dir ./config --plugin eosio::chain_api_plugin --plugin eosio::history_api_plugin --verbose-http-errors --max-transaction-time=1000 –replay-blockchain –hard-replay-blockchain --contracts-console --filter-on "*" & 启动test3节点 config.ini http-server-address = 192.168.1.41:8003 p2p-listen-endpoint = 192.168.1.41:9841 p2p-peer-address = 192.168.1.60:9860 p2p-peer-address = 192.168.1.37:9837 p2p-peer-address = 192.168.1.38:9838

producer-name = test3 signature-provider = EOS66YSrPznoLyJxLfXCqHRfcJUMwCe6hQXD4kQvqkAaUJRvER9sb=KEY:5JzzedWh2hQnuXTZEEKgVir3XknPFgo51hQZBCdJUaBRZJFTib5

--replay-blockchain –hard-replay-blockchain nohup ./nodeos -e -p test3 --data-dir ./data --config-dir ./config --plugin eosio::chain_api_plugin --plugin eosio::history_api_plugin --verbose-http-errors --max-transaction-time=1000 --contracts-console --filter-on "*" & 注册出块节点候选人 ./cleos -u http://192.168.1.60:8000 system regproducer test1 EOS5fxeiybMtbWFzwagyRqnqiCvF3cYfdJt3K4Ryg6cKpTvDGN8fs ./cleos -u http://192.168.1.60:8000 system regproducer test2 EOS8MWX8iKxpRaDyB8F3ovSg1Cw1pj95CU1wq236Qpu1EnVeCYoGg ./cleos -u http://192.168.1.60:8000 system regproducer test3 EOS66YSrPznoLyJxLfXCqHRfcJUMwCe6hQXD4kQvqkAaUJRvER9sb 查看投票投票情况 由于没有投票,投票率为0 ./cleos -u http://192.168.1.60:8000 system listproducers

给user1、user2、user3分别转账 ./cleos -u http://192.168.1.60:8000 push action eosio.token transfer '["eosio", "user1","50000000.0000 SYS","vote"]' -p eosio ./cleos -u http://192.168.1.60:8000 push action eosio.token transfer '["eosio", "user2","50000000.0000 SYS","vote"]' -p eosio ./cleos -u http://192.168.1.60:8000 push action eosio.token transfer '["eosio", "user3","50000000.0000 SYS","vote"]' -p eosio

./cleos -u http://192.168.1.60:8000 get account user1

给uesr1、user2、user3分别抵押25000000.0000SYS,占系统15% 以下命令分别执行5次,这里有一点就是如果一次抵押数值太大就会越界,具体峰值不知道,刚开始25000000.0000的时候报错 抵押资源 ./cleos -u http://192.168.1.60:8000 system delegatebw user1 user1 "5000000.0000 SYS" "5000000.0000 SYS"

./cleos -u http://192.168.1.60:8000 system delegatebw user2 user2 "5000000.0000 SYS" "5000000.0000 SYS"

./cleos -u http://192.168.1.60:8000 system delegatebw user3 user3 "5000000.0000 SYS" "5000000.0000 SYS" 投票 ./cleos -u http://192.168.1.60:8000 system voteproducer prods user1 test1 ./cleos -u http://192.168.1.60:8000 system voteproducer prods user2 test2 ./cleos -u http://192.168.1.60:8000 system voteproducer prods user3 test3 再次查看投票投票情况 投票完成,每个候选节点获得33%的票 ./cleos -u http://192.168.1.60:8000 system listproducers

投票前,由eosio出块,test1、test2、test3分别同步eosio的出块信息,当投票完成后,test1、test2、test3分别出块,eosio停止出块,eosio同步test1、test2、test3交替出块

共收到 2 条回复

你先按 http://knowledge.cryptokylin.io/topics/77 文档重新部署试试

Surou 回复

我刚才又重新同步了 创世节点eosio 的 ,每次都只有删除出块节点数据 重新同步才可以

需要 登录 后方可回复, 如果你还没有账号请点击这里 注册