Elastos 测试网上注册 DPoS 2.0 超级节点操作指南

2022-10-14 15:18 

DPoS 2.0 即将上线 Elastos 主链!目前已经开始在测试网调试,Gelaxy 团队为社区小伙伴提供了在测试网运行超级节点的所有步骤的全面分解。如果您想要运行一个超级节点,请查看以下在测试网上注册 DPoS 2.0 超级节点操作指南。
随着 Elastos 主链向 DPoS(委托权益证明)2.0 共识升级的准备工作接近尾声,整个生态系统的当前和未来的超级节点运营商需要开始准备搭建节点,以便为新的、改进的、健壮的生态系统做出贡献。当然,在 DPoS 2.0 阶段,超级节点们仍将会以区块奖励的形式获得 ELA 激励。
为了简化和方便构建超级节点的操作过程,Gelaxy 团队提供了详细的教程,说明了如何在 DPoS 2.0 共识中注册超级节点。除了详细的说明,Gelaxy 团队还列出了一些重要资源和信息链接,以及直接链接到 Elastos Github 的相关页面。现在,我们邀请整个社区继续前进,并开始在测试网上注册您自己的 DPoS 2.0 超级节点!
DPoS 2.0 测试网超级节点注册指南:
1 注册 DPoS 2.0 超级节点

1.1 准备 ELA 账户

$ mkdir ~/node
$ cd ~/node
$ curl -O https://download-beta.elastos.io/elastos-ela/elastos-ela-v0.9.0.rc4/elastos-ela-v0.9.0.rc4-linux-x86_64.tgz
$ tar xf elastos-ela-v0.9.0.rc4-linux-x86_64.tgz
$ cd elastos-ela-v0.9.0.rc4-linux-x86_64
  • 创建 ELA 账户;
$./ela-cli wallet c

返回成功结果:

$ ./ela-cli wallet c
Password:
ADDRESS                            PUBLIC KEY                                                        
---------------------------------- ------------------------------------------------------------------
ELsKx7nfwHeyDRNHC8VpTMq7ZmTCq2QXrz 036d127fa2acc1d1339e1886b803669bb5c02eb71fa7800ee560223ac710581233
---------------------------------- ------------------------------------------------------------------
  • 查看账号地址和公钥命令;
$./ela-cli wallet a

返回成功结果:

$ ./ela-cli wallet a
Password:
ADDRESS                            PUBLIC KEY                                                        
---------------------------------- ------------------------------------------------------------------
ELsKx7nfwHeyDRNHC8VpTMq7ZmTCq2QXrz 036d127fa2acc1d1339e1886b803669bb5c02eb71fa7800ee560223ac710581233
---------------------------------- ------------------------------------------------------------------
  • 查看账户 ELA 余额;
$ ./ela-cli wallet b --rpcurl https://api-testnet.elastos.io/ela

返回成功结果。

$ ./ela-cli wallet b --rpcurl https://api-testnet.elastos.io/ela
INDEX                            ADDRESS BALANCE                           (LOCKED) 
----- ---------------------------------- ------------------------------------------
    0 ELsKx7nfwHeyDRNHC8VpTMq7ZmTCq2QXrz 0                                      (0) 
----- ---------------------------------- ------------------------------------------

1.2 注册 DPoS 2.0 超级节点

名称描述
amount将 2000 ELA 存入您的账户,锁定地址以 D 开头
fee交易费用
nodepublickey运营超级节点的公钥
nickname超级节点的名称
url超级节点的 url
location超级节点的位置
netaddress超级节点的网络地址
stakeuntil超级节点质押时间块高度(当前块高度+锁定时间(以区块计算),7200 * 3 <=锁定时间)
rpcurl访问 ELA 节点的 rpc 接口的 url
  • 创建交易;
$ ./ela-cli wallet buildtx producer register v2 --amount 2000 --fee 0.0001 --nodepublickey 036d127fa2acc1d1339e1886b803669bb5c02eb71fa7800ee560223ac710581233 --nickname test --url test.com --location 86 --netaddress 127.0.0.1 --stakeuntil 2628000 --rpcurl https://api-testnet.elastos.io/ela

交易成功创建并返回到 to_be_signed.txn 文件:

