版权声明:
以下内容来自微信公共帐号“EOS技术爱好者”,搜索“EOSTechLover”即可订阅,翻译Yvonne。转载必须保留以上声明。仅授权原文转载。
本文原文链接为https://steemit.com/eos/@leordev/eos-ram-and-bandwith-analysis-airdropping-steps-on-junglenet ,由本号“EOS技术爱好者”翻译。
作者:leordev
翻译:Yvonne
我正在研究EOS RAM分配,CPU和网络带宽,我想知道组织一次真正的空投需要花费多少钱。所以我刚刚在Jungle测试网络的小实验,它可以完全适应于Mainnet,因为存储和bandwith是相同的,您可以调整当前的EOS和RAM价格。
在EOS <3中它实际上超级简单
1、为您的智能合约创建一个帐户
2、从eos存储库下载官方eosio.token
(https://github.com/EOSIO/eos/tree/013c282edb3513078c573d4feb626403778af954/contracts/eosio.token)
3、编译并将其部署到您的合同
4、创建您的代币符号和供应
5、开始发放代币
以下我将详细展开以上的各步骤,让我们开始吧!
在Junglenet上创建默认帐户
从 http://dev.cryptolions.io/#account 创建eosairdroper
账户
以下是初始帐户余额和利率统计信息:
$ cleos get account eosairdroper
permissions:
owner 1: 1 EOS84uT4DBAJQpagWDfZPbk2hd9aaH8ZGZUxHTrpdjCqCzMEVP8cB
active 1: 1 EOS84uT4DBAJQpagWDfZPbk2hd9aaH8ZGZUxHTrpdjCqCzMEVP8cB
memory:
quota: 623.2 Kb used: 3.365 Kb
net bandwidth: staked: 100.0000 EOS (total stake delegated from account to self) delegated: 0.0000 EOS (total staked delegated to account from others) used: 0 bytes available: 19.29 Mb limit: 19.29 Mb
cpu bandwidth: staked: 100.0000 EOS (total stake delegated from account to self) delegated: 0.0000 EOS (total staked delegated to account from others) used: 0 us available: 3.862 sec limit: 3.862 sec
部署eosio.token
合同
从原始EOS Repo简单部署,无需任何更改:
$ cleos set contract eosairdroper ~/eos/build/contracts/eosio.token~/eos/build/contracts/eosio.token/eosio.token.wast~/eos/build/contracts/eosio.token/eosio.token.abi
Reading WAST/WASM...
Assembling WASM...
Publishing contract...
executed transaction: d4025c7627d3a8334451ca382be86867eed55f2a442205ac269db8d4228554ca 8496 bytes 3203 us
eosio <= eosio::setcode {"account":"eosairdroper","vmtype":0,"vmversion":0,"code":"0061736d01000000017e1560037f7e7f0060057f7...
eosio <= eosio::setabi {"account":"eosairdroper","abi":"0e656f73696f3a3a6162692f312e30010c6163636f756e745f6e616d65046e616d6...`
#>>>> checking account stats <<<< $ cleos get account eosairdroper permissions: owner 1: 1 EOS84uT4DBAJQpagWDfZPbk2hd9aaH8ZGZUxHTrpdjCqCzMEVP8cB active 1: 1 EOS84uT4DBAJQpagWDfZPbk2hd9aaH8ZGZUxHTrpdjCqCzMEVP8cB memory: quota: 623.2 Kb used: 189.7 Kb
net bandwidth: staked: 100.0000 EOS (total stake delegated from account to self) delegated: 0.0000 EOS (total staked delegated to account from others) used: 8.298 Kb available: 19.28 Mb limit: 19.29 Mb
cpu bandwidth: staked: 100.0000 EOS (total stake delegated from account to self) delegated: 0.0000 EOS (total staked delegated to account from others) used: 1.817 ms available: 3.859 sec limit: 3.862 sec
资产统计:
使用的RAM:186.335 Kb(从3.365 Kb,到189.7 Kb)
使用的NET:8.298 Kb(从0 Kb,到8.298 Kb)
使用的CPU:1.817毫秒(从0毫秒,至1.817毫秒)
是的,部署的成本 eosio.token
是今天版本的186.335 Kb!好的,好玩的就要开始了......让我们创建一个token!
创建一个token
默认token,如同EOS一样,10亿个的供应及精确到小数点后四位。
`$ cleos push action eosairdroper create '[ "eosairdroper", "1000000000.0000 TOKEN", 0, 0, 0]' -p eosairdroper
executed transaction: 7123c8e34853205b9176a8d02526a570f32e908212f0a3eff7e9dd9544803101 120 bytes 738 us
eosairdroper <= eosairdroper::create {"issuer":"eosairdroper","maximum_supply":"1000000000.0000 TOKEN"}`
#>>>> checking account stats <<<< $ cleos get account eosairdroper permissions: owner 1: 1 EOS84uT4DBAJQpagWDfZPbk2hd9aaH8ZGZUxHTrpdjCqCzMEVP8cB active 1: 1 EOS84uT4DBAJQpagWDfZPbk2hd9aaH8ZGZUxHTrpdjCqCzMEVP8cB memory: quota: 623.2 Kb used: 190 Kb
net bandwidth: staked: 100.0000 EOS (total stake delegated from account to self) delegated: 0.0000 EOS (total staked delegated to account from others) used: 8.314 Kb available: 19.28 Mb limit: 19.29 Mb
cpu bandwidth: staked: 100.0000 EOS (total stake delegated from account to self) delegated: 0.0000 EOS (total staked delegated to account from others) used: 2.656 ms available: 3.859 sec limit: 3.862 sec
资产统计:
使用的RAM:0.3 Kb(从189.7 Kb,至190 Kb)
使用的NET:0.016 Kb(从8.298 Kb,至8.314 Kb)
使用的CPU:0.839毫秒(从1.817毫秒,至2.656毫秒)
接下来!为了创建一个token,我们花费的资源很少,甚至几乎没有...
发行一些toekn
现在让我们空投一些token!
我正在使用官方快照中的一些随机帐户(如果其中有你的,不好意思了):
`cleos push action eosairdroper issue '["gu2dgmrshege", "15000.9383 TOKEN", "airdrop"]' -p eosairdroper
executed transaction: f81bf85f5fe51e2bb78e8f3398e384b17587d1abb21255ca4e5dc64874fac263 128 bytes 2467 us
eosairdroper <= eosairdroper::issue {"to":"gu2dgmrshege","quantity":"15000.9383 TOKEN","memo":"airdrop"}
eosairdroper <= eosairdroper::transfer {"from":"eosairdroper","to":"gu2dgmrshege","quantity":"15000.9383 TOKEN","memo":"airdrop"}
gu2dgmrshege <= eosairdroper::transfer {"from":"eosairdroper","to":"gu2dgmrshege","quantity":"15000.9383 TOKEN","memo":"airdrop"}`
cleos get account eosairdroper permissions: owner 1: 1 EOS84uT4DBAJQpagWDfZPbk2hd9aaH8ZGZUxHTrpdjCqCzMEVP8cB active 1: 1 EOS84uT4DBAJQpagWDfZPbk2hd9aaH8ZGZUxHTrpdjCqCzMEVP8cB memory: quota: 623.2 Kb used: 190.2 Kb
net bandwidth: staked: 100.0000 EOS (total stake delegated from account to self) delegated: 0.0000 EOS (total staked delegated to account from others) used: 8.346 Kb available: 19.28 Mb limit: 19.29 Mb
cpu bandwidth: staked: 100.0000 EOS (total stake delegated from account to self) delegated: 0.0000 EOS (total staked delegated to account from others) used: 3.787 ms available: 3.858 sec limit: 3.862 sec
资产统计:
使用的RAM:0.2 Kb(从190 Kb到190.2 Kb)
使用的NET:0.032 Kb(从8.314 Kb,到8.346 Kb)
使用的CPU:1.131 ms(从2.656 ms到3.787 ms)
发行更多token
cleos push action eosairdroper issue '["gu2dgmrrguge", "6233.0000 TOKEN", "airdrop"]' -p eosairdroper executed transaction: 26a0477eaa5147e454a0a2c4c436ae5d4b356deddc303d4a0ad43108c3480307 128 bytes 2122 us
$ cleos get account eosairdroper permissions: owner 1: 1 EOS84uT4DBAJQpagWDfZPbk2hd9aaH8ZGZUxHTrpdjCqCzMEVP8cB active 1: 1 EOS84uT4DBAJQpagWDfZPbk2hd9aaH8ZGZUxHTrpdjCqCzMEVP8cB memory: quota: 623.2 Kb used: 190.4 Kb
net bandwidth: staked: 100.0000 EOS (total stake delegated from account to self) delegated: 0.0000 EOS (total staked delegated to account from others) used: 7.506 Kb available: 19.28 Mb limit: 19.29 Mb
cpu bandwidth: staked: 100.0000 EOS (total stake delegated from account to self) delegated: 0.0000 EOS (total staked delegated to account from others) used: 5.567 ms available: 3.856 sec limit: 3.862 sec
$ cleosjn push action eosairdroper issue '["gu2dkmztgage", "606.0000 TOKEN", "airdrop"]' -p eosairdroper executed transaction: a642adfaf2a715e7bf9a8ecb2d9f8cd1cbc4925ffb7edbbbe1c78b77383de487 128 bytes 2291 us
$ cleos get account eosairdroper permissions: owner 1: 1 EOS84uT4DBAJQpagWDfZPbk2hd9aaH8ZGZUxHTrpdjCqCzMEVP8cB active 1: 1 EOS84uT4DBAJQpagWDfZPbk2hd9aaH8ZGZUxHTrpdjCqCzMEVP8cB memory: quota: 623.2 Kb used: 190.7 Kb
net bandwidth: staked: 100.0000 EOS (total stake delegated from account to self) delegated: 0.0000 EOS (total staked delegated to account from others) used: 7.443 Kb available: 19.28 Mb limit: 19.29 Mb
cpu bandwidth: staked: 100.0000 EOS (total stake delegated from account to self) delegated: 0.0000 EOS (total staked delegated to account from others) used: 7.719 ms available: 3.854 sec limit: 3.862 sec
cleos push action eosairdroper issue '["gm4domrtgqge", "12.6521 TOKEN", "airdrop"]' -p eosairdroper executed transaction: 6a9695ba0508bb967b08341794ba49a597276971d2c34f7178a06db089b39943 128 bytes 2326 us
$ cleos get account eosairdroper permissions: owner 1: 1 EOS84uT4DBAJQpagWDfZPbk2hd9aaH8ZGZUxHTrpdjCqCzMEVP8cB active 1: 1 EOS84uT4DBAJQpagWDfZPbk2hd9aaH8ZGZUxHTrpdjCqCzMEVP8cB memory: quota: 623.2 Kb used: 190.9 Kb
net bandwidth: staked: 100.0000 EOS (total stake delegated from account to self) delegated: 0.0000 EOS (total staked delegated to account from others) used: 7.561 Kb available: 19.28 Mb limit: 19.29 Mb
cpu bandwidth: staked: 100.0000 EOS (total stake delegated from account to self) delegated: 0.0000 EOS (total staked delegated to account from others) used: 9.026 ms available: 3.853 sec limit: 3.862 sec
经过6小时后
看起来像我网络的CPU bandwith了一点,完美!
$ cleos push action eosairdroper issue '["ge3tgmzxhege", "172150.0000 TOKEN", "airdrop"]' -p eosairdroper executed transaction: 704ba42b779cbb7a77ca0160511c7178117c65700ec2da40f0579e3ecdaa6594 128 bytes 2375 us
$ cleos get account eosairdroper permissions: owner 1: 1 EOS84uT4DBAJQpagWDfZPbk2hd9aaH8ZGZUxHTrpdjCqCzMEVP8cB active 1: 1 EOS84uT4DBAJQpagWDfZPbk2hd9aaH8ZGZUxHTrpdjCqCzMEVP8cB memory: quota: 623.2 Kb used: 191.2 Kb
net bandwidth: staked: 100.0000 EOS (total stake delegated from account to self) delegated: 0.0000 EOS (total staked delegated to account from others) used: 6.129 Kb available: 19.2 Mb limit: 19.2 Mb
cpu bandwidth: staked: 100.0000 EOS (total stake delegated from account to self) delegated: 0.0000 EOS (total staked delegated to account from others) used: 9.543 ms available: 3.835 sec limit: 3.845 sec
B1大空投
测试一大笔空投到B1(并不是真的需要这笔空投, 通常这将取决于空投团队)
$ cleos push action eosairdroper issue '["b1", "100000000.0100 TOKEN", "airdrop"]' -p eosairdroper executed transaction: 8458b5f23d6764333db5ba2d8133cabe65265abf6ecf674810a8eb1de05e25f7 128 bytes 2540 us
`#eosairdroper <= eosairdroper::issue {"to":"b1","quantity":"100000000.0100 TOKEN","memo":"airdrop"}
eosairdroper <= eosairdroper::transfer {"from":"eosairdroper","to":"b1","quantity":"100000000.0100 TOKEN","memo":"airdrop"}
b1 <= eosairdroper::transfer {"from":"eosairdroper","to":"b1","quantity":"100000000.0100 TOKEN","memo":"airdrop"}`
$ cleos get account eosairdroper permissions: owner 1: 1 EOS84uT4DBAJQpagWDfZPbk2hd9aaH8ZGZUxHTrpdjCqCzMEVP8cB active 1: 1 EOS84uT4DBAJQpagWDfZPbk2hd9aaH8ZGZUxHTrpdjCqCzMEVP8cB memory: quota: 623.2 Kb used: 191.4 Kb
net bandwidth: staked: 100.0000 EOS (total stake delegated from account to self) delegated: 0.0000 EOS (total staked delegated to account from others) used: 6.22 Kb available: 19.2 Mb limit: 19.2 Mb
cpu bandwidth: staked: 100.0000 EOS (total stake delegated from account to self) delegated: 0.0000 EOS (total staked delegated to account from others) used: 11.66 ms available: 3.833 sec limit: 3.845 sec
没有MEMO
测试到没有memo空投给另一个随机帐户ge3dmgenesis: 1000.5425 EOS
- bandwith的使用情况从128字节减少到的120字节,在cpu上没有任何重大变化,并且不影响RAM上的任何内容,全被记住了,从eosio.token
合同中我们不会将memo存储在任何地方。
cleos push action eosairdroper issue '["ge3dmgenesis", "1000.5425 TOKEN", ""]' -p eosairdroper executed transaction: 34d05c59c10049ae946ad4e66703bb42987d1a1ce248115f3bea4bb6b1120e7f 120 bytes 2387 us
$ cleosjn get account eosairdroper permissions: owner 1: 1 EOS84uT4DBAJQpagWDfZPbk2hd9aaH8ZGZUxHTrpdjCqCzMEVP8cB active 1: 1 EOS84uT4DBAJQpagWDfZPbk2hd9aaH8ZGZUxHTrpdjCqCzMEVP8cB memory: quota: 623.2 Kb used: 191.6 Kb
net bandwidth: staked: 100.0000 EOS (total stake delegated from account to self) delegated: 0.0000 EOS (total staked delegated to account from others) used: 6.275 Kb available: 19.2 Mb limit: 19.2 Mb
cpu bandwidth: staked: 100.0000 EOS (total stake delegated from account to self) delegated: 0.0000 EOS (total staked delegated to account from others) used: 13.22 ms available: 3.831 sec limit: 3.845 sec
结果
如果我们假设上述数值为近似平均值(我需要加载一批数千个帐户来确保),这些数据是基于官方mainnet(https://github.com/eoscafe/eos-snapshot-validation )启动快照完整空投所需的统计数据:
您最终会想要从空投中删除一些账户,如B1,交易所等。
这些还是来自创世快照的其他的有趣数据:
Mainnet
截至今天,几个小时前,我们创建了一个账户,其RAM内存价格为0.015 EOS / Kb。
所以,如果你现在正在计划一个空投,那么官方的创世纪快照将耗资约563 EOS,现在转换为6025.17美元。我不考虑网络和CPU,因为它在3天内完全恢复,那么你可以分开你的空投。
我的下一步是运行一大批发行交易的代币,这样我就可以证明所有这些统计资料都是正确的。
也非常感谢@nsjames,@syedjafri和@blockliberty 很好的见解,关于讨论和价格!当然,还有这个很好用的Jungle Testnet @cryptolions
本文图片来源于网络
相关文章:
We are EOShenzhen
不同入口如何投票:
imToken
火币
portal
关于我们更多联系:
Website:https://eoshenzhen.io
Steem:https://steemit.com/@eoshenzhen
Busy:https://busy.org/@eoshenzhen
Telegram:https://t.me/eoshenzhen
Twitter:https://twitter.com/eostechlover
:EOS技术爱好者
新浪微博:EOSTechLover
EOShenzhen的投票账号:eoshenzhenio