承接Tron节点搭建,在这一篇介绍下如何接入Tron官方的测试/主网节点。
准备工作
- 创建账号并申请创建超级节点
在官方浏览器网站(https://tronscan.org/)创建账号,并申请成为超级节点
编译
参考Tron节点搭建,进行编译。
配置文件修改(根据最新版本修改)
直接使用源码中的配置文件;
接入主网,修改配置项:localwitnesskeystore
删除配置项中的数据,如下:
localwitnesskeystore = [
]
接入测试网络(5.31后官网在跑主网),修改配置项如下:
net {
type = testnet
}
p2p {
version = 71# 10000: mainnet; 71: testnet
}
运行节点
- 启动命令
java -jar java-tron.jar -p 个人地址的私钥 --witness -c /home/tron/superNode/config.conf
- 验证节点
创建创世块
17:06:58.395 INFO [main] [o.t.c.d.Manager](Manager.java:313) save block: BlockCapsule
[ hash=0000000000000000c1d2f99e0075c68b46e39c24354facb4bd09b596a2af7bb3
number=0
parentId=0000000000000000000000000000000000000000000000000000000000000000
witness address=
generated by myself=true
generate time=1970-01-01 00:00:00.0
merkle root=e9da61a422ace90360c92f73e4eb5bec489b595d1978550741e1ffe7f3acacfe
txs size=3
]
连接节点:
17:07:08.533 INFO [nioEventLoopGroup-3-4] [HandshakeHandler](HandshakeHandler.java:73) channel active, /47.97.215.104:35258
17:07:08.534 INFO [nioEventLoopGroup-3-4] [HandshakeHandler](HandshakeHandler.java:87) Handshake Receive from /47.97.215.104:
35258, type: P2P_HELLO
from {
address: "47.97.215.104"
port: 18888
nodeId: "\2053D\006\220dm.GU\246\v\265f\256\323\217\237z\344&G\342\3332c\351\367\275\274\3108p\247\000\344%\266\305\330N\355
C*\232\267@h\367\344HtR\320E\3603\203b\340\226\026\334S"
}
version: 10000
timestamp: 1528736828330
genesisBlockId {
hash: "\000\000\000\000\000\000\000\000\301\322\371\236\000u\306\213F\343\234$5O\254\264\275\t\265\226\242\257{\263"
}
同步区块:
17:07:12.688 INFO [pool-7-thread-1] [o.t.c.d.Manager](Manager.java:740) save block: BlockCapsule
[ hash=00000000000000013009a046efe34e9d1fb09bfc6ca3222d8e93e8265184f6b9
number=1
parentId=0000000000000000c1d2f99e0075c68b46e39c24354facb4bd09b596a2af7bb3
witness address=41d7bfa8bfeb5822837878180a66921473339cf0d3
generated by myself=false
generate time=2018-05-31 13:39:27.0
txs are empty
]
17:07:12.688 INFO [nioEventLoopGroup-3-4] [MessageQueue](MessageQueue.java:104) Receive from /47.97.215.104:35258, type: BLOC
K
Num:883,ID:000000000000037369a9b2d5fec39ae4b15546fbf0267868e61c6db10395fdbe, trx size: 0
备注:
节点异常信息笔者将会单独起个单章来专门罗列。
网友评论