Hex:  0902000100133230313836333134383831353435393435343201ee417a90b373a69f9f2bc64780a95713c82256b03bcb70f7777cc9eb8535d5010100ffffffff02b037db964a231458d2d6ffd5ea18944c4f90e63d547c5d3b9874df66a4ead0a340420f0000000000000000002128bdd90d3841f1c4c373f78dd6b328dc2991702a00b037db964a231458d2d6ffd5ea18944c4f90e63d547c5d3b9874df66a4ead0a3ec86a76d7ae60000000000002136c6f2ad6785cef94fab1216b776add14bd756a8000000000001002321032f4540e915134f38ba24cdc08621ad7f5b8b62db36843ae8fa9422c047a04be8ac
File:  to_be_signed.txn
  • 对已成功创建的交易进行签名;
$ ./ela-cli wallet signtx -f to_be_signed.txn

签名成功并返回 ready_to_send.txn 文件:

[ 1 / 1 ] BaseTransaction was successfully signed
Hex:  0902000100133230313836333134383831353435393435343201ee417a90b373a69f9f2bc64780a95713c82256b03bcb70f7777cc9eb8535d5010100ffffffff02b037db964a231458d2d6ffd5ea18944c4f90e63d547c5d3b9874df66a4ead0a340420f0000000000000000002128bdd90d3841f1c4c373f78dd6b328dc2991702a00b037db964a231458d2d6ffd5ea18944c4f90e63d547c5d3b9874df66a4ead0a3ec86a76d7ae60000000000002136c6f2ad6785cef94fab1216b776add14bd756a8000000000001414036638609db104dfd3c1d89629fe8cdb538f361d98710a34c01a552b2e1f9e1bc0bef95a0b17eab1aa1475e5d4cb46d4edec38d54ea53ec49076b779cfefc73782321032f4540e915134f38ba24cdc08621ad7f5b8b62db36843ae8fa9422c047a04be8ac
File:  ready_to_send.txn
  • 将签名的交易发送到测试网络;
$ ./ela-cli wallet sendtx --file ready_to_send.txn --rpcurl https://api-testnet.elastos.io/ela

交易发送成功,返回交易哈希值。

ded1c3e69acc7cadf91b318faee25f8a911c9b59a63c9173bcec117a90742925

1.3 质押 ELA Token 获得票权

名称描述
amount保证金金额
fee交易费用
stakepool质押池地址,默认为“employepoolxxxxxxxxxxxxxxxxxxxpp1pq2”
rpcurl访问 ELA 节点的 rpc 接口的 url
$./ela-cli wallet buildtx stake --amount 1 --fee 0.001 --stakepool STAKEPooLXXXXXXXXXXXXXXXXXXXpP1PQ2 --rpcurl https://api-testnet.elastos.io/ela
$./ela-cli wallet signtx --file to_be_signed.txn
$./ela-cli wallet sendtx --file ready_to_send.txn --rpcurl https://api-testnet.elastos.io/ela
  • 交易成功后,可通过如下命令查看质押票权。
# Generate staking address
$ ./ela-cli wallet stakeaddress ELsKx7nfwHeyDRNHC8VpTMq7ZmTCq2QXrz
Sdp4gnD6v2Z7RpCgqBYDBtc7YRpbeFh9ad
# Request the getvoterights interface to view the staking rights

1.4 超级节点投票

名称描述
fee交易费用
candidates超级节点的 ownerpublickey 公钥,listproducers 接口获取所有超级节点信息
votes投票数量
stakeuntils质押时间(当前块高度+锁定时间(以区块计算),7200*3<=锁定时间<=720000,并且 stakeuntils<=注册超级节点 stakeuntils 参数值)
votetype投票类型,投票 DPoS 2.0 超级节点默认为4
rpcurl访问 ELA 节点的 rpc 接口的 url
$ ./ela-cli wallet buildtx dposv2vote --fee 0.1  --candidates "036d127fa2acc1d1339e1886b803669bb5c02eb71fa7800ee560223ac710581233,02e0f9bb1138e74e59e75dd756732336140927713f0bc8416515ecfd585840555f" --votes "1.1,1.1" --stakeuntils "2628000,2628000" --votetype 4 --rpcurl https://api-testnet.elastos.io/ela
  • 交易成功创建后,将返回 referKey,请务必保存构建交易返回的 referKey
