├── .gitmodules
├── README.md
├── documentation
├── Algorithm for improving EOS consensus speed based on PBFT.md
└── 基于PBFT提升EOS共识速度的算法.md
├── k8s-bos
├── scripts
│ ├── contracts
│ │ ├── eosio.bios
│ │ │ ├── eosio.bios.abi
│ │ │ └── eosio.bios.wasm
│ │ ├── eosio.msig
│ │ │ ├── eosio.msig.abi
│ │ │ └── eosio.msig.wasm
│ │ ├── eosio.system
│ │ │ ├── eosio.system.abi
│ │ │ └── eosio.system.wasm
│ │ ├── eosio.token
│ │ │ ├── eosio.token.abi
│ │ │ └── eosio.token.wasm
│ │ └── eosio.wrap
│ │ │ ├── eosio.wrap.abi
│ │ │ └── eosio.wrap.wasm
│ ├── cron-vote.sh
│ ├── env.sh
│ └── start.sh
└── src
│ ├── gcp
│ ├── apply.sh
│ ├── delete.sh
│ ├── kustomization.yaml
│ ├── mannual_delete_pod.sh
│ ├── monitor.yaml
│ ├── service.yaml
│ ├── statefulsets.yaml
│ └── storageclass.yaml
│ ├── localhost
│ ├── apply.sh
│ ├── delete.sh
│ ├── kustomization.yaml
│ ├── mannual_delete_pod.sh
│ └── statefulsets.yaml
│ └── n-nodes
│ ├── configmap.yaml
│ ├── kustomization.yaml
│ ├── monitor.yaml
│ ├── service.yaml
│ ├── statefulsets.yaml
│ └── tps.yaml
└── k8s
├── deprecated
├── nginx.yaml
└── test.yaml
├── scripts
├── contracts
│ ├── eosio.bios
│ │ ├── eosio.bios.abi
│ │ ├── eosio.bios.abi.hpp
│ │ └── eosio.bios.wasm
│ ├── eosio.msig
│ │ ├── eosio.msig.abi
│ │ ├── eosio.msig.abi.hpp
│ │ └── eosio.msig.wasm
│ ├── eosio.sudo
│ │ ├── eosio.sudo.abi
│ │ ├── eosio.sudo.abi.hpp
│ │ └── eosio.sudo.wasm
│ ├── eosio.system
│ │ ├── eosio.system.abi
│ │ ├── eosio.system.abi.hpp
│ │ └── eosio.system.wasm
│ └── eosio.token
│ │ ├── eosio.token.abi
│ │ ├── eosio.token.abi.hpp
│ │ └── eosio.token.wasm
├── cron-vote.sh
├── env.sh
└── start.sh
└── src
├── gcp
├── apply.sh
├── clean.sh
├── delete.sh
├── kustomization.yaml
├── mannual_delete_pod.sh
├── monitor.yaml
├── statefulsets.yaml
└── storageclass.yaml
├── localhost
├── apply.sh
├── clean.sh
├── delete.sh
├── kustomization.yaml
├── mannual_delete_pod.sh
└── statefulsets.yaml
└── n-nodes
├── configmap.yaml
├── kustomization.yaml
├── monitor.yaml
├── service.yaml
├── statefulsets.yaml
└── tps.yaml
/.gitmodules:
--------------------------------------------------------------------------------
1 | [submodule "dpos-pbft"]
2 | path = dpos-pbft
3 | url = https://github.com/eosiosg/eos.git
4 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
2 | ## consensus protocol: dpos - practical bft
3 |
4 | boost the consensus gap from 162.5 seconds to 3-6 seconds
5 |
6 | [source code changes](https://github.com/eosiosg/eos/compare/v1.4.4...eosiosg:feature/dpos-pbft)
7 |
8 |
9 | # deploy test network using k8s
10 |
11 | ## pre-requirement
12 | - install kubectl
13 | - install kustomize
14 |
15 | ## sample configuration is in k8s/n-nodes.
16 |
17 | following nodes are pre-configured:
18 | - boot node named eosio
19 | - 26 bp nodes, named as bpa, bpb, bpc ... bpz
20 | - 9 full nodes, named as node-0, node-1, node-2 ... node-8
21 |
22 | in pre-configured network topology:
23 | - full nodes are fully meshed
24 | - each full node connects to 3 bp and eosio
25 | - each bp connects to 3 node
26 |
27 | the topology can be easily adjusted in k8s/n-nodes/configmap.yaml
28 |
29 | ## how to deploy to localhost
30 | ```bash
31 | cd k8s/src/localhost
32 | ./apply.sh
33 | ```
34 | ## how to clean up
35 | ```bash
36 | cd k8s/src/localhost
37 | ./delete.sh
38 | ```
39 | for fast deletion of statefulset, use ```./mannual_delete_pod.sh``` to fast delete all bp and node
40 |
41 | ## how to monitor nodes info
42 | - if deployed locally, use http://localhost to monitor
43 | - if deployed in cloud, you need to config monitor.yaml to enable monitor
44 | - for sample monitor page, view http://dpos-pbft.eosio.sg
45 |
46 | ## shuffle producer scripts is in k8s/scripts
47 |
48 | 1. use ```. ./env```to setup your env
49 | 2. use ```./start``` to deploy contracts and create accounts
50 | 3. use ```./cron-vote.sh``` to trigger producer shuffle
51 |
--------------------------------------------------------------------------------
/documentation/Algorithm for improving EOS consensus speed based on PBFT.md:
--------------------------------------------------------------------------------
1 | # Algorithm for improving EOS consensus speed based on PBFT
2 |
3 | ## 1 Background
4 | #### 1.1 Phenomenon
5 | There is a gap of 325+ blocks between the chain height of the main network and the consensus height, which is equivalent to a time difference of ~3 minutes. In other words, the current submitted trx needs to wait ~3 minutes to confirm whether it is recorded in the chain. This performance is unbearable for many DApps, especially those that require immediate confirmation.
6 |
7 |
8 | #### 1.2 Reasons
9 | * The reason for this phenomenon on the main network is that in EOS's DPOS-based consensus algorithm, all block synchronization and acknowledgment information can only be sent when it is out of the block. That is to say, in the case where the BP1 is out of the block (the block is BLK) and the BP1~BP21 round out block, BP2~BP21 will receive and verify BLK one after another, but all BPs can only send confirmation messages to BLK when they are out of the block. This is also why we see the logs in the nodes. When each BP comes out of the first block in the schedule, `confirmed` is always 240. The fastest speed of DPOS+Pipeline BFT consensus (ie, the smallest gap between head and LIB) is 325.
10 |
11 |
12 | * 240 = (21-1)*12
13 | This is actually the sum of all the blocks in the previous round (in the case of good network conditions). Each node maintains a vector `confirm_count` with a length of up to 240 and an initial value of 14 in `block_header`, corresponding to all blocks received but not agreed upon and the required number of acknowledgments. Whenever more than one BP acknowledges the block, the value of the corresponding block is -1, until the required number of acknowledgments of a block is reduced to 0, the block and all previous blocks enter the consensus ([related code] (https: //github.com/EOSIO/eos/blob/905e7c85714aee4286fa180ce946f15ceb4ce73c/libraries/chain/block_header_state.cpp#L188)).
14 |
15 | * 325 = 12*(13+1+13) + 1
16 | The entire network needs 15 people to confirm to reach a consensus. Everyone by default confirms their own blocks, so each block requires 14 people's implicit confirm and (explicit) confirm. The 14th BP has confirmed that the number of people has reached 15 since it was included in the block, so it will issue implicit confirm and (explicit) confirm. Then ideally, after a block is generated from it, it will not be able to get the consensus of the whole network and enter the LIB until the first block produced by the 28th BP. Therefore, there are the above calculations.
17 |
18 |
19 | * ** We believe that all BPs do not need to wait until the block to confirm other blocks, use PBFT** (Practical Byzantine Fault Tolerance[1])** instead of Pipeline BFT, let The real-time confirmation of the blocks currently being produced between the BPs enables the entire system to eventually reach a near real-time consensus speed. **
20 |
21 | ## 2 Algorithm Core
22 | * Retain the DPOS's BP Schedule mechanism and, like EOS, impose strong constraints on synchronized clock and BP Schedule.
23 |
24 | * Remove the Pipeline BFT part of the consensus in EOS (ie remove the implicit confirm and (explict) confirm part of the original EOS block), because in extreme cases it may conflict with PBFT consensus results.
25 |
26 | * Consensus communication mechanism uses existing p2p networks for communication, but increases communication costs, using the PBFT mechanism to broadcast prepare and commit information.
27 |
28 | * Optimized by batch (replaces the requirement for consensus on each block in PBFT), a batch consensus can be reached to approximate the ideal state of real-time BFT and reduce network load.
29 |
30 |
31 | ## 3 Basic concepts
32 | #### 3.1 The concrete realization of BP change in DPOS
33 | * In the current code, the voting rank is refreshed every 60s (120 blocks) ([related code] (https://github.com/EOSIO/eos/blob/8f0f54cf0c15c4d08b60c7de4fd468c5a8b38f2f/contracts/eosio.system/producer_pay.cpp#L47) ), if the first 21 changes, will issue the `promoting proposed schedule` ([related code] at the next refresh ranking (https://github.com/EOSIO/eos/blob/8f0f54cf0c15c4d08b60c7de4fd468c5a8b38f2f/libraries/chain/controller. Cpp#L909))
34 |
35 | * When a block containing `promoting proposed schedule` enters LIB, BP will update the `pending_schedule` in its own block header.
36 |
37 | * After 2/3 +1 BP nodes have updated the block header, `pending schedule` has reached a consensus. BP will update the `active schedule` to the value of the `pending schedule` at this time, and start to block out according to the new BP combination. The whole process needs to go through at least two rounds of complete outbound.
38 |
39 | * Every new BP combination must be able to reach a consensus to be effective. In other words, if 7 or more nodes in the network are unable to communicate properly, then no new BP can be generated by voting. The LIB of the network will stay at the consensus point where the node crashes.
40 |
41 | * DPOS can effectively avoid some of the fork problems, so the DPOS consensus mechanism for BP elections will still be used. All BP changes will not take effect until the probability schedule enters LIB.
42 |
43 | #### 3.2 Prerequisites for PBFT
44 | * If there are f Byzantine nodes in the network, then the total number of nodes n is required to satisfy n≥3f+1. A Byzantine node is a node that is inconsistent in its external state, including a node with a main action and a node that fails or partially fails due to network reasons.
45 |
46 | * All information is ultimately reachable: All communication information may be delayed/out of order/discarded, but retrying will ensure that the information will eventually be delivered.
47 |
48 |
49 | #### 3.3 The key concepts in PBFT correspond to DPOS
50 | **pre-prepare** means that the primary node receives the request and broadcasts it to all replicas in the network. It can be analogized to BP in DPOS and broadcast to the whole network.
51 |
52 |
53 | **prepare** means that the replica will broadcast the request to the entire network after receiving the request. The analogy is DPOS. All nodes receive the block and verify the success of the broadcast of the received information.
54 |
55 |
56 | **commit** means that the replica receives enough prepare messages for the same request to broadcast the request to the entire network. It can be analogized that the node in DPOS receives enough prepare messages for the same block, and proposes a proposed lib message.
57 |
58 | **committed-local**, which means that the replica receives enough commit messages for the same request and completes the verification. It can be compared to the LIB promotion in DPOS.
59 |
60 |
61 | **view change** means that the primary node loses the trust of the replica for various reasons, and the entire system changes the primary process. Since EOS adopts the DPOS algorithm, all BPs are determined in advance by voting. The order of the whole system is completely unchanged under the same BP schedule. When the network is in good condition and the BP schedule is unchanged, it can be considered. There is no view change.
62 | After the introduction of PBFT, in order to avoid the fork caused the consensus does not advance, join the view change mechanism, discard all unconsented blocks for replay, and continually try again until the consensus is continued.
63 |
64 | **checkpoint**, which refers to the record of consensus evidence at a block height to provide security proof. When enough checkpoints of the replica are the same, the checkpoint is considered to be stable. The checkpoint generation consists of two major categories. One is fixed k block generation; the other is a special point that needs to provide security proof, such as a block with a change in BP schedule.
65 |
66 |
67 | ## 4 Unoptimized version overview
68 |
69 | the term:
70 | * v: view version
71 | * i: BP's name
72 | * BLKn: the nth block
73 | * dn: Consensus message digest corresponding to the nth block digest
74 | * σi: signature of BP named i
75 | * n: height of the block
76 |
77 | All BPs agree on each block in order, using the PBFT mechanism. The following subsections describe:
78 |
79 |
80 | #### **4.1 Under normal circumstances (no BP changes or forks, and the network is in good condition)**
81 | The **pre-prepare** phase is no different from the current logic, that is, the BP broadcasts its signed block.
82 |
83 |
84 | **prepare** stage, BPi receives the block BPKn of the current BP signature, and is verified (PREPARE,v,n,dn,i)σi message, waiting for consensus. When BPi receives a 2/3 node and sends a PREPARE message to BLKn under view v, it is considered that the peer of the block has reached a consensus in the network. The PREPARE message has been sent and cannot be changed.
85 |
86 |
87 | **commit** stage, when BLKn is marked as ***prepared***, BPi is issued (COMMIT,v,n,dn,i)σi. It should be noted that PBFT implements security by guaranteeing strict order, so the consensus on all nodes is also strictly in order, that is, (PREPARE, v, n, dn,i)σi is issued under the premise that BLKn-1 is at least ***committed under the same view *** Status.
88 |
89 |
90 | **LIB promotion under the whole network perspective**, when BPi receives 2/3 nodes, it sends a COMIT message to BLKn, BPi believes that there is a consensus on the commit of this block in the network, that is, the block has reached a consensus, this block is marked as *committed* state, and the LIB is raised to the current height n, and then the next block is prepared. If the height of the block is Hi, the LIB heights of all BPs are arranged in descending order to obtain a vector Vc of length L, from the perspective of the whole network, Vc[2/3L] and below LIB can be considered as ***stable***, Vc[2/3L] is the LIB height of the whole network at this time.
91 |
92 |
93 | ** For the same block, only the sufficient PREPARE message is collected before entering the commit phase. Similarly, only after collecting enough COMMIT messages, will start the prepare for the next block, otherwise it will be resent until the number of messages meets the requirements or the view change (see below). **
94 |
95 | #### **4.2 When BP changes, **
96 | **pre-prepare** phase, no difference from 4.1.
97 |
98 |
99 | In the **prepare** and **commit** phases, due to the timing of the consensus between different BPs on the information of BP changes, there will be an inconsistent state between the BPs for the schedule.
100 | Taking BPi as an example, BPi receives the block BLKn of the current BPc signature, if Most BP's active schedule has been changed to S', and BPi is still S, then BPi will continue to wait for the PREPARE information sent by BP in S, which cannot Enter the commit phase.
101 | However, at this time, most nodes in the network will still reach a consensus with each other, resulting in an increase in the LIB of the entire network. If BPi receives enough commit information under the same view, BPi enters the commit-local state and promotes its own LIB.
102 |
103 |
104 |
105 | #### **4.3 When a fork is generated**
106 | **pre-prepare** phase, no difference from 4.1.
107 |
108 | **prepare** and **commit** phases, when BPi does not collect enough PREPARE or COMMIT messages in timeout=T, that is, the consensus is not promoted during this time period, The VIEW-CHANGE message initiates a view change and no longer receives any messages except VIEW-CHANGE, NEW-VIEW, and CHECKPOINT.
109 |
110 | **view change** stage, BPi is issued (VIEW-CHANGE, v+1, hlib, n, i)σi< /sub> message. When 2/3 +1 v'=v+1 VIEW-CHANGE messages are collected, they are sent by the next BP in the schedule (NEW-VIEW, v+1, n, VC, O)σ< Sub>bp message, where VC is all VIEW-CHANGE messages including BP signatures, and O is all unrecognized PRE-PREPARE messages (between hlib and Between nmax). After other BPs receive and verify that the NEW-VIEW message is valid, discard all blocks that are not currently agreed, and re-prepone the prepare and commit phases based on all PRE-PREPARE messages.
111 | If the view change fails to reach a consensus within timeout=T (there is no correct NEW-VIEW message sent), a new round of v+2 view change is initiated, the wait time is timeout=2T, and so on, until the network status Convergence, the consensus began to improve.
112 |
113 |
114 | **Remarks**: The original PBFT does not have a fork problem, because PBFT will only process the next request after a request has reached a consensus.
115 |
116 |
117 | ## 5 Problems with unoptimized versions:
118 | #### 5.1 Consensus speed
119 | When the consensus speed of a block is less than 500ms, that is, the transmission of two rounds of messages can receive enough confirmation numbers within 500ms, the gap between head and LIB can be stabilized and can approach 1 block, that is, real-time consensus. When the average consensus speed for a block is greater than or equal to 500ms or the network state is extremely poor, resulting in too many retries, the algorithm may be slower than DPOS+Pipeline BFT.
120 |
121 | #### 5.2 Network overhead
122 | Suppose the node in the network is N, the message propagation uses the gossip algorithm, and the block size is B. Then the message that DPOS needs to propagate is N2, and the required bandwidth is BN2.
123 | Assuming that the PREPARE and COMMIT message sizes are p and c, respectively, the number of messages that PBFT+DPOS needs to propagate is (1+rp+rc)N2 , where 1 is the pre-prepare transmission, rm, rc is the number of retries for prepare and commit, and the required bandwidth is (B+pr p+crc)N2. When the p and c optimizations are small enough, the extra bandwidth overhead depends mainly on the number of retries.
124 |
125 | ## 6 Overview of the optimized version
126 | #### 6.1 Implement batch consensus through adaptive granularity adjustment
127 | ##### 6.1.1 batch strategy
128 | The height of LIB is hLIB
129 | The height of the block at the highest point in the fork is hHEAD
130 | The block height involved in the BP schedule change is hs
131 | Batch consensus batch:
132 | * batchmin = 1
133 | * batchmax = min(default_batch_max, hHEAD - hLIB)
134 |
135 | When batchmax does not contain BP Schedule changes, batch = batchmax
136 | Batch = hs - 1 when batchmax contains BP Schedule changes and hLIB < hs
137 | When batchmax contains BP Schedule changes and hLIB == hs, batch = batchmax
138 |
139 | ##### 6.1.2 Batch Consensus Principle
140 | When there is no fork condition, the above construction can be compared with the consensus in the view of PBFT. And based on the basic structure of Merkle Tree, when most nodes can reach consensus on BLKn Hash, all previous blocks should be consensus. The total order of the block is guaranteed here.
141 |
142 | When there is a fork condition, the PREPARE information cannot be changed, otherwise it may appear as a Byzantine error. At this point, it is necessary to continuously resend the current PREPARE message until the network reaches a consensus or triggers a timeout to initiate a view change.
143 |
144 | ##### 6.1.3 Implementation Method
145 | * Whenever a new block is received, BP generates PREPARE information through the batch policy for caching and broadcasting.
146 |
147 | * Each BP maintains a minimum water level h for the block_header, and the highest water level H, corresponding to the lowest point and the highest point that have not yet reached consensus.
148 |
149 | * Maintain two vectors of length (H-h) Vp & Vc at the same time, including the number of PREPARE messages and COMMIT messages required for each block between water levels.
150 |
151 | * Each time a PREPARE message (or COMMIT message) of height n is received, it is verified by the signature and digest of the message and confirmed that he is in the same fork as himself, and then Vp(V< All values in the sub>c) (h ≤ n) -1.
152 |
153 | * Constantly resend the PREPARE message (or COMMIT message) with the height H on the same fork until the consensus is reached or the timeout triggers View Change (based on New View to restart the PBFT consensus, v' = v+1).
154 |
155 | * When a block at height x (h ≤ x ≤ H) collects more than 2/3 +1 PREPARE messages, the block contents from h to x are sequentially executed and all blocks of (h ≤ x) are marked as *prepared* And then automatically issue a COMIT message of height x.
156 |
157 | * When a block at height y (y ≤ H) collects more than 2/3 +1 COMMIT messages, the block contents from h to y are sequentially executed and all blocks of (h ≤ y) are marked as *committed*. At this point, all blocks that think ≤y have reached a consensus and raise their LIB height to y.
158 |
159 | * Generate checkpoints every few blocks to improve performance. When the latest checkpoint of more than 2/3 +1 in the network reaches a certain height c and is on the same fork, the checkpoint is considered stable.
160 |
161 | ##### 6.1.4 view change strategy
162 | * BP becomes the backup of the previous person according to the schedule of the block, ensuring that only one person can be found in the primary after each view change.
163 |
164 | * When the network begins to enter the view change, NEW-VIEW should re-consider the block between the lowest point h and the highest point H seen by 2/3 +1 people.
165 |
166 | * The BP that issued NEW-VIEW should include all VIEW-CHANGE messages in the message, and calculate h and H based on all VIEW-CHANGE messages, and exceed (2/3 +1) in the [h, H] interval. The fork of the person's choice is issued.
167 |
168 | * When BP receives the NEW-VIEW message and verifies it, it repeats the prepare based on the content of NEW-VIEW.
169 |
170 | * If the view change cannot be completed within timeout=T, a new round of view change of v+2 will be initiated until the network has reached a consensus on the choice of fork.
171 |
172 | #### 6.2 Avoid fork risk by always preparing the longest chain and combining view change
173 | * When BP receives multiple forks, it should make a preference for the longest chain that can be seen at present, taking the longest-live-fork principle.
174 |
175 | * BP should stagger the time point of BP switching when making a prepare, so as to avoid choosing a fork supported by a few people.
176 |
177 | * **BP once you make a prepare for a fork, you can no longer change the prepare message, otherwise it may become a Byzantine error, ** BP needs to:
178 | 1) Constantly resend the previous PREPARE message, waiting for the final consensus. Even if this fork is not the longest chain, because there are more people to support, you should choose this fork;
179 | 2) Or wait for timeout=T, initiate a view change, all BP starts a new BPFT consensus based on the fork issued by NEW-VIEW;
180 | 3) Receive a COMMIT message or checkpoint that exceeds (2/3 +1) the same fork, discarding the current state synchronization to the height reached by the majority.
181 |
182 | #### 6.3 Implementing GC and improving synchronization performance through Checkpoint mechanism
183 | * BP continuously broadcasts its current checkpoint status within the network and receives checkpoints from other people.
184 |
185 | * When there are more than (2/3 +1) people on the same branch whose checkpoint is higher than c, it is considered that CHECKPOINTc has been stable, and all caches such as PREPARE and COMMIT messages with a height lower than c are deleted.
186 |
187 | * By verifying the correctness of the checkpoint, you can greatly improve the synchronization speed of the node.
188 |
189 | ## 7 FAQ
190 | DPOS related issues (see 1.2)
191 |
192 | 1. Briefly explain how DPOS works.
193 | Temporary
194 | 2. Why DPOS lib is 12 12 ups
195 | Temporary
196 | 3. Why is the gap between HEAD and LIB of DPOS so large?
197 | Temporary
198 | 4. How does DPOS work when BP changes?
199 | Temporary
200 | 5. How is the data between nodes currently synchronized?
201 | Temporary
202 |
203 | PBFT related issues
204 |
205 | 1. Brief description of PBFT
206 | Temporary
207 |
208 | DPOS-PBFT related issues
209 |
210 | 1. Briefly explain how DPOS-PBFT works
211 | See 5
212 |
213 |
214 | 2. Why can't I only broadcast the information of prepare once?
215 | When there is a fork (or BP change) in the network, if there is only PREPARE information, all nodes cannot respond to the view change of other nodes, which will lead to hard fork. For example: Due to the nature of distributed networks, information can be delayed or disrupted. Suppose now that there are three consecutive blocks of BP A, B, C. If B does not receive the last block of A, then he will continue to block from the second to last block. This causes two forks to choose F1 F2. Assuming that the last block of A contains information about BP changes (the block is in F1), then the node that selected F1 needs a new BP S1 for consensus, and F2 The node needs the original BP S2 for consensus. The consensus group has changed, and it is very likely that both sides will eventually enter a consensus state, which will lead to the overall network bifurcation.
216 |
217 |
218 | 3. How does the prepare and commit retransmission mechanism work?
219 | When a given acknowledgment is not received for a block that is *prepared* or *committed* after a given timeout T, the same message is retransmitted one more time until enough acknowledgments are collected or A view change has occurred.
220 |
221 |
222 | 4. Is there a fork risk when the BP set changes?
223 | See 4.2
224 |
225 |
226 | 6. Do you need to wait for the consensus to complete before you can continue to block
227 | The block can continue, and the consensus only affects the height of the LIB.
228 |
229 |
230 | 7. If the Nth block does not meet the BFT consensus number, but the N+1th block receives enough confirmation, what should I do?
231 | For the optimized algorithm, you can start collecting consensus messages based on N+2 blocks.
232 |
233 |
234 | 8. Will continuous spurs be forked because the consensus is not quickly reached?
235 | No, at least the status of DPOS will eventually lead to consensus on the longest chain.
236 |
237 |
238 | 9. Does the BFT commit information need to be written to the block?
239 | All messages (issued and received) are only local. But they need to be kept for a period of time to provide evidence for peers.
240 |
241 |
242 | 10. What is the extra overhead?
243 | See 5.2
244 |
245 |
246 | 11. Can the speed of consensus really improve? If the BFT consensus average time is >500ms, the height of BFT is lower than DPOS.
247 | See 5.1
248 |
249 |
250 | ## 8 Reference
251 | [1] http://pmg.csail.mit.edu/papers/osdi99.pdf
252 |
--------------------------------------------------------------------------------
/documentation/基于PBFT提升EOS共识速度的算法.md:
--------------------------------------------------------------------------------
1 | # 基于PBFT提升EOS共识速度的算法
2 |
3 | ## 1 背景介绍
4 | #### 1.1 现象
5 | 当前主网的链高度和共识高度之间有325+个块的差距,相当于~3分钟左右的时间差。也就是说,当下提交的trx需要等到~3分钟后才能确认是否被记在链上。这样的表现对于很多DApp来说是不可承受的,尤其是那些需要即时确认的应用。
6 |
7 |
8 | #### 1.2 原因阐述
9 | * 造成主网上这种现象的原因,是EOS基于DPOS的共识算法中,所有块同步和确认信息都只通过出块的时候才能发出。也就是说,在BP1出块(所出块为BLK)、BP1~BP21轮流出块的情况下,BP2~BP21会陆续收到并验证BLK,但所有BP只能等到自己出块的时候才能发出对BLK的确认信息。这也是为什么我们看到nodes的log中,每个BP在schedule中第一次出块的时候,`confirmed`总是240。DPOS+Pipeline BFT理论上共识的最快速度(即head和LIB之间的最小差距)为325。
10 |
11 |
12 | * 240 = (21-1)*12
13 | 这其实是(在网络情况良好的情况下)上一轮所有块数之和。每个节点在`block_header`中维护着一个长度最长为240,初始值为14的vector `confirm_count`,对应所有收到但是未达成共识的块以及尚需的确认数。每当收到多一个BP对这些块的确认,对应块的数值-1,直到某一块所需的确认数减到0,此块及之前的所有块便进入共识([相关代码](https://github.com/EOSIO/eos/blob/905e7c85714aee4286fa180ce946f15ceb4ce73c/libraries/chain/block_header_state.cpp#L188))。
14 |
15 | * 325 = 12*(13+1+13) + 1
16 | 整个网络需要15个人确认才能达成共识。每个人默认会对自己出的块进行确认,所以每个块需要14个人的implicit confirm和(explicit)confirm。第14个BP在出块时由于包括自己在内确认人数已经达到15人,所以它会同时发出implicit confirm和(explicit)confirm。那么理想情况下,一个块从它产生后,要到之后的第28个BP所产出的第一个块时才能得到全网共识,进入LIB。因此有以上计算。
17 |
18 |
19 | * **我们认为,所有BP不需要等到出块的时候才对其他块进行确认,用PBFT**(Practical Byzantine Fault Tolerance[1])**来替代Pipeline BFT,让BP之间实时地对当前正在生产的区块进行确认,能够使整个系统最终达到接近实时的共识速度。**
20 |
21 | ## 2 算法核心
22 | * 保留DPOS的BP Schedule机制,和EOS一样对synchronized clock和BP Schedule进行强约束。
23 |
24 | * 去掉EOS中的Pipeline BFT部分共识(即去掉原本EOS中出块时的implicit confirm和(explict) confirm部分),因为在极端情况下可能与PBFT的共识结果有冲突。
25 |
26 | * 共识的通讯机制使用现有p2p网络进行通信,但增加通信成本,使用PBFT机制广播prepare和commit信息。
27 |
28 | * 通过batch方式优化(替换掉PBFT中对每个块进行共识的要求), 能够达成批量共识,以此来逼近实时BFT的理想状态并减轻网络负载。
29 |
30 |
31 | ## 3 基础概念
32 | #### 3.1 DPOS中BP变更的具体实现
33 | * 当前代码中,每60s(120个块)刷新一次投票排名([相关代码](https://github.com/EOSIO/eos/blob/8f0f54cf0c15c4d08b60c7de4fd468c5a8b38f2f/contracts/eosio.system/producer_pay.cpp#L47)),如果前21名发生变化,会在下一次刷新排名的时候发出`promoting proposed schedule`([相关代码](https://github.com/EOSIO/eos/blob/8f0f54cf0c15c4d08b60c7de4fd468c5a8b38f2f/libraries/chain/controller.cpp#L909))
34 |
35 | * 当包含`promoting proposed schedule`的块进入LIB后,BP会陆续更新自己block header中的`pending_schedule`
36 |
37 | * 等到2/3 +1个BP节点都已经更新block header后,`pending schedule`达成共识。BP会陆续将`active schedule`更新为此时`pending schedule`的值,并按照新的BP组合开始出块,整个过程需要至少经过两轮完整的出块。
38 |
39 | * 每一次新的BP组合,一定要能够达成共识才能真正生效。换句话说,如果网络中7个或更多节点无法正常通信,那么无论如何不能通过投票的方式产生新的BP。网络的LIB会一直停留在节点崩溃的那个共识点。
40 |
41 | * DPOS这样的做法可以有效的避免一部分分叉问题,所以仍会沿用DPOS关于BP选举部分的共识机制,即所有的BP变动,需要等到propose schedule进入LIB后才真实生效。
42 |
43 | #### 3.2 PBFT的前提
44 | * 如果网络中的拜占庭节点为f个,那么要求总节点数n满足n≥3f+1。拜占庭节点是指对外状态表现不一致的节点,包括主动作恶的节点和因为网络原因导致失效或部分失效的节点。
45 |
46 | * 所有信息最终可达: 所有通信信息可能会被延迟/乱序/丢弃, 但通过重试的方式可以保证信息最终会被送达。
47 |
48 |
49 | #### 3.3 PBFT中的关键概念对应DPOS
50 | **pre-prepare**,指primary节点收到请求,广播给网络里的所有replica。可以类比为DPOS中BP出块并广播至全网。
51 |
52 |
53 | **prepare**,指replica收到请求后向全网广播将要对此请求进行执行。可类比为DPOS重所有节点收到块并验证成功后广播已收到的信息。
54 |
55 |
56 | **commit**,指replica收到足够多的对同一请求的prepare消息,向全网广播执行此请求。可以类比为DPOS中节点收到足够多对同一个块的prepare消息, 提出proposed lib消息
57 |
58 | **committed-local**, 指replica收到足够多对同一请求的commit消息, 完成了验证工作. 可以类比为DPOS中的LIB提升.
59 |
60 |
61 | **view change**,指primary节点因为各种原因失去replica信任,整个系统更改primary的过程。由于EOS采用了DPOS的算法,所有BP是通过投票的方式提前确定的,在同一个BP schedule下整个系统的出块顺序是完全不变的,当网络情况良好并且BP schedule不变的时候可以认为不存在view change。
62 | 当引入PBFT后,为了避免分叉导致共识不前进的情况,加入view change机制,抛弃所有未达成共识的块进行replay,不断重试直到继续共识。
63 |
64 | **checkpoint**, 指在某一个块高度记录共识证据, 以此来提供安全性证明. 当足够多的replica的checkpoint相同时, 这个checkpoint被认为是stable的. checkpoint的生成包括两大类,一类是固定k个块生成; 另一类是特殊的需要提供安全性证明的点,例如BP schedule发生变更的块.
65 |
66 |
67 | ## 4 未优化版本概述
68 |
69 | 术语:
70 | * v: view version
71 | * i: BP的名字
72 | * BLKn: 第n个块
73 | * dn: 对应第n个块的共识消息摘要digest
74 | * σi: 名为i的BP的签名
75 | * n: 区块的高度
76 |
77 | 所有BP针对每一个块按顺序进行共识, 采用PBFT机制. 以下分情况进行描述:
78 |
79 |
80 | #### **4.1 在正常的情况下(不涉及BP变更也没有分叉,且网络状况良好)**
81 | **pre-prepare**阶段,与现行逻辑没有区别,即BP广播其签名的块。
82 |
83 |
84 | **prepare**阶段,BPi收到当前BP签名的块BLKn,经过验证后发出 (PREPARE,v,n,dn,i)σi 消息,等待共识。当BPi收到了2/3的节点发出view v下对BLKn的PREPARE消息,认为网络中对此块的prepare已达成共识。已发出的PREPARE消息,不可更改。
85 |
86 |
87 | **commit**阶段,当BLKn标记为 ***prepared*** 后,BPi发出(COMMIT,v,n,dn,i)σi。需要注意的是,PBFT是通过保证严格顺序来实现安全性的,所以对所有节点对块的共识也是严格的按照顺序进行,也就是说,(PREPARE,v,n,dn,i)σi发出的前提条件是在同一个view下,BLKn-1至少已经处于 ***committed*** 状态。
88 |
89 |
90 | **全网角度下LIB提升**,当BPi收到了2/3的节点发出v下对BLKn的COMMIT消息,BPi认为网络中对此块的commit已达成共识,即此块已达成共识,此块标记为 *committed* 状态,并将LIB提升到当前高度n,然后开始对下一个块进行prepare。若此区块高度为Hi,所有BP的LIB高度进行降序排列后得到长度为L的向量Vc, 从全网角度来看Vc[2/3L]及以下的LIB可以被认为 ***stable*** ,Vc[2/3L]即此时全网的LIB高度。
91 |
92 |
93 | **对于同一个块而言,只有收集足够的PREPARE消息,才会进入commit阶段。同理,只有收集足够的COMMIT消息,才会开始对下一个块开始prepare,否则就一直重发直到消息数满足要求或进行view change(见后文)。**
94 |
95 | #### **4.2 当BP产生变化的时候**
96 | **pre-prepare**阶段,与4.1无区别。
97 |
98 |
99 | **prepare**和**commit**阶段,由于不同BP间对于BP变动的信息达成共识的时间有先后,此时便会出现BP之间对于schedule的不一致状态。
100 | 以BPi为例,BPi收到了当前BPc签名的块BLKn,如果此时多数BP的active schedule已改为S',而BPi仍是S,那么BPi便会持续等待S中的BP发送的PREPARE信息,从而无法进入commit阶段。
101 | 但此时网络中的多数节点仍会相互达成共识,致使全网的LIB提升。如果BPi收到足够的同一个view下的commit信息, BPi会进入commit-local状态,提升自己的LIB。
102 |
103 |
104 |
105 | #### **4.3 当产生分叉的时候**
106 | **pre-prepare**阶段,与4.1无区别。
107 |
108 | **prepare**和**commit**阶段,当BPi 在timeout=T内没有收集足够的PREPARE或COMMIT消息,即共识没有在这个时间段内提升,此时发出VIEW-CHANGE消息,发起view change 并不再接收除VIEW-CHANGE、NEW-VIEW和CHECKPOINT外的任何消息。
109 |
110 | **view change**阶段,BPi 发出 (VIEW-CHANGE,v+1,hlib,n,i)σi消息。当收集到 2/3 +1 个v'=v+1的VIEW-CHANGE消息后,由schedule中的下一个BP发出 (NEW-VIEW,v+1,n,VC,O)σbp消息,其中VC是所有包括BP签名的VIEW-CHANGE消息,O是所有未达成共识的PRE-PREPARE消息(介于hlib和nmax之间)。当其它BP收到并验证NEW-VIEW消息合法后,丢弃掉所有当前未达成共识的块,基于所有的PRE-PREPARE消息重新进行prepare和commit阶段。
111 | 若view change未能在timeout=T内达成共识(没有正确的NEW-VIEW消息发出),即发起新一轮v+2的view change,等待时间timeout=2T, 依次类推不断重试,直到网络状态收敛,共识开始提升。
112 |
113 |
114 | **备注**: 原始的PBFT不存在分叉的问题, 因为PBFT只有在一个请求达成共识后才会开始处理下一个请求。
115 |
116 |
117 | ## 5 未优化版本存在的问题:
118 | #### 5.1 共识速度
119 | 当对一个块的共识速度小于500ms,即两轮消息的发送可以在500ms内收到足够的确认数,head和LIB的差距稳定后可以趋近于1个块,即实时共识。而当对一个块的平均共识速度大于等于500ms或网络状态极差导致重试次数过多,本算法表现可能慢于DPOS+Pipeline BFT。
120 |
121 | #### 5.2 网络开销
122 | 假设网络中的节点为N,消息传播使用gossip算法,块大小为B,那么DPOS需要传播的消息为N2,所需带宽为BN2。
123 | 假设PREPARE和COMMIT消息大小分别为p和c,PBFT+DPOS所需要传播的消息数为 (1+rp+rc)N2,其中1 是pre-prepare的传输,rm,rc为prepare和commit的重试次数,所需带宽为(B+prp+crc)N2。当p、c优化的足够小后,额外的带宽开销主要取决于重试次数。
124 |
125 | ## 6 优化后的版本概述
126 | #### 6.1 通过自适应粒度调整,实现批量共识
127 | ##### 6.1.1 batch 策略
128 | LIB的高度为hLIB
129 | fork中最高点的块的高度为 hHEAD
130 | 涉及到BP schedule变动的块高度为 hs
131 | 批量共识batch:
132 | * batchmin = 1
133 | * batchmax = min(default_batch_max, hHEAD - hLIB)
134 |
135 | 当batchmax中不包含BP Schedule变动时, batch = batchmax
136 | 当batchmax中包含BP Schedule变动且hLIB < hs 时, batch = hs - 1
137 | 当batchmax中包含BP Schedule变动且hLIB == hs 时, batch = batchmax
138 |
139 | ##### 6.1.2 批量共识原理
140 | 当未出现分叉情况时, 以上构筑可类比PBFT中view不变情况下的共识. 并且基于Merkle Tree的基本结构,当多数节点可以对BLKn的Hash达成共识,那么之前的所有块都应该是共识的. 此处保证了块的total order.
141 |
142 | 当出现分叉情况时, PREPARE 信息不能变动,否则可能对外表现为拜占庭错误。此时需要不断重发当前的PREPARE消息直到网络达成共识或触发timeout 后发起view change。
143 |
144 | ##### 6.1.3 实现方法
145 | * 每当收到新的块时, BP 通过batch的策略生成PREPARE信息, 进行缓存及广播
146 |
147 | * 每个BP为block_header维护一个最低水位h,和最高水位H,分别对应自己还没有达成共识的最低点和最高点。
148 |
149 | * 同时维护两个长度为(H-h)的向量 Vp & Vc,包括水位间每一个块所需要的PREPARE消息数和COMMIT消息数。
150 |
151 | * 每收到一个高度为n的PREPARE消息(或COMMIT消息),通过消息的签名和digest进行验证并确认他与自己处于相同的fork后,依次将Vp(Vc)中(h ≤ n)的所有数值-1。
152 |
153 | * 不断重发同一个fork上高度为H的PREPARE消息(或COMMIT消息),直到达成共识或超时后触发View Change(基于New View重新开始PBFT共识,此时v' = v+1)。
154 |
155 | * 当某一个处于高度x(h ≤ x ≤ H)的块收集超过2/3 +1个PREPARE消息,依次执行从h~x的块内容并标记所有(h ≤ x)的块为 *prepared*,然后自动发出高度为x的COMMIT消息。
156 |
157 | * 当某一个处于高度y(y ≤ H)的块收集超过2/3 +1个COMMIT消息,依次执行从h~y的块内容并标记所有(h ≤ y)的块为 *committed*。此时认为≤y的所有块已达成共识,将自己的LIB高度提升至y。
158 |
159 | * 每隔若干块生成checkpoint以提高性能。当网络内超过2/3 +1的最新的checkpoint 都达到某一高度c,并且处于同一fork上,则认为此checkpoint稳定。
160 |
161 | ##### 6.1.4 view change策略
162 | * BP依据出块的schedule依次成为前一人的backup,确保每一次view change后的primary只可能有一人。
163 |
164 | * 当网络开始进入view change后,NEW-VIEW应该重新对2/3 +1人看到的最低点h和最高点H之间的块进行重新共识。
165 |
166 | * 发出NEW-VIEW的BP应该在消息内包括所有VIEW-CHANGE消息,并根据所有的VIEW-CHANGE消息计算出h和H,并将[h, H]区间内超过(2/3 +1)的人选择的fork一并发出。
167 |
168 | * 当BP收到NEW-VIEW消息并进行验证后,基于NEW-VIEW的内容重新进行prepare。
169 |
170 | * 若在timeout=T内无法完成view change,便开始发起v+2的新一轮view change,直到网络对fork的选择达成共识。
171 |
172 | #### 6.2 通过始终prepare最长链并结合view change,避免分叉风险
173 | * 当BP收到多个fork的时候,应该对当前所能看到的最长链进行prepare, 采取longest-live-fork原则.
174 |
175 | * BP在进行prepare的时候,应该错开BP切换的时间点,从而避免选择少数人支持的fork。
176 |
177 | * **BP一旦对某个fork进行prepare,就不能再对prepare消息进行更改,否则可能成为拜占庭错误,** BP需要:
178 | 1)不断重发之前的PREPARE消息,等待最终达成共识。即使这个fork不是最长链, 因为有更多人支持,也应该选择这个fork;
179 | 2)或等待timeout=T后,发起view change,所有BP基于NEW-VIEW发出的fork开始新的BPFT共识;
180 | 3)收到超过(2/3 +1)同一fork的COMMIT消息或checkpoint,抛弃当前状态同步至多数人达成共识的高度。
181 |
182 | #### 6.3 通过Checkpoint机制实现GC并提升同步性能
183 | * BP不断网络内广播自己当前的checkpoint状态,并且接收来自其他人的checkpoint。
184 |
185 | * 当同一分支上有超过(2/3 +1)人的checkpoint已经高于c,认为CHECKPOINTc已经stable,删除高度低于c以前所有PREPARE、COMMIT消息等cache。
186 |
187 | * 通过验证checkpoint的正确性,可以大幅提升节点的同步速度。
188 |
189 | ## 7 FAQ
190 | DPOS相关问题(见1.2)
191 |
192 | 1. 简单说明DPOS是如何工作的
193 | 暂略
194 | 2. 为什么DPOS的lib是12个12个的涨
195 | 暂略
196 | 3. 为什么DPOS的HEAD和LIB差距这么大
197 | 暂略
198 | 4. 当BP变动时, DPOS是如何工作的
199 | 暂略
200 | 5. 目前节点间的数据是如何同步的
201 | 暂略
202 |
203 | PBFT相关问题
204 |
205 | 1. 简单说明PBFT
206 | 暂略
207 |
208 | DPOS-PBFT相关问题
209 |
210 | 1. 简单说明DPOS-PBFT是如何工作的
211 | 见5
212 |
213 |
214 | 2. 为什么不能只广播一次prepare的信息
215 | 当网络出现分叉(或BP变动)的时候,如果只有PREPARE信息,所有节点是无法对其它节点的view change进行响应的,会导致硬分叉。 举例说明: 因为分布式网络的特性, 信息会被延迟或打乱。假设现在有三个连续出块的BP A,B,C 如果B没有收到A的最后一个块, 那么他会继续从倒数第二个块开始出块。这样造成了两个fork选择F1 F2. 假定A的最后一个块里包含了BP变动的信息(该块在F1里), 那么选择了F1的节点需要一个新的BP S1来进行共识, 而F2的节点需要原有的BP S2 进行共识。 共识的群体发生了变化, 很有可能会两边最终都进入共识状态, 进而导致整体网络发生分叉。
216 |
217 |
218 | 3. prepare和commit重发机制是如何工作的
219 | 当超过给定的timeout T后仍然没有对某一个处于 *prepared* 或者 *committed* 的块收集到足够多的确认,就对同一个消息进行多一次的重发,直到收集到足够多的确认或发生view change。
220 |
221 |
222 | 4. 当BP集合变动的时候,是否存在分叉风险
223 | 见4.2
224 |
225 |
226 | 6. 是否需要等待共识完成才能继续出块
227 | 出块可以持续进行,共识只影响LIB的高度
228 |
229 |
230 | 7. 如果第N个块未满足BFT共识个数,但第N+1个块收到了足够多的confirm,该如何处理
231 | 对于优化后的算法,可以直接开始基于N+2个块开始收集共识消息
232 |
233 |
234 | 8. 持续出块是否会因为共识未迅速达成而分叉
235 | 不会,至少表现为DPOS的状态,最终会共识在最长链上
236 |
237 |
238 | 9. BFT的commit信息是否需要写入块中
239 | 所有消息(发出的和收到的)都只存在本地. 但需要保留一段时间, 用以为peer提供共识的证据
240 |
241 |
242 | 10. 额外增加的开销有多少
243 | 见5.2
244 |
245 |
246 | 11. 共识的速度真的能提升吗,如果BFT共识平均时间>500ms,BFT的高度是低于DPOS的
247 | 见5.1
248 |
249 |
250 | ## 8 参考
251 | [1] http://pmg.csail.mit.edu/papers/osdi99.pdf
252 |
--------------------------------------------------------------------------------
/k8s-bos/scripts/contracts/eosio.bios/eosio.bios.abi:
--------------------------------------------------------------------------------
1 | {
2 | "____comment": "This file was generated with eosio-abigen. DO NOT EDIT Thu Dec 13 11:20:33 2018",
3 | "version": "eosio::abi/1.1",
4 | "structs": [
5 | {
6 | "name": "abi_hash",
7 | "base": "",
8 | "fields": [
9 | {
10 | "name": "owner",
11 | "type": "name"
12 | },
13 | {
14 | "name": "hash",
15 | "type": "checksum256"
16 | }
17 | ]
18 | },
19 | {
20 | "name": "authority",
21 | "base": "",
22 | "fields": [
23 | {
24 | "name": "threshold",
25 | "type": "uint32"
26 | },
27 | {
28 | "name": "keys",
29 | "type": "key_weight[]"
30 | },
31 | {
32 | "name": "accounts",
33 | "type": "permission_level_weight[]"
34 | },
35 | {
36 | "name": "waits",
37 | "type": "wait_weight[]"
38 | }
39 | ]
40 | },
41 | {
42 | "name": "blockchain_parameters",
43 | "base": "",
44 | "fields": [
45 | {
46 | "name": "max_block_net_usage",
47 | "type": "uint64"
48 | },
49 | {
50 | "name": "target_block_net_usage_pct",
51 | "type": "uint32"
52 | },
53 | {
54 | "name": "max_transaction_net_usage",
55 | "type": "uint32"
56 | },
57 | {
58 | "name": "base_per_transaction_net_usage",
59 | "type": "uint32"
60 | },
61 | {
62 | "name": "net_usage_leeway",
63 | "type": "uint32"
64 | },
65 | {
66 | "name": "context_free_discount_net_usage_num",
67 | "type": "uint32"
68 | },
69 | {
70 | "name": "context_free_discount_net_usage_den",
71 | "type": "uint32"
72 | },
73 | {
74 | "name": "max_block_cpu_usage",
75 | "type": "uint32"
76 | },
77 | {
78 | "name": "target_block_cpu_usage_pct",
79 | "type": "uint32"
80 | },
81 | {
82 | "name": "max_transaction_cpu_usage",
83 | "type": "uint32"
84 | },
85 | {
86 | "name": "min_transaction_cpu_usage",
87 | "type": "uint32"
88 | },
89 | {
90 | "name": "max_transaction_lifetime",
91 | "type": "uint32"
92 | },
93 | {
94 | "name": "deferred_trx_expiration_window",
95 | "type": "uint32"
96 | },
97 | {
98 | "name": "max_transaction_delay",
99 | "type": "uint32"
100 | },
101 | {
102 | "name": "max_inline_action_size",
103 | "type": "uint32"
104 | },
105 | {
106 | "name": "max_inline_action_depth",
107 | "type": "uint16"
108 | },
109 | {
110 | "name": "max_authority_depth",
111 | "type": "uint16"
112 | }
113 | ]
114 | },
115 | {
116 | "name": "canceldelay",
117 | "base": "",
118 | "fields": [
119 | {
120 | "name": "canceling_auth",
121 | "type": "permission_level"
122 | },
123 | {
124 | "name": "trx_id",
125 | "type": "checksum256"
126 | }
127 | ]
128 | },
129 | {
130 | "name": "deleteauth",
131 | "base": "",
132 | "fields": [
133 | {
134 | "name": "account",
135 | "type": "name"
136 | },
137 | {
138 | "name": "permission",
139 | "type": "name"
140 | }
141 | ]
142 | },
143 | {
144 | "name": "key_weight",
145 | "base": "",
146 | "fields": [
147 | {
148 | "name": "key",
149 | "type": "public_key"
150 | },
151 | {
152 | "name": "weight",
153 | "type": "uint16"
154 | }
155 | ]
156 | },
157 | {
158 | "name": "linkauth",
159 | "base": "",
160 | "fields": [
161 | {
162 | "name": "account",
163 | "type": "name"
164 | },
165 | {
166 | "name": "code",
167 | "type": "name"
168 | },
169 | {
170 | "name": "type",
171 | "type": "name"
172 | },
173 | {
174 | "name": "requirement",
175 | "type": "name"
176 | }
177 | ]
178 | },
179 | {
180 | "name": "newaccount",
181 | "base": "",
182 | "fields": [
183 | {
184 | "name": "creator",
185 | "type": "name"
186 | },
187 | {
188 | "name": "newact",
189 | "type": "name"
190 | },
191 | {
192 | "name": "owner",
193 | "type": "authority"
194 | },
195 | {
196 | "name": "active",
197 | "type": "authority"
198 | }
199 | ]
200 | },
201 | {
202 | "name": "onerror",
203 | "base": "",
204 | "fields": [
205 | {
206 | "name": "sender_id",
207 | "type": "uint128"
208 | },
209 | {
210 | "name": "sent_trx",
211 | "type": "bytes"
212 | }
213 | ]
214 | },
215 | {
216 | "name": "permission_level",
217 | "base": "",
218 | "fields": [
219 | {
220 | "name": "actor",
221 | "type": "name"
222 | },
223 | {
224 | "name": "permission",
225 | "type": "name"
226 | }
227 | ]
228 | },
229 | {
230 | "name": "permission_level_weight",
231 | "base": "",
232 | "fields": [
233 | {
234 | "name": "permission",
235 | "type": "permission_level"
236 | },
237 | {
238 | "name": "weight",
239 | "type": "uint16"
240 | }
241 | ]
242 | },
243 | {
244 | "name": "producer_key",
245 | "base": "",
246 | "fields": [
247 | {
248 | "name": "producer_name",
249 | "type": "name"
250 | },
251 | {
252 | "name": "block_signing_key",
253 | "type": "public_key"
254 | }
255 | ]
256 | },
257 | {
258 | "name": "reqauth",
259 | "base": "",
260 | "fields": [
261 | {
262 | "name": "from",
263 | "type": "name"
264 | }
265 | ]
266 | },
267 | {
268 | "name": "setabi",
269 | "base": "",
270 | "fields": [
271 | {
272 | "name": "account",
273 | "type": "name"
274 | },
275 | {
276 | "name": "abi",
277 | "type": "bytes"
278 | }
279 | ]
280 | },
281 | {
282 | "name": "setalimits",
283 | "base": "",
284 | "fields": [
285 | {
286 | "name": "account",
287 | "type": "name"
288 | },
289 | {
290 | "name": "ram_bytes",
291 | "type": "int64"
292 | },
293 | {
294 | "name": "net_weight",
295 | "type": "int64"
296 | },
297 | {
298 | "name": "cpu_weight",
299 | "type": "int64"
300 | }
301 | ]
302 | },
303 | {
304 | "name": "setcode",
305 | "base": "",
306 | "fields": [
307 | {
308 | "name": "account",
309 | "type": "name"
310 | },
311 | {
312 | "name": "vmtype",
313 | "type": "uint8"
314 | },
315 | {
316 | "name": "vmversion",
317 | "type": "uint8"
318 | },
319 | {
320 | "name": "code",
321 | "type": "bytes"
322 | }
323 | ]
324 | },
325 | {
326 | "name": "setglimits",
327 | "base": "",
328 | "fields": [
329 | {
330 | "name": "ram",
331 | "type": "uint64"
332 | },
333 | {
334 | "name": "net",
335 | "type": "uint64"
336 | },
337 | {
338 | "name": "cpu",
339 | "type": "uint64"
340 | }
341 | ]
342 | },
343 | {
344 | "name": "setparams",
345 | "base": "",
346 | "fields": [
347 | {
348 | "name": "params",
349 | "type": "blockchain_parameters"
350 | }
351 | ]
352 | },
353 | {
354 | "name": "setpriv",
355 | "base": "",
356 | "fields": [
357 | {
358 | "name": "account",
359 | "type": "name"
360 | },
361 | {
362 | "name": "is_priv",
363 | "type": "uint8"
364 | }
365 | ]
366 | },
367 | {
368 | "name": "setprods",
369 | "base": "",
370 | "fields": [
371 | {
372 | "name": "schedule",
373 | "type": "producer_key[]"
374 | }
375 | ]
376 | },
377 | {
378 | "name": "unlinkauth",
379 | "base": "",
380 | "fields": [
381 | {
382 | "name": "account",
383 | "type": "name"
384 | },
385 | {
386 | "name": "code",
387 | "type": "name"
388 | },
389 | {
390 | "name": "type",
391 | "type": "name"
392 | }
393 | ]
394 | },
395 | {
396 | "name": "updateauth",
397 | "base": "",
398 | "fields": [
399 | {
400 | "name": "account",
401 | "type": "name"
402 | },
403 | {
404 | "name": "permission",
405 | "type": "name"
406 | },
407 | {
408 | "name": "parent",
409 | "type": "name"
410 | },
411 | {
412 | "name": "auth",
413 | "type": "authority"
414 | }
415 | ]
416 | },
417 | {
418 | "name": "wait_weight",
419 | "base": "",
420 | "fields": [
421 | {
422 | "name": "wait_sec",
423 | "type": "uint32"
424 | },
425 | {
426 | "name": "weight",
427 | "type": "uint16"
428 | }
429 | ]
430 | }
431 | ],
432 | "types": [],
433 | "actions": [
434 | {
435 | "name": "canceldelay",
436 | "type": "canceldelay",
437 | "ricardian_contract": ""
438 | },
439 | {
440 | "name": "deleteauth",
441 | "type": "deleteauth",
442 | "ricardian_contract": ""
443 | },
444 | {
445 | "name": "linkauth",
446 | "type": "linkauth",
447 | "ricardian_contract": ""
448 | },
449 | {
450 | "name": "newaccount",
451 | "type": "newaccount",
452 | "ricardian_contract": ""
453 | },
454 | {
455 | "name": "onerror",
456 | "type": "onerror",
457 | "ricardian_contract": ""
458 | },
459 | {
460 | "name": "reqauth",
461 | "type": "reqauth",
462 | "ricardian_contract": ""
463 | },
464 | {
465 | "name": "setabi",
466 | "type": "setabi",
467 | "ricardian_contract": ""
468 | },
469 | {
470 | "name": "setalimits",
471 | "type": "setalimits",
472 | "ricardian_contract": ""
473 | },
474 | {
475 | "name": "setcode",
476 | "type": "setcode",
477 | "ricardian_contract": ""
478 | },
479 | {
480 | "name": "setglimits",
481 | "type": "setglimits",
482 | "ricardian_contract": ""
483 | },
484 | {
485 | "name": "setparams",
486 | "type": "setparams",
487 | "ricardian_contract": ""
488 | },
489 | {
490 | "name": "setpriv",
491 | "type": "setpriv",
492 | "ricardian_contract": ""
493 | },
494 | {
495 | "name": "setprods",
496 | "type": "setprods",
497 | "ricardian_contract": ""
498 | },
499 | {
500 | "name": "unlinkauth",
501 | "type": "unlinkauth",
502 | "ricardian_contract": ""
503 | },
504 | {
505 | "name": "updateauth",
506 | "type": "updateauth",
507 | "ricardian_contract": ""
508 | }
509 | ],
510 | "tables": [
511 | {
512 | "name": "abihash",
513 | "type": "abi_hash",
514 | "index_type": "i64",
515 | "key_names": [],
516 | "key_types": []
517 | }
518 | ],
519 | "ricardian_clauses": [],
520 | "variants": [],
521 | "abi_extensions": []
522 | }
--------------------------------------------------------------------------------
/k8s-bos/scripts/contracts/eosio.bios/eosio.bios.wasm:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eosiosg/dpos-pbft/f5891e202a9692f8b8287dceb03f1f03a68e9fde/k8s-bos/scripts/contracts/eosio.bios/eosio.bios.wasm
--------------------------------------------------------------------------------
/k8s-bos/scripts/contracts/eosio.msig/eosio.msig.abi:
--------------------------------------------------------------------------------
1 | {
2 | "____comment": "This file was generated with eosio-abigen. DO NOT EDIT Sat Nov 24 16:47:00 2018",
3 | "version": "eosio::abi/1.1",
4 | "structs": [
5 | {
6 | "name": "action",
7 | "base": "",
8 | "fields": [
9 | {
10 | "name": "account",
11 | "type": "name"
12 | },
13 | {
14 | "name": "name",
15 | "type": "name"
16 | },
17 | {
18 | "name": "authorization",
19 | "type": "permission_level[]"
20 | },
21 | {
22 | "name": "data",
23 | "type": "bytes"
24 | }
25 | ]
26 | },
27 | {
28 | "name": "approval",
29 | "base": "",
30 | "fields": [
31 | {
32 | "name": "level",
33 | "type": "permission_level"
34 | },
35 | {
36 | "name": "time",
37 | "type": "time_point"
38 | }
39 | ]
40 | },
41 | {
42 | "name": "approvals_info",
43 | "base": "",
44 | "fields": [
45 | {
46 | "name": "version",
47 | "type": "uint8"
48 | },
49 | {
50 | "name": "proposal_name",
51 | "type": "name"
52 | },
53 | {
54 | "name": "requested_approvals",
55 | "type": "approval[]"
56 | },
57 | {
58 | "name": "provided_approvals",
59 | "type": "approval[]"
60 | }
61 | ]
62 | },
63 | {
64 | "name": "approve",
65 | "base": "",
66 | "fields": [
67 | {
68 | "name": "proposer",
69 | "type": "name"
70 | },
71 | {
72 | "name": "proposal_name",
73 | "type": "name"
74 | },
75 | {
76 | "name": "level",
77 | "type": "permission_level"
78 | },
79 | {
80 | "name": "proposal_hash",
81 | "type": "checksum256$"
82 | }
83 | ]
84 | },
85 | {
86 | "name": "cancel",
87 | "base": "",
88 | "fields": [
89 | {
90 | "name": "proposer",
91 | "type": "name"
92 | },
93 | {
94 | "name": "proposal_name",
95 | "type": "name"
96 | },
97 | {
98 | "name": "canceler",
99 | "type": "name"
100 | }
101 | ]
102 | },
103 | {
104 | "name": "exec",
105 | "base": "",
106 | "fields": [
107 | {
108 | "name": "proposer",
109 | "type": "name"
110 | },
111 | {
112 | "name": "proposal_name",
113 | "type": "name"
114 | },
115 | {
116 | "name": "executer",
117 | "type": "name"
118 | }
119 | ]
120 | },
121 | {
122 | "name": "extension",
123 | "base": "",
124 | "fields": [
125 | {
126 | "name": "type",
127 | "type": "uint16"
128 | },
129 | {
130 | "name": "data",
131 | "type": "bytes"
132 | }
133 | ]
134 | },
135 | {
136 | "name": "invalidate",
137 | "base": "",
138 | "fields": [
139 | {
140 | "name": "account",
141 | "type": "name"
142 | }
143 | ]
144 | },
145 | {
146 | "name": "invalidation",
147 | "base": "",
148 | "fields": [
149 | {
150 | "name": "account",
151 | "type": "name"
152 | },
153 | {
154 | "name": "last_invalidation_time",
155 | "type": "time_point"
156 | }
157 | ]
158 | },
159 | {
160 | "name": "old_approvals_info",
161 | "base": "",
162 | "fields": [
163 | {
164 | "name": "proposal_name",
165 | "type": "name"
166 | },
167 | {
168 | "name": "requested_approvals",
169 | "type": "permission_level[]"
170 | },
171 | {
172 | "name": "provided_approvals",
173 | "type": "permission_level[]"
174 | }
175 | ]
176 | },
177 | {
178 | "name": "permission_level",
179 | "base": "",
180 | "fields": [
181 | {
182 | "name": "actor",
183 | "type": "name"
184 | },
185 | {
186 | "name": "permission",
187 | "type": "name"
188 | }
189 | ]
190 | },
191 | {
192 | "name": "proposal",
193 | "base": "",
194 | "fields": [
195 | {
196 | "name": "proposal_name",
197 | "type": "name"
198 | },
199 | {
200 | "name": "packed_transaction",
201 | "type": "bytes"
202 | }
203 | ]
204 | },
205 | {
206 | "name": "propose",
207 | "base": "",
208 | "fields": [
209 | {
210 | "name": "proposer",
211 | "type": "name"
212 | },
213 | {
214 | "name": "proposal_name",
215 | "type": "name"
216 | },
217 | {
218 | "name": "requested",
219 | "type": "permission_level[]"
220 | },
221 | {
222 | "name": "trx",
223 | "type": "transaction"
224 | }
225 | ]
226 | },
227 | {
228 | "name": "transaction",
229 | "base": "transaction_header",
230 | "fields": [
231 | {
232 | "name": "context_free_actions",
233 | "type": "action[]"
234 | },
235 | {
236 | "name": "actions",
237 | "type": "action[]"
238 | },
239 | {
240 | "name": "transaction_extensions",
241 | "type": "extension[]"
242 | }
243 | ]
244 | },
245 | {
246 | "name": "transaction_header",
247 | "base": "",
248 | "fields": [
249 | {
250 | "name": "expiration",
251 | "type": "time_point_sec"
252 | },
253 | {
254 | "name": "ref_block_num",
255 | "type": "uint16"
256 | },
257 | {
258 | "name": "ref_block_prefix",
259 | "type": "uint32"
260 | },
261 | {
262 | "name": "max_net_usage_words",
263 | "type": "varuint32"
264 | },
265 | {
266 | "name": "max_cpu_usage_ms",
267 | "type": "uint8"
268 | },
269 | {
270 | "name": "delay_sec",
271 | "type": "varuint32"
272 | }
273 | ]
274 | },
275 | {
276 | "name": "unapprove",
277 | "base": "",
278 | "fields": [
279 | {
280 | "name": "proposer",
281 | "type": "name"
282 | },
283 | {
284 | "name": "proposal_name",
285 | "type": "name"
286 | },
287 | {
288 | "name": "level",
289 | "type": "permission_level"
290 | }
291 | ]
292 | }
293 | ],
294 | "types": [],
295 | "actions": [
296 | {
297 | "name": "approve",
298 | "type": "approve",
299 | "ricardian_contract": ""
300 | },
301 | {
302 | "name": "cancel",
303 | "type": "cancel",
304 | "ricardian_contract": ""
305 | },
306 | {
307 | "name": "exec",
308 | "type": "exec",
309 | "ricardian_contract": ""
310 | },
311 | {
312 | "name": "invalidate",
313 | "type": "invalidate",
314 | "ricardian_contract": ""
315 | },
316 | {
317 | "name": "propose",
318 | "type": "propose",
319 | "ricardian_contract": ""
320 | },
321 | {
322 | "name": "unapprove",
323 | "type": "unapprove",
324 | "ricardian_contract": ""
325 | }
326 | ],
327 | "tables": [
328 | {
329 | "name": "approvals",
330 | "type": "old_approvals_info",
331 | "index_type": "i64",
332 | "key_names": [],
333 | "key_types": []
334 | },
335 | {
336 | "name": "approvals2",
337 | "type": "approvals_info",
338 | "index_type": "i64",
339 | "key_names": [],
340 | "key_types": []
341 | },
342 | {
343 | "name": "invals",
344 | "type": "invalidation",
345 | "index_type": "i64",
346 | "key_names": [],
347 | "key_types": []
348 | },
349 | {
350 | "name": "proposal",
351 | "type": "proposal",
352 | "index_type": "i64",
353 | "key_names": [],
354 | "key_types": []
355 | }
356 | ],
357 | "ricardian_clauses": [],
358 | "variants": [],
359 | "abi_extensions": []
360 | }
--------------------------------------------------------------------------------
/k8s-bos/scripts/contracts/eosio.msig/eosio.msig.wasm:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eosiosg/dpos-pbft/f5891e202a9692f8b8287dceb03f1f03a68e9fde/k8s-bos/scripts/contracts/eosio.msig/eosio.msig.wasm
--------------------------------------------------------------------------------
/k8s-bos/scripts/contracts/eosio.system/eosio.system.wasm:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eosiosg/dpos-pbft/f5891e202a9692f8b8287dceb03f1f03a68e9fde/k8s-bos/scripts/contracts/eosio.system/eosio.system.wasm
--------------------------------------------------------------------------------
/k8s-bos/scripts/contracts/eosio.token/eosio.token.abi:
--------------------------------------------------------------------------------
1 | {
2 | "____comment": "This file was generated with eosio-abigen. DO NOT EDIT Sat Nov 24 16:47:08 2018",
3 | "version": "eosio::abi/1.1",
4 | "structs": [
5 | {
6 | "name": "account",
7 | "base": "",
8 | "fields": [
9 | {
10 | "name": "balance",
11 | "type": "asset"
12 | }
13 | ]
14 | },
15 | {
16 | "name": "close",
17 | "base": "",
18 | "fields": [
19 | {
20 | "name": "owner",
21 | "type": "name"
22 | },
23 | {
24 | "name": "symbol",
25 | "type": "symbol"
26 | }
27 | ]
28 | },
29 | {
30 | "name": "create",
31 | "base": "",
32 | "fields": [
33 | {
34 | "name": "issuer",
35 | "type": "name"
36 | },
37 | {
38 | "name": "maximum_supply",
39 | "type": "asset"
40 | }
41 | ]
42 | },
43 | {
44 | "name": "currency_stats",
45 | "base": "",
46 | "fields": [
47 | {
48 | "name": "supply",
49 | "type": "asset"
50 | },
51 | {
52 | "name": "max_supply",
53 | "type": "asset"
54 | },
55 | {
56 | "name": "issuer",
57 | "type": "name"
58 | }
59 | ]
60 | },
61 | {
62 | "name": "issue",
63 | "base": "",
64 | "fields": [
65 | {
66 | "name": "to",
67 | "type": "name"
68 | },
69 | {
70 | "name": "quantity",
71 | "type": "asset"
72 | },
73 | {
74 | "name": "memo",
75 | "type": "string"
76 | }
77 | ]
78 | },
79 | {
80 | "name": "open",
81 | "base": "",
82 | "fields": [
83 | {
84 | "name": "owner",
85 | "type": "name"
86 | },
87 | {
88 | "name": "symbol",
89 | "type": "symbol"
90 | },
91 | {
92 | "name": "ram_payer",
93 | "type": "name"
94 | }
95 | ]
96 | },
97 | {
98 | "name": "retire",
99 | "base": "",
100 | "fields": [
101 | {
102 | "name": "quantity",
103 | "type": "asset"
104 | },
105 | {
106 | "name": "memo",
107 | "type": "string"
108 | }
109 | ]
110 | },
111 | {
112 | "name": "transfer",
113 | "base": "",
114 | "fields": [
115 | {
116 | "name": "from",
117 | "type": "name"
118 | },
119 | {
120 | "name": "to",
121 | "type": "name"
122 | },
123 | {
124 | "name": "quantity",
125 | "type": "asset"
126 | },
127 | {
128 | "name": "memo",
129 | "type": "string"
130 | }
131 | ]
132 | }
133 | ],
134 | "types": [],
135 | "actions": [
136 | {
137 | "name": "close",
138 | "type": "close",
139 | "ricardian_contract": ""
140 | },
141 | {
142 | "name": "create",
143 | "type": "create",
144 | "ricardian_contract": ""
145 | },
146 | {
147 | "name": "issue",
148 | "type": "issue",
149 | "ricardian_contract": ""
150 | },
151 | {
152 | "name": "open",
153 | "type": "open",
154 | "ricardian_contract": ""
155 | },
156 | {
157 | "name": "retire",
158 | "type": "retire",
159 | "ricardian_contract": ""
160 | },
161 | {
162 | "name": "transfer",
163 | "type": "transfer",
164 | "ricardian_contract": ""
165 | }
166 | ],
167 | "tables": [
168 | {
169 | "name": "accounts",
170 | "type": "account",
171 | "index_type": "i64",
172 | "key_names": [],
173 | "key_types": []
174 | },
175 | {
176 | "name": "stat",
177 | "type": "currency_stats",
178 | "index_type": "i64",
179 | "key_names": [],
180 | "key_types": []
181 | }
182 | ],
183 | "ricardian_clauses": [],
184 | "variants": [],
185 | "abi_extensions": []
186 | }
--------------------------------------------------------------------------------
/k8s-bos/scripts/contracts/eosio.token/eosio.token.wasm:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eosiosg/dpos-pbft/f5891e202a9692f8b8287dceb03f1f03a68e9fde/k8s-bos/scripts/contracts/eosio.token/eosio.token.wasm
--------------------------------------------------------------------------------
/k8s-bos/scripts/contracts/eosio.wrap/eosio.wrap.abi:
--------------------------------------------------------------------------------
1 | {
2 | "____comment": "This file was generated with eosio-abigen. DO NOT EDIT Sat Nov 24 16:46:52 2018",
3 | "version": "eosio::abi/1.1",
4 | "structs": [
5 | {
6 | "name": "action",
7 | "base": "",
8 | "fields": [
9 | {
10 | "name": "account",
11 | "type": "name"
12 | },
13 | {
14 | "name": "name",
15 | "type": "name"
16 | },
17 | {
18 | "name": "authorization",
19 | "type": "permission_level[]"
20 | },
21 | {
22 | "name": "data",
23 | "type": "bytes"
24 | }
25 | ]
26 | },
27 | {
28 | "name": "exec",
29 | "base": "",
30 | "fields": [
31 | {
32 | "name": "executer",
33 | "type": "name"
34 | },
35 | {
36 | "name": "trx",
37 | "type": "transaction"
38 | }
39 | ]
40 | },
41 | {
42 | "name": "extension",
43 | "base": "",
44 | "fields": [
45 | {
46 | "name": "type",
47 | "type": "uint16"
48 | },
49 | {
50 | "name": "data",
51 | "type": "bytes"
52 | }
53 | ]
54 | },
55 | {
56 | "name": "permission_level",
57 | "base": "",
58 | "fields": [
59 | {
60 | "name": "actor",
61 | "type": "name"
62 | },
63 | {
64 | "name": "permission",
65 | "type": "name"
66 | }
67 | ]
68 | },
69 | {
70 | "name": "transaction",
71 | "base": "transaction_header",
72 | "fields": [
73 | {
74 | "name": "context_free_actions",
75 | "type": "action[]"
76 | },
77 | {
78 | "name": "actions",
79 | "type": "action[]"
80 | },
81 | {
82 | "name": "transaction_extensions",
83 | "type": "extension[]"
84 | }
85 | ]
86 | },
87 | {
88 | "name": "transaction_header",
89 | "base": "",
90 | "fields": [
91 | {
92 | "name": "expiration",
93 | "type": "time_point_sec"
94 | },
95 | {
96 | "name": "ref_block_num",
97 | "type": "uint16"
98 | },
99 | {
100 | "name": "ref_block_prefix",
101 | "type": "uint32"
102 | },
103 | {
104 | "name": "max_net_usage_words",
105 | "type": "varuint32"
106 | },
107 | {
108 | "name": "max_cpu_usage_ms",
109 | "type": "uint8"
110 | },
111 | {
112 | "name": "delay_sec",
113 | "type": "varuint32"
114 | }
115 | ]
116 | }
117 | ],
118 | "types": [],
119 | "actions": [
120 | {
121 | "name": "exec",
122 | "type": "exec",
123 | "ricardian_contract": ""
124 | }
125 | ],
126 | "tables": [],
127 | "ricardian_clauses": [],
128 | "variants": [],
129 | "abi_extensions": []
130 | }
--------------------------------------------------------------------------------
/k8s-bos/scripts/contracts/eosio.wrap/eosio.wrap.wasm:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eosiosg/dpos-pbft/f5891e202a9692f8b8287dceb03f1f03a68e9fde/k8s-bos/scripts/contracts/eosio.wrap/eosio.wrap.wasm
--------------------------------------------------------------------------------
/k8s-bos/scripts/cron-vote.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | # set -ex
4 |
5 | SELECTED=()
6 |
7 | shuffle_and_select_bps(){
8 | N=7
9 | # N=21
10 | # BPS=( bpa bpb bpc bpd bpe bpf bpg bph bpi bpj bpk bpl bpm bpn bpo bpp bpq bpr bps bpt bpu bpv bpw bpx bpy bpz )
11 | BPS=( bpa bpb bpc bpd bpe bpf bpg bph bpi )
12 | tmp=()
13 | for index in $(shuf --input-range=0-$(( ${#BPS[*]} - 1 )) -n ${N})
14 | do
15 | tmp+=(${BPS[$index]})
16 | done
17 | SELECTED=($(echo "${tmp[@]}" | sed 's/ /\n/g' | sort))
18 | }
19 |
20 | shuffle_and_select_bps
21 | # new_array=($(echo "${SELECTED[@]}" | sed 's/ /\n/g' | sort))
22 | echo ${SELECTED[@]}
23 |
24 | while :
25 | do
26 | shuffle_and_select_bps
27 | cleos $remote system voteproducer prods voter ${SELECTED[*]} -p voter
28 | echo "sleep 10 seconds"
29 | sleep 10
30 | done
31 |
32 |
33 |
34 | # N=11
35 | # BPS=( bpa bpb bpc bpd bpe bpf bpg bph bpi bpj bpk bpl bpm bpn )
36 | # SELECTED=()
37 | # for index in $(shuf --input-range=0-$(( ${#BPS[*]} - 1 )) -n ${N})
38 | # do
39 | # echo "selecte: ${BPS[$index]}"
40 | # SELECTED+=(${BPS[$index]})
41 | # done
42 | #
43 | # echo ${BPS[*]}
44 | # echo ${SELECTED[*]}
45 | #
46 | # while :
47 | # do
48 | # cleos $remote system voteproducer prods voter -p voter
49 | # echo "sleep 120 seconds"
50 | # sleep 120
51 | #
52 | # cleos $remote system voteproducer prods voter -p voter
53 | # echo "sleep 120 seconds"
54 | # sleep 120
55 | #
56 | # cleos $remote system voteproducer prods voter -p voter
57 | # echo "sleep 120 seconds"
58 | # sleep 120
59 | #
60 | # done
61 | # bpa bpb bpc bpd bpe bpf bpg bph bpi bpj bpk bpl bpm bpn
62 |
--------------------------------------------------------------------------------
/k8s-bos/scripts/env.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | export remote="-u http://127.0.0.1:8888"
4 |
--------------------------------------------------------------------------------
/k8s-bos/scripts/start.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | #import eosio key
4 | cleos wallet import --private-key 5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3
5 |
6 | # deploy bios
7 | cleos $remote set contract eosio ./contracts/eosio.bios/ eosio.bios.wasm eosio.bios.abi -p eosio
8 |
9 | # create system account
10 | SYSTEM_ACCOUNT="eosio.bpay eosio.msig eosio.names eosio.ram eosio.ramfee eosio.saving eosio.stake eosio.token eosio.vpay"
11 |
12 | for sa in $SYSTEM_ACCOUNT
13 | do
14 | echo $sa
15 | cleos $remote create account eosio $sa EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV -p eosio
16 | done
17 |
18 | # deploy token contract and issue
19 | cleos $remote set contract eosio.token ./contracts/eosio.token eosio.token.wasm eosio.token.abi -p eosio.token
20 |
21 | cleos $remote push action eosio.token create '["eosio", "10000000000.0000 BOS", 0, 0, 0]' -p eosio.token
22 | cleos $remote push action eosio.token issue '["eosio", "1000000000.0000 BOS", "issue 1B to eosio"]' -p eosio
23 |
24 |
25 | # deploy msig contract
26 | cleos $remote set contract eosio.msig ./contracts/eosio.msig eosio.msig.wasm eosio.msig.abi -p eosio.msig
27 |
28 | # deploy system contract
29 | cleos $remote set contract eosio ./contracts/eosio.system eosio.system.wasm eosio.system.abi -p eosio
30 | cleos $remote push action eosio init '{"version": 0, "core": "4,BOS"}' -p eosio
31 |
32 | cleos $remote system newaccount eosio voter EOS54HgSQ9d6qjUT7pEZgbP83zQpcymR4QW1jz2jPDEdbAeKGaUif EOS54HgSQ9d6qjUT7pEZgbP83zQpcymR4QW1jz2jPDEdbAeKGaUif --stake-net "10 BOS" --stake-cpu "10 BOS" --buy-ram-kbytes 10000
33 | cleos wallet import --private-key 5KE3vxAZ5tBXubjMeFJ9uCHHjfQeAzDqPLeW4XHGVcuKHPPLCrA
34 | cleos $remote transfer eosio voter "200000000.0000 BOS" "transfer 200M to voter"
35 | sleep 2 ;
36 | cleos $remote system delegatebw voter voter '100000000.0000 BOS' '100000000.0000 BOS' -p voter
37 |
38 |
39 |
40 | #cleos $remote push action eosio setpriv '["eosio.msig",1]' -p eosio
41 |
42 | # create bps
43 | ACCOUNTS="bpa bpb bpc bpd bpe bpf bpg bph bpi bpj bpk bpl bpm bpn bpo bpp bpq bpr bps bpt bpu bpv bpw bpx bpy bpz"
44 |
45 | for acc in $ACCOUNTS
46 | do
47 | echo $acc
48 | cleos $remote system newaccount eosio $acc EOS54HgSQ9d6qjUT7pEZgbP83zQpcymR4QW1jz2jPDEdbAeKGaUif EOS54HgSQ9d6qjUT7pEZgbP83zQpcymR4QW1jz2jPDEdbAeKGaUif --stake-cpu "10 BOS" --stake-net "10 BOS" --buy-ram "10 BOS" -p eosio
49 | cleos $remote transfer eosio $acc "1000 BOS" "red packet" -p eosio
50 | done
51 |
52 | cleos $remote system regproducer bpa EOS5ZMVRKjoxdqwy3eDQkLF53uYRSvTvW8EijsD47NAkbq5GbmSH3 '' 0 -p bpa
53 | cleos $remote system regproducer bpb EOS7WKuVc8R8X5zrfTRKbhbZuaJPKRYZqQQ6qXoXQfeS8iGK4afyk '' 0 -p bpb
54 | cleos $remote system regproducer bpc EOS73iZuyLajqCK2WDGAmYMUb4Zr3hmpDeNSJvKJwDVkgoHcvMpjW '' 0 -p bpc
55 | cleos $remote system regproducer bpd EOS84pKNhrH712xbjAwst9yW7nBZenAd3eZs6PYZuPYu6Y2PfC84p '' 0 -p bpd
56 | cleos $remote system regproducer bpe EOS5nfo8X8NvHtNA8cTDSi2mdSFuBcUHtQ1ZyTdxocVtQTHjakdMg '' 0 -p bpe
57 | cleos $remote system regproducer bpf EOS5MUtpyHQsH41rdfU6LG3urrGLozaR4i4N1Mkj39D3zyBwtw4rU '' 0 -p bpf
58 | cleos $remote system regproducer bpg EOS6USJq2xnmsBpvoJjFcefLCtxeEvoCQTTwSqbvRg79UeCdNGzB6 '' 0 -p bpg
59 | cleos $remote system regproducer bph EOS52rUogvuR7RjA7EHaPomAxPr4iKkGxFFFk83Mc24SusUGQxBvk '' 0 -p bph
60 | cleos $remote system regproducer bpi EOS66RMTqXUDn7osZ2feCFZgBMEib4QNUzs9zLqTF4g2kTXWVstpg '' 0 -p bpi
61 | cleos $remote system regproducer bpj EOS5iLrUhakDpFCNHcmrxv6xiYG3XQDTHEGt9jbJZorj1VB1LbzNX '' 0 -p bpj
62 | cleos $remote system regproducer bpk EOS5dnfLiLQHHvBd4GqWVrVT9KtUvT1Kfm6EUMC2jXbSdVuypUGKk '' 0 -p bpk
63 | cleos $remote system regproducer bpl EOS6qdG6S7Ev8uYEXD3nFxVvBU7iuP5F2WoYboZNvaG814nfgYiDN '' 0 -p bpl
64 | cleos $remote system regproducer bpm EOS7YyTzTxxR87hrvNtYat5UGojJGxm3ikvPQP68KMav2WBwwA9ic '' 0 -p bpm
65 | cleos $remote system regproducer bpn EOS6mA2BxGKbEiwDbbDPhQ1vqV4bAps49PfXuvadb8Vc4REJw1V3h '' 0 -p bpn
66 | cleos $remote system regproducer bpo EOS7XfCLNwreuApLd1RnTSCHwZEs3BKVDp4G5uk49en6whkjnVZ6G '' 0 -p bpo
67 | cleos $remote system regproducer bpp EOS7435EQ76dweLSHa4XBtwTVL9MVqGW1d9sm6SNPHkeEkDSp2e84 '' 0 -p bpp
68 | cleos $remote system regproducer bpq EOS5tDFbEzjpxktdCZZgH1wERjYPHajH3LcH9TVjCF6iSJ6EVAr9t '' 0 -p bpq
69 | cleos $remote system regproducer bpr EOS6FqJDxVzNh5CNnmktB4s2qiLzKUTH8SCjKRNTyHSYxsasdnZVA '' 0 -p bpr
70 | cleos $remote system regproducer bpt EOS5zcM9Dweb3s96G7eY8N1FmBP98uhdSXHgAG78kJBsqyamBDvSh '' 0 -p bpt
71 | cleos $remote system regproducer bps EOS6CyP5JLTnJ353wXdggayRm8wDMQ5YA3hVwSQ1rwVJ9Q9rsnT1x '' 0 -p bps
72 | cleos $remote system regproducer bpu EOS5GVbsUDmuuEnQFNJdoPBTNPXhzTqRFKz6d1zgRPmdrXxg6obuL '' 0 -p bpu
73 | cleos $remote system regproducer bpv EOS885TY14LT21h8ieV2Krxpahf17TnuCJm2wbHpWrhNcUgYUdcb3 '' 0 -p bpv
74 | cleos $remote system regproducer bpw EOS7zVNTpr9PfLzTYybnWMn8KsMCtpsNu842rPRMxQiAAm4KFjyn1 '' 0 -p bpw
75 | cleos $remote system regproducer bpx EOS8RufiWCXVUrSfGPirnS8zGp4nRkbZwX9ykakviAnrnP5i6mE9Y '' 0 -p bpx
76 | cleos $remote system regproducer bpy EOS54bVNK7hvwKuhyeBTTyZpucD6LkXN6Bzw5NspoTkMaojo3poch '' 0 -p bpy
77 | cleos $remote system regproducer bpz EOS6S5QYtt7choB6EYc7yAwUMVeBXQDhx3BR36VRhFkhwpfURr6SP '' 0 -p bpz
78 |
--------------------------------------------------------------------------------
/k8s-bos/src/gcp/apply.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | kustomize build . | kubectl apply -f -
4 |
--------------------------------------------------------------------------------
/k8s-bos/src/gcp/delete.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | kustomize build . | kubectl delete -f -
4 |
--------------------------------------------------------------------------------
/k8s-bos/src/gcp/kustomization.yaml:
--------------------------------------------------------------------------------
1 | commonLabels:
2 | app: nodes
3 | bases:
4 | - ../n-nodes
5 | resources:
6 | - storageclass.yaml
7 | patches:
8 | - statefulsets.yaml
9 | - storageclass.yaml
10 | - monitor.yaml
11 |
--------------------------------------------------------------------------------
/k8s-bos/src/gcp/mannual_delete_pod.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | for i in {25..0..-1}; do kubectl delete pod bp-$i; done
4 | for i in {8..0..-1}; do kubectl delete pod node-$i; done
5 |
--------------------------------------------------------------------------------
/k8s-bos/src/gcp/monitor.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: apps/v1
2 | kind: ReplicaSet
3 | metadata:
4 | name: monitor
5 | spec:
6 | replicas: 1
7 | template:
8 | metadata:
9 | name: monitor
10 | labels:
11 | app: nodes
12 | name: monitor
13 | spec:
14 | containers:
15 | - name: monitor
16 | image: deadlock/node-monitor:gcp
17 | imagePullPolicy: Always
18 | ports:
19 | - containerPort: 7700
20 |
--------------------------------------------------------------------------------
/k8s-bos/src/gcp/service.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: v1
2 | kind: Service
3 | metadata:
4 | name: monitor
5 | spec:
6 | ports:
7 | - port: 80
8 | targetPort: 7700
9 | protocol: TCP
10 | selector:
11 | name: monitor
12 | type: LoadBalancer
13 | loadBalancerIP: "35.229.237.194"
14 |
--------------------------------------------------------------------------------
/k8s-bos/src/gcp/statefulsets.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: apps/v1
2 | kind: StatefulSet
3 | metadata:
4 | name: eosio
5 | spec:
6 | selector:
7 | matchLabels:
8 | app: nodes
9 | serviceName: nodes
10 | replicas: 1
11 | template:
12 | spec:
13 | terminationGracePeriodSeconds: 600
14 | containers:
15 | - name: eosio
16 | image: deadlock/eos-dpos-pbft:bos-v0.6.0
17 | volumeMounts:
18 | - name: data-dir
19 | mountPath: /root/.local/share/eosio/nodeos/data
20 | volumeClaimTemplates:
21 | - metadata:
22 | name: data-dir
23 | spec:
24 | accessModes:
25 | - ReadWriteOnce
26 | storageClassName: slow
27 | resources:
28 | requests:
29 | storage: 1Gi
30 |
31 | ---
32 |
33 | apiVersion: apps/v1
34 | kind: StatefulSet
35 | metadata:
36 | name: bp
37 | spec:
38 | selector:
39 | matchLabels:
40 | app: nodes
41 | serviceName: nodes
42 | replicas: 0
43 | template:
44 | metadata:
45 | labels:
46 | app: nodes
47 | spec:
48 | terminationGracePeriodSeconds: 600
49 | containers:
50 | - name: bp
51 | image: deadlock/eos-dpos-pbft:bos-v0.6.0
52 | volumeMounts:
53 | - name: n-nodes-config-config-ini
54 | mountPath: /root/.local/share/eosio/nodeos/config/config.ini
55 | subPath: config.ini
56 | - name: data-dir
57 | mountPath: /root/.local/share/eosio/nodeos/data
58 | volumes:
59 | - name: n-nodes-config-config-ini
60 | configMap:
61 | name: n-nodes-config
62 | volumeClaimTemplates:
63 | - metadata:
64 | name: data-dir
65 | spec:
66 | accessModes:
67 | - ReadWriteOnce
68 | storageClassName: slow
69 | resources:
70 | requests:
71 | storage: 1Gi
72 |
73 | ---
74 |
75 | apiVersion: apps/v1
76 | kind: StatefulSet
77 | metadata:
78 | name: node
79 | spec:
80 | selector:
81 | matchLabels:
82 | app: nodes
83 | serviceName: nodes
84 | replicas: 0
85 | template:
86 | metadata:
87 | labels:
88 | app: nodes
89 | spec:
90 | terminationGracePeriodSeconds: 1
91 | containers:
92 | - name: node
93 | image: deadlock/eos-dpos-pbft:bos-v0.6.0
94 | volumeMounts:
95 | - name: n-nodes-config-config-ini
96 | mountPath: /root/.local/share/eosio/nodeos/config/config.ini
97 | subPath: config.ini
98 | - name: data-dir
99 | mountPath: /root/.local/share/eosio/nodeos/data
100 | volumes:
101 | - name: n-nodes-config-config-ini
102 | configMap:
103 | name: n-nodes-config
104 | volumeClaimTemplates:
105 | - metadata:
106 | name: data-dir
107 | spec:
108 | accessModes:
109 | - ReadWriteOnce
110 | storageClassName: slow
111 | resources:
112 | requests:
113 | storage: 1Gi
114 |
--------------------------------------------------------------------------------
/k8s-bos/src/gcp/storageclass.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: storage.k8s.io/v1
2 | kind: StorageClass
3 | metadata:
4 | name: slow
5 | provisioner: kubernetes.io/gce-pd
6 | parameters:
7 | type: pd-standard
8 |
--------------------------------------------------------------------------------
/k8s-bos/src/localhost/apply.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | kustomize build . | kubectl apply -f -
4 |
--------------------------------------------------------------------------------
/k8s-bos/src/localhost/delete.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | kustomize build . | kubectl delete -f -
4 |
--------------------------------------------------------------------------------
/k8s-bos/src/localhost/kustomization.yaml:
--------------------------------------------------------------------------------
1 | commonLabels:
2 | app: nodes
3 | bases:
4 | - ../n-nodes
5 | patches:
6 | - statefulsets.yaml
7 |
--------------------------------------------------------------------------------
/k8s-bos/src/localhost/mannual_delete_pod.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | for i in {25..0..-1}; do kubectl delete pod bp-$i; done
4 | for i in {8..0..-1}; do kubectl delete pod node-$i; done
5 |
--------------------------------------------------------------------------------
/k8s-bos/src/localhost/statefulsets.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: apps/v1
2 | kind: StatefulSet
3 | metadata:
4 | name: eosio
5 | spec:
6 | selector:
7 | matchLabels:
8 | app: nodes
9 | serviceName: nodes
10 | replicas: 1
11 | template:
12 | spec:
13 | terminationGracePeriodSeconds: 600
14 | containers:
15 | - name: eosio
16 | image: deadlock/eos-dpos-pbft:bos-v0.6.0
17 | volumes:
18 | - name: data-dir
19 | emptyDir: {}
20 | volumeClaimTemplates: []
21 |
22 | ---
23 |
24 | apiVersion: apps/v1
25 | kind: StatefulSet
26 | metadata:
27 | name: bp
28 | spec:
29 | selector:
30 | matchLabels:
31 | app: nodes
32 | serviceName: nodes
33 | replicas: 26
34 | template:
35 | spec:
36 | terminationGracePeriodSeconds: 600
37 | containers:
38 | - name: bp
39 | image: deadlock/eos-dpos-pbft:bos-v0.6.0
40 | volumes:
41 | - name: n-nodes-config-config-ini
42 | configMap:
43 | name: n-nodes-config
44 | - name: data-dir
45 | emptyDir: {}
46 | volumeClaimTemplates: []
47 |
48 | ---
49 |
50 | apiVersion: apps/v1
51 | kind: StatefulSet
52 | metadata:
53 | name: node
54 | spec:
55 | selector:
56 | matchLabels:
57 | app: nodes
58 | serviceName: nodes
59 | replicas: 9
60 | template:
61 | spec:
62 | terminationGracePeriodSeconds: 600
63 | containers:
64 | - name: node
65 | image: deadlock/eos-dpos-pbft:bos-v0.6.0
66 | volumes:
67 | - name: n-nodes-config-config-ini
68 | configMap:
69 | name: n-nodes-config
70 | - name: data-dir
71 | emptyDir: {}
72 | volumeClaimTemplates: []
73 |
--------------------------------------------------------------------------------
/k8s-bos/src/n-nodes/kustomization.yaml:
--------------------------------------------------------------------------------
1 | commonLabels:
2 | app: nodes
3 | resources:
4 | - configmap.yaml
5 | - monitor.yaml
6 | - service.yaml
7 | - statefulsets.yaml
8 | - tps.yaml
9 |
--------------------------------------------------------------------------------
/k8s-bos/src/n-nodes/monitor.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: apps/v1
2 | kind: ReplicaSet
3 | metadata:
4 | name: monitor
5 | spec:
6 | selector:
7 | matchLabels:
8 | app: nodes
9 | replicas: 1
10 | template:
11 | metadata:
12 | name: monitor
13 | labels:
14 | app: nodes
15 | name: monitor
16 | spec:
17 | containers:
18 | - name: monitor
19 | image: deadlock/node-monitor:localhost
20 | ports:
21 | - containerPort: 7700
22 |
--------------------------------------------------------------------------------
/k8s-bos/src/n-nodes/service.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: v1
2 | kind: Service
3 | metadata:
4 | name: nodes
5 | labels:
6 | app: nodes
7 | spec:
8 | ports:
9 | - port: 8888
10 | protocol: TCP
11 | clusterIP: None
12 | selector:
13 | app: nodes
14 |
15 | ---
16 |
17 | apiVersion: v1
18 | kind: Service
19 | metadata:
20 | name: loadbalancer
21 | spec:
22 | selector:
23 | app: nodes
24 | name: node
25 | ports:
26 | - name: p2p
27 | protocol: TCP
28 | port: 9876
29 | targetPort: 9876
30 | - name: api
31 | protocol: TCP
32 | port: 8888
33 | targetPort: 8888
34 | type: LoadBalancer
35 |
36 | ---
37 | apiVersion: v1
38 | kind: Service
39 | metadata:
40 | name: monitor
41 | spec:
42 | ports:
43 | - port: 80
44 | targetPort: 7700
45 | protocol: TCP
46 | selector:
47 | name: monitor
48 | type: LoadBalancer
49 |
--------------------------------------------------------------------------------
/k8s-bos/src/n-nodes/statefulsets.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: apps/v1
2 | kind: StatefulSet
3 | metadata:
4 | name: eosio
5 | spec:
6 | selector:
7 | matchLabels:
8 | app: nodes
9 | serviceName: nodes
10 | replicas: 0
11 | template:
12 | metadata:
13 | labels:
14 | app: nodes
15 | producer: eosio
16 | spec:
17 | terminationGracePeriodSeconds: 600
18 | containers:
19 | - name: eosio
20 | image: deadlock/eos-dpos-pbft:bos-v0.6.0
21 | # resources:
22 | # limits:
23 | # cpu: "1"
24 | # requests:
25 | # cpu: "1"
26 | ports:
27 | - containerPort: 8888
28 | - containerPort: 9876
29 | envFrom:
30 | - configMapRef:
31 | name: n-nodes-config
32 | command: ["/bin/bash", "-c"]
33 | args:
34 | - export profile_id=${HOSTNAME##*-} ;
35 | export profile_name=eosio ;
36 | nodeos --producer-name=${profile_name} ${!profile_name} ;
37 | lifecycle:
38 | preStop:
39 | exec:
40 | command:
41 | - /bin/bash
42 | - -c
43 | - pkill nodeos ; while kill -0 8 2>/dev/null ; do sleep 1; done;
44 | volumeMounts:
45 | - name: data-dir
46 | mountPath: /root/.local/share/eosio/nodeos/data
47 |
48 | ---
49 |
50 | apiVersion: apps/v1
51 | kind: StatefulSet
52 | metadata:
53 | name: bp
54 | spec:
55 | selector:
56 | matchLabels:
57 | app: nodes
58 | serviceName: nodes
59 | replicas: 0
60 | template:
61 | metadata:
62 | labels:
63 | app: nodes
64 | name: bp
65 | spec:
66 | terminationGracePeriodSeconds: 600
67 | containers:
68 | - name: bp
69 | image: deadlock/eos-dpos-pbft:bos-v0.6.0
70 | # resources:
71 | # limits:
72 | # cpu: "1"
73 | # requests:
74 | # cpu: "1"
75 | ports:
76 | - containerPort: 8888
77 | - containerPort: 9876
78 | envFrom:
79 | - configMapRef:
80 | name: n-nodes-config
81 | command: ["/bin/bash", "-c"]
82 | args:
83 | - export profile_id=${HOSTNAME##*-} ;
84 | export abc=(bpa bpb bpc bpd bpe bpf bpg bph bpi bpj bpk bpl bpm bpn bpo bpp bpq bpr bps bpt bpu bpv bpw bpx bpy bpz) ;
85 | export profile_name=${abc[$profile_id]} ;
86 | nodeos --producer-name=${profile_name} ${!profile_name} ;
87 | lifecycle:
88 | preStop:
89 | exec:
90 | command:
91 | - sh
92 | - -c
93 | - pkill nodeos ; while kill -0 8 2>/dev/null ; do sleep 1; done;
94 | volumeMounts:
95 | - name: n-nodes-config-config-ini
96 | mountPath: /root/.local/share/eosio/nodeos/config/config.ini
97 | subPath: config.ini
98 | - name: data-dir
99 | mountPath: /root/.local/share/eosio/nodeos/data
100 | volumes:
101 | - name: n-nodes-config-config-ini
102 | configMap:
103 | name: n-nodes-config
104 | volumeClaimTemplates:
105 | - metadata:
106 | name: data-dir
107 | spec:
108 | accessModes:
109 | - ReadWriteOnce
110 | storageClassName: slow
111 | resources:
112 | requests:
113 | storage: 1Gi
114 |
115 | ---
116 |
117 | apiVersion: apps/v1
118 | kind: StatefulSet
119 | metadata:
120 | name: node
121 | spec:
122 | selector:
123 | matchLabels:
124 | app: nodes
125 | serviceName: nodes
126 | replicas: 0
127 | template:
128 | metadata:
129 | labels:
130 | app: nodes
131 | name: node
132 | spec:
133 | terminationGracePeriodSeconds: 600
134 | containers:
135 | - name: node
136 | image: deadlock/eos-dpos-pbft:bos-v0.6.0
137 | # resources:
138 | # limits:
139 | # cpu: "1"
140 | # requests:
141 | # cpu: "1"
142 | ports:
143 | - containerPort: 8888
144 | - containerPort: 9876
145 | envFrom:
146 | - configMapRef:
147 | name: n-nodes-config
148 | command: ["/bin/bash", "-c"]
149 | args:
150 | - export profile_id=${HOSTNAME##*-} ;
151 | export abc=({0..25}) ;
152 | export profile_name=node${abc[$profile_id]} ;
153 | nodeos ${!profile_name} ;
154 | lifecycle:
155 | preStop:
156 | exec:
157 | command:
158 | - sh
159 | - -c
160 | - pkill nodeos ; while kill -0 8 2>/dev/null ; do sleep 1; done;
161 | volumeMounts:
162 | - name: n-nodes-config-config-ini
163 | mountPath: /root/.local/share/eosio/nodeos/config/config.ini
164 | subPath: config.ini
165 | - name: data-dir
166 | mountPath: /root/.local/share/eosio/nodeos/data
167 | volumes:
168 | - name: n-nodes-config-config-ini
169 | configMap:
170 | name: n-nodes-config
171 | volumeClaimTemplates:
172 | - metadata:
173 | name: data-dir
174 | spec:
175 | accessModes:
176 | - ReadWriteOnce
177 | storageClassName: slow
178 | resources:
179 | requests:
180 | storage: 1Gi
181 |
--------------------------------------------------------------------------------
/k8s-bos/src/n-nodes/tps.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: apps/v1
2 | kind: ReplicaSet
3 | metadata:
4 | name: tps
5 | spec:
6 | selector:
7 | matchLabels:
8 | app: nodes
9 | replicas: 0
10 | template:
11 | metadata:
12 | labels:
13 | app: nodes
14 | spec:
15 | containers:
16 | - name: tps
17 | image: deadlock/eos-tps:v1
18 | resources:
19 | requests:
20 | cpu: 100m
21 | memory: 100Mi
22 | env:
23 | - name: ChainId
24 | value: '0365870660fa09c7fe15870aeab6a30cf89aef6f96a9765ab63f2588b388eacf'
25 | - name: PRIVATE_KEY
26 | value: '5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3'
27 | - name: CONTRACT_NAME
28 | value: 'eosio.token'
29 | - name: ENDPOINT
30 | value: 'http://eosio-0.nodes.default.svc.cluster.local:8888'
31 | - name: FROM
32 | value: 'eosio'
33 | - name: TO
34 | value: 'bpa'
35 | - name: QUANTITY
36 | value: '0.0001 BOS'
37 | - name: INTERVAL
38 | value: '100'
39 |
--------------------------------------------------------------------------------
/k8s/deprecated/nginx.yaml:
--------------------------------------------------------------------------------
1 | # apiVersion: apps/v1
2 | # kind: ReplicaSet
3 | # metadata:
4 | # name: nginx
5 | # spec:
6 | # selector:
7 | # matchLabels:
8 | # app: nodes
9 | # replicas: 1
10 | # template:
11 | # metadata:
12 | # labels:
13 | # app: nodes
14 | # role: nginx
15 | # spec:
16 | # terminationGracePeriodSeconds: 10
17 | # containers:
18 | # - name: nginx
19 | # image: nginx:alpine
20 | # ports:
21 | # - containerPort: 80
22 | # volumeMounts:
23 | # - name: nginx-config
24 | # mountPath: /etc/nginx/nginx.conf
25 | # subPath: nginx.conf
26 | # volumes:
27 | # - name: nginx-config
28 | # configMap:
29 | # name: n-nodes-nginx-config
30 | #
31 | # ---
32 | #
33 | # apiVersion: v1
34 | # kind: ConfigMap
35 | # metadata:
36 | # name: n-nodes-nginx-config
37 | # namespace: default
38 | # data:
39 | # nginx.conf: |
40 | # user nginx;
41 | # worker_processes 1;
42 | #
43 | # error_log /var/log/nginx/error.log warn;
44 | # pid /var/run/nginx.pid;
45 | #
46 | #
47 | # events {
48 | # worker_connections 1024;
49 | # }
50 | #
51 | #
52 | # http {
53 | # #include /etc/nginx/mime.types;
54 | # #default_type application/octet-stream;
55 | #
56 | # log_format main '$remote_addr - $remote_user [$time_local] "$request" '
57 | # '$status $body_bytes_sent "$http_referer" '
58 | # '"$http_user_agent" "$http_x_forwarded_for"';
59 | #
60 | # access_log /var/log/nginx/access.log main;
61 | #
62 | # #sendfile on;
63 | # #tcp_nopush on;
64 | #
65 | # #keepalive_timeout 65;
66 | #
67 | # #gzip on;
68 | #
69 | # #include /etc/nginx/conf.d/*.conf;
70 | #
71 | # #resolver kube-dns.kube-system.svc.cluster.local ipv6=off;
72 | # upstream backend{
73 | # #server eosio-0.nodes:8888;
74 | # server 10.48.0.11:8888;
75 | # }
76 | # server {
77 | # location / {
78 | # # resolver 127.0.0.1:53 ipv6=off;
79 | # # set $backend_upstream "http://eosio-0.nodes.default.svc.cluster.local:8888";
80 | # # proxy_pass $backend_upstream;
81 | # proxy_pass http://10.48.1.22:8888;
82 | # }
83 | # }
84 | # }
85 |
--------------------------------------------------------------------------------
/k8s/deprecated/test.yaml:
--------------------------------------------------------------------------------
1 | # apiVersion: apps/v1
2 | # kind: ReplicaSet
3 | # metadata:
4 | # name: test
5 | # spec:
6 | # selector:
7 | # matchLabels:
8 | # app: nodes
9 | # replicas: 1
10 | # template:
11 | # metadata:
12 | # labels:
13 | # app: nodes
14 | # spec:
15 | # terminationGracePeriodSeconds: 1
16 | # containers:
17 | # - name: test
18 | # image: ubuntu:18.04
19 | # ports:
20 | # - containerPort: 80
21 | # command: [ "/bin/bash", "-c", "--" ]
22 | # args: [ "while true; do sleep 30; done;" ]
23 |
--------------------------------------------------------------------------------
/k8s/scripts/contracts/eosio.bios/eosio.bios.abi:
--------------------------------------------------------------------------------
1 | {
2 | "version": "eosio::abi/1.0",
3 | "types": [{
4 | "new_type_name": "account_name",
5 | "type": "name"
6 | },{
7 | "new_type_name": "permission_name",
8 | "type": "name"
9 | },{
10 | "new_type_name": "action_name",
11 | "type": "name"
12 | },{
13 | "new_type_name": "transaction_id_type",
14 | "type": "checksum256"
15 | },{
16 | "new_type_name": "weight_type",
17 | "type": "uint16"
18 | }],
19 | "structs": [{
20 | "name": "permission_level",
21 | "base": "",
22 | "fields": [
23 | {"name":"actor", "type":"account_name"},
24 | {"name":"permission", "type":"permission_name"}
25 | ]
26 | },{
27 | "name": "key_weight",
28 | "base": "",
29 | "fields": [
30 | {"name":"key", "type":"public_key"},
31 | {"name":"weight", "type":"weight_type"}
32 | ]
33 | },{
34 | "name": "permission_level_weight",
35 | "base": "",
36 | "fields": [
37 | {"name":"permission", "type":"permission_level"},
38 | {"name":"weight", "type":"weight_type"}
39 | ]
40 | },{
41 | "name": "wait_weight",
42 | "base": "",
43 | "fields": [
44 | {"name":"wait_sec", "type":"uint32"},
45 | {"name":"weight", "type":"weight_type"}
46 | ]
47 | },{
48 | "name": "authority",
49 | "base": "",
50 | "fields": [
51 | {"name":"threshold", "type":"uint32"},
52 | {"name":"keys", "type":"key_weight[]"},
53 | {"name":"accounts", "type":"permission_level_weight[]"},
54 | {"name":"waits", "type":"wait_weight[]"}
55 | ]
56 | },{
57 | "name": "blockchain_parameters",
58 | "base": "",
59 | "fields": [
60 | {"name":"max_block_net_usage", "type":"uint64"},
61 | {"name":"target_block_net_usage_pct", "type":"uint32"},
62 | {"name":"max_transaction_net_usage", "type":"uint32"},
63 | {"name":"base_per_transaction_net_usage", "type":"uint32"},
64 | {"name":"net_usage_leeway", "type":"uint32"},
65 | {"name":"context_free_discount_net_usage_num", "type":"uint32"},
66 | {"name":"context_free_discount_net_usage_den", "type":"uint32"},
67 | {"name":"max_block_cpu_usage", "type":"uint32"},
68 | {"name":"target_block_cpu_usage_pct", "type":"uint32"},
69 | {"name":"max_transaction_cpu_usage", "type":"uint32"},
70 | {"name":"min_transaction_cpu_usage", "type":"uint32"},
71 | {"name":"max_transaction_lifetime", "type":"uint32"},
72 | {"name":"deferred_trx_expiration_window", "type":"uint32"},
73 | {"name":"max_transaction_delay", "type":"uint32"},
74 | {"name":"max_inline_action_size", "type":"uint32"},
75 | {"name":"max_inline_action_depth", "type":"uint16"},
76 | {"name":"max_authority_depth", "type":"uint16"}
77 | ]
78 | },{
79 | "name": "newaccount",
80 | "base": "",
81 | "fields": [
82 | {"name":"creator", "type":"account_name"},
83 | {"name":"name", "type":"account_name"},
84 | {"name":"owner", "type":"authority"},
85 | {"name":"active", "type":"authority"}
86 | ]
87 | },{
88 | "name": "setcode",
89 | "base": "",
90 | "fields": [
91 | {"name":"account", "type":"account_name"},
92 | {"name":"vmtype", "type":"uint8"},
93 | {"name":"vmversion", "type":"uint8"},
94 | {"name":"code", "type":"bytes"}
95 | ]
96 | },{
97 | "name": "setabi",
98 | "base": "",
99 | "fields": [
100 | {"name":"account", "type":"account_name"},
101 | {"name":"abi", "type":"bytes"}
102 | ]
103 | },{
104 | "name": "updateauth",
105 | "base": "",
106 | "fields": [
107 | {"name":"account", "type":"account_name"},
108 | {"name":"permission", "type":"permission_name"},
109 | {"name":"parent", "type":"permission_name"},
110 | {"name":"auth", "type":"authority"}
111 | ]
112 | },{
113 | "name": "deleteauth",
114 | "base": "",
115 | "fields": [
116 | {"name":"account", "type":"account_name"},
117 | {"name":"permission", "type":"permission_name"}
118 | ]
119 | },{
120 | "name": "linkauth",
121 | "base": "",
122 | "fields": [
123 | {"name":"account", "type":"account_name"},
124 | {"name":"code", "type":"account_name"},
125 | {"name":"type", "type":"action_name"},
126 | {"name":"requirement", "type":"permission_name"}
127 | ]
128 | },{
129 | "name": "unlinkauth",
130 | "base": "",
131 | "fields": [
132 | {"name":"account", "type":"account_name"},
133 | {"name":"code", "type":"account_name"},
134 | {"name":"type", "type":"action_name"}
135 | ]
136 | },{
137 | "name": "canceldelay",
138 | "base": "",
139 | "fields": [
140 | {"name":"canceling_auth", "type":"permission_level"},
141 | {"name":"trx_id", "type":"transaction_id_type"}
142 | ]
143 | },{
144 | "name": "onerror",
145 | "base": "",
146 | "fields": [
147 | {"name":"sender_id", "type":"uint128"},
148 | {"name":"sent_trx", "type":"bytes"}
149 | ]
150 | },{
151 | "name": "set_account_limits",
152 | "base": "",
153 | "fields": [
154 | {"name":"account", "type":"account_name"},
155 | {"name":"ram_bytes", "type":"int64"},
156 | {"name":"net_weight", "type":"int64"},
157 | {"name":"cpu_weight", "type":"int64"}
158 | ]
159 | },{
160 | "name": "setpriv",
161 | "base": "",
162 | "fields": [
163 | {"name":"account", "type":"account_name"},
164 | {"name":"is_priv", "type":"int8"}
165 | ]
166 | },{
167 | "name": "set_global_limits",
168 | "base": "",
169 | "fields": [
170 | {"name":"cpu_usec_per_period", "type":"int64"}
171 | ]
172 | },{
173 | "name": "producer_key",
174 | "base": "",
175 | "fields": [
176 | {"name":"producer_name", "type":"account_name"},
177 | {"name":"block_signing_key", "type":"public_key"}
178 | ]
179 | },{
180 | "name": "set_producers",
181 | "base": "",
182 | "fields": [
183 | {"name":"schedule", "type":"producer_key[]"}
184 | ]
185 | },{
186 | "name": "setparams",
187 | "base": "",
188 | "fields": [
189 | {"name":"params", "type":"blockchain_parameters"}
190 | ]
191 | },{
192 | "name": "require_auth",
193 | "base": "",
194 | "fields": [
195 | {"name":"from", "type":"account_name"}
196 | ]
197 | }],
198 | "actions": [{
199 | "name": "newaccount",
200 | "type": "newaccount",
201 | "ricardian_contract": ""
202 | },{
203 | "name": "setcode",
204 | "type": "setcode",
205 | "ricardian_contract": ""
206 | },{
207 | "name": "setabi",
208 | "type": "setabi",
209 | "ricardian_contract": ""
210 | },{
211 | "name": "updateauth",
212 | "type": "updateauth",
213 | "ricardian_contract": ""
214 | },{
215 | "name": "deleteauth",
216 | "type": "deleteauth",
217 | "ricardian_contract": ""
218 | },{
219 | "name": "linkauth",
220 | "type": "linkauth",
221 | "ricardian_contract": ""
222 | },{
223 | "name": "unlinkauth",
224 | "type": "unlinkauth",
225 | "ricardian_contract": ""
226 | },{
227 | "name": "canceldelay",
228 | "type": "canceldelay",
229 | "ricardian_contract": ""
230 | },{
231 | "name": "onerror",
232 | "type": "onerror",
233 | "ricardian_contract": ""
234 | },{
235 | "name": "setalimits",
236 | "type": "set_account_limits",
237 | "ricardian_contract": ""
238 | },{
239 | "name": "setglimits",
240 | "type": "set_global_limits",
241 | "ricardian_contract": ""
242 | },{
243 | "name": "setpriv",
244 | "type": "setpriv",
245 | "ricardian_contract": ""
246 | },{
247 | "name": "setprods",
248 | "type": "set_producers",
249 | "ricardian_contract": ""
250 | },{
251 | "name": "setparams",
252 | "type": "setparams",
253 | "ricardian_contract": ""
254 | },{
255 | "name": "reqauth",
256 | "type": "require_auth",
257 | "ricardian_contract": ""
258 | }
259 | ],
260 | "tables": [],
261 | "ricardian_clauses": [],
262 | "abi_extensions": []
263 | }
264 |
--------------------------------------------------------------------------------
/k8s/scripts/contracts/eosio.bios/eosio.bios.abi.hpp:
--------------------------------------------------------------------------------
1 | const char* const eosio_bios_abi = R"=====(
2 | {
3 | "version": "eosio::abi/1.0",
4 | "types": [{
5 | "new_type_name": "account_name",
6 | "type": "name"
7 | },{
8 | "new_type_name": "permission_name",
9 | "type": "name"
10 | },{
11 | "new_type_name": "action_name",
12 | "type": "name"
13 | },{
14 | "new_type_name": "transaction_id_type",
15 | "type": "checksum256"
16 | },{
17 | "new_type_name": "weight_type",
18 | "type": "uint16"
19 | }],
20 | "structs": [{
21 | "name": "permission_level",
22 | "base": "",
23 | "fields": [
24 | {"name":"actor", "type":"account_name"},
25 | {"name":"permission", "type":"permission_name"}
26 | ]
27 | },{
28 | "name": "key_weight",
29 | "base": "",
30 | "fields": [
31 | {"name":"key", "type":"public_key"},
32 | {"name":"weight", "type":"weight_type"}
33 | ]
34 | },{
35 | "name": "permission_level_weight",
36 | "base": "",
37 | "fields": [
38 | {"name":"permission", "type":"permission_level"},
39 | {"name":"weight", "type":"weight_type"}
40 | ]
41 | },{
42 | "name": "wait_weight",
43 | "base": "",
44 | "fields": [
45 | {"name":"wait_sec", "type":"uint32"},
46 | {"name":"weight", "type":"weight_type"}
47 | ]
48 | },{
49 | "name": "authority",
50 | "base": "",
51 | "fields": [
52 | {"name":"threshold", "type":"uint32"},
53 | {"name":"keys", "type":"key_weight[]"},
54 | {"name":"accounts", "type":"permission_level_weight[]"},
55 | {"name":"waits", "type":"wait_weight[]"}
56 | ]
57 | },{
58 | "name": "blockchain_parameters",
59 | "base": "",
60 | "fields": [
61 | {"name":"max_block_net_usage", "type":"uint64"},
62 | {"name":"target_block_net_usage_pct", "type":"uint32"},
63 | {"name":"max_transaction_net_usage", "type":"uint32"},
64 | {"name":"base_per_transaction_net_usage", "type":"uint32"},
65 | {"name":"net_usage_leeway", "type":"uint32"},
66 | {"name":"context_free_discount_net_usage_num", "type":"uint32"},
67 | {"name":"context_free_discount_net_usage_den", "type":"uint32"},
68 | {"name":"max_block_cpu_usage", "type":"uint32"},
69 | {"name":"target_block_cpu_usage_pct", "type":"uint32"},
70 | {"name":"max_transaction_cpu_usage", "type":"uint32"},
71 | {"name":"min_transaction_cpu_usage", "type":"uint32"},
72 | {"name":"max_transaction_lifetime", "type":"uint32"},
73 | {"name":"deferred_trx_expiration_window", "type":"uint32"},
74 | {"name":"max_transaction_delay", "type":"uint32"},
75 | {"name":"max_inline_action_size", "type":"uint32"},
76 | {"name":"max_inline_action_depth", "type":"uint16"},
77 | {"name":"max_authority_depth", "type":"uint16"}
78 | ]
79 | },{
80 | "name": "newaccount",
81 | "base": "",
82 | "fields": [
83 | {"name":"creator", "type":"account_name"},
84 | {"name":"name", "type":"account_name"},
85 | {"name":"owner", "type":"authority"},
86 | {"name":"active", "type":"authority"}
87 | ]
88 | },{
89 | "name": "setcode",
90 | "base": "",
91 | "fields": [
92 | {"name":"account", "type":"account_name"},
93 | {"name":"vmtype", "type":"uint8"},
94 | {"name":"vmversion", "type":"uint8"},
95 | {"name":"code", "type":"bytes"}
96 | ]
97 | },{
98 | "name": "setabi",
99 | "base": "",
100 | "fields": [
101 | {"name":"account", "type":"account_name"},
102 | {"name":"abi", "type":"bytes"}
103 | ]
104 | },{
105 | "name": "updateauth",
106 | "base": "",
107 | "fields": [
108 | {"name":"account", "type":"account_name"},
109 | {"name":"permission", "type":"permission_name"},
110 | {"name":"parent", "type":"permission_name"},
111 | {"name":"auth", "type":"authority"}
112 | ]
113 | },{
114 | "name": "deleteauth",
115 | "base": "",
116 | "fields": [
117 | {"name":"account", "type":"account_name"},
118 | {"name":"permission", "type":"permission_name"}
119 | ]
120 | },{
121 | "name": "linkauth",
122 | "base": "",
123 | "fields": [
124 | {"name":"account", "type":"account_name"},
125 | {"name":"code", "type":"account_name"},
126 | {"name":"type", "type":"action_name"},
127 | {"name":"requirement", "type":"permission_name"}
128 | ]
129 | },{
130 | "name": "unlinkauth",
131 | "base": "",
132 | "fields": [
133 | {"name":"account", "type":"account_name"},
134 | {"name":"code", "type":"account_name"},
135 | {"name":"type", "type":"action_name"}
136 | ]
137 | },{
138 | "name": "canceldelay",
139 | "base": "",
140 | "fields": [
141 | {"name":"canceling_auth", "type":"permission_level"},
142 | {"name":"trx_id", "type":"transaction_id_type"}
143 | ]
144 | },{
145 | "name": "onerror",
146 | "base": "",
147 | "fields": [
148 | {"name":"sender_id", "type":"uint128"},
149 | {"name":"sent_trx", "type":"bytes"}
150 | ]
151 | },{
152 | "name": "set_account_limits",
153 | "base": "",
154 | "fields": [
155 | {"name":"account", "type":"account_name"},
156 | {"name":"ram_bytes", "type":"int64"},
157 | {"name":"net_weight", "type":"int64"},
158 | {"name":"cpu_weight", "type":"int64"}
159 | ]
160 | },{
161 | "name": "setpriv",
162 | "base": "",
163 | "fields": [
164 | {"name":"account", "type":"account_name"},
165 | {"name":"is_priv", "type":"int8"}
166 | ]
167 | },{
168 | "name": "set_global_limits",
169 | "base": "",
170 | "fields": [
171 | {"name":"cpu_usec_per_period", "type":"int64"}
172 | ]
173 | },{
174 | "name": "producer_key",
175 | "base": "",
176 | "fields": [
177 | {"name":"producer_name", "type":"account_name"},
178 | {"name":"block_signing_key", "type":"public_key"}
179 | ]
180 | },{
181 | "name": "set_producers",
182 | "base": "",
183 | "fields": [
184 | {"name":"schedule", "type":"producer_key[]"}
185 | ]
186 | },{
187 | "name": "setparams",
188 | "base": "",
189 | "fields": [
190 | {"name":"params", "type":"blockchain_parameters"}
191 | ]
192 | },{
193 | "name": "require_auth",
194 | "base": "",
195 | "fields": [
196 | {"name":"from", "type":"account_name"}
197 | ]
198 | }],
199 | "actions": [{
200 | "name": "newaccount",
201 | "type": "newaccount",
202 | "ricardian_contract": ""
203 | },{
204 | "name": "setcode",
205 | "type": "setcode",
206 | "ricardian_contract": ""
207 | },{
208 | "name": "setabi",
209 | "type": "setabi",
210 | "ricardian_contract": ""
211 | },{
212 | "name": "updateauth",
213 | "type": "updateauth",
214 | "ricardian_contract": ""
215 | },{
216 | "name": "deleteauth",
217 | "type": "deleteauth",
218 | "ricardian_contract": ""
219 | },{
220 | "name": "linkauth",
221 | "type": "linkauth",
222 | "ricardian_contract": ""
223 | },{
224 | "name": "unlinkauth",
225 | "type": "unlinkauth",
226 | "ricardian_contract": ""
227 | },{
228 | "name": "canceldelay",
229 | "type": "canceldelay",
230 | "ricardian_contract": ""
231 | },{
232 | "name": "onerror",
233 | "type": "onerror",
234 | "ricardian_contract": ""
235 | },{
236 | "name": "setalimits",
237 | "type": "set_account_limits",
238 | "ricardian_contract": ""
239 | },{
240 | "name": "setglimits",
241 | "type": "set_global_limits",
242 | "ricardian_contract": ""
243 | },{
244 | "name": "setpriv",
245 | "type": "setpriv",
246 | "ricardian_contract": ""
247 | },{
248 | "name": "setprods",
249 | "type": "set_producers",
250 | "ricardian_contract": ""
251 | },{
252 | "name": "setparams",
253 | "type": "setparams",
254 | "ricardian_contract": ""
255 | },{
256 | "name": "reqauth",
257 | "type": "require_auth",
258 | "ricardian_contract": ""
259 | }
260 | ],
261 | "tables": [],
262 | "ricardian_clauses": [],
263 | "abi_extensions": []
264 | }
265 | )=====";
266 |
--------------------------------------------------------------------------------
/k8s/scripts/contracts/eosio.bios/eosio.bios.wasm:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eosiosg/dpos-pbft/f5891e202a9692f8b8287dceb03f1f03a68e9fde/k8s/scripts/contracts/eosio.bios/eosio.bios.wasm
--------------------------------------------------------------------------------
/k8s/scripts/contracts/eosio.msig/eosio.msig.abi:
--------------------------------------------------------------------------------
1 | {
2 | "version": "eosio::abi/1.0",
3 | "types": [{
4 | "new_type_name": "account_name",
5 | "type": "name"
6 | },{
7 | "new_type_name": "permission_name",
8 | "type": "name"
9 | },{
10 | "new_type_name": "action_name",
11 | "type": "name"
12 | }],
13 | "structs": [{
14 | "name": "permission_level",
15 | "base": "",
16 | "fields": [
17 | {"name": "actor", "type": "account_name"},
18 | {"name": "permission", "type": "permission_name"}
19 | ]
20 | },{
21 | "name": "action",
22 | "base": "",
23 | "fields": [
24 | {"name": "account", "type": "account_name"},
25 | {"name": "name", "type": "action_name"},
26 | {"name": "authorization", "type": "permission_level[]"},
27 | {"name": "data", "type": "bytes"}
28 | ]
29 | },{
30 | "name": "transaction_header",
31 | "base": "",
32 | "fields": [
33 | {"name": "expiration", "type": "time_point_sec"},
34 | {"name": "ref_block_num", "type": "uint16"},
35 | {"name": "ref_block_prefix", "type": "uint32"},
36 | {"name": "max_net_usage_words", "type": "varuint32"},
37 | {"name": "max_cpu_usage_ms", "type": "uint8"},
38 | {"name": "delay_sec", "type": "varuint32"}
39 | ]
40 | },{
41 | "name": "extension",
42 | "base": "",
43 | "fields": [
44 | {"name": "type", "type" : "uint16" },
45 | {"name": "data", "type": "bytes"}
46 | ]
47 | },{
48 | "name": "transaction",
49 | "base": "transaction_header",
50 | "fields": [
51 | {"name": "context_free_actions", "type": "action[]"},
52 | {"name": "actions", "type": "action[]"},
53 | {"name": "transaction_extensions", "type": "extension[]"}
54 | ]
55 | },{
56 | "name": "propose",
57 | "base": "",
58 | "fields": [
59 | {"name":"proposer", "type":"account_name"},
60 | {"name":"proposal_name", "type":"name"},
61 | {"name":"requested", "type":"permission_level[]"},
62 | {"name":"trx", "type":"transaction"}
63 | ]
64 | },{
65 | "name": "approve",
66 | "base": "",
67 | "fields": [
68 | {"name":"proposer", "type":"account_name"},
69 | {"name":"proposal_name", "type":"name"},
70 | {"name":"level", "type":"permission_level"}
71 | ]
72 | },{
73 | "name": "unapprove",
74 | "base": "",
75 | "fields": [
76 | {"name":"proposer", "type":"account_name"},
77 | {"name":"proposal_name", "type":"name"},
78 | {"name":"level", "type":"permission_level"}
79 | ]
80 | },{
81 | "name": "cancel",
82 | "base": "",
83 | "fields": [
84 | {"name":"proposer", "type":"account_name"},
85 | {"name":"proposal_name", "type":"name"},
86 | {"name":"canceler", "type":"account_name"}
87 | ]
88 | },{
89 | "name": "exec",
90 | "base": "",
91 | "fields": [
92 | {"name":"proposer", "type":"account_name"},
93 | {"name":"proposal_name", "type":"name"},
94 | {"name":"executer", "type":"account_name"}
95 | ]
96 | },{
97 | "name": "proposal",
98 | "base": "",
99 | "fields": [
100 | {"name": "proposal_name", "type": "name"},
101 | {"name": "packed_transaction", "type": "bytes"}
102 | ]
103 | },{
104 | "name": "approvals_info",
105 | "base": "",
106 | "fields": [
107 | {"name": "proposal_name", "type": "name"},
108 | {"name": "requested_approvals", "type": "permission_level[]"},
109 | {"name": "provided_approvals", "type": "permission_level[]"}
110 | ]
111 | }
112 | ],
113 | "actions": [{
114 | "name": "propose",
115 | "type": "propose",
116 | "ricardian_contract": ""
117 | },{
118 | "name": "approve",
119 | "type": "approve",
120 | "ricardian_contract": ""
121 | },{
122 | "name": "unapprove",
123 | "type": "unapprove",
124 | "ricardian_contract": ""
125 | }, {
126 | "name": "cancel",
127 | "type": "cancel",
128 | "ricardian_contract": ""
129 | }, {
130 | "name": "exec",
131 | "type": "exec",
132 | "ricardian_contract": ""
133 | }
134 |
135 | ],
136 | "tables": [{
137 | "name": "proposal",
138 | "type": "proposal",
139 | "index_type": "i64",
140 | "key_names" : ["proposal_name"],
141 | "key_types" : ["name"]
142 | },{
143 | "name": "approvals",
144 | "type": "approvals_info",
145 | "index_type": "i64",
146 | "key_names" : ["proposal_name"],
147 | "key_types" : ["name"]
148 | }
149 | ],
150 | "ricardian_clauses": [],
151 | "abi_extensions": []
152 | }
153 |
--------------------------------------------------------------------------------
/k8s/scripts/contracts/eosio.msig/eosio.msig.abi.hpp:
--------------------------------------------------------------------------------
1 | const char* const eosio_msig_abi = R"=====(
2 | {
3 | "version": "eosio::abi/1.0",
4 | "types": [{
5 | "new_type_name": "account_name",
6 | "type": "name"
7 | },{
8 | "new_type_name": "permission_name",
9 | "type": "name"
10 | },{
11 | "new_type_name": "action_name",
12 | "type": "name"
13 | }],
14 | "structs": [{
15 | "name": "permission_level",
16 | "base": "",
17 | "fields": [
18 | {"name": "actor", "type": "account_name"},
19 | {"name": "permission", "type": "permission_name"}
20 | ]
21 | },{
22 | "name": "action",
23 | "base": "",
24 | "fields": [
25 | {"name": "account", "type": "account_name"},
26 | {"name": "name", "type": "action_name"},
27 | {"name": "authorization", "type": "permission_level[]"},
28 | {"name": "data", "type": "bytes"}
29 | ]
30 | },{
31 | "name": "transaction_header",
32 | "base": "",
33 | "fields": [
34 | {"name": "expiration", "type": "time_point_sec"},
35 | {"name": "ref_block_num", "type": "uint16"},
36 | {"name": "ref_block_prefix", "type": "uint32"},
37 | {"name": "max_net_usage_words", "type": "varuint32"},
38 | {"name": "max_cpu_usage_ms", "type": "uint8"},
39 | {"name": "delay_sec", "type": "varuint32"}
40 | ]
41 | },{
42 | "name": "extension",
43 | "base": "",
44 | "fields": [
45 | {"name": "type", "type" : "uint16" },
46 | {"name": "data", "type": "bytes"}
47 | ]
48 | },{
49 | "name": "transaction",
50 | "base": "transaction_header",
51 | "fields": [
52 | {"name": "context_free_actions", "type": "action[]"},
53 | {"name": "actions", "type": "action[]"},
54 | {"name": "transaction_extensions", "type": "extension[]"}
55 | ]
56 | },{
57 | "name": "propose",
58 | "base": "",
59 | "fields": [
60 | {"name":"proposer", "type":"account_name"},
61 | {"name":"proposal_name", "type":"name"},
62 | {"name":"requested", "type":"permission_level[]"},
63 | {"name":"trx", "type":"transaction"}
64 | ]
65 | },{
66 | "name": "approve",
67 | "base": "",
68 | "fields": [
69 | {"name":"proposer", "type":"account_name"},
70 | {"name":"proposal_name", "type":"name"},
71 | {"name":"level", "type":"permission_level"}
72 | ]
73 | },{
74 | "name": "unapprove",
75 | "base": "",
76 | "fields": [
77 | {"name":"proposer", "type":"account_name"},
78 | {"name":"proposal_name", "type":"name"},
79 | {"name":"level", "type":"permission_level"}
80 | ]
81 | },{
82 | "name": "cancel",
83 | "base": "",
84 | "fields": [
85 | {"name":"proposer", "type":"account_name"},
86 | {"name":"proposal_name", "type":"name"},
87 | {"name":"canceler", "type":"account_name"}
88 | ]
89 | },{
90 | "name": "exec",
91 | "base": "",
92 | "fields": [
93 | {"name":"proposer", "type":"account_name"},
94 | {"name":"proposal_name", "type":"name"},
95 | {"name":"executer", "type":"account_name"}
96 | ]
97 | },{
98 | "name": "proposal",
99 | "base": "",
100 | "fields": [
101 | {"name": "proposal_name", "type": "name"},
102 | {"name": "packed_transaction", "type": "bytes"}
103 | ]
104 | },{
105 | "name": "approvals_info",
106 | "base": "",
107 | "fields": [
108 | {"name": "proposal_name", "type": "name"},
109 | {"name": "requested_approvals", "type": "permission_level[]"},
110 | {"name": "provided_approvals", "type": "permission_level[]"}
111 | ]
112 | }
113 | ],
114 | "actions": [{
115 | "name": "propose",
116 | "type": "propose",
117 | "ricardian_contract": ""
118 | },{
119 | "name": "approve",
120 | "type": "approve",
121 | "ricardian_contract": ""
122 | },{
123 | "name": "unapprove",
124 | "type": "unapprove",
125 | "ricardian_contract": ""
126 | }, {
127 | "name": "cancel",
128 | "type": "cancel",
129 | "ricardian_contract": ""
130 | }, {
131 | "name": "exec",
132 | "type": "exec",
133 | "ricardian_contract": ""
134 | }
135 |
136 | ],
137 | "tables": [{
138 | "name": "proposal",
139 | "type": "proposal",
140 | "index_type": "i64",
141 | "key_names" : ["proposal_name"],
142 | "key_types" : ["name"]
143 | },{
144 | "name": "approvals",
145 | "type": "approvals_info",
146 | "index_type": "i64",
147 | "key_names" : ["proposal_name"],
148 | "key_types" : ["name"]
149 | }
150 | ],
151 | "ricardian_clauses": [],
152 | "abi_extensions": []
153 | }
154 | )=====";
155 |
--------------------------------------------------------------------------------
/k8s/scripts/contracts/eosio.msig/eosio.msig.wasm:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eosiosg/dpos-pbft/f5891e202a9692f8b8287dceb03f1f03a68e9fde/k8s/scripts/contracts/eosio.msig/eosio.msig.wasm
--------------------------------------------------------------------------------
/k8s/scripts/contracts/eosio.sudo/eosio.sudo.abi:
--------------------------------------------------------------------------------
1 | {
2 | "version": "eosio::abi/1.0",
3 | "types": [{
4 | "new_type_name": "account_name",
5 | "type": "name"
6 | },{
7 | "new_type_name": "permission_name",
8 | "type": "name"
9 | },{
10 | "new_type_name": "action_name",
11 | "type": "name"
12 | }],
13 | "structs": [{
14 | "name": "permission_level",
15 | "base": "",
16 | "fields": [
17 | {"name": "actor", "type": "account_name"},
18 | {"name": "permission", "type": "permission_name"}
19 | ]
20 | },{
21 | "name": "action",
22 | "base": "",
23 | "fields": [
24 | {"name": "account", "type": "account_name"},
25 | {"name": "name", "type": "action_name"},
26 | {"name": "authorization", "type": "permission_level[]"},
27 | {"name": "data", "type": "bytes"}
28 | ]
29 | },{
30 | "name": "transaction_header",
31 | "base": "",
32 | "fields": [
33 | {"name": "expiration", "type": "time_point_sec"},
34 | {"name": "ref_block_num", "type": "uint16"},
35 | {"name": "ref_block_prefix", "type": "uint32"},
36 | {"name": "max_net_usage_words", "type": "varuint32"},
37 | {"name": "max_cpu_usage_ms", "type": "uint8"},
38 | {"name": "delay_sec", "type": "varuint32"}
39 | ]
40 | },{
41 | "name": "extension",
42 | "base": "",
43 | "fields": [
44 | {"name": "type", "type" : "uint16" },
45 | {"name": "data", "type": "bytes"}
46 | ]
47 | },{
48 | "name": "transaction",
49 | "base": "transaction_header",
50 | "fields": [
51 | {"name": "context_free_actions", "type": "action[]"},
52 | {"name": "actions", "type": "action[]"},
53 | {"name": "transaction_extensions", "type": "extension[]"}
54 | ]
55 | },{
56 | "name": "exec",
57 | "base": "",
58 | "fields": [
59 | {"name":"executer", "type":"account_name"},
60 | {"name":"trx", "type":"transaction"}
61 | ]
62 | }
63 | ],
64 | "actions": [{
65 | "name": "exec",
66 | "type": "exec",
67 | "ricardian_contract": ""
68 | }
69 | ],
70 | "tables": [],
71 | "ricardian_clauses": [],
72 | "abi_extensions": []
73 | }
74 |
--------------------------------------------------------------------------------
/k8s/scripts/contracts/eosio.sudo/eosio.sudo.abi.hpp:
--------------------------------------------------------------------------------
1 | const char* const eosio_sudo_abi = R"=====(
2 | {
3 | "version": "eosio::abi/1.0",
4 | "types": [{
5 | "new_type_name": "account_name",
6 | "type": "name"
7 | },{
8 | "new_type_name": "permission_name",
9 | "type": "name"
10 | },{
11 | "new_type_name": "action_name",
12 | "type": "name"
13 | }],
14 | "structs": [{
15 | "name": "permission_level",
16 | "base": "",
17 | "fields": [
18 | {"name": "actor", "type": "account_name"},
19 | {"name": "permission", "type": "permission_name"}
20 | ]
21 | },{
22 | "name": "action",
23 | "base": "",
24 | "fields": [
25 | {"name": "account", "type": "account_name"},
26 | {"name": "name", "type": "action_name"},
27 | {"name": "authorization", "type": "permission_level[]"},
28 | {"name": "data", "type": "bytes"}
29 | ]
30 | },{
31 | "name": "transaction_header",
32 | "base": "",
33 | "fields": [
34 | {"name": "expiration", "type": "time_point_sec"},
35 | {"name": "ref_block_num", "type": "uint16"},
36 | {"name": "ref_block_prefix", "type": "uint32"},
37 | {"name": "max_net_usage_words", "type": "varuint32"},
38 | {"name": "max_cpu_usage_ms", "type": "uint8"},
39 | {"name": "delay_sec", "type": "varuint32"}
40 | ]
41 | },{
42 | "name": "extension",
43 | "base": "",
44 | "fields": [
45 | {"name": "type", "type" : "uint16" },
46 | {"name": "data", "type": "bytes"}
47 | ]
48 | },{
49 | "name": "transaction",
50 | "base": "transaction_header",
51 | "fields": [
52 | {"name": "context_free_actions", "type": "action[]"},
53 | {"name": "actions", "type": "action[]"},
54 | {"name": "transaction_extensions", "type": "extension[]"}
55 | ]
56 | },{
57 | "name": "exec",
58 | "base": "",
59 | "fields": [
60 | {"name":"executer", "type":"account_name"},
61 | {"name":"trx", "type":"transaction"}
62 | ]
63 | }
64 | ],
65 | "actions": [{
66 | "name": "exec",
67 | "type": "exec",
68 | "ricardian_contract": ""
69 | }
70 | ],
71 | "tables": [],
72 | "ricardian_clauses": [],
73 | "abi_extensions": []
74 | }
75 | )=====";
76 |
--------------------------------------------------------------------------------
/k8s/scripts/contracts/eosio.sudo/eosio.sudo.wasm:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eosiosg/dpos-pbft/f5891e202a9692f8b8287dceb03f1f03a68e9fde/k8s/scripts/contracts/eosio.sudo/eosio.sudo.wasm
--------------------------------------------------------------------------------
/k8s/scripts/contracts/eosio.system/eosio.system.abi:
--------------------------------------------------------------------------------
1 | {
2 | "version": "eosio::abi/1.0",
3 | "types": [{
4 | "new_type_name": "account_name",
5 | "type": "name"
6 | },{
7 | "new_type_name": "permission_name",
8 | "type": "name"
9 | },{
10 | "new_type_name": "action_name",
11 | "type": "name"
12 | },{
13 | "new_type_name": "transaction_id_type",
14 | "type": "checksum256"
15 | },{
16 | "new_type_name": "weight_type",
17 | "type": "uint16"
18 | }],
19 | "____comment": "eosio.bios structs: set_account_limits, setpriv, set_global_limits, producer_key, set_producers, require_auth are provided so abi available for deserialization in future.",
20 | "structs": [{
21 | "name": "permission_level",
22 | "base": "",
23 | "fields": [
24 | {"name":"actor", "type":"account_name"},
25 | {"name":"permission", "type":"permission_name"}
26 | ]
27 | },{
28 | "name": "key_weight",
29 | "base": "",
30 | "fields": [
31 | {"name":"key", "type":"public_key"},
32 | {"name":"weight", "type":"weight_type"}
33 | ]
34 | },{
35 | "name": "bidname",
36 | "base": "",
37 | "fields": [
38 | {"name":"bidder", "type":"account_name"},
39 | {"name":"newname", "type":"account_name"},
40 | {"name":"bid", "type":"asset"}
41 | ]
42 | },{
43 | "name": "permission_level_weight",
44 | "base": "",
45 | "fields": [
46 | {"name":"permission", "type":"permission_level"},
47 | {"name":"weight", "type":"weight_type"}
48 | ]
49 | },{
50 | "name": "wait_weight",
51 | "base": "",
52 | "fields": [
53 | {"name":"wait_sec", "type":"uint32"},
54 | {"name":"weight", "type":"weight_type"}
55 | ]
56 | },{
57 | "name": "authority",
58 | "base": "",
59 | "fields": [
60 | {"name":"threshold", "type":"uint32"},
61 | {"name":"keys", "type":"key_weight[]"},
62 | {"name":"accounts", "type":"permission_level_weight[]"},
63 | {"name":"waits", "type":"wait_weight[]"}
64 | ]
65 | },{
66 | "name": "newaccount",
67 | "base": "",
68 | "fields": [
69 | {"name":"creator", "type":"account_name"},
70 | {"name":"name", "type":"account_name"},
71 | {"name":"owner", "type":"authority"},
72 | {"name":"active", "type":"authority"}
73 | ]
74 | },{
75 | "name": "setcode",
76 | "base": "",
77 | "fields": [
78 | {"name":"account", "type":"account_name"},
79 | {"name":"vmtype", "type":"uint8"},
80 | {"name":"vmversion", "type":"uint8"},
81 | {"name":"code", "type":"bytes"}
82 | ]
83 | },{
84 | "name": "setabi",
85 | "base": "",
86 | "fields": [
87 | {"name":"account", "type":"account_name"},
88 | {"name":"abi", "type":"bytes"}
89 | ]
90 | },{
91 | "name": "updateauth",
92 | "base": "",
93 | "fields": [
94 | {"name":"account", "type":"account_name"},
95 | {"name":"permission", "type":"permission_name"},
96 | {"name":"parent", "type":"permission_name"},
97 | {"name":"auth", "type":"authority"}
98 | ]
99 | },{
100 | "name": "deleteauth",
101 | "base": "",
102 | "fields": [
103 | {"name":"account", "type":"account_name"},
104 | {"name":"permission", "type":"permission_name"}
105 | ]
106 | },{
107 | "name": "linkauth",
108 | "base": "",
109 | "fields": [
110 | {"name":"account", "type":"account_name"},
111 | {"name":"code", "type":"account_name"},
112 | {"name":"type", "type":"action_name"},
113 | {"name":"requirement", "type":"permission_name"}
114 | ]
115 | },{
116 | "name": "unlinkauth",
117 | "base": "",
118 | "fields": [
119 | {"name":"account", "type":"account_name"},
120 | {"name":"code", "type":"account_name"},
121 | {"name":"type", "type":"action_name"}
122 | ]
123 | },{
124 | "name": "canceldelay",
125 | "base": "",
126 | "fields": [
127 | {"name":"canceling_auth", "type":"permission_level"},
128 | {"name":"trx_id", "type":"transaction_id_type"}
129 | ]
130 | },{
131 | "name": "onerror",
132 | "base": "",
133 | "fields": [
134 | {"name":"sender_id", "type":"uint128"},
135 | {"name":"sent_trx", "type":"bytes"}
136 | ]
137 | },{
138 | "name": "buyrambytes",
139 | "base": "",
140 | "fields": [
141 | {"name":"payer", "type":"account_name"},
142 | {"name":"receiver", "type":"account_name"},
143 | {"name":"bytes", "type":"uint32"}
144 | ]
145 | },{
146 | "name": "sellram",
147 | "base": "",
148 | "fields": [
149 | {"name":"account", "type":"account_name"},
150 | {"name":"bytes", "type":"uint64"}
151 | ]
152 | },{
153 | "name": "buyram",
154 | "base": "",
155 | "fields": [
156 | {"name":"payer", "type":"account_name"},
157 | {"name":"receiver", "type":"account_name"},
158 | {"name":"quant", "type":"asset"}
159 | ]
160 | },{
161 | "name": "delegatebw",
162 | "base": "",
163 | "fields": [
164 | {"name":"from", "type":"account_name"},
165 | {"name":"receiver", "type":"account_name"},
166 | {"name":"stake_net_quantity", "type":"asset"},
167 | {"name":"stake_cpu_quantity", "type":"asset"},
168 | {"name":"transfer", "type":"bool"}
169 | ]
170 | },{
171 | "name": "undelegatebw",
172 | "base": "",
173 | "fields": [
174 | {"name":"from", "type":"account_name"},
175 | {"name":"receiver", "type":"account_name"},
176 | {"name":"unstake_net_quantity", "type":"asset"},
177 | {"name":"unstake_cpu_quantity", "type":"asset"}
178 | ]
179 | },{
180 | "name": "refund",
181 | "base": "",
182 | "fields": [
183 | {"name":"owner", "type":"account_name"}
184 | ]
185 | },{
186 | "name": "delegated_bandwidth",
187 | "base": "",
188 | "fields": [
189 | {"name":"from", "type":"account_name"},
190 | {"name":"to", "type":"account_name"},
191 | {"name":"net_weight", "type":"asset"},
192 | {"name":"cpu_weight", "type":"asset"}
193 | ]
194 | },{
195 | "name": "user_resources",
196 | "base": "",
197 | "fields": [
198 | {"name":"owner", "type":"account_name"},
199 | {"name":"net_weight", "type":"asset"},
200 | {"name":"cpu_weight", "type":"asset"},
201 | {"name":"ram_bytes", "type":"uint64"}
202 | ]
203 | },{
204 | "name": "total_resources",
205 | "base": "",
206 | "fields": [
207 | {"name":"owner", "type":"account_name"},
208 | {"name":"net_weight", "type":"asset"},
209 | {"name":"cpu_weight", "type":"asset"},
210 | {"name":"ram_bytes", "type":"uint64"}
211 | ]
212 | },{
213 | "name": "refund_request",
214 | "base": "",
215 | "fields": [
216 | {"name":"owner", "type":"account_name"},
217 | {"name":"request_time", "type":"time_point_sec"},
218 | {"name":"net_amount", "type":"asset"},
219 | {"name":"cpu_amount", "type":"asset"}
220 | ]
221 | },{
222 | "name": "blockchain_parameters",
223 | "base": "",
224 | "fields": [
225 |
226 | {"name":"max_block_net_usage", "type":"uint64"},
227 | {"name":"target_block_net_usage_pct", "type":"uint32"},
228 | {"name":"max_transaction_net_usage", "type":"uint32"},
229 | {"name":"base_per_transaction_net_usage", "type":"uint32"},
230 | {"name":"net_usage_leeway", "type":"uint32"},
231 | {"name":"context_free_discount_net_usage_num", "type":"uint32"},
232 | {"name":"context_free_discount_net_usage_den", "type":"uint32"},
233 | {"name":"max_block_cpu_usage", "type":"uint32"},
234 | {"name":"target_block_cpu_usage_pct", "type":"uint32"},
235 | {"name":"max_transaction_cpu_usage", "type":"uint32"},
236 | {"name":"min_transaction_cpu_usage", "type":"uint32"},
237 | {"name":"max_transaction_lifetime", "type":"uint32"},
238 | {"name":"deferred_trx_expiration_window", "type":"uint32"},
239 | {"name":"max_transaction_delay", "type":"uint32"},
240 | {"name":"max_inline_action_size", "type":"uint32"},
241 | {"name":"max_inline_action_depth", "type":"uint16"},
242 | {"name":"max_authority_depth", "type":"uint16"}
243 |
244 | ]
245 | },{
246 | "name": "eosio_global_state",
247 | "base": "blockchain_parameters",
248 | "fields": [
249 | {"name":"max_ram_size", "type":"uint64"},
250 | {"name":"total_ram_bytes_reserved", "type":"uint64"},
251 | {"name":"total_ram_stake", "type":"int64"},
252 | {"name":"last_producer_schedule_update", "type":"block_timestamp_type"},
253 | {"name":"last_pervote_bucket_fill", "type":"uint64"},
254 | {"name":"pervote_bucket", "type":"int64"},
255 | {"name":"perblock_bucket", "type":"int64"},
256 | {"name":"total_unpaid_blocks", "type":"uint32"},
257 | {"name":"total_activated_stake", "type":"int64"},
258 | {"name":"thresh_activated_stake_time", "type":"uint64"},
259 | {"name":"last_producer_schedule_size", "type":"uint16"},
260 | {"name":"total_producer_vote_weight", "type":"float64"},
261 | {"name":"last_name_close", "type":"block_timestamp_type"}
262 | ]
263 | },{
264 | "name": "producer_info",
265 | "base": "",
266 | "fields": [
267 | {"name":"owner", "type":"account_name"},
268 | {"name":"total_votes", "type":"float64"},
269 | {"name":"producer_key", "type":"public_key"},
270 | {"name":"is_active", "type":"bool"},
271 | {"name":"url", "type":"string"},
272 | {"name":"unpaid_blocks", "type":"uint32"},
273 | {"name":"last_claim_time", "type":"uint64"},
274 | {"name":"location", "type":"uint16"}
275 | ]
276 | },{
277 | "name": "regproducer",
278 | "base": "",
279 | "fields": [
280 | {"name":"producer", "type":"account_name"},
281 | {"name":"producer_key", "type":"public_key"},
282 | {"name":"url", "type":"string"},
283 | {"name":"location", "type":"uint16"}
284 | ]
285 | },{
286 | "name": "unregprod",
287 | "base": "",
288 | "fields": [
289 | {"name":"producer", "type":"account_name"}
290 | ]
291 | },{
292 | "name": "setram",
293 | "base": "",
294 | "fields": [
295 | {"name":"max_ram_size", "type":"uint64"}
296 | ]
297 | },{
298 | "name": "regproxy",
299 | "base": "",
300 | "fields": [
301 | {"name":"proxy", "type":"account_name"},
302 | {"name":"isproxy", "type":"bool"}
303 | ]
304 | },{
305 | "name": "voteproducer",
306 | "base": "",
307 | "fields": [
308 | {"name":"voter", "type":"account_name"},
309 | {"name":"proxy", "type":"account_name"},
310 | {"name":"producers", "type":"account_name[]"}
311 | ]
312 | },{
313 | "name": "voter_info",
314 | "base": "",
315 | "fields": [
316 | {"name":"owner", "type":"account_name"},
317 | {"name":"proxy", "type":"account_name"},
318 | {"name":"producers", "type":"account_name[]"},
319 | {"name":"staked", "type":"int64"},
320 | {"name":"last_vote_weight", "type":"float64"},
321 | {"name":"proxied_vote_weight", "type":"float64"},
322 | {"name":"is_proxy", "type":"bool"}
323 | ]
324 | },{
325 | "name": "claimrewards",
326 | "base": "",
327 | "fields": [
328 | {"name":"owner", "type":"account_name"}
329 | ]
330 | },{
331 | "name": "setpriv",
332 | "base": "",
333 | "fields": [
334 | {"name":"account", "type":"account_name"},
335 | {"name":"is_priv", "type":"int8"}
336 | ]
337 | },{
338 | "name": "rmvproducer",
339 | "base": "",
340 | "fields": [
341 | {"name":"producer", "type":"account_name"}
342 | ]
343 | },{
344 | "name": "set_account_limits",
345 | "base": "",
346 | "fields": [
347 | {"name":"account", "type":"account_name"},
348 | {"name":"ram_bytes", "type":"int64"},
349 | {"name":"net_weight", "type":"int64"},
350 | {"name":"cpu_weight", "type":"int64"}
351 | ]
352 | },{
353 | "name": "set_global_limits",
354 | "base": "",
355 | "fields": [
356 | {"name":"cpu_usec_per_period", "type":"int64"}
357 | ]
358 | },{
359 | "name": "producer_key",
360 | "base": "",
361 | "fields": [
362 | {"name":"producer_name", "type":"account_name"},
363 | {"name":"block_signing_key", "type":"public_key"}
364 | ]
365 | },{
366 | "name": "set_producers",
367 | "base": "",
368 | "fields": [
369 | {"name":"schedule", "type":"producer_key[]"}
370 | ]
371 | },{
372 | "name": "require_auth",
373 | "base": "",
374 | "fields": [
375 | {"name":"from", "type":"account_name"}
376 | ]
377 | },{
378 | "name": "setparams",
379 | "base": "",
380 | "fields": [
381 | {"name":"params", "type":"blockchain_parameters"}
382 | ]
383 | },{
384 | "name": "connector",
385 | "base": "",
386 | "fields": [
387 | {"name":"balance", "type":"asset"},
388 | {"name":"weight", "type":"float64"}
389 | ]
390 | },{
391 | "name": "exchange_state",
392 | "base": "",
393 | "fields": [
394 | {"name":"supply", "type":"asset"},
395 | {"name":"base", "type":"connector"},
396 | {"name":"quote", "type":"connector"}
397 | ]
398 | }, {
399 | "name": "namebid_info",
400 | "base": "",
401 | "fields": [
402 | {"name":"newname", "type":"account_name"},
403 | {"name":"high_bidder", "type":"account_name"},
404 | {"name":"high_bid", "type":"int64"},
405 | {"name":"last_bid_time", "type":"uint64"}
406 | ]
407 | }
408 | ],
409 | "actions": [{
410 | "name": "newaccount",
411 | "type": "newaccount",
412 | "ricardian_contract": ""
413 | },{
414 | "name": "setcode",
415 | "type": "setcode",
416 | "ricardian_contract": ""
417 | },{
418 | "name": "setabi",
419 | "type": "setabi",
420 | "ricardian_contract": ""
421 | },{
422 | "name": "updateauth",
423 | "type": "updateauth",
424 | "ricardian_contract": ""
425 | },{
426 | "name": "deleteauth",
427 | "type": "deleteauth",
428 | "ricardian_contract": ""
429 | },{
430 | "name": "linkauth",
431 | "type": "linkauth",
432 | "ricardian_contract": ""
433 | },{
434 | "name": "unlinkauth",
435 | "type": "unlinkauth",
436 | "ricardian_contract": ""
437 | },{
438 | "name": "canceldelay",
439 | "type": "canceldelay",
440 | "ricardian_contract": ""
441 | },{
442 | "name": "onerror",
443 | "type": "onerror",
444 | "ricardian_contract": ""
445 | },{
446 | "name": "buyrambytes",
447 | "type": "buyrambytes",
448 | "ricardian_contract": ""
449 | },{
450 | "name": "buyram",
451 | "type": "buyram",
452 | "ricardian_contract": ""
453 | },{
454 | "name": "sellram",
455 | "type": "sellram",
456 | "ricardian_contract": ""
457 | },{
458 | "name": "delegatebw",
459 | "type": "delegatebw",
460 | "ricardian_contract": ""
461 | },{
462 | "name": "undelegatebw",
463 | "type": "undelegatebw",
464 | "ricardian_contract": ""
465 | },{
466 | "name": "refund",
467 | "type": "refund",
468 | "ricardian_contract": ""
469 | },{
470 | "name": "regproducer",
471 | "type": "regproducer",
472 | "ricardian_contract": ""
473 | },{
474 | "name": "setram",
475 | "type": "setram",
476 | "ricardian_contract": ""
477 | },{
478 | "name": "bidname",
479 | "type": "bidname",
480 | "ricardian_contract": ""
481 | },{
482 | "name": "unregprod",
483 | "type": "unregprod",
484 | "ricardian_contract": ""
485 | },{
486 | "name": "regproxy",
487 | "type": "regproxy",
488 | "ricardian_contract": ""
489 | },{
490 | "name": "voteproducer",
491 | "type": "voteproducer",
492 | "ricardian_contract": ""
493 | },{
494 | "name": "claimrewards",
495 | "type": "claimrewards",
496 | "ricardian_contract": ""
497 | },{
498 | "name": "setpriv",
499 | "type": "setpriv",
500 | "ricardian_contract": ""
501 | },{
502 | "name": "rmvproducer",
503 | "type": "rmvproducer",
504 | "ricardian_contract": ""
505 | },{
506 | "name": "setalimits",
507 | "type": "set_account_limits",
508 | "ricardian_contract": ""
509 | },{
510 | "name": "setglimits",
511 | "type": "set_global_limits",
512 | "ricardian_contract": ""
513 | },{
514 | "name": "setprods",
515 | "type": "set_producers",
516 | "ricardian_contract": ""
517 | },{
518 | "name": "reqauth",
519 | "type": "require_auth",
520 | "ricardian_contract": ""
521 | },{
522 | "name": "setparams",
523 | "type": "setparams",
524 | "ricardian_contract": ""
525 | }],
526 | "tables": [{
527 | "name": "producers",
528 | "type": "producer_info",
529 | "index_type": "i64",
530 | "key_names" : ["owner"],
531 | "key_types" : ["uint64"]
532 | },{
533 | "name": "global",
534 | "type": "eosio_global_state",
535 | "index_type": "i64",
536 | "key_names" : [],
537 | "key_types" : []
538 | },{
539 | "name": "voters",
540 | "type": "voter_info",
541 | "index_type": "i64",
542 | "key_names" : ["owner"],
543 | "key_types" : ["account_name"]
544 | },{
545 | "name": "userres",
546 | "type": "user_resources",
547 | "index_type": "i64",
548 | "key_names" : ["owner"],
549 | "key_types" : ["uint64"]
550 | },{
551 | "name": "delband",
552 | "type": "delegated_bandwidth",
553 | "index_type": "i64",
554 | "key_names" : ["to"],
555 | "key_types" : ["uint64"]
556 | },{
557 | "name": "rammarket",
558 | "type": "exchange_state",
559 | "index_type": "i64",
560 | "key_names" : ["supply"],
561 | "key_types" : ["uint64"]
562 | },{
563 | "name": "refunds",
564 | "type": "refund_request",
565 | "index_type": "i64",
566 | "key_names" : ["owner"],
567 | "key_types" : ["uint64"]
568 | },{
569 | "name": "namebids",
570 | "type": "namebid_info",
571 | "index_type": "i64",
572 | "key_names" : ["newname"],
573 | "key_types" : ["account_name"]
574 | }
575 | ],
576 | "ricardian_clauses": [],
577 | "abi_extensions": []
578 | }
579 |
--------------------------------------------------------------------------------
/k8s/scripts/contracts/eosio.system/eosio.system.abi.hpp:
--------------------------------------------------------------------------------
1 | const char* const eosio_system_abi = R"=====(
2 | {
3 | "version": "eosio::abi/1.0",
4 | "types": [{
5 | "new_type_name": "account_name",
6 | "type": "name"
7 | },{
8 | "new_type_name": "permission_name",
9 | "type": "name"
10 | },{
11 | "new_type_name": "action_name",
12 | "type": "name"
13 | },{
14 | "new_type_name": "transaction_id_type",
15 | "type": "checksum256"
16 | },{
17 | "new_type_name": "weight_type",
18 | "type": "uint16"
19 | }],
20 | "____comment": "eosio.bios structs: set_account_limits, setpriv, set_global_limits, producer_key, set_producers, require_auth are provided so abi available for deserialization in future.",
21 | "structs": [{
22 | "name": "permission_level",
23 | "base": "",
24 | "fields": [
25 | {"name":"actor", "type":"account_name"},
26 | {"name":"permission", "type":"permission_name"}
27 | ]
28 | },{
29 | "name": "key_weight",
30 | "base": "",
31 | "fields": [
32 | {"name":"key", "type":"public_key"},
33 | {"name":"weight", "type":"weight_type"}
34 | ]
35 | },{
36 | "name": "bidname",
37 | "base": "",
38 | "fields": [
39 | {"name":"bidder", "type":"account_name"},
40 | {"name":"newname", "type":"account_name"},
41 | {"name":"bid", "type":"asset"}
42 | ]
43 | },{
44 | "name": "permission_level_weight",
45 | "base": "",
46 | "fields": [
47 | {"name":"permission", "type":"permission_level"},
48 | {"name":"weight", "type":"weight_type"}
49 | ]
50 | },{
51 | "name": "wait_weight",
52 | "base": "",
53 | "fields": [
54 | {"name":"wait_sec", "type":"uint32"},
55 | {"name":"weight", "type":"weight_type"}
56 | ]
57 | },{
58 | "name": "authority",
59 | "base": "",
60 | "fields": [
61 | {"name":"threshold", "type":"uint32"},
62 | {"name":"keys", "type":"key_weight[]"},
63 | {"name":"accounts", "type":"permission_level_weight[]"},
64 | {"name":"waits", "type":"wait_weight[]"}
65 | ]
66 | },{
67 | "name": "newaccount",
68 | "base": "",
69 | "fields": [
70 | {"name":"creator", "type":"account_name"},
71 | {"name":"name", "type":"account_name"},
72 | {"name":"owner", "type":"authority"},
73 | {"name":"active", "type":"authority"}
74 | ]
75 | },{
76 | "name": "setcode",
77 | "base": "",
78 | "fields": [
79 | {"name":"account", "type":"account_name"},
80 | {"name":"vmtype", "type":"uint8"},
81 | {"name":"vmversion", "type":"uint8"},
82 | {"name":"code", "type":"bytes"}
83 | ]
84 | },{
85 | "name": "setabi",
86 | "base": "",
87 | "fields": [
88 | {"name":"account", "type":"account_name"},
89 | {"name":"abi", "type":"bytes"}
90 | ]
91 | },{
92 | "name": "updateauth",
93 | "base": "",
94 | "fields": [
95 | {"name":"account", "type":"account_name"},
96 | {"name":"permission", "type":"permission_name"},
97 | {"name":"parent", "type":"permission_name"},
98 | {"name":"auth", "type":"authority"}
99 | ]
100 | },{
101 | "name": "deleteauth",
102 | "base": "",
103 | "fields": [
104 | {"name":"account", "type":"account_name"},
105 | {"name":"permission", "type":"permission_name"}
106 | ]
107 | },{
108 | "name": "linkauth",
109 | "base": "",
110 | "fields": [
111 | {"name":"account", "type":"account_name"},
112 | {"name":"code", "type":"account_name"},
113 | {"name":"type", "type":"action_name"},
114 | {"name":"requirement", "type":"permission_name"}
115 | ]
116 | },{
117 | "name": "unlinkauth",
118 | "base": "",
119 | "fields": [
120 | {"name":"account", "type":"account_name"},
121 | {"name":"code", "type":"account_name"},
122 | {"name":"type", "type":"action_name"}
123 | ]
124 | },{
125 | "name": "canceldelay",
126 | "base": "",
127 | "fields": [
128 | {"name":"canceling_auth", "type":"permission_level"},
129 | {"name":"trx_id", "type":"transaction_id_type"}
130 | ]
131 | },{
132 | "name": "onerror",
133 | "base": "",
134 | "fields": [
135 | {"name":"sender_id", "type":"uint128"},
136 | {"name":"sent_trx", "type":"bytes"}
137 | ]
138 | },{
139 | "name": "buyrambytes",
140 | "base": "",
141 | "fields": [
142 | {"name":"payer", "type":"account_name"},
143 | {"name":"receiver", "type":"account_name"},
144 | {"name":"bytes", "type":"uint32"}
145 | ]
146 | },{
147 | "name": "sellram",
148 | "base": "",
149 | "fields": [
150 | {"name":"account", "type":"account_name"},
151 | {"name":"bytes", "type":"uint64"}
152 | ]
153 | },{
154 | "name": "buyram",
155 | "base": "",
156 | "fields": [
157 | {"name":"payer", "type":"account_name"},
158 | {"name":"receiver", "type":"account_name"},
159 | {"name":"quant", "type":"asset"}
160 | ]
161 | },{
162 | "name": "delegatebw",
163 | "base": "",
164 | "fields": [
165 | {"name":"from", "type":"account_name"},
166 | {"name":"receiver", "type":"account_name"},
167 | {"name":"stake_net_quantity", "type":"asset"},
168 | {"name":"stake_cpu_quantity", "type":"asset"},
169 | {"name":"transfer", "type":"bool"}
170 | ]
171 | },{
172 | "name": "undelegatebw",
173 | "base": "",
174 | "fields": [
175 | {"name":"from", "type":"account_name"},
176 | {"name":"receiver", "type":"account_name"},
177 | {"name":"unstake_net_quantity", "type":"asset"},
178 | {"name":"unstake_cpu_quantity", "type":"asset"}
179 | ]
180 | },{
181 | "name": "refund",
182 | "base": "",
183 | "fields": [
184 | {"name":"owner", "type":"account_name"}
185 | ]
186 | },{
187 | "name": "delegated_bandwidth",
188 | "base": "",
189 | "fields": [
190 | {"name":"from", "type":"account_name"},
191 | {"name":"to", "type":"account_name"},
192 | {"name":"net_weight", "type":"asset"},
193 | {"name":"cpu_weight", "type":"asset"}
194 | ]
195 | },{
196 | "name": "user_resources",
197 | "base": "",
198 | "fields": [
199 | {"name":"owner", "type":"account_name"},
200 | {"name":"net_weight", "type":"asset"},
201 | {"name":"cpu_weight", "type":"asset"},
202 | {"name":"ram_bytes", "type":"uint64"}
203 | ]
204 | },{
205 | "name": "total_resources",
206 | "base": "",
207 | "fields": [
208 | {"name":"owner", "type":"account_name"},
209 | {"name":"net_weight", "type":"asset"},
210 | {"name":"cpu_weight", "type":"asset"},
211 | {"name":"ram_bytes", "type":"uint64"}
212 | ]
213 | },{
214 | "name": "refund_request",
215 | "base": "",
216 | "fields": [
217 | {"name":"owner", "type":"account_name"},
218 | {"name":"request_time", "type":"time_point_sec"},
219 | {"name":"net_amount", "type":"asset"},
220 | {"name":"cpu_amount", "type":"asset"}
221 | ]
222 | },{
223 | "name": "blockchain_parameters",
224 | "base": "",
225 | "fields": [
226 |
227 | {"name":"max_block_net_usage", "type":"uint64"},
228 | {"name":"target_block_net_usage_pct", "type":"uint32"},
229 | {"name":"max_transaction_net_usage", "type":"uint32"},
230 | {"name":"base_per_transaction_net_usage", "type":"uint32"},
231 | {"name":"net_usage_leeway", "type":"uint32"},
232 | {"name":"context_free_discount_net_usage_num", "type":"uint32"},
233 | {"name":"context_free_discount_net_usage_den", "type":"uint32"},
234 | {"name":"max_block_cpu_usage", "type":"uint32"},
235 | {"name":"target_block_cpu_usage_pct", "type":"uint32"},
236 | {"name":"max_transaction_cpu_usage", "type":"uint32"},
237 | {"name":"min_transaction_cpu_usage", "type":"uint32"},
238 | {"name":"max_transaction_lifetime", "type":"uint32"},
239 | {"name":"deferred_trx_expiration_window", "type":"uint32"},
240 | {"name":"max_transaction_delay", "type":"uint32"},
241 | {"name":"max_inline_action_size", "type":"uint32"},
242 | {"name":"max_inline_action_depth", "type":"uint16"},
243 | {"name":"max_authority_depth", "type":"uint16"}
244 |
245 | ]
246 | },{
247 | "name": "eosio_global_state",
248 | "base": "blockchain_parameters",
249 | "fields": [
250 | {"name":"max_ram_size", "type":"uint64"},
251 | {"name":"total_ram_bytes_reserved", "type":"uint64"},
252 | {"name":"total_ram_stake", "type":"int64"},
253 | {"name":"last_producer_schedule_update", "type":"block_timestamp_type"},
254 | {"name":"last_pervote_bucket_fill", "type":"uint64"},
255 | {"name":"pervote_bucket", "type":"int64"},
256 | {"name":"perblock_bucket", "type":"int64"},
257 | {"name":"total_unpaid_blocks", "type":"uint32"},
258 | {"name":"total_activated_stake", "type":"int64"},
259 | {"name":"thresh_activated_stake_time", "type":"uint64"},
260 | {"name":"last_producer_schedule_size", "type":"uint16"},
261 | {"name":"total_producer_vote_weight", "type":"float64"},
262 | {"name":"last_name_close", "type":"block_timestamp_type"}
263 | ]
264 | },{
265 | "name": "producer_info",
266 | "base": "",
267 | "fields": [
268 | {"name":"owner", "type":"account_name"},
269 | {"name":"total_votes", "type":"float64"},
270 | {"name":"producer_key", "type":"public_key"},
271 | {"name":"is_active", "type":"bool"},
272 | {"name":"url", "type":"string"},
273 | {"name":"unpaid_blocks", "type":"uint32"},
274 | {"name":"last_claim_time", "type":"uint64"},
275 | {"name":"location", "type":"uint16"}
276 | ]
277 | },{
278 | "name": "regproducer",
279 | "base": "",
280 | "fields": [
281 | {"name":"producer", "type":"account_name"},
282 | {"name":"producer_key", "type":"public_key"},
283 | {"name":"url", "type":"string"},
284 | {"name":"location", "type":"uint16"}
285 | ]
286 | },{
287 | "name": "unregprod",
288 | "base": "",
289 | "fields": [
290 | {"name":"producer", "type":"account_name"}
291 | ]
292 | },{
293 | "name": "setram",
294 | "base": "",
295 | "fields": [
296 | {"name":"max_ram_size", "type":"uint64"}
297 | ]
298 | },{
299 | "name": "regproxy",
300 | "base": "",
301 | "fields": [
302 | {"name":"proxy", "type":"account_name"},
303 | {"name":"isproxy", "type":"bool"}
304 | ]
305 | },{
306 | "name": "voteproducer",
307 | "base": "",
308 | "fields": [
309 | {"name":"voter", "type":"account_name"},
310 | {"name":"proxy", "type":"account_name"},
311 | {"name":"producers", "type":"account_name[]"}
312 | ]
313 | },{
314 | "name": "voter_info",
315 | "base": "",
316 | "fields": [
317 | {"name":"owner", "type":"account_name"},
318 | {"name":"proxy", "type":"account_name"},
319 | {"name":"producers", "type":"account_name[]"},
320 | {"name":"staked", "type":"int64"},
321 | {"name":"last_vote_weight", "type":"float64"},
322 | {"name":"proxied_vote_weight", "type":"float64"},
323 | {"name":"is_proxy", "type":"bool"}
324 | ]
325 | },{
326 | "name": "claimrewards",
327 | "base": "",
328 | "fields": [
329 | {"name":"owner", "type":"account_name"}
330 | ]
331 | },{
332 | "name": "setpriv",
333 | "base": "",
334 | "fields": [
335 | {"name":"account", "type":"account_name"},
336 | {"name":"is_priv", "type":"int8"}
337 | ]
338 | },{
339 | "name": "rmvproducer",
340 | "base": "",
341 | "fields": [
342 | {"name":"producer", "type":"account_name"}
343 | ]
344 | },{
345 | "name": "set_account_limits",
346 | "base": "",
347 | "fields": [
348 | {"name":"account", "type":"account_name"},
349 | {"name":"ram_bytes", "type":"int64"},
350 | {"name":"net_weight", "type":"int64"},
351 | {"name":"cpu_weight", "type":"int64"}
352 | ]
353 | },{
354 | "name": "set_global_limits",
355 | "base": "",
356 | "fields": [
357 | {"name":"cpu_usec_per_period", "type":"int64"}
358 | ]
359 | },{
360 | "name": "producer_key",
361 | "base": "",
362 | "fields": [
363 | {"name":"producer_name", "type":"account_name"},
364 | {"name":"block_signing_key", "type":"public_key"}
365 | ]
366 | },{
367 | "name": "set_producers",
368 | "base": "",
369 | "fields": [
370 | {"name":"schedule", "type":"producer_key[]"}
371 | ]
372 | },{
373 | "name": "require_auth",
374 | "base": "",
375 | "fields": [
376 | {"name":"from", "type":"account_name"}
377 | ]
378 | },{
379 | "name": "setparams",
380 | "base": "",
381 | "fields": [
382 | {"name":"params", "type":"blockchain_parameters"}
383 | ]
384 | },{
385 | "name": "connector",
386 | "base": "",
387 | "fields": [
388 | {"name":"balance", "type":"asset"},
389 | {"name":"weight", "type":"float64"}
390 | ]
391 | },{
392 | "name": "exchange_state",
393 | "base": "",
394 | "fields": [
395 | {"name":"supply", "type":"asset"},
396 | {"name":"base", "type":"connector"},
397 | {"name":"quote", "type":"connector"}
398 | ]
399 | }, {
400 | "name": "namebid_info",
401 | "base": "",
402 | "fields": [
403 | {"name":"newname", "type":"account_name"},
404 | {"name":"high_bidder", "type":"account_name"},
405 | {"name":"high_bid", "type":"int64"},
406 | {"name":"last_bid_time", "type":"uint64"}
407 | ]
408 | }
409 | ],
410 | "actions": [{
411 | "name": "newaccount",
412 | "type": "newaccount",
413 | "ricardian_contract": ""
414 | },{
415 | "name": "setcode",
416 | "type": "setcode",
417 | "ricardian_contract": ""
418 | },{
419 | "name": "setabi",
420 | "type": "setabi",
421 | "ricardian_contract": ""
422 | },{
423 | "name": "updateauth",
424 | "type": "updateauth",
425 | "ricardian_contract": ""
426 | },{
427 | "name": "deleteauth",
428 | "type": "deleteauth",
429 | "ricardian_contract": ""
430 | },{
431 | "name": "linkauth",
432 | "type": "linkauth",
433 | "ricardian_contract": ""
434 | },{
435 | "name": "unlinkauth",
436 | "type": "unlinkauth",
437 | "ricardian_contract": ""
438 | },{
439 | "name": "canceldelay",
440 | "type": "canceldelay",
441 | "ricardian_contract": ""
442 | },{
443 | "name": "onerror",
444 | "type": "onerror",
445 | "ricardian_contract": ""
446 | },{
447 | "name": "buyrambytes",
448 | "type": "buyrambytes",
449 | "ricardian_contract": ""
450 | },{
451 | "name": "buyram",
452 | "type": "buyram",
453 | "ricardian_contract": ""
454 | },{
455 | "name": "sellram",
456 | "type": "sellram",
457 | "ricardian_contract": ""
458 | },{
459 | "name": "delegatebw",
460 | "type": "delegatebw",
461 | "ricardian_contract": ""
462 | },{
463 | "name": "undelegatebw",
464 | "type": "undelegatebw",
465 | "ricardian_contract": ""
466 | },{
467 | "name": "refund",
468 | "type": "refund",
469 | "ricardian_contract": ""
470 | },{
471 | "name": "regproducer",
472 | "type": "regproducer",
473 | "ricardian_contract": ""
474 | },{
475 | "name": "setram",
476 | "type": "setram",
477 | "ricardian_contract": ""
478 | },{
479 | "name": "bidname",
480 | "type": "bidname",
481 | "ricardian_contract": ""
482 | },{
483 | "name": "unregprod",
484 | "type": "unregprod",
485 | "ricardian_contract": ""
486 | },{
487 | "name": "regproxy",
488 | "type": "regproxy",
489 | "ricardian_contract": ""
490 | },{
491 | "name": "voteproducer",
492 | "type": "voteproducer",
493 | "ricardian_contract": ""
494 | },{
495 | "name": "claimrewards",
496 | "type": "claimrewards",
497 | "ricardian_contract": ""
498 | },{
499 | "name": "setpriv",
500 | "type": "setpriv",
501 | "ricardian_contract": ""
502 | },{
503 | "name": "rmvproducer",
504 | "type": "rmvproducer",
505 | "ricardian_contract": ""
506 | },{
507 | "name": "setalimits",
508 | "type": "set_account_limits",
509 | "ricardian_contract": ""
510 | },{
511 | "name": "setglimits",
512 | "type": "set_global_limits",
513 | "ricardian_contract": ""
514 | },{
515 | "name": "setprods",
516 | "type": "set_producers",
517 | "ricardian_contract": ""
518 | },{
519 | "name": "reqauth",
520 | "type": "require_auth",
521 | "ricardian_contract": ""
522 | },{
523 | "name": "setparams",
524 | "type": "setparams",
525 | "ricardian_contract": ""
526 | }],
527 | "tables": [{
528 | "name": "producers",
529 | "type": "producer_info",
530 | "index_type": "i64",
531 | "key_names" : ["owner"],
532 | "key_types" : ["uint64"]
533 | },{
534 | "name": "global",
535 | "type": "eosio_global_state",
536 | "index_type": "i64",
537 | "key_names" : [],
538 | "key_types" : []
539 | },{
540 | "name": "voters",
541 | "type": "voter_info",
542 | "index_type": "i64",
543 | "key_names" : ["owner"],
544 | "key_types" : ["account_name"]
545 | },{
546 | "name": "userres",
547 | "type": "user_resources",
548 | "index_type": "i64",
549 | "key_names" : ["owner"],
550 | "key_types" : ["uint64"]
551 | },{
552 | "name": "delband",
553 | "type": "delegated_bandwidth",
554 | "index_type": "i64",
555 | "key_names" : ["to"],
556 | "key_types" : ["uint64"]
557 | },{
558 | "name": "rammarket",
559 | "type": "exchange_state",
560 | "index_type": "i64",
561 | "key_names" : ["supply"],
562 | "key_types" : ["uint64"]
563 | },{
564 | "name": "refunds",
565 | "type": "refund_request",
566 | "index_type": "i64",
567 | "key_names" : ["owner"],
568 | "key_types" : ["uint64"]
569 | },{
570 | "name": "namebids",
571 | "type": "namebid_info",
572 | "index_type": "i64",
573 | "key_names" : ["newname"],
574 | "key_types" : ["account_name"]
575 | }
576 | ],
577 | "ricardian_clauses": [],
578 | "abi_extensions": []
579 | }
580 | )=====";
581 |
--------------------------------------------------------------------------------
/k8s/scripts/contracts/eosio.system/eosio.system.wasm:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eosiosg/dpos-pbft/f5891e202a9692f8b8287dceb03f1f03a68e9fde/k8s/scripts/contracts/eosio.system/eosio.system.wasm
--------------------------------------------------------------------------------
/k8s/scripts/contracts/eosio.token/eosio.token.abi:
--------------------------------------------------------------------------------
1 | {
2 | "version": "eosio::abi/1.0",
3 | "types": [{
4 | "new_type_name": "account_name",
5 | "type": "name"
6 | }],
7 | "structs": [{
8 | "name": "transfer",
9 | "base": "",
10 | "fields": [
11 | {"name":"from", "type":"account_name"},
12 | {"name":"to", "type":"account_name"},
13 | {"name":"quantity", "type":"asset"},
14 | {"name":"memo", "type":"string"}
15 | ]
16 | },{
17 | "name": "create",
18 | "base": "",
19 | "fields": [
20 | {"name":"issuer", "type":"account_name"},
21 | {"name":"maximum_supply", "type":"asset"}
22 | ]
23 | },{
24 | "name": "issue",
25 | "base": "",
26 | "fields": [
27 | {"name":"to", "type":"account_name"},
28 | {"name":"quantity", "type":"asset"},
29 | {"name":"memo", "type":"string"}
30 | ]
31 | },{
32 | "name": "account",
33 | "base": "",
34 | "fields": [
35 | {"name":"balance", "type":"asset"}
36 | ]
37 | },{
38 | "name": "currency_stats",
39 | "base": "",
40 | "fields": [
41 | {"name":"supply", "type":"asset"},
42 | {"name":"max_supply", "type":"asset"},
43 | {"name":"issuer", "type":"account_name"}
44 | ]
45 | }
46 | ],
47 | "actions": [{
48 | "name": "transfer",
49 | "type": "transfer",
50 | "ricardian_contract": ""
51 | },{
52 | "name": "issue",
53 | "type": "issue",
54 | "ricardian_contract": ""
55 | }, {
56 | "name": "create",
57 | "type": "create",
58 | "ricardian_contract": ""
59 | }
60 |
61 | ],
62 | "tables": [{
63 | "name": "accounts",
64 | "type": "account",
65 | "index_type": "i64",
66 | "key_names" : ["currency"],
67 | "key_types" : ["uint64"]
68 | },{
69 | "name": "stat",
70 | "type": "currency_stats",
71 | "index_type": "i64",
72 | "key_names" : ["currency"],
73 | "key_types" : ["uint64"]
74 | }
75 | ],
76 | "ricardian_clauses": [],
77 | "abi_extensions": []
78 | }
79 |
--------------------------------------------------------------------------------
/k8s/scripts/contracts/eosio.token/eosio.token.abi.hpp:
--------------------------------------------------------------------------------
1 | const char* const eosio_token_abi = R"=====(
2 | {
3 | "version": "eosio::abi/1.0",
4 | "types": [{
5 | "new_type_name": "account_name",
6 | "type": "name"
7 | }],
8 | "structs": [{
9 | "name": "transfer",
10 | "base": "",
11 | "fields": [
12 | {"name":"from", "type":"account_name"},
13 | {"name":"to", "type":"account_name"},
14 | {"name":"quantity", "type":"asset"},
15 | {"name":"memo", "type":"string"}
16 | ]
17 | },{
18 | "name": "create",
19 | "base": "",
20 | "fields": [
21 | {"name":"issuer", "type":"account_name"},
22 | {"name":"maximum_supply", "type":"asset"}
23 | ]
24 | },{
25 | "name": "issue",
26 | "base": "",
27 | "fields": [
28 | {"name":"to", "type":"account_name"},
29 | {"name":"quantity", "type":"asset"},
30 | {"name":"memo", "type":"string"}
31 | ]
32 | },{
33 | "name": "account",
34 | "base": "",
35 | "fields": [
36 | {"name":"balance", "type":"asset"}
37 | ]
38 | },{
39 | "name": "currency_stats",
40 | "base": "",
41 | "fields": [
42 | {"name":"supply", "type":"asset"},
43 | {"name":"max_supply", "type":"asset"},
44 | {"name":"issuer", "type":"account_name"}
45 | ]
46 | }
47 | ],
48 | "actions": [{
49 | "name": "transfer",
50 | "type": "transfer",
51 | "ricardian_contract": ""
52 | },{
53 | "name": "issue",
54 | "type": "issue",
55 | "ricardian_contract": ""
56 | }, {
57 | "name": "create",
58 | "type": "create",
59 | "ricardian_contract": ""
60 | }
61 |
62 | ],
63 | "tables": [{
64 | "name": "accounts",
65 | "type": "account",
66 | "index_type": "i64",
67 | "key_names" : ["currency"],
68 | "key_types" : ["uint64"]
69 | },{
70 | "name": "stat",
71 | "type": "currency_stats",
72 | "index_type": "i64",
73 | "key_names" : ["currency"],
74 | "key_types" : ["uint64"]
75 | }
76 | ],
77 | "ricardian_clauses": [],
78 | "abi_extensions": []
79 | }
80 | )=====";
81 |
--------------------------------------------------------------------------------
/k8s/scripts/contracts/eosio.token/eosio.token.wasm:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eosiosg/dpos-pbft/f5891e202a9692f8b8287dceb03f1f03a68e9fde/k8s/scripts/contracts/eosio.token/eosio.token.wasm
--------------------------------------------------------------------------------
/k8s/scripts/cron-vote.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | # set -ex
4 |
5 | SELECTED=()
6 |
7 | shuffle_and_select_bps(){
8 | N=21
9 | BPS=( bpa bpb bpc bpd bpe bpf bpg bph bpi bpj bpk bpl bpm bpn bpo bpp bpq bpr bps bpt bpu bpv bpw bpx bpy bpz )
10 | tmp=()
11 | for index in $(shuf --input-range=0-$(( ${#BPS[*]} - 1 )) -n ${N})
12 | do
13 | tmp+=(${BPS[$index]})
14 | done
15 | SELECTED=($(echo "${tmp[@]}" | sed 's/ /\n/g' | sort))
16 | }
17 |
18 | shuffle_and_select_bps
19 | # new_array=($(echo "${SELECTED[@]}" | sed 's/ /\n/g' | sort))
20 | echo ${SELECTED[@]}
21 |
22 | while :
23 | do
24 | shuffle_and_select_bps
25 | cleos $remote system voteproducer prods voter ${SELECTED[*]} -p voter
26 | echo "sleep 10 seconds"
27 | sleep 10
28 | done
29 |
30 |
31 |
32 | # N=11
33 | # BPS=( bpa bpb bpc bpd bpe bpf bpg bph bpi bpj bpk bpl bpm bpn )
34 | # SELECTED=()
35 | # for index in $(shuf --input-range=0-$(( ${#BPS[*]} - 1 )) -n ${N})
36 | # do
37 | # echo "selecte: ${BPS[$index]}"
38 | # SELECTED+=(${BPS[$index]})
39 | # done
40 | #
41 | # echo ${BPS[*]}
42 | # echo ${SELECTED[*]}
43 | #
44 | # while :
45 | # do
46 | # cleos $remote system voteproducer prods voter -p voter
47 | # echo "sleep 120 seconds"
48 | # sleep 120
49 | #
50 | # cleos $remote system voteproducer prods voter -p voter
51 | # echo "sleep 120 seconds"
52 | # sleep 120
53 | #
54 | # cleos $remote system voteproducer prods voter -p voter
55 | # echo "sleep 120 seconds"
56 | # sleep 120
57 | #
58 | # done
59 | # bpa bpb bpc bpd bpe bpf bpg bph bpi bpj bpk bpl bpm bpn
60 |
--------------------------------------------------------------------------------
/k8s/scripts/env.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | export remote="-u http://127.0.0.1:8888"
4 |
--------------------------------------------------------------------------------
/k8s/scripts/start.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | #import eosio key
4 | cleos wallet import --private-key 5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3
5 |
6 | # deploy bios
7 | cleos $remote set contract eosio ./contracts/eosio.bios/ eosio.bios.wasm eosio.bios.abi -p eosio
8 |
9 | # create system account
10 | SYSTEM_ACCOUNT="eosio.bpay eosio.msig eosio.names eosio.ram eosio.ramfee eosio.saving eosio.stake eosio.token eosio.vpay"
11 |
12 | for sa in $SYSTEM_ACCOUNT
13 | do
14 | echo $sa
15 | cleos $remote create account eosio $sa EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV -p eosio
16 | done
17 |
18 | # deploy token contract and issue
19 | cleos $remote set contract eosio.token contracts/eosio.token eosio.token.wasm eosio.token.abi -p eosio.token
20 |
21 | cleos $remote push action eosio.token create '["eosio", "10000000000.0000 EOS", 0, 0, 0]' -p eosio.token
22 | cleos $remote push action eosio.token issue '["eosio", "1000000000.0000 EOS", "issue 1B to eosio"]' -p eosio
23 |
24 | # deploy msig contract
25 | cleos $remote set contract eosio.msig contracts/eosio.msig eosio.msig.wasm eosio.msig.abi -p eosio.msig
26 |
27 | # deploy system contract
28 | cleos $remote set contract eosio contracts/eosio.system eosio.system.wasm eosio.system.abi -p eosio
29 |
30 | cleos $remote system newaccount eosio voter EOS54HgSQ9d6qjUT7pEZgbP83zQpcymR4QW1jz2jPDEdbAeKGaUif EOS54HgSQ9d6qjUT7pEZgbP83zQpcymR4QW1jz2jPDEdbAeKGaUif --stake-net "10 EOS" --stake-cpu "10 EOS" --buy-ram-kbytes 10000
31 | cleos wallet import --private-key 5KE3vxAZ5tBXubjMeFJ9uCHHjfQeAzDqPLeW4XHGVcuKHPPLCrA
32 | cleos $remote transfer eosio voter "200000000.0000 EOS" "transfer 200M to voter"
33 | sleep 2 ;
34 | cleos $remote system delegatebw voter voter '100000000.0000 EOS' '100000000.0000 EOS' -p voter
35 |
36 |
37 |
38 | #cleos $remote push action eosio setpriv '["eosio.msig",1]' -p eosio
39 |
40 | # create bps
41 | ACCOUNTS="bpa bpb bpc bpd bpe bpf bpg bph bpi bpj bpk bpl bpm bpn bpo bpp bpq bpr bps bpt bpu bpv bpw bpx bpy bpz"
42 |
43 | for acc in $ACCOUNTS
44 | do
45 | echo $acc
46 | cleos $remote system newaccount eosio $acc EOS54HgSQ9d6qjUT7pEZgbP83zQpcymR4QW1jz2jPDEdbAeKGaUif EOS54HgSQ9d6qjUT7pEZgbP83zQpcymR4QW1jz2jPDEdbAeKGaUif --stake-cpu "1000 EOS" --stake-net "1000 EOS" --buy-ram "1000 EOS" -p eosio
47 | cleos $remote transfer eosio $acc "1000 EOS" "red packet" -p eosio
48 | done
49 |
50 | cleos $remote system regproducer bpa EOS5ZMVRKjoxdqwy3eDQkLF53uYRSvTvW8EijsD47NAkbq5GbmSH3 '' 0 -p bpa
51 | cleos $remote system regproducer bpb EOS7WKuVc8R8X5zrfTRKbhbZuaJPKRYZqQQ6qXoXQfeS8iGK4afyk '' 0 -p bpb
52 | cleos $remote system regproducer bpc EOS73iZuyLajqCK2WDGAmYMUb4Zr3hmpDeNSJvKJwDVkgoHcvMpjW '' 0 -p bpc
53 | cleos $remote system regproducer bpd EOS84pKNhrH712xbjAwst9yW7nBZenAd3eZs6PYZuPYu6Y2PfC84p '' 0 -p bpd
54 | cleos $remote system regproducer bpe EOS5nfo8X8NvHtNA8cTDSi2mdSFuBcUHtQ1ZyTdxocVtQTHjakdMg '' 0 -p bpe
55 | cleos $remote system regproducer bpf EOS5MUtpyHQsH41rdfU6LG3urrGLozaR4i4N1Mkj39D3zyBwtw4rU '' 0 -p bpf
56 | cleos $remote system regproducer bpg EOS6USJq2xnmsBpvoJjFcefLCtxeEvoCQTTwSqbvRg79UeCdNGzB6 '' 0 -p bpg
57 | cleos $remote system regproducer bph EOS52rUogvuR7RjA7EHaPomAxPr4iKkGxFFFk83Mc24SusUGQxBvk '' 0 -p bph
58 | cleos $remote system regproducer bpi EOS66RMTqXUDn7osZ2feCFZgBMEib4QNUzs9zLqTF4g2kTXWVstpg '' 0 -p bpi
59 | cleos $remote system regproducer bpj EOS5iLrUhakDpFCNHcmrxv6xiYG3XQDTHEGt9jbJZorj1VB1LbzNX '' 0 -p bpj
60 | cleos $remote system regproducer bpk EOS5dnfLiLQHHvBd4GqWVrVT9KtUvT1Kfm6EUMC2jXbSdVuypUGKk '' 0 -p bpk
61 | cleos $remote system regproducer bpl EOS6qdG6S7Ev8uYEXD3nFxVvBU7iuP5F2WoYboZNvaG814nfgYiDN '' 0 -p bpl
62 | cleos $remote system regproducer bpm EOS7YyTzTxxR87hrvNtYat5UGojJGxm3ikvPQP68KMav2WBwwA9ic '' 0 -p bpm
63 | cleos $remote system regproducer bpn EOS6mA2BxGKbEiwDbbDPhQ1vqV4bAps49PfXuvadb8Vc4REJw1V3h '' 0 -p bpn
64 | cleos $remote system regproducer bpo EOS7XfCLNwreuApLd1RnTSCHwZEs3BKVDp4G5uk49en6whkjnVZ6G '' 0 -p bpo
65 | cleos $remote system regproducer bpp EOS7435EQ76dweLSHa4XBtwTVL9MVqGW1d9sm6SNPHkeEkDSp2e84 '' 0 -p bpp
66 | cleos $remote system regproducer bpq EOS5tDFbEzjpxktdCZZgH1wERjYPHajH3LcH9TVjCF6iSJ6EVAr9t '' 0 -p bpq
67 | cleos $remote system regproducer bpr EOS6FqJDxVzNh5CNnmktB4s2qiLzKUTH8SCjKRNTyHSYxsasdnZVA '' 0 -p bpr
68 | cleos $remote system regproducer bpt EOS5zcM9Dweb3s96G7eY8N1FmBP98uhdSXHgAG78kJBsqyamBDvSh '' 0 -p bpt
69 | cleos $remote system regproducer bps EOS6CyP5JLTnJ353wXdggayRm8wDMQ5YA3hVwSQ1rwVJ9Q9rsnT1x '' 0 -p bps
70 | cleos $remote system regproducer bpu EOS5GVbsUDmuuEnQFNJdoPBTNPXhzTqRFKz6d1zgRPmdrXxg6obuL '' 0 -p bpu
71 | cleos $remote system regproducer bpv EOS885TY14LT21h8ieV2Krxpahf17TnuCJm2wbHpWrhNcUgYUdcb3 '' 0 -p bpv
72 | cleos $remote system regproducer bpw EOS7zVNTpr9PfLzTYybnWMn8KsMCtpsNu842rPRMxQiAAm4KFjyn1 '' 0 -p bpw
73 | cleos $remote system regproducer bpx EOS8RufiWCXVUrSfGPirnS8zGp4nRkbZwX9ykakviAnrnP5i6mE9Y '' 0 -p bpx
74 | cleos $remote system regproducer bpy EOS54bVNK7hvwKuhyeBTTyZpucD6LkXN6Bzw5NspoTkMaojo3poch '' 0 -p bpy
75 | cleos $remote system regproducer bpz EOS6S5QYtt7choB6EYc7yAwUMVeBXQDhx3BR36VRhFkhwpfURr6SP '' 0 -p bpz
76 |
--------------------------------------------------------------------------------
/k8s/src/gcp/apply.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | kustomize build . | kubectl apply -f -
4 |
--------------------------------------------------------------------------------
/k8s/src/gcp/clean.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | kubectl scale --replicas=0 statefulset eosio
4 | kubectl scale --replicas=0 statefulset node
5 | kubectl scale --replicas=0 statefulset bp
6 |
7 | for i in {25..0..-1}; do kubectl delete pod bp-$i; done
8 | for i in {8..0..-1}; do kubectl delete pod node-$i; done
9 |
10 | kubectl delete statefulset eosio
11 | kubectl delete statefulset node
12 | kubectl delete statefulset bp
13 |
14 | kubectl delete pvc --all
15 |
--------------------------------------------------------------------------------
/k8s/src/gcp/delete.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | kustomize build . | kubectl delete -f -
4 |
--------------------------------------------------------------------------------
/k8s/src/gcp/kustomization.yaml:
--------------------------------------------------------------------------------
1 | commonLabels:
2 | app: nodes
3 | bases:
4 | - ../n-nodes
5 | resources:
6 | - storageclass.yaml
7 | patches:
8 | - statefulsets.yaml
9 | - storageclass.yaml
10 | - monitor.yaml
11 |
--------------------------------------------------------------------------------
/k8s/src/gcp/mannual_delete_pod.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | for i in {25..0..-1}; do kubectl delete pod bp-$i; done
4 | for i in {8..0..-1}; do kubectl delete pod node-$i; done
5 |
--------------------------------------------------------------------------------
/k8s/src/gcp/monitor.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: apps/v1
2 | kind: ReplicaSet
3 | metadata:
4 | name: monitor
5 | spec:
6 | replicas: 1
7 | template:
8 | metadata:
9 | name: monitor
10 | labels:
11 | app: nodes
12 | name: monitor
13 | spec:
14 | containers:
15 | - name: monitor
16 | image: deadlock/node-monitor:gcp
17 | ports:
18 | - containerPort: 7700
19 |
--------------------------------------------------------------------------------
/k8s/src/gcp/statefulsets.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: apps/v1
2 | kind: StatefulSet
3 | metadata:
4 | name: eosio
5 | spec:
6 | selector:
7 | matchLabels:
8 | app: nodes
9 | serviceName: nodes
10 | replicas: 1
11 | template:
12 | spec:
13 | terminationGracePeriodSeconds: 600
14 | containers:
15 | - name: eosio
16 | image: deadlock/eos-dpos-pbft:v0.5.5
17 | volumeMounts:
18 | - name: data-dir
19 | mountPath: /root/.local/share/eosio/nodeos/data
20 | volumeClaimTemplates:
21 | - metadata:
22 | name: data-dir
23 | spec:
24 | accessModes:
25 | - ReadWriteOnce
26 | storageClassName: slow
27 | resources:
28 | requests:
29 | storage: 1Gi
30 |
31 | ---
32 |
33 | apiVersion: apps/v1
34 | kind: StatefulSet
35 | metadata:
36 | name: bp
37 | spec:
38 | selector:
39 | matchLabels:
40 | app: nodes
41 | serviceName: nodes
42 | replicas: 26
43 | template:
44 | metadata:
45 | labels:
46 | app: nodes
47 | spec:
48 | terminationGracePeriodSeconds: 600
49 | containers:
50 | - name: bp
51 | image: deadlock/eos-dpos-pbft:v0.5.5
52 | volumeMounts:
53 | - name: n-nodes-config-config-ini
54 | mountPath: /root/.local/share/eosio/nodeos/config/config.ini
55 | subPath: config.ini
56 | - name: data-dir
57 | mountPath: /root/.local/share/eosio/nodeos/data
58 | volumes:
59 | - name: n-nodes-config-config-ini
60 | configMap:
61 | name: n-nodes-config
62 | volumeClaimTemplates:
63 | - metadata:
64 | name: data-dir
65 | spec:
66 | accessModes:
67 | - ReadWriteOnce
68 | storageClassName: slow
69 | resources:
70 | requests:
71 | storage: 1Gi
72 |
73 | ---
74 |
75 | apiVersion: apps/v1
76 | kind: StatefulSet
77 | metadata:
78 | name: node
79 | spec:
80 | selector:
81 | matchLabels:
82 | app: nodes
83 | serviceName: nodes
84 | replicas: 9
85 | template:
86 | metadata:
87 | labels:
88 | app: nodes
89 | spec:
90 | terminationGracePeriodSeconds: 600
91 | containers:
92 | - name: node
93 | image: deadlock/eos-dpos-pbft:v0.5.5
94 | volumeMounts:
95 | - name: n-nodes-config-config-ini
96 | mountPath: /root/.local/share/eosio/nodeos/config/config.ini
97 | subPath: config.ini
98 | - name: data-dir
99 | mountPath: /root/.local/share/eosio/nodeos/data
100 | volumes:
101 | - name: n-nodes-config-config-ini
102 | configMap:
103 | name: n-nodes-config
104 | volumeClaimTemplates:
105 | - metadata:
106 | name: data-dir
107 | spec:
108 | accessModes:
109 | - ReadWriteOnce
110 | storageClassName: slow
111 | resources:
112 | requests:
113 | storage: 1Gi
114 |
--------------------------------------------------------------------------------
/k8s/src/gcp/storageclass.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: storage.k8s.io/v1
2 | kind: StorageClass
3 | metadata:
4 | name: slow
5 | provisioner: kubernetes.io/gce-pd
6 | parameters:
7 | type: pd-standard
8 |
--------------------------------------------------------------------------------
/k8s/src/localhost/apply.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | kustomize build . | kubectl apply -f -
4 |
--------------------------------------------------------------------------------
/k8s/src/localhost/clean.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | kubectl scale --replicas=0 statefulset eosio
4 | kubectl scale --replicas=0 statefulset node
5 | kubectl scale --replicas=0 statefulset bp
6 |
7 | for i in {25..0..-1}; do kubectl delete pod bp-$i; done
8 | for i in {8..0..-1}; do kubectl delete pod node-$i; done
9 |
10 | kubectl delete statefulset eosio
11 | kubectl delete statefulset node
12 | kubectl delete statefulset bp
13 |
--------------------------------------------------------------------------------
/k8s/src/localhost/delete.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | kustomize build . | kubectl delete -f -
4 |
--------------------------------------------------------------------------------
/k8s/src/localhost/kustomization.yaml:
--------------------------------------------------------------------------------
1 | commonLabels:
2 | app: nodes
3 | bases:
4 | - ../n-nodes
5 | patches:
6 | - statefulsets.yaml
7 |
--------------------------------------------------------------------------------
/k8s/src/localhost/mannual_delete_pod.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | for i in {25..0..-1}; do kubectl delete pod bp-$i; done
4 | for i in {8..0..-1}; do kubectl delete pod node-$i; done
5 |
--------------------------------------------------------------------------------
/k8s/src/localhost/statefulsets.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: apps/v1
2 | kind: StatefulSet
3 | metadata:
4 | name: eosio
5 | spec:
6 | selector:
7 | matchLabels:
8 | app: nodes
9 | serviceName: nodes
10 | replicas: 1
11 | template:
12 | spec:
13 | terminationGracePeriodSeconds: 600
14 | containers:
15 | - name: eosio
16 | image: deadlock/eos-dpos-pbft:v0.5.10
17 | volumes:
18 | - name: data-dir
19 | emptyDir: {}
20 | volumeClaimTemplates: []
21 |
22 | ---
23 |
24 | apiVersion: apps/v1
25 | kind: StatefulSet
26 | metadata:
27 | name: bp
28 | spec:
29 | selector:
30 | matchLabels:
31 | app: nodes
32 | serviceName: nodes
33 | replicas: 26
34 | template:
35 | spec:
36 | terminationGracePeriodSeconds: 600
37 | containers:
38 | - name: bp
39 | image: deadlock/eos-dpos-pbft:v0.5.10
40 | volumes:
41 | - name: n-nodes-config-config-ini
42 | configMap:
43 | name: n-nodes-config
44 | - name: data-dir
45 | emptyDir: {}
46 | volumeClaimTemplates: []
47 |
48 | ---
49 |
50 | apiVersion: apps/v1
51 | kind: StatefulSet
52 | metadata:
53 | name: node
54 | spec:
55 | selector:
56 | matchLabels:
57 | app: nodes
58 | serviceName: nodes
59 | replicas: 9
60 | template:
61 | spec:
62 | terminationGracePeriodSeconds: 600
63 | containers:
64 | - name: node
65 | image: deadlock/eos-dpos-pbft:v0.5.10
66 | volumes:
67 | - name: n-nodes-config-config-ini
68 | configMap:
69 | name: n-nodes-config
70 | - name: data-dir
71 | emptyDir: {}
72 | volumeClaimTemplates: []
73 |
--------------------------------------------------------------------------------
/k8s/src/n-nodes/kustomization.yaml:
--------------------------------------------------------------------------------
1 | commonLabels:
2 | app: nodes
3 | resources:
4 | - configmap.yaml
5 | - monitor.yaml
6 | - service.yaml
7 | - statefulsets.yaml
8 | - tps.yaml
9 |
--------------------------------------------------------------------------------
/k8s/src/n-nodes/monitor.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: apps/v1
2 | kind: ReplicaSet
3 | metadata:
4 | name: monitor
5 | spec:
6 | selector:
7 | matchLabels:
8 | app: nodes
9 | replicas: 1
10 | template:
11 | metadata:
12 | name: monitor
13 | labels:
14 | app: nodes
15 | name: monitor
16 | spec:
17 | containers:
18 | - name: monitor
19 | image: deadlock/node-monitor:localhost
20 | ports:
21 | - containerPort: 7700
22 |
--------------------------------------------------------------------------------
/k8s/src/n-nodes/service.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: v1
2 | kind: Service
3 | metadata:
4 | name: nodes
5 | labels:
6 | app: nodes
7 | spec:
8 | ports:
9 | - port: 8888
10 | protocol: TCP
11 | clusterIP: None
12 | selector:
13 | app: nodes
14 |
15 | ---
16 |
17 | apiVersion: v1
18 | kind: Service
19 | metadata:
20 | name: loadbalancer
21 | spec:
22 | selector:
23 | app: nodes
24 | name: node
25 | ports:
26 | - name: p2p
27 | protocol: TCP
28 | port: 9876
29 | targetPort: 9876
30 | - name: api
31 | protocol: TCP
32 | port: 8888
33 | targetPort: 8888
34 | type: LoadBalancer
35 |
36 | ---
37 | apiVersion: v1
38 | kind: Service
39 | metadata:
40 | name: monitor
41 | spec:
42 | ports:
43 | - port: 80
44 | targetPort: 7700
45 | protocol: TCP
46 | selector:
47 | name: monitor
48 | type: LoadBalancer
49 |
--------------------------------------------------------------------------------
/k8s/src/n-nodes/statefulsets.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: apps/v1
2 | kind: StatefulSet
3 | metadata:
4 | name: eosio
5 | spec:
6 | selector:
7 | matchLabels:
8 | app: nodes
9 | serviceName: nodes
10 | replicas: 0
11 | template:
12 | metadata:
13 | labels:
14 | app: nodes
15 | producer: eosio
16 | spec:
17 | terminationGracePeriodSeconds: 600
18 | containers:
19 | - name: eosio
20 | image: deadlock/eos-dpos-pbft:v0.4.8
21 | resources:
22 | limits:
23 | cpu: "1"
24 | requests:
25 | cpu: "0.01"
26 | ports:
27 | - containerPort: 8888
28 | - containerPort: 9876
29 | envFrom:
30 | - configMapRef:
31 | name: n-nodes-config
32 | command: ["/bin/bash", "-c"]
33 | args:
34 | - export profile_id=${HOSTNAME##*-} ;
35 | export profile_name=eosio ;
36 | nodeos --producer-name=${profile_name} ${!profile_name} ;
37 | lifecycle:
38 | preStop:
39 | exec:
40 | command:
41 | - /bin/bash
42 | - -c
43 | - pkill nodeos ; while kill -0 8 2>/dev/null ; do sleep 1; done;
44 | volumeMounts:
45 | - name: data-dir
46 | mountPath: /root/.local/share/eosio/nodeos/data
47 |
48 | ---
49 |
50 | apiVersion: apps/v1
51 | kind: StatefulSet
52 | metadata:
53 | name: bp
54 | spec:
55 | selector:
56 | matchLabels:
57 | app: nodes
58 | serviceName: nodes
59 | replicas: 0
60 | template:
61 | metadata:
62 | labels:
63 | app: nodes
64 | name: bp
65 | spec:
66 | terminationGracePeriodSeconds: 600
67 | containers:
68 | - name: bp
69 | image: deadlock/eos-dpos-pbft:v0.4.8
70 | resources:
71 | limits:
72 | cpu: "1"
73 | requests:
74 | cpu: "0.01"
75 | ports:
76 | - containerPort: 8888
77 | - containerPort: 9876
78 | envFrom:
79 | - configMapRef:
80 | name: n-nodes-config
81 | command: ["/bin/bash", "-c"]
82 | args:
83 | - export profile_id=${HOSTNAME##*-} ;
84 | export abc=(bpa bpb bpc bpd bpe bpf bpg bph bpi bpj bpk bpl bpm bpn bpo bpp bpq bpr bps bpt bpu bpv bpw bpx bpy bpz) ;
85 | export profile_name=${abc[$profile_id]} ;
86 | nodeos --producer-name=${profile_name} ${!profile_name} ;
87 | lifecycle:
88 | preStop:
89 | exec:
90 | command:
91 | - sh
92 | - -c
93 | - pkill nodeos ; while kill -0 8 2>/dev/null ; do sleep 1; done;
94 | volumeMounts:
95 | - name: n-nodes-config-config-ini
96 | mountPath: /root/.local/share/eosio/nodeos/config/config.ini
97 | subPath: config.ini
98 | - name: data-dir
99 | mountPath: /root/.local/share/eosio/nodeos/data
100 | volumes:
101 | - name: n-nodes-config-config-ini
102 | configMap:
103 | name: n-nodes-config
104 | volumeClaimTemplates:
105 | - metadata:
106 | name: data-dir
107 | spec:
108 | accessModes:
109 | - ReadWriteOnce
110 | storageClassName: slow
111 | resources:
112 | requests:
113 | storage: 1Gi
114 |
115 | ---
116 |
117 | apiVersion: apps/v1
118 | kind: StatefulSet
119 | metadata:
120 | name: node
121 | spec:
122 | selector:
123 | matchLabels:
124 | app: nodes
125 | serviceName: nodes
126 | replicas: 0
127 | template:
128 | metadata:
129 | labels:
130 | app: nodes
131 | name: node
132 | spec:
133 | terminationGracePeriodSeconds: 600
134 | containers:
135 | - name: node
136 | image: deadlock/eos-dpos-pbft:v0.4.8
137 | resources:
138 | limits:
139 | cpu: "1"
140 | requests:
141 | cpu: "0.01"
142 | ports:
143 | - containerPort: 8888
144 | - containerPort: 9876
145 | envFrom:
146 | - configMapRef:
147 | name: n-nodes-config
148 | command: ["/bin/bash", "-c"]
149 | args:
150 | - export profile_id=${HOSTNAME##*-} ;
151 | export abc=({0..25}) ;
152 | export profile_name=node${abc[$profile_id]} ;
153 | nodeos ${!profile_name} ;
154 | lifecycle:
155 | preStop:
156 | exec:
157 | command:
158 | - sh
159 | - -c
160 | - pkill nodeos ; while kill -0 8 2>/dev/null ; do sleep 1; done;
161 | volumeMounts:
162 | - name: n-nodes-config-config-ini
163 | mountPath: /root/.local/share/eosio/nodeos/config/config.ini
164 | subPath: config.ini
165 | - name: data-dir
166 | mountPath: /root/.local/share/eosio/nodeos/data
167 | volumes:
168 | - name: n-nodes-config-config-ini
169 | configMap:
170 | name: n-nodes-config
171 | volumeClaimTemplates:
172 | - metadata:
173 | name: data-dir
174 | spec:
175 | accessModes:
176 | - ReadWriteOnce
177 | storageClassName: slow
178 | resources:
179 | requests:
180 | storage: 1Gi
181 |
--------------------------------------------------------------------------------
/k8s/src/n-nodes/tps.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: apps/v1
2 | kind: ReplicaSet
3 | metadata:
4 | name: tps
5 | spec:
6 | selector:
7 | matchLabels:
8 | app: nodes
9 | replicas: 0
10 | template:
11 | metadata:
12 | labels:
13 | app: nodes
14 | spec:
15 | containers:
16 | - name: tps
17 | image: deadlock/eos-tps:v1
18 | resources:
19 | limits:
20 | cpu: "0.1"
21 | requests:
22 | cpu: "0.01"
23 | env:
24 | - name: ChainId
25 | value: 'cf057bbfb72640471fd910bcb67639c22df9f92470936cddc1ade0e2f2e7dc4f'
26 | - name: PRIVATE_KEY
27 | value: '5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3'
28 | - name: CONTRACT_NAME
29 | value: 'eosio.token'
30 | - name: ENDPOINT
31 | value: 'http://eosio-0.nodes.default.svc.cluster.local:8888'
32 | - name: FROM
33 | value: 'eosio'
34 | - name: TO
35 | value: 'bpa'
36 | - name: QUANTITY
37 | value: '0.0001 EOS'
38 | - name: INTERVAL
39 | value: '100'
40 |
--------------------------------------------------------------------------------