https://developers.eos.io/welcome/latest/tutorials/bios-boot-sequence
本篇主要说明如何启动一个创世节点,并且如何从单个创世节点变成具有多个Block Producer的区块链网络。
本次没有按照文档一步一步执行,仅仅总结相关知识。
通过通读全文,对eosio网络的运行方式的理解会有一定帮助。
1、创世节点
The Genesis node:
Bears the name eosio
Produces blocks
Listens for HTTP request on 127.0.0.1:8888
Listens for peer connections requests on 127.0.0.1:9010
Initiates periodic peer connections to localhost:9011, localhost:9012, and localhost:9013; these nodes are not running yet so ignore if you see any failed connection attempts
Has the parameter --contracts-console which prints contracts output to the console; in our case, this information is good for troubleshooting problems
2、系统账号
eosio.bpay
eosio.msig
eosio.names
eosio.ram
eosio.ramfee
eosio.saving
eosio.stake
eosio.token
eosio.vpay
eosio.rex
发现以”EOS“开头的应该都是公钥。
Every new EOSIO chain has a default "system" user called "eosio". This account is used to setup the chain by loading system contracts that dictate the governance and consensus of the EOSIO chain. Every new EOSIO chain comes with a development key, and this key is the same. Load this key to sign transactions on behalf of the system user (eosio)
eosio是用来部署eosio.*等系统账号的。
3、eosio.system 合约
部署:
cleos set contract eosio EOSIO_OLD_CONTRACTS_DIRECTORY/eosio.system/
注意:是用eosio账号部署的
作用:
token抵押/token撤销
系统资源消耗(cpu、net、memory)
创建账号
投票
系统资源购买
4、多节点协作
The target is to manage the blockchain by a collection of elected producers, operating under a rule of 2/3 + 1 producers agreeing before a block is final.
目标是通过一系列被选举出来的节点来管理区块链。被 2/3 + 1 同意的块就不可逆了。
Producers are chosen by election. The list of producers can change. Rather than giving privileged authority directly to any producer, the governing rules are associated with a special built-in account named eosio.prods. This account represents the group of elected producers. The eosio.prods account (effectively the producer group) operates using permissions defined by the eosio.msig contract.
eosio.prods 账号:管理block producer的账号,这个账号代表被选举出来的bps。该账号使用被eosio.msig账号签名过的权限。
The accounts eosio and eosio.msig are privileged accounts. The other eosio.* accounts are created but are not privileged.
5、抵押
By default, cleos stakes 8 KB of RAM on account creation, paid by the account creator.
--producer-name $CURDIRNAME \ # Producer name, set in the script to be the parent directory name
...
--http-server-address 127.0.0.1:8011 \ # http listening port for API incoming requests
--p2p-listen-endpoint 127.0.0.1:9011 \ # p2p listening port for incoming connection requests
...
...
--p2p-peer-address localhost:9010 \ # Meshing with peer `genesis` node
--p2p-peer-address localhost:9012 \ # Meshing with peer `accountnum12` node
--p2p-peer-address localhost:9013 \. # Meshing with peer `accountnum13` node
At this point the nodes are started, meshed together in a network, and they receive blocks from genesis node but they do not produce.
6、投票
Once producers have been elected and the minimum number requirements have been met, that is, a minimum 15% of tokens have been staked to produce votes, the eosio account can resign, leaving the eosio.msig account as the only privileged account.
至少15%的token用于投票后,eosio账号进行重签名,导致只有eosio.msig变成唯一的特权账号。
ps:
网友评论