Hex:  0963000104022103065bcbdd897e654bcee27afac10c7be9c9fe40e13da3e4240923d24631b06a7b80778e0600000000086b00002102e0f9bb1138e74e59e75dd756732336140927713f0bc8416515ecfd585840555f80778e0600000000086b00000100133238353939353533383331313235383638353501d65d6a54a707238a5253631edd4f4141a0126d64acd7b08d568d6109c464bb7b0000ffffffff01b037db964a231458d2d6ffd5ea18944c4f90e63d547c5d3b9874df66a4ead0a3f0b9f505000000000000000021b5318aac5d36c1d8d8484dcfa3c107b8a6aea176000000000001002321022747b9663d8b6e1e469be64ebf7977f3925a4d0fea750845221d31fa9583e130ac
File:  to_be_signed.txn
candidate: 03065bcbdd897e654bcee27afac10c7be9c9fe40e13da3e4240923d24631b06a7b votes: 1.10000000 referKey: a115e83d06727c4c5daa7387c6135653148a07739197917eba46a95c82a9e419
candidate: 02e0f9bb1138e74e59e75dd756732336140927713f0bc8416515ecfd585840555f votes: 1.10000000 referKey: 67e5ee0040d73ce9b5612106cb10d7617923809b89b28362560420a12385d88b
  • 签名并发送交易;
$./ela-cli wallet signtx --file to_be_signed.txn
$./ela-cli wallet sendtx --file ready_to_send.txn --rpcurl https://api-testnet.elastos.io/ela
  • 质押权限必须大于3000才有资格成为超级节点;
  • 单个质押获得的质押权计算公式为:N = E * log(T / 720);E =质押的 token 个数,T =单个质押的质押时间(以区块计算,7200 <= T <= 720000);
  • 投票完成后,可以通过 listproducers 界面查看 dposv2votes 的质押权限是否大于3000;
  • 完成以上4个步骤,完成 DPoS 2.0 的选举。

2 其他超级节点交易

2.1 超级节点续签

  • 不能更新 votes,只能更新 stakeuntil;
名称描述
fee交易费用
referkey投票唯一标识符,记录投票信息
candidates超级节点的 ownerpublickey 公钥,listproducers 接口获取所有超级节点信息
votes投票数量
stakeuntils质押时间(当前块高度+锁定时间(以区块计算),7200*3<=锁定时间<=720000,并且 stakeuntils<=注册超级节点 stakeuntils 参数值)
votetype投票类型,投票 DPoS 2.0 超级节点默认为4
rpcurl访问 ELA 节点的 rpc 接口的 url
$ ./ela-cli wallet buildtx dposv2voterenew --fee 0.01 --referkeys "a115e83d06727c4c5daa7387c6135653148a07739197917eba46a95c82a9e419,67e5ee0040d73ce9b5612106cb10d7617923809b89b28362560420a12385d88b" --candidates "036d127fa2acc1d1339e1886b803669bb5c02eb71fa7800ee560223ac710581233,02e0f9bb1138e74e59e75dd756732336140927713f0bc8416515ecfd585840555f" --votes "1.1,1.1" --stakeuntils "3828000,3828000" --rpcurl https://api-testnet.elastos.io/ela
  • 交易成功创建后,将返回 referKey,请务必保存构建交易返回的 referKey
contents: [Content: {
                                ReferKey: a115e83d06727c4c5daa7387c6135653148a07739197917eba46a95c82a9e419
                                VotesInfo: {[3 6 91 203 221 137 126 101 75 206 226 122 250 193 12 123 233 201 254 64 225 61 163 228 36 9 35 210 70 49 176 106 123] 1.10000000 27500}}
                                 Content: {
                                ReferKey: 67e5ee0040d73ce9b5612106cb10d7617923809b89b28362560420a12385d88b
                                VotesInfo: {[2 224 249 187 17 56 231 78 89 231 93 215 86 115 35 54 20 9 39 113 63 11 200 65 101 21 236 253 88 88 64 85 95] 1.10000000 27500}}
                                ]
Hex:  09630102a115e83d06727c4c5daa7387c6135653148a07739197917eba46a95c82a9e4192103065bcbdd897e654bcee27afac10c7be9c9fe40e13da3e4240923d24631b06a7b80778e06000000006c6b000067e5ee0040d73ce9b5612106cb10d7617923809b89b28362560420a12385d88b2102e0f9bb1138e74e59e75dd756732336140927713f0bc8416515ecfd585840555f80778e06000000006c6b000001001335323437393531313734313132383033353131015548fe16af96ee1a4b69fa51f26667f544c32d4944bef6174aa7c110812127c60000ffffffff01b037db964a231458d2d6ffd5ea18944c4f90e63d547c5d3b9874df66a4ead0a35226233c000000000000000021b5318aac5d36c1d8d8484dcfa3c107b8a6aea176000000000001002321022747b9663d8b6e1e469be64ebf7977f3925a4d0fea750845221d31fa9583e130ac
File:  to_be_signed.txn
candidate: 03065bcbdd897e654bcee27afac10c7be9c9fe40e13da3e4240923d24631b06a7b votes: 1.10000000 referKey: 28a8042484ab4390e087a72b900d865319663021c1627a94e312fb14c0e2aad0
candidate: 02e0f9bb1138e74e59e75dd756732336140927713f0bc8416515ecfd585840555f votes: 1.10000000 referKey: fb1a64f40d7e5d06407eb2b39875506304b7fef9357f246f61364612809a0975
  • 签署并发送交易。
