Jump to content
Enumivo Community

ansen

Members
  • Content count

    127
  • Joined

  • Last visited

  • Days Won

    5

ansen last won the day on November 6

ansen had the most liked content!

Community Reputation

94 Excellent

Crypto Addresses

  • Ethereum
    0x8587cff276960bcaffdcb67994ebac944e2cd152
  • Bitcoin
    1E8eoUDoXLNagHiL3NGaZimEqphCBgoiTB
  • LiteShares
    ansen9
  • Enumivo
    ansenironman

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Name ansen Social Media Links wechat: qq1004516065 telegram: @ansen9 Introduction I am a developer in China, and I’ve been here in the community of enumivo since May 2018. I am a believer in blockchain + UBI and we need to find a way to achieve the goal of social justice for all. The things I’ve done for the community are listed below: Write the draft proposal of UFE with @PeiLin. Maintane a top-10 block producer node ansenironman. Develop the IRONMAN browser plugin and a toolkit website for ENU. Develop a auto ".enu" premeium ENU account maker. Develop the ENU pixels playground dapp game, which is virtually free to play. Lead the bp’s to upgrade system contracts. I spread the idea of enumivo and UBI with my friends. Enumivo Mainnet Account ansenironman Skills Programming in C++/Java EOS smart contract developing EOS block producer node maintanance translation between Englisth and Chinese What can you do for Enumivo? First, I will keep all the tools I've built safe and available for the long term. Second, I'll take the response of block producer to keep our mainnet safe. Third, I'll spend more time on the topic of UBI and I'll start a mini UBI project to test the idea of proof-of-life with a selfie. It will be in the form of a telegram chatbot. People will be asked to do some tasks, such as writing down a block id on a paper and taking a selfie holding the paper or verifying other people's selfie. The advantages of using a telegram chatbot are that people can easily upload and input something within a mobile phone. People in less developed areas are more likely to have a mobile phone than a PC. Also, the telegram is great at keeping personal privacy. The purpose of launching a mini UBI project is not to compete with AP, but a meaningful way to explore different paths at the same time, which will accelerate the coming of a practical UBI solution. There will be a formal introduction to the project soon.
  2. At 20:10 2018.11.06 Beijing time, we successfully deployed the new version of enu.msig contract, the hardest part of this upgrading routine. Thanks all BP's for your collaboration and efforts! http://enumivo.qsx.io/search?q=0a7aa19bd7ea08f2feaa3f0f0741be09397a136315acb1eb890bbc9fd70c349b
  3. Hello, everyone. We are going to upgrade the system contracts tomorrow! First, we will upgrade enu.msig contract, which enables us to upgrade contracts using propose_trx in the future. THIS IS IMPORTANT!! @Daifuku and me have already upgraded the contracts on the testnet, the code is verified by other BP's. We believe it's safe to upgrade the contract on the mainnet. Here's the plan: 1. At 2018.11.05 12:00:00 Beijing (2018.11.05 04:00:00 UTC), I'll release the upgrade_enumsig_contract_official_trx.json in my github repo: https://github.com/AnsenYu/ENU-mainnet-contract-upgrade/tree/master/enumsig . 2. The expiration of the transaction is 2018.11.05 21:00:00 Beijing (2018.11.05 13:00:00 UTC). So before the transaction expires, every BP please do the following: a. clone the my github repo: git clone https://github.com/AnsenYu/ENU-mainnet-contract-upgrade.git b. read the README under the folder of enumsig. https://github.com/AnsenYu/ENU-mainnet-contract-upgrade/tree/master/enumsig c. You can perform step 1 to record the original information of current enu.msig contract d. Please do the step 3 to sign the transaction. e. Use your bp account to transfer 0.0001 ENU to ansenironman with memo in the format of "enumsig upgrade: YOUR SIGNATURE" f. Post your BP mainnet account and the transfer transaction link in the issue: https://github.com/AnsenYu/ENU-mainnet-contract-upgrade/issues/1 3. If more than 15 bp's submit the signatures before expiration time, I'll perform the push transaction step between 20:00:00 and 21:00:00 2018.11.05 Beijing. If everything goes fine, we will upgrade the enu.msig contract by about 21:00:00 tomorrow! After that we will go on to upgrade the system and token contract. That will be much easier!! 大家好,我们明天将启动主网系统合约升级程序。首先,我们会先升级enu.msig合约,使得我们后续可以通过异步提案的方式来升级其他系统合约。所以这第一步非常关键!我和大福君已经在测试网络上升级合约,并且经过其他BP的检验。我们认为在主网上进行升级是安全的。 下面是升级计划: 1. 我会在明天(2018.11.05)中午北京时间12点在我的github上公布升级需要的交易文件, upgrade_enumsig_contract_official_trx.json Github地址: https://github.com/AnsenYu/ENU-mainnet-contract-upgrade/tree/master/enumsig . 2. 升级合约的交易的过期时间设定为晚上21点,所以在过期时间之前,各位超级节点请执行以下操作: a. 克隆github项目到你的本地机器 git clone https://github.com/AnsenYu/ENU-mainnet-contract-upgrade.git b. 仔细阅读项目README: https://github.com/AnsenYu/ENU-mainnet-contract-upgrade/tree/master/enumsig . c. 你可以执行Step 1 来记录当前合约的abi和wasm d. 请执行Step 3来进行签名 e. 使用你的BP账号转0.0001 ENU到ansenironman这个账号,memo中填写“enumsig upgrade : 你的签名” e. 在这个issue下面留言,附带你的超级节点账号和浏览器转账记录。https://github.com/AnsenYu/ENU-mainnet-contract-upgrade/issues/1 3. 如果在过期时间前有超过15个超级节点完成签名,我会在晚上8点到9点之间执行推送交易来升级合约。 如果一切顺利,我们在明晚9点左右就能完成enu.msig合约的升级,后续升级系统合约和token合约就可以用提案系统,那将会简单的多。
  4. ansen

    A Brand New Enumivo Testnet

    Sorry, I got this, please provide a new public key:
  5. ansen

    A Brand New Enumivo Testnet

    Considering the recent emergency event and the lack of participants of testnet, @Daifuku and I decide to postpone the contract upgrade practice on testnet a few days later. Those who still wants to join the upgrade practice can still ask for an account in this thread. 由于最近的主网紧急事件和测试网络上参与者人数偏低,@daifuku 和我决定推迟几天进行测试网络彩排。仍希望参与彩排的BP们可以继续在本帖子后留言请求测试网络账号。请知晓。
  6. ansen

    Enumivo Chain Emergency

    @enumivo ansenironman is up running p2p-peer-address = 149.28.177.107:9876
  7. enu.token & ltsonenumivo contract prevents users to transfer amount less than 0.0001 already. $ enucli push action ltsonenumivo transfer '["twotwotwotwo", "testexenults", "0.00001 LTS", "test sell LTS" ]' -p twotwotwotwo@active Error 3050003: enumivo_assert_message assertion failure Error Details: assertion failure with message: symbol precision mismatch pending console output:
  8. Yeah. I'll give 20 ENU to each of the first 10 testers who trade successfully with the "testexenults" contract from now on, whatever the trade volume. The gift will send to the trade account. 我会赠送20ENU给前十位成功使用"testexenults"合约进行交易的用户,无论交易金额大小。ENU会直接发送到参与交易的账户上。 Updated: I've sent 20 ENU to the ten accounts below: transactions: http://enumivo.qsx.io/transactions/298d52b52b64edcc87d57b86a93f91b79b8be694d0a1a8adde4cc642c9362960 http://enumivo.qsx.io/transactions/023207aaafb717f1bf231a79eee8f0203f7541df1ace3181e01e5209787eec6a http://enumivo.qsx.io/transactions/66a72aa7ea833ddd5ab952ae7f9d6a6f891dcafcac2f9743f79b1f3b669effec http://enumivo.qsx.io/transactions/1e92b655e3ccca41d64b74eb5e65cf891ac65346b5b9d83e203887660d3a814b http://enumivo.qsx.io/transactions/01778639e162681246ed459fe5fea0826beb9f6e29c21ee0c863efad435351f0 http://enumivo.qsx.io/transactions/c60b08e30b62d8480e2fd7dae62814064e4d444907035d623d0b5d3ad7e6a5f3 http://enumivo.qsx.io/transactions/dd276cdc5438e4029332e93140d1247ffdbfdb3a51e75a952c6ce34ce0e5a7e8 http://enumivo.qsx.io/transactions/92644f4c94db98d2bcec485ab85676f1f8c74a39b6b07a45d47ea36e5c548305 http://enumivo.qsx.io/transactions/ff698725982488430ace25b0d5f12fd0a3bf0f5839b042bc39d806c221d98e37 http://enumivo.qsx.io/transactions/6c31dd5b21560908ccf53b6b2bee64545d669c76cd857ff7f02b841f95bd071e
  9. Yes, I did set the limit. Please check the source code here: https://github.com/AnsenYu/enultsexchange
  10. I've deployed the contract on the account "testexenults" on the mainnet. Initially, there are 100 ENU and 100 LTS for this account. * Anyone want to buy LTS with ENU, just send ENU to contract account "testexenults", and the contract will send you back LTS accordingly. enucli transfer twotwotwotwo testexenults "1 ENU" "test" eg. http://enumivo.qsx.io/transactions/2c5fed982742a1acce4d0518c138ad0b2d2cdf3b3f1cceeebb57e5da92644996 I send 1 ENU to testexenults, and buy LTS at the price of 100/100 = 1 LTS/ENU. Considering the 0.1% fee, I should have 0.999 LTS back. * Anyone want to sell LTS, just send LTS to contract account "testexenults", and the contract will send you back ENU accordingly. enucli push action ltsonenumivo transfer '["twotwotwotwo", "testexenults", "0.1000 LTS", "test sell LTS" ]' -p twotwotwotwo@active eg. http://enumivo.qsx.io/transactions/51e3efaf82f51a3e51c17a2cbc8c45ee3ff80d862d97c7d0b619f346ba3bc3c8 I send 0.1 LTS to testexenults, and sell LTS at the price of 101/99.001 = 1.02019 ENU/LTS. Considering the 0.1% fee, I should have 0.1019 ENU back. To check the current balance of the contract. This smart contract will be able to buy or sell of up to 1% of x at a time. $ enucli get currency balance ltsonenumivo testexenults "LTS" 99.1010 LTS $ enucli get currency balance enu.token testexenults "ENU" 100.8981 ENU updated: The source code is here: https://github.com/AnsenYu/enultsexchange
  11. I've built and unit-tested a contract locally, it's working fine. I will deploy it on the mainnet and test more.
  12. Below is my list(still updating) of voted candidates of the "Most Valuable Member" of the Oracle voting. I want to make it public and show my reasons of why I choose them. As part of the Oracle, I think we are responsible to know the community members well and vote for those who actually make contributions to the community. 下面列表(仍在更新中)是我准备投给“最具价值成员”的Oracle投票。我想将这个列表公开,和大家分享下为什么要选这些人。作为Oracle的一份子,我认为我们有责任充分了解社区成员,把票投给真正在为社区做事的人。 Enumivo account 主网账号 forum account & Link 论坛账号 Vote Reason 投票原因 marshalllife marshalllife Active promoter 活跃推广者 midantechltd Sololean UFE manager 基金会管理者 enudavidfnck Davidfnck Community leader 社区领袖 wangwangwang Peilin Chief CX officier 首席传销官 funkydaifuku Daifuku Active developer 活跃开发者 enusmallfish Fish Active dev, zhandui.io 站队开发者 tylerxiong22 TylerXiong KOL, BIXIN COO 意见领袖,币信COO enuniversity ENUholder Desinger & promoter 首席设计师 summitdecent Peesus White paper Author 白皮书作者 tomblocknode Tom Community Educator 社区教育者 enumivoqsxio Joshua Qiu Enumivo Browser Author 浏览器作者 cryptococooo Cocojam0610 Active promoter 活跃推广者 ansenironman ansen Ironman wallet Author 钱包开发者 talktomyself leimao Wechat group manager 微信群主 dennyyuanman Denny_Yu Freshman Educator 新人教育者 firefly.enu firefly_man Active promoter 活跃推广者
  13. ansen

    Enumivo Massive Hiring by Oracles

    @enumivo Here's my introduction. Thanks.
  14. Hi, enumivians. I'm ansen, a blockchain engineer from China. I am a long-time supporter and developer of Enumivo. Here's the list of things I've done for Enumivo community: 各位牛油果社区小伙伴们好,我是ansen,一个来自中国的区块链工程师。我是ENU的长期支持者和开发者。下面是我为ENU社区做过的一些事情: Developed the Ironman wallet (600+ users), which empowers many dapps, and maintain the website of enuironman.com 开发了Ironman浏览器插件钱包(600+用户),支持了许多dapp应用,并且维护enuironman.com网站。 Created a free account auto-maker on TokenPocket, and have over 1000+ free registerd accounts. 在TP钱包商创建了一个免费ENU账号注册机,成功创建超过1000+免费账号。 Served as one of the top21 block producers ( ansenironman ) most of the time after the mainnet goes live; 主网上线后大部分时间被选上担任21超节点之一,持续为社区提供服务。我的节点是ansenironman。 Propose to set up the UFE(United Foundation of Enumivo) with PeiLin, which make community governing more decentralized. 和PeiLin一起提议并且推动建立了牛油果团队基金会,使社区治理更加去中心化。 Translated several important post of Aiden into Chinese. 翻译了若干篇重要的Aiden的文章。 Spread the idea of ENU/UBI, and build relationship with men in the EOS community 传播ENU/UBI理念,与EOS社区成员保持紧密联系。 In the future, I will do more for the community. Basically, I will focus on the tools and infrastructure of the blockchain and provide service for all kinds of dapps. Please support me, and vote for me. Thanks! 在未来,我会为社区持续做更多事情。我会关注区块链上工具和基础设施建设,为各种dapp提供基础服务。请投票支持我,谢谢!
  15. Let's upgrade ENU‘s system contract to version 1.2.1 Hi, all BP's of enumivo, we are now preparing for our first upgrade of system contract. ENU的超级节点们,我们正在准则进行首次系统合约的升级。 Why should we upgrade to 1.2.1, rather than the latest release version? 为什么要升级到1.2.1版本而不是最新版本? For now, the latest release of ENU contract is 1.3.1, but we don't plan to upgrade to 1.3.1 directly. EOS is now on 1.2.1 version, so I suggest ENU follows and upgrade to 1.2.1, too. 目前最新的ENU系统合约发布版本是1.3.1,但是我们不准备直接升级到1.3.1。因为EOS目前部署的是1.2.1版本,因此我建议ENU跟随EOS,升级到1.2.1版本。 Can we upgrade contract with enu.msig? 我们能用enu.msig(提案-同意-执行)来升级合约吗? No and Yes. The original version of enu.msig contract can not process transactions with multiple actions. Upgrading a contract requires both setcode and setabi actions. The issue was solved in a later release of enumivo V1.1.0. 暂时还不可以。原始版本的enu.msig合约不能处理含有过个action的交易。升级合约需要在一个交易中完成setcode和setabi两个action。这个问题在后来的发布V1.1.0版本中解决了。 So we have to first upgrade enu.msig contract to v1.2.1. Then we can utilize the upgraded enu.msig to upgrade both the system and token contract. 因此我们需要首先升级enu.msig合约到v1.2.1版本。然后后面我们就可以用enu.msig来升级系统合约和代币合约。 How to upgrade the enu.msig contract? 如何升级enu.msig合约? We have to go through a offline-signing process to upgrade the enu.msig contract. The offline-signning approach of EOS is here. 我们需要通过一个线下签名的过程来升级enu.msig合约。EOS的线下合约升级教程在这儿。 The following is a forked version for enumivo's enu.msig contract: 以下是改为升级ENU的enu.msig合约的说明。 Environment preparing Below is the version of the required environment (enumivo, enumivo.cdt, enumivo.contracts). Note to generate the same wasm code from the same source cpp, please keep our enviroment consistent: 下面是我的合约编译环境,注意为了保证编译出来的wasm的完全一致,请大家验证合约时保持一致的编译环境。 Note: One may have to modify the depenency of enu.contracts in CMakeLists.txt 需要修改enu.contracts项目的CMakeLists.txt文件中的依赖。 ~/enumivo.contracts# git diff diff --git a/CMakeLists.txt b/CMakeLists.txt index 19b618d..41ae627 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required(VERSION 3.5) project(enumivo_contracts VERSION 1.2.1) -set(ENUMIVO_DEPENDENCY "1.2") +set(ENUMIVO_DEPENDENCY "1.3") set(ENUMIVO_WASMSDK_DEPENDENCY "1.1") Below is the hash of the output enu.msig.wasm of my environment. Everyone should have the same hash of hise wasm code. 以下是在上述环境中编译得到的enu.msig.wasm的哈希值,每个人在同样环境下编译出来得到的值应该是一样的。 sha256sum enu.msig.wasm 2e585c92323c9ae846adc01193171cef7f4fd161f3ac719d794e1883e38758a3 enu.msig.wasm Upgrading routine Each of the top 21 block producers should do the following: 排名前21的超级节点需要做以下事情: Get current enu.msig contract for later comparison: 获得当前enu.msig合约,用作后面的对比。 $enucli get code -c original_enumsig_contract.wast -a original_enumsig_contract.abi enu.msig code hash: 0c62f070b2b34ab742d79465b21c92ba2cf9b94c23adb9315ca374bfc33fdc26 saving wast to original_enumsig_contract.wast saving abi to original_enumsig_contract.abi Comiple the v1.2.1 enumivo.contracts code. (run ./build.sh). Generate the unsigned transaction which upgrades the enu.msig contract: 编译1.2.1版本的enumivo.contracts项目代码(执行./build.sh)。执行下面命令产生未签名的用来升级enu.msig的交易。 (in enumivo.contracts direcotry; run build.sh already) enucli -u https://rpc.enu.one set contract -s -j -d enu.msig build/enu.msig > upgrade_enumsig_contract_trx.json The first few lines of the generated file should be something similar to (except with very different numbers for expiration, ref_block_num, and ref_block_prefix): 生成的交易文件应该类似下面这样,除了expiration, ref_block_num, ref_block_prefix不同以外,其余应该相同。 { "expiration": "2018-09-24T09:54:11", "ref_block_num": 38558, "ref_block_prefix": 2263549217, "max_net_usage_words": 0, "max_cpu_usage_ms": 0, "delay_sec": 0, "context_free_actions": [], "actions": [{ "account": "enumivo", "name": "setcode", "authorization": [{ "actor": "enu.msig", "permission": "active" } ], and the last few lines should be: 最后几行是这样 } ], "transaction_extensions": [], "signatures": [], "context_free_data": [] } One of the top block producers should be chosen to lead the upgrade process. This lead producer should take their generated upgrade_enumsig_contract_trx.json, rename it to upgrade_enumsig_contract_official_trx.json, and do the following: 从21个节点中选一个leader节点来主持升级过程。leader节点产生一份上面的交易文件,然后重命名为upgrade_enumsig_contract_official_trx.json,然后执行下面的操作: Modify the expiration timestamp in upgrade_enumsig_contract_official_trx.json to a time that is sufficiently far in the future to give enough time to collect all the necessary signatures, but not more than 9 hours from the time the transaction was generated. Also, keep in mind that the transaction will not be accepted into the blockchain if the expiration is more than 1 hour from the present time. 修改expiration时间戳为一个足够远的未来时间来收集全部其他节点的签名,但是这个时间不能大于交易文件生成时间后9个小时。并且,即使提前收集完了全部签名,只能等到离expiration小于1个小时才能提交交易,否则区块链不会接受交易。 Pass the upgrade_enumsig_contract_official_trx.json file to all the other top 21 block producers. 把修改后的upgrade_enumsig_contract_official_trx.json文件发给全部21个超级节点。 Then each of the top 21 block producers should do the following: 21个超级节点都要执行下面的操作。 Compare their generated upgrade_enumsig_contract_official_trx.json file with the upgrade_enumsig_contract_official_trx.json provided by the lead producer. The only difference should be in expiration, ref_block_num, ref_block_prefix, for example: 比较自己产生的upgrade_enumsig_contract_official_trx.json文件和leader节点发来的文件,diff的差别应该只有expiration, ref_block_num和ref_block_prefix这三处,譬如: diff upgrade_enumsig_contract_trx.json upgrade_enumsig_contract_trx.check.json 2,4c2,4 < "expiration": "2018-09-24T09:54:11", < "ref_block_num": 38558, < "ref_block_prefix": 2263549217, --- > "expiration": "2018-09-24T10:01:59", > "ref_block_num": 39494, > "ref_block_prefix": 2951834115, If the comparison is good, each block producer should proceed with signing the official upgrade transaction (sent from the leader) with the keys necessary to satisfy their active permission. If the block producer only has a single key (i.e the "active key") in the active permission of their block producing account, then they only need to generate one signature using that active key. This signing process can be done offline for extra security. 如果文件比较没有问题,每个节点应该继续执行用active权限对leader发来的交易进行签名。如果节点的active权限只有一个私钥(譬如 active私钥),那么就用改私钥来产生交易签名。这个签名过程可以在离线环境进行来提升安全性。 On a secure computer the producer can sign the transaction (the producer will need to paste in their private key when prompted): 在一台安全的计算机上,节点可以用下面的命令签名交易(节点需要按照提示粘贴输入私钥)【下面的chain-id已经是enu主网的chain id】 (the chain-id below is for ENU mainnet already!) enucli -u https://rpc.enu.one sign --chain-id cf057bbfb72640471fd910bcb67639c22df9f92470936cddc1ade0e2f2e7dc4f upgrade_enumsig_contract_trx.json | tail -n 5 private key: "signatures": [ "SIG_K1_K8QQVUZjs22RQ7kAMBeNVBDzPbNKdhyKwc2G5dJpJ3WTBbGahrqLife4axMoEEYJwaP6RfNAKhJv1cE5BtdzdC5i2G2ass" ], "context_free_data": [] } The output should include the signature (in this case "SIG_K1_K8QQVUZjs22RQ7kAMBeNVBDzPbNKdhyKwc2G5dJpJ3WTBbGahrqLife4axMoEEYJwaP6RfNAKhJv1cE5BtdzdC5i2G2ass") which the producer should then send to the lead producer. 输出中应该包含签名("SIG_xxxx"),节点应将签名发给leader节点。 When the lead producer collects 15 producer signatures, the lead producer should do the following: 当收集满15个超级节点的签名后,leader节点应该执行下面的操作: Make a copy of the upgrade_enumsig_contract_official_trx.json and call it upgrade_enumsig_contract_official_trx_signed.json, and then modify the upgrade_enumsig_contract_official_trx_signed.json so that the signatures field includes all 15 collected signatures. So the tail end of upgrade_enumsig_contract_official_trx_signed.json could look something like: 拷贝一份upgrade_enumsig_contract_official_trx.json文件,重命名为upgrade_enumsig_contract_official_trx_signed.json,然后修改文件中的signatures字段,包含15个BP的签名。最终改完的upgrade_enumsig_contract_official_trx_signed.json文件最后几行应该类似这样: $ cat upgrade_enumsig_contract_official_trx_signed.json | tail -n 20 "transaction_extensions": [], "signatures": [ "SIG_K1_JzABB9gzDGwUHaRmox68UNcfxMVwMnEXqqS1MvtsyUX8KGTbsZ5aZQZjHD5vREQa5BkZ7ft8CceLBLAj8eZ5erZb9cHuy5", "SIG_K1_Kj7XJxnPQSxEXZhMA8uK3Q1zAxp7AExzsRd7Xaa7ywcE4iUrhbVA3B6GWre5Ctgikb4q4CeU6Bvv5qmh9uJjqKEbbjd3sX", "SIG_K1_KbE7qyz3A9LoQPYWzo4e6kg5ZVojQVAkDKuufUN2EwVUqtFhtjmGoC6QPQqLi8J7ftiysBp52wJBPjtNQUfZiGpGMsnZ1f", "SIG_K1_KdQsE7ahHA9swE9SDGg4oF6XahpgHmZfEgQAy9KPBLd9HuwrF6c8m6jz43zizK2oo32Ejg1DYuMfoEvJgVfXo81jsqTHvA", "SIG_K1_K6228Hi2z1WabgVdf5bk2UdKyyDSVFwkMaagTn9oLVDV8rCX7aQcjY94c39ah2CkLTsTEqzTPAYknJ8m2m9B7npPkHaFzc", "SIG_K1_Jzdx75hBCA2WSaXgrupmrNbcQocUCsP8r1BKkPXMreiAKPZDwX9J3G8fS1HhyqWjc7FbukwZf8sVRdS3wKbJVpytqXe7Nn", "SIG_K1_KW7Qu2SdPD3zuQKh2ziFLzn9QbKqeMpeiemULky5Bbg1Mst6ijbCX3k2AVFGNFLkNLA36PM1WAT5oipzu1B1K7ymRxTx1Z", "SIG_K1_KXJf1KZNpz73YFKKE7u6jFgsQ8XcX3yA7rDX6ZmG1Qfnc9FLLmT1WViv4bwcPbxaEYfR6SNWfk5cCR9eao2si1soqkXq92", "SIG_K1_JynjkHFT5UFGDpEcqdriXTzCGCwS36Xztq4UAWQHLQgRUZT2YFoLhUcc87kvUteqCUGVxsmSbfgWv1KLy24voKN4Qs5zTe", "SIG_K1_JxhfCaGBhuNShpDHn7j1CryG3iSebvfi7FUnJsfkXNTiwLyq2NDBkeakwjCMWFbzr6qqWuMDLjfXbzdtU17f1wCXMjKSgk", "SIG_K1_KcMSz89QG1ZRFNrXc69R63d5KXbJA8CBjNPYv1VEA3TRfjqVYuhyaHpGXQN4RSKDq4ygr3UTRYBQQVutkJnR6zZ4Ssgd7R", "SIG_K1_JuxT6bhUAbDs6Q2ppuKyKauduvbaJLxvh4gBH4e4A9yRhvUBT7w3DcvMyhdaor27Kbu29jnqhTbvXcb57QqKWQDpboLv7e", "SIG_K1_K8BuFYpCiC5FhpVK8ZAzc3VUg7vz6WwLoWBrGN6nnuqUjngGqvHp3UxDVzcwhqccHdv8kdPXvF6G1NszwF1dd3wjCrHBYw", "SIG_K1_KfH5ZirPwDk1RQKvJv2AGPfsJyPXvXLegZ7LvcPmRtjtMiErs1STXLNT8kiBfhZr4xkWRA5NR1kMF3d49DFMJiB2iWMXJc", "SIG_K1_KjJB8jtcqpVe3r5jouFiAa9wJeYqoLMh5xrUV6kBF6UWfbYjimMWBJWz2ZPomGDsk7JtdUESVrYj1AhYbdp3X48KLm5Cev" ], "context_free_data": [] } Push the signed transaction to the blockchain: 推送签名后的交易到区块链。 enucli push transaction --skip-sign upgrade_enumsig_contract_official_trx_signed.json { "transaction_id": "202888b32e7a0f9de1b8483befac8118188c786380f6e62ced445f93fb2b1041", "processed": { "id": "202888b32e7a0f9de1b8483befac8118188c786380f6e62ced445f93fb2b1041", "receipt": { "status": "executed", "cpu_usage_us": 4909, "net_usage_words": 15124 }, "elapsed": 4909, "net_usage": 120992, "scheduled": false, "action_traces": [{ ... Assuming the transaction successfully executes, everyone can then verify that the new contract is in place: 如果交易执行成功,每个人都可以验证部署好的新合约。 enucli get code -c new_enumsig_contract.wast -a new_enumsig_contract.abi enu.msig code hash: 9fd195bc5a26d3cd82ae76b70bb71d8ce83dcfeb0e5e27e4e740998fdb7b98f8 saving wast to new_enumsig_contract.wast saving abi to new_enumsig_contract.abi $ diff original_enumsig_contract.abi new_enumsig_contract.abi 584,592d583 < },{ < "name": "deferred_trx_id", < "type": "uint32" < },{ < "name": "last_unstake_time", < "type": "time_point_sec" < },{ < "name": "unstaking", < "type": "asset" Upgrade enu.system contract and enu.token contract with enu.msig 使用enu.msig合约来升级enumivo系统合约和enu.token合约 After the enu.msig contract is upgraded, we can use it to propose trasactions with multiple actions. Below is t the steps to upgrade enu.system contract forked from contract upgrade for enu.sudo. enu.token contract takes a similar routine. enu.msig合约升级完以后,我们就能用它来提案多动作交易。以下是升级enu系统合约升级步骤,参考了enu.sudo的升级说明。enu代币合约的升级流程类似。 Generate the transaction to deploy the enu.system contract 生成部署enu.system合约的交易 The transaction to deploy the contract to the enumivo account will need to be proposed to get the necessary approvals from active block producers before executing it. This transaction needs to first be generated and stored as JSON into a file so that it can be used in the enucli command to propose the transaction to the enu.msig contract. 部署到enumivo账号的合约的交易需要先提案,获得足够超级节点的同意后才能执行。这个交易需要先生成并且按JSON结构存到文件中,然后使用enucli命令行来提案交易到enu.msig合约。 The easy way to generate this transaction is using enucli: 可以使用以下命令产生提案交易。 $enucli set contract -s -j -d enumivo build/enu.system/ > deploy_system_contract_trx.json $cat deploy_system_contract_trx.json { "expiration": "2018-09-24T14:15:26", "ref_block_num": 4362, "ref_block_prefix": 2619980881, "max_net_usage_words": 0, "max_cpu_usage_ms": 0, "delay_sec": 0, "context_free_actions": [], "actions": [{ "account": "enumivo", "name": "setcode", "authorization": [{ "actor": "enumivo", "permission": "active" } ], "data": ... },{ "account": "enumivo", "name": "setabi", "authorization": [{ "actor": "enumivo", "permission": "active" } ], "data": ... } ], "transaction_extensions": [], "signatures": [], "context_free_data": [] } Edit the values of the ref_block_num and ref_block_prefix fields to be 0 and edit the time of the expiration field to some point in the future that provides enough time to approve and execute the proposed transaction. After editing deploy_system_contract_trx.json the first few lines of it may look something like the following: 修改文件中的ref_block_num和ref_block_prefix字段为0,然后修改expiration字段为未来某个时间,留足够时间来收集同意提案和执行提案。修改完deploy_system_contract_trx.json后前几行文件应该是这样: $ head -n 9 deploy_system_contract_trx.json { "expiration": "2018-07-06T12:00:00", "ref_block_num": 0, "ref_block_prefix": 0, "max_net_usage_words": 0, "max_cpu_usage_ms": 0, "delay_sec": 0, "context_free_actions": [], "actions": [{ assume that there are 21 active block producers on the chain with account names: blkproducera, blkproducerb, ..., blkproduceru. 假设21个超级节点的账号名为blkproducera, blkproducerb, ..., blkproduceru. In that case, create a file producer_permissions.json with the content shown in the command below: 按以下内容创建一个producer_permissions.json文件。 $ cat producer_permissions.json [ {"actor": "blkproducera", "permission": "active"}, {"actor": "blkproducerb", "permission": "active"}, {"actor": "blkproducerc", "permission": "active"}, {"actor": "blkproducerd", "permission": "active"}, {"actor": "blkproducere", "permission": "active"}, {"actor": "blkproducerf", "permission": "active"}, {"actor": "blkproducerg", "permission": "active"}, {"actor": "blkproducerh", "permission": "active"}, {"actor": "blkproduceri", "permission": "active"}, {"actor": "blkproducerj", "permission": "active"}, {"actor": "blkproducerk", "permission": "active"}, {"actor": "blkproducerl", "permission": "active"}, {"actor": "blkproducerm", "permission": "active"}, {"actor": "blkproducern", "permission": "active"}, {"actor": "blkproducero", "permission": "active"}, {"actor": "blkproducerp", "permission": "active"}, {"actor": "blkproducerq", "permission": "active"}, {"actor": "blkproducerr", "permission": "active"}, {"actor": "blkproducers", "permission": "active"}, {"actor": "blkproducert", "permission": "active"}, {"actor": "blkproduceru", "permission": "active"} ] Propose the transaction to deploy the enu.system contract 提交部署enu.system合约的提案交易 assume that blkproducera was chosen as the lead block producer to propose the transaction. 假设blkproducera被选为leader节点来提交提案。 The lead block producer (blkproducera) should propose the transaction stored in deploy_system_contract_trx.json: Leader节点应该提交存储在deploy_system_contract_trx.json文件中的交易提案。 $ enucli multisig propose_trx deploysystem producer_permissions.json deploy_sudo_contract_trx.json blkproducera executed transaction: 9e50dd40eba25583a657ee8114986a921d413b917002c8fb2d02e2d670f720a8 4312 bytes 871 us # enu.msig <= enu.msig::propose {"proposer":"blkproducera","proposal_name":"deploysystem","requested":[{"actor":"blkproducera","permis... warning: transaction executed locally, but may not be confirmed by the network yet Review and approve the transaction to deploy the enu.system contract 审查并且同意部署enu.system合约的提案 Each of the potential approvers of the proposed transaction (i.e. the active block producers) should first review the proposed transaction to make sure they are not approving anything that they do not agree to. 每一个超级节点应该先审查提交的提案交易,确保他们不会批准通过不希望的内容。 The proposed transaction can be reviewed using the enucli multisig review command: 提案交易可以使用enucli multisig review命令来查看。 $ enucli multisig review blkproducera deploysystem > deploy_system_contract_trx_to_review.json $ cat deploy_system_contract_trx_to_review.json { "proposal_name": "deploysystem", "packed_transaction": "...", "transaction": { "expiration": "2018-07-06T12:00:00", "ref_block_num": 0, "ref_block_prefix": 0, "max_net_usage_words": 0, "max_cpu_usage_ms": 0, "delay_sec": 0, "context_free_actions": [], "actions": [{ "account": "enumivo", "name": "setcode", "authorization": [{ "actor": "enumivo", "permission": "active" } ], "data": { "account": "enumivo", "vmtype": 0, "vmversion": 0, "code": "..." }, "hex_data": "..." },{ "account": "enumivo", "name": "setabi", "authorization": [{ "actor": "enumivo", "permission": "active" } ], "data": { "account": "enumivo", "abi": "..." }, "hex_data": "..." } ], "transaction_extensions": [] } } Each approver should have already audited the source code of the contract (V1.2.1) to be deployed and has already compiled that code to generate the WebAssembly code that should be byte-for-byte identical to the code that every other approver following the same process should have generated. 每个超级节点需要先审查v1.2.1的system合约源码,并且编译。生成的webassembly代应该码与提案review中的内容应该保证每字节完全相同。 Each approver should generate deploy_system_contract_trx.json by itself and get deploy_system_contract_trx_to_review.json with multisig review. Then compare the code with following command. Both should be exactly the same. 每个超级节点应该执行Step 1的set contract生成deploy_system_contract_trx.json,然后执行以下命令对比期望部署的合约代码与提案部署合约代码,二者应保持完全一致。 $ enucli multisig propose_trx -j -s -d deploysystem '[]' deploy_system_contract_trx.json blkproducera | grep '"data":' | sed 's/^[ \t]*"data":[ \t]*//;s/[",]//g' | cut -c 35- > expected_deploy_system_trx_serialized.hex $ cat expected_deploy_system_trx_serialized.hex | cut -c -50 c0593f5b00000000000000000000020000000000ea30550000 $ cat deploy_system_account_trx_to_review.json | grep '"packed_transaction":' | sed 's/^[ \t]*"packed_transaction":[ \t]*//;s/[",]//g' > proposed_deploy_system_trx_serialized.hex $ cat proposed_deploy_system_trx_serialized.hex | cut -c -50 c0593f5b00000000000000000000020000000000ea30550000 $ diff expected_deploy_system_trx_serialized.hex proposed_deploy_system_trx_serialized.hex When an approver (e.g. blkproducerb) is satisfied with the proposed transaction, they can simply approve it: 如果一个节点(譬如 blkproducerb)同意提案,则执行以下命令同意提案。 $ enucli multisig approve blkproducera deploysystem '{"actor": "blkproducerb", "permission": "active"}' -p blkproducerb executed transaction: d1e424e05ee4d96eb079fcd5190dd0bf35eca8c27dd7231b59df8e464881abfd 128 bytes 483 us # enu.msig <= enu.msig::approve {"proposer":"blkproducera","proposal_name":"deploysystem","level":{"actor":"blkproducerb","permission"... warning: transaction executed locally, but may not be confirmed by the network yet Execute the transaction to deploy the enu.system contract 执行提案交易部署enu.system合约 When the necessary approvals are collected (in this example, with 21 block producers, at least 15 of their approvals were required), the lead block producer who proposed the transaction should execute it. 当必要的提案同意收集足够(譬如21个超级节点中的15个同意),提案交易的leader节点来执行提案。 $ enucli multisig exec blkproducera deploysystem blkproducera executed transaction: e8da14c6f1fdc3255b5413adccfd0d89b18f832a4cc18c4324ea2beec6abd483 160 bytes 1877 us # enu.msig <= enu.msig::exec {"proposer":"blkproducera","proposal_name":"deploysystem","executer":"blkproducera"} Anyone can now verify that the enumivo contract was deployed correctly. 任何人都可以验证enumivo账号上合约正确部署。 $ enucli get code -a retrieved-enumivo.abi enumivo code hash: 1b3456a5eca28bcaca7a2a3360fbb2a72b9772a416c8e11a303bcb26bfe3263c saving abi to retrieved-enumivo.abi $ sha256sum build/enu.system/enu.system.wasm 1b3456a5eca28bcaca7a2a3360fbb2a72b9772a416c8e11a303bcb26bfe3263c build/enu.system/enu.system.wasm If the two hashes match then the local WebAssembly code is the one deployed on the blockchain. The retrieved ABI, which was stored in the file retrieved-enumivo.abi, can then be compared to the original ABI of the contract (contracts/enu.system/enu.system.abi) to ensure they are semantically the same. 如果两个哈希值完全一致,则本地的webassembly代码和区块链上部署的完全一致。另外从区块链拉取的retrieved-enumivo.abi文件和本地合约生成的abi文件进行比较,确保语义上完全一致。 Use the enu.msig to upgrade the enu.token contract. 使用enu.msig升级enu.token合约。 upgrading Schedule Set up a testnet and practice upgrading the contract. Upgrade contracts on the mainnet.
×