$./ela-cli wallet signtx --file to_be_signed.txn
$./ela-cli wallet sendtx --file ready_to_send.txn --rpcurl https://api-testnet.elastos.io/ela

2.2 赎回票权返回 ELA Token

名称描述
amount赎回票权数,可赎回票权数=质押金额-投票金额
toELA Token 到账户地址
fee交易费用
rpcurl访问 ELA 节点的 rpc 接口的 url
$./ela-cli wallet buildtx unstake --amount 1.1 -to EZfy9XGTcceptp266bYee8SWfJ6JL6y88y --rpcurl https://api-testnet.elastos.io/ela
$./ela-cli wallet signtx --file to_be_signed.txn
$./ela-cli wallet sendtx --file ready_to_send.txn --rpcurl https://api-testnet.elastos.io/ela

2.3 认领收益交易

  • 访问 dposv2rewardinfo 接口,查看可以认领的 Token 数量。
名称描述
claimamount可认领金额
to认领金额转入地址
fee交易费用
rpcurl访问 ELA 节点的 rpc 接口的 url
$./ela-cli wallet buildtx dposv2claimreward --claimamount 1.1 --to EZfy9XGTcceptp266bYee8SWfJ6JL6y88y --rpcurl https://api-testnet.elastos.io/ela
$./ela-cli wallet signtx --file to_be_signed.txn
$./ela-cli wallet sendtx --file ready_to_send.txn --rpcurl https://api-testnet.elastos.io/ela

2.4 更新超级节点

名称描述
fee交易费用
nodepublickey运营超级节点的公钥
nickname超级节点的名称
url超级节点的 url
location超级节点的位置
netaddress超级节点的网络地址
stakeuntil超级节点质押时间块高度(当前块高度+锁定时间(以块计),7200 * 3 <=锁定时间)
rpcurl访问 ELA 节点的 rpc 接口的 url
$./ela-cli wallet buildtx producer update v2 --fee 0.0001 --nodepublickey 032895050b7de1a9cf43416e6e5310f8e909249dcd9c4166159b04a343f7f141b5 --nickname test --url test.com --location 86 --netaddress 127.0.0.1 --stakeuntil 2000000 --rpcurl https://api-testnet.elastos.io/ela
$./ela-cli wallet signtx --file to_be_signed.txn
$./ela-cli wallet sendtx --file ready_to_send.txn --rpcurl https://api-testnet.elastos.io/ela

2.5 赎回超级节点保证金

名称描述
amount保证金金额
to保证金到账户地址
fee交易费用
rpcurl访问 ELA 节点的 rpc 接口的 url
$./ela-cli wallet buildtx producer returndeposit --amount 1998 --fee 0.01  --rpcurl https://api-testnet.elastos.io/ela
$./ela-cli wallet signtx --file to_be_signed.txn
$./ela-cli wallet sendtx --file ready_to_send.txn --rpcurl https://api-testnet.elastos.io/ela

3 部署 DPoS 2.0 超级节点参与共识

3.1 服务器环境准备

  • Ubuntu 20.04 LTS 服务器;
  • 2核8G内存,硬盘100G以上;
  • 全网开放 ELA 节点21338个 P2P 端口和21339个 DPoS 直连端口。

3.2 部署节点

  • 部署 ELA 节点;
$ mkdir ~/node
$ cd ~/node
$ curl -O https://raw.githubusercontent.com/elastos/Elastos.Node/master/build/skeleton/node.sh
$ chmod a+x node.sh
$ ./node.sh     # Set the network type, please select 2 as Testnet network
$ ./node.sh ela init
$ ./node.sh ela start
$ ./node.sh ela status
  • 节点高度同步完成后,参考步骤2.4更新超级节点的 nodepublickey。“nodepublickey”账号目录位于“~/node/ela/keystore.dat”目录下。

关于 Elastos 向 DPoS 2.0 过渡以及所有相关流程的问题、意见和查询,请联系 Gelaxy 团队的 discord: https://discord.gg/UAyyVt3Fch

要了解关于发布 Elastos DPoS 2.0 共识、超级节点注册等的最新进展和公告,请关注 CR 先锋资讯。

本文地址:https://crherald.com/?p=5566
版权声明:本文为原创文章,版权归 ela888 所有,欢迎分享本文,转载请保留出处!

发表评论


表情