├── .gitignore ├── 184_patch ├── patch.md └── patch.sh ├── README.md ├── README_CN.md ├── README_CN_testnet.md ├── README_testnet.md ├── alert └── alertmanager.yml.tmpl ├── archive-node.md ├── changelog ├── README.md ├── evm-istanbul.md ├── sync-interval.png ├── v1.1-release-note.md ├── v1.10.0-release-note.md ├── v1.10.1-release-note.md ├── v1.11.0-release-note.md ├── v1.11.1-release-note.md ├── v1.11.2-release-note.md ├── v1.12.0-release-note.md ├── v1.12.1-release-note.md ├── v1.13.0-release-note.md ├── v1.13.1-release-note.md ├── v1.14.0-release-note.md ├── v1.14.1-release-note.md ├── v1.14.2-release-note.md ├── v1.2-instruction.md ├── v1.2-release-note.md ├── v1.3-release-note.md ├── v1.4-release-note.md ├── v1.5-release-note.md ├── v1.6-release-note.md ├── v1.7-release-note.md ├── v1.8-release-note.md ├── v1.9.0-release-note.md ├── v1.9.1-release-note.md ├── v1.9.2-release-note.md ├── v2.0.0-release-note.md ├── v2.0.1-release-note.md ├── v2.0.2-release-note.md ├── v2.0.3-release-note.md ├── v2.0.4-release-note.md ├── v2.1.0-release-note.md └── v2.1.2-release-note.md ├── claim_reward_distribute_voters.md ├── claim_reward_distribute_voters_CN.md ├── config_archive_mainnet.yaml ├── config_mainnet.yaml ├── config_testnet.yaml ├── deployment └── contracts.md ├── designdoc ├── blockdao.jpg └── blockdao.md ├── genesis_mainnet.yaml ├── genesis_testnet.yaml ├── get_elected_testnet.md ├── infra ├── infra.png ├── infraguide.md ├── infraguide_CN.md ├── monitoring │ ├── README.md │ ├── grafana_01.png │ ├── grafana_02.png │ ├── iotex-grafana.json │ ├── iotex_metric.png │ └── iotex_targets.png ├── security_practice.md └── security_practice_CN.md ├── launch_playbook_mainnet.md ├── launch_playbook_mainnet_CN.md ├── monitor ├── .env ├── alert.rules ├── docker-compose.yml ├── docker-compose.yml.gateway ├── docker-compose.yml.marketplace ├── example │ ├── example_IoTeX.json │ ├── example_dashboards.yaml │ ├── example_datasource.yaml │ ├── example_monitor_dockerfile │ └── example_run.sh └── prometheus.yml ├── native-to-erc20.abi ├── pharos.md ├── pharos └── pharos.md ├── poll ├── community-poll.md └── poll.abi ├── postmortem ├── 2019-04-23.md ├── 2019-06-11.md ├── 2019-06-25.md ├── 2019-10-30.md ├── 2020-01-29.md └── 2020-03-17.md ├── release_flow.md ├── rollbacks └── testnet-2021-05-08.md ├── scripts ├── get_systemstat.sh ├── setup_fullnode.sh ├── setup_fullnode_marketplace.sh ├── setup_monitor_alert.sh ├── stop_fullnode.sh └── update_silence.sh ├── tools └── auto-update │ ├── LICENSE │ ├── Makefile │ ├── README.md │ ├── auto-update │ ├── auto-update_darwin-amd64 │ ├── auto-update_linux-amd64 │ ├── go.mod │ ├── go.sum │ └── main.go ├── trie.db.patch └── tube ├── e2n.abi ├── erc20-to-native.md ├── n2e.abi ├── native-to-erc20.md └── tube.md /.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | data/ 3 | etc/ 4 | log/ -------------------------------------------------------------------------------- /184_patch/patch.md: -------------------------------------------------------------------------------- 1 | # v1.8.4 patch 2 | In the past 2 weeks certain IoTeX nodes run into an issue of failing to sync with 3 | most recent blocks. After careful analysis it was root-caused to an incorrect state 4 | in memory storage, which may occur when a node restarts. 5 | 6 | ## Impact 7 | A node could be affected by this issue if it has restarted sometime between Sep 30 8 | and Oct 08, 2022. It will get stuck on a certain height if it happens. 9 | 10 | ## Solution 11 | This issue has been fixed in the v1.8.4 release. A script tool has been provided 12 | to download a patch file, which would correctly restore the internal state. 13 | 14 | This fix is **not** a hard-fork, and is **only** needed one-time. After applying 15 | the patch, the node will be able to successfully restart and continue to run. It 16 | does **not** need to rely on this patch in the future restarts. 17 | 18 | Follow steps below to apply the patch and upgrade to v1.8.4. 19 | 20 | ## Apply the patch 21 | 1. First, stop your IoTeX node and remove the docker container. This is **needed** 22 | to ensure that the patch fix can be applied correctly and the node can successfully 23 | restart later. 24 | 2. Download the patch script: 25 | ``` 26 | curl https://raw.githubusercontent.com/iotexproject/iotex-bootstrap/v1.8.4/184_patch/patch.sh > ./patch.sh 27 | ``` 28 | 3. `chmod a+x ./patch.sh` 29 | 4. Make sure you have the `$IOTEX_HOME` environment variable properly set. It is 30 | the full-node home directory containing all node settings and data files in the 31 | `/etc`, `/data`, `/log` sub-directories. By default, it is `/iotex-var`, you can 32 | check it by `echo $IOTEX_HOME`. If it is not set, when you run the script in the 33 | next step you will be asked to input it, make sure you enter the right directory 34 | using absolute path. 35 | 5. Run the script `./patch.sh`, it will download the proper patch file, you will 36 | see message like: 37 | ``` 38 | download /iotex-var/data/19901069.patch success, please upgrade to v1.8.4 and restart iotex-server 39 | ``` 40 | 41 | ## Upgrade to v1.8.4 42 | Now with the correct path file in place, it's time to upgrade to v1.8.4. 43 | ``` 44 | docker pull iotex/iotex-core:v1.8.4 45 | ``` 46 | Restart your node as usual, but use `iotex/iotex-core:v1.8.4` image in the docker 47 | script/commandline. Your node should apply the patch file, and then continue to 48 | run normally. 49 | -------------------------------------------------------------------------------- /184_patch/patch.sh: -------------------------------------------------------------------------------- 1 | read -p "Please confirm that the iotex server process has been stopped [yes/no] (Default: no)" check 2 | 3 | if [ "${check}"X != "yes"X ];then 4 | echo "the iotex server process is not stopped. Please stop the process first" 5 | exit 1 6 | fi 7 | 8 | #check IOTEX_HOME variable & statedb path 9 | if [ ! $IOTEX_HOME ] || [ ! -f ${IOTEX_HOME}/data/trie.db ];then 10 | read -p "Input your \$IOTEX_HOME : " inputdir 11 | IOTEX_HOME=${inputdir} 12 | fi 13 | 14 | echo "IOTEX_HOME : $IOTEX_HOME" 15 | 16 | 17 | cd $IOTEX_HOME 18 | 19 | #download readtip file 20 | curl https://storage.googleapis.com/blockchain-archive/readtip > $IOTEX_HOME/readtip 21 | 22 | if [ ! -f $IOTEX_HOME/readtip ];then 23 | echo "$IOTEX_HOME/readtip does not exist" 24 | exit 1 25 | fi 26 | 27 | chmod a+x $IOTEX_HOME/readtip 28 | 29 | tipHeight=`$IOTEX_HOME/readtip -state-db-path=$IOTEX_HOME/data/trie.db` 30 | 31 | if [ ! $tipHeight ];then 32 | echo "can't get $tipHeight" 33 | exit 1 34 | fi 35 | 36 | echo "tip height : $tipHeight" 37 | 38 | #download the patch file 39 | if [ $tipHeight -gt 19778036 ];then 40 | ServerIP='patch.iotex.io' 41 | patchUrl=`curl https://$ServerIP/$tipHeight` 42 | echo "the patch url: $patchUrl" 43 | 44 | patchFile=$IOTEX_HOME/data/$tipHeight.patch 45 | curl $patchUrl >$patchFile 46 | 47 | if [ ! -f $patchFile ];then 48 | echo "$patchFile does not exist" 49 | exit 1 50 | fi 51 | fi 52 | 53 | echo "download $patchFile success, please upgrade to v1.8.4 and restart iotex-server" 54 | -------------------------------------------------------------------------------- /alert/alertmanager.yml.tmpl: -------------------------------------------------------------------------------- 1 | templates: 2 | - '/alertmanager/template/*.tmpl' 3 | 4 | route: 5 | group_by: ['alertname'] 6 | group_wait: 10s 7 | group_interval: 10s 8 | repeat_interval: 10m 9 | receiver: 'email-receiver' 10 | 11 | receivers: 12 | - name: 'email-receiver' 13 | email_configs: 14 | - to: '_EMAIL_' 15 | from: '_EMAIL_' 16 | smarthost: '_SMTP_HOST_:_SMTP_PORT_' 17 | auth_username: '_EMAIL_' 18 | auth_password: '_PASSWORD_' 19 | headers: { Subject: "IOTEX NODE Alert" } 20 | -------------------------------------------------------------------------------- /changelog/README.md: -------------------------------------------------------------------------------- 1 | - We have upgraded testnet and mainnet to `v1.1.1`. A improvement to blocksync request handling is introduced. That version doesn't have a activation height. 2 | - We have upgraded testnet and mainnet to `v1.1.0`. The breaking changes which will be activated on mainnet at block height 6544441. 3 | - We have upgraded testnet and mainnet to `v1.0.0`. The breaking changes which will be activated on mainnet at block height 5157001. 4 | - We have upgraded testnet to `v1.0.0-rc`. This version introduces native staking on IoTeX chain. 5 | - We have upgraded testnet and mainnet to `v0.11.1`. A blocker indexer racing issue is fixed. The breaking changes which will still be activated on mainnet at block height 4478761. 6 | - We have upgraded testnet and mainnet to `v0.11.0`. This version introduces delegates probation. It contains breaking changes which will be activated on mainnet at block height 4478761. 7 | - We have upgraded testnet to `v0.11.0-rc`. This version introduces probation. 8 | - We added auto upgrade feature in our upgrader. Auto upgrade will check if there is an avilable upgrade every 3 days and automactilly doing the upgrade. 9 | - We have upgraded testnet and mainnet to `v0.10.3`. This version improve stability on reading native staking buckets. 10 | - We have upgraded mainnet to `v0.10.2`. It contains breaking changes which will be activated on block height 3238921. Delegates must upgrade your node to the new version before that. 11 | - We have upgraded testnet to `v0.10.2`. This version correct a gas limit issue for reading native vote bucket. 12 | - We have upgraded mainnet to `v0.10.0`. It contains breaking changes which will be activated on block height 1816201. Delegates must upgrade your node to the new version before that. 13 | - We have upgraded testnet to `v0.10.0`. This version reduce block interval to 5s. 14 | - We found a bug in `v0.9.0` which may cause the nodes not agree on the delegates list. We already pushed out a build `v0.9.2` to address this issue. 15 | - `v0.9.0` is released, so that delegates should upgrade their softwares to this new version. The fork will happen at block height 1641601. Before restarting with `v0.9.0` docker image, please re-pull the up-to-date mainnet genesis config file first. It's a MUST step for this upgrade. In addtion, note that this upgrade will result in db migration upon restart which could takes 30min to 1hr to complete. Therefore, please upgrade when the delegate node is not in the active consensus epoch. 16 | - We have reset testnet, and deployed `v0.8.3`, and finally upgraded it to `v0.9.0`. The genesis config file has been updated as well. 17 | - We have upgraded mainnet to `v0.8.3`. It contains breaking changes which will be activated on block height 1512001. Delegates must upgrade your node to the new version before that. 18 | - We have upgraded testnet to `v0.8.4`. 19 | - We have upgraded testnet to `v0.8.3`, which contains the new error code, and consensus improvement. 20 | -------------------------------------------------------------------------------- /changelog/evm-istanbul.md: -------------------------------------------------------------------------------- 1 | # EVM Istanbul upgrade 2 | 3 | Starting v1.3 the IoTeX blockchain supports EVM Istanbul, which brings upgrades 4 | that improve denial-of-service attack resilience, and adjust gas costs for EVM 5 | storage and zk-SNARKs and zk-STARKs, allowing privacy applications based on 6 | SNARK and STARK to scale at a cheaper cost. 7 | 8 | Here's the list of EIP adopted in the Istanbul upgrade: 9 | 10 | - [EIP-152](https://eips.ethereum.org/EIPS/eip-152) -- precompiled Blake2b to 11 | facilitate Zcash 12 | - [EIP-1108](https://eips.ethereum.org/EIPS/eip-1108) -- better bn256 library 13 | for faster EC computation and reduced gas cost 14 | - [EIP-1344](https://eips.ethereum.org/EIPS/eip-1344) -- adds the CHAINID opcode 15 | to return current chain's EIP-155 unique identifier inside smart contract 16 | - [EIP-1884](https://eips.ethereum.org/EIPS/eip-1884) -- repricing for trie-size 17 | -dependent opcodes 18 | - [EIP-2028](https://eips.ethereum.org/EIPS/eip-2028) -- transaction data gas cost 19 | reduction 20 | - [EIP-2200](https://eips.ethereum.org/EIPS/eip-2200) -- cost reduction of storage 21 | in the EVM 22 | 23 | ## Gas cost change 24 | Here's a summary of gas cost change as a result of these EIPs 25 | 26 | | Precompiled contract | Address | Current gas cost | Updated gas cost | 27 | | --- | --- | --- | --- | 28 | | ECADD | 0x06 | 500 | 150 | 29 | | ECMUL | 0x07 | 40000 | 6000 | 30 | | Pairing check | 0x08 | 80000*k* + 100000 | 34000*k* + 45000 | 31 | 32 | *k* is the number of pairings being computed 33 | 34 | | Opcode | Address | Current gas cost | Updated gas cost | 35 | | --- | --- | --- | --- | 36 | | SLOAD | 0x54 | 200 | 800 | 37 | | BALANCE | 0x31 | 400 | 700 | 38 | | EXTCODEHASH | 0x3F | 400 | 700 | 39 | | SELFBALANCE | 0x47 | n/a | 5 | 40 | | Calldata | n/a | 68 per byte | 16 per byte | 41 | 42 | -------------------------------------------------------------------------------- /changelog/sync-interval.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iotexproject/iotex-bootstrap/b27aef5305b38c4af2cebe9df5d6703fc8498289/changelog/sync-interval.png -------------------------------------------------------------------------------- /changelog/v1.1-release-note.md: -------------------------------------------------------------------------------- 1 | # v1.1 Release Note 2 | 3 | ### v1.1.3 Release Note 4 | 1. support of getAllLogs and GetActPoolActions APIs 5 | 2. `ioctl` support HD wallet, `ioctl contract` improvement 6 | 3. bug fixes and test coverage improved 7 | 8 | ### v1.1.2 Release Note 9 | 1. Improve transaction log APIs 10 | 2. fixed issue where staking protocol account data height is not accurate 11 | 3. Add configuration to allow node to split chain db file and apply data compression using Snappy on chain db data 12 | In order to turn the compression on, you will need to set the following setting in your config.yaml: 13 | ``` 14 | db: 15 | v2BlocksToSplitDB: 1000000 16 | ``` 17 | 1,000,000 is the maximum number of blocks a splitted chain db file may contain(the estimated size of resulting chain db file is about 4GB). You can change to another number that fits your needs best. 18 | 19 | 20 | ### v1.1.1 Release Note 21 | 1. Improve node stability on poor blocksync request handling 22 | 2. Fix a nill ptr issue on blockmeta API when gateway is turned off 23 | 24 | 25 | ### v1.1.0 Release Note 26 | 27 | 1. Support of Reclaim Buckets 28 | One can now transfer the ownership of a bucket that is previously staked by a private key in Ethereum hardware wallet to another designated IoTeX address 29 | - One signs a message using the hardware wallet to prove one's ownership of the original bucket and designation of a new address, and upon protocol's verification, that bucket will be transferred to the new address on IoTeX blockchain. 30 | - To use it, go to https://member.iotex.io/reclaim-bucket/, or download the latest ioctl tool, type in "ioctl stake2 reclaim", and follow the instruction. 31 | 32 | 2. New Transaction Log 33 | One important aspect of blockchain is record of all transactions involving token change-hand for accounting/auditing purpose. This release has added this capability by providing two new gRPC APIs as below. Please refer to https://github.com/iotexproject/iotex-proto/tree/v0.4.0 for details about latest API. 34 | - "GetTransactionLogByActionHash": query transaction logs by action hash 35 | - "GetTransactionLogByBlockHeight": query transaction logs by block height 36 | 37 | 3. Visibility about Staking 38 | The protocol and the latest ioctl tool provide support of visibility of the native staking. The new commands can be used as below: 39 | - "ioctl account balance io000000000000000000000000stakingprotocol": this shows the total amount of staked token 40 | - "ioctl account balance io0000000000000000000000rewardingprotocol": this shows the total amount of available rewards 41 | 42 | 4. Optimize Docker Image 43 | v1.1.0 brings more lean and secure binaries by switching the docker base image to Alpine, a lightweight and secure Linux distribution. As a result, the image size reduced from 1.99GB to only 93.9MB, which enables a faster download and easier installation. 44 | 45 | 5. Misc 46 | - Upgrade of Protobuf 47 | - Improvement of ioctl 48 | - Improve the performance of trie 49 | - Bug fixes 50 | -------------------------------------------------------------------------------- /changelog/v1.10.0-release-note.md: -------------------------------------------------------------------------------- 1 | # v1.10.0 Release Note 2 | 3 | ## Summary 4 | **v1.10.0 has a hardfork, which will be activated at block height 5 | 22,991,401 (ETA is around 04/04/2023 11pm UTC) on IoTeX mainnet.** 6 | 7 | All nodes **must** upgrade to this release, or otherwise the node won't be able 8 | to sync with the IoTeX blockchain after the activation block. 9 | 10 | Also we'll use this release opportunity to disable the auto-upgrader, since the 11 | auto-upgrader is a fixed script that cannot adapt perfectly well to each release 12 | scenario, and has caused a couple of failed upgrades in the past. 13 | 14 | In the past, if you use the one-line upgrader tool to run your IoTeX node, please 15 | continue to use it to do the v1.10.0 upgrade. This time the script will turn off 16 | the auto-upgrader (if it was turned on before). Run the script below just as before. 17 | ```bash 18 | sudo bash # If your docker requires root privilege 19 | bash <(curl -s https://raw.githubusercontent.com/iotexproject/iotex-bootstrap/master/scripts/setup_fullnode.sh) 20 | ``` 21 | 22 | If you use the very long `docker run` command (like below) to run your IoTeX node, 23 | don't worry about the auto-upgrader since it is **not** turned on. Continue to 24 | upgrade your node using the v1.10.0 image: 25 | ``` 26 | docker stop iotex 27 | docker rm iotex 28 | docker run -d --restart on-failure --name iotex \ 29 | -p 4689:4689 \ 30 | -p 8080:8080 \ 31 | -v=$IOTEX_HOME/data:/var/data:rw \ 32 | -v=$IOTEX_HOME/log:/var/log:rw \ 33 | -v=$IOTEX_HOME/etc/config.yaml:/etc/iotex/config_override.yaml:ro \ 34 | -v=$IOTEX_HOME/etc/genesis.yaml:/etc/iotex/genesis.yaml:ro \ 35 | iotex/iotex-core:v1.10.0 \ 36 | iotex-server \ 37 | -config-path=/etc/iotex/config_override.yaml \ 38 | -genesis-path=/etc/iotex/genesis.yaml 39 | ``` 40 | 41 | ## Breaking Changes 42 | v1.10.0 enables 2 important features: 43 | 1. Claim reward via web3.js protocol 44 | 2. Node status monitoring by p2p messaging 45 | 46 | ### Claim reward via web3.js protocol 47 | Similar to how we enabled sending transfer and staking actions via web3.js protocol, 48 | in v1.10.0 claim reward is enabled as well. Delegates can now send claim reward action 49 | using Metamask. 50 | 51 | ### Node status monitoring by p2p messaging 52 | Currently, the IoTeX node is relying on a pre-defined HTTP port to collect the 53 | real-time running status, such as the software version and blockchain height. 54 | This means that delegate nodes need to open up that HTTP port which might be a 55 | security risk, especially for nodes running on clour service provider. It also 56 | requires delegate nodes to expose their public IP address, which is not preferred 57 | due to both security and privacy concerns, and creates additional maintenance 58 | burden to manually update the IP address in case it changes. 59 | 60 | In v1.10.0, a new node status monitoring solution is implemented based on the 61 | existing p2p network. By exchanging messages about their running status using 62 | the p2p network, delegate nodes no longer have to publicize their IP address nor 63 | open that specific HTTP port. In addition, the external IP address of a node can 64 | now freely change (like being assigned a new IP address after reboot) without 65 | worrying about status reporting/collection. 66 | 67 | Also in upcoming new releases, we'll introduce more advanced node status monitor 68 | functionalities. For instance, an automatic alert service where delegates can 69 | register a webhook and receive notification when the node is becoming offline or 70 | entering probation. 71 | 72 | ## Upgrade Priority 73 | v1.10.0 comes with a hardfork, so all nodes **must** upgrade in order to keep 74 | syncing with the IoTeX blockchain 75 | 76 | | Node type | Action | 77 | | ---------- | ------------ | 78 | | Delegate | Must upgrade | 79 | | Fullnode | Must upgrade | 80 | 81 | ## Important Commits (not a complete list) 82 | 1. [genesis] set Palau to activate at 04-04-2023 11pm UTC [#3823](https://github.com/iotexproject/iotex-core/pull/3823) 83 | 2. [nodeinfo] keep updating broadcast list [#3818](https://github.com/iotexproject/iotex-core/pull/3818) 84 | 3. [config] enable web3 staking and broadcast node info at Palau height [#3810](https://github.com/iotexproject/iotex-core/pull/3810) 85 | 4. [API] add batch size limit for jsonrpc [#3805](https://github.com/iotexproject/iotex-core/pull/3805) 86 | 5. implement isDelegate() in nodeinfo [#3804](https://github.com/iotexproject/iotex-core/pull/3804) 87 | 6. [nodeinfo] broadcast node's height info into p2p network [#3744](https://github.com/iotexproject/iotex-core/pull/3744) 88 | 7. [goMod] Upgrade iotex-proto to 0.5.13 [#3799](https://github.com/iotexproject/iotex-core/pull/3799) 89 | 8. [state] Remove receipt checking after runAction [#3780](https://github.com/iotexproject/iotex-core/pull/3780) 90 | 9. [pkg] Introduce batchWriter [#3581](https://github.com/iotexproject/iotex-core/pull/3581) 91 | 10. [action] Clean code in handleTransfer [#3761](https://github.com/iotexproject/iotex-core/pull/3761) 92 | 11. [state] Return err if receipt is nil [#3759](https://github.com/iotexproject/iotex-core/pull/3759) 93 | 12. [block] deprecate ConvertToBlockHeaderPb() [#3774](https://github.com/iotexproject/iotex-core/pull/3774) 94 | 13. [db] Optimize memory relocation in writeinfo [#3763](https://github.com/iotexproject/iotex-core/pull/3763) 95 | 14. [rewarding] add active web3 rewarding settings [#3740](https://github.com/iotexproject/iotex-core/pull/3740) 96 | 15. update docker build command [#3751](https://github.com/iotexproject/iotex-core/pull/3751) 97 | 16. complete web3 intergrity test [#3743](https://github.com/iotexproject/iotex-core/pull/3743) 98 | 17. [config] move config.API to api package [#3739](https://github.com/iotexproject/iotex-core/pull/3739) 99 | 18. [config] move config.Blocksync to blocksync package [#3736](https://github.com/iotexproject/iotex-core/pull/3736) 100 | 19. [action] validate candidate name [#3705](https://github.com/iotexproject/iotex-core/pull/3705) 101 | 20. [config] move config.Consensus to consensus package [#3735](https://github.com/iotexproject/iotex-core/pull/3735) 102 | 21. [api] web3 rewarding action [#3691](https://github.com/iotexproject/iotex-core/pull/3691) 103 | 22. [tests] add more cases for gas refund [#3707](https://github.com/iotexproject/iotex-core/pull/3707) 104 | 23. use config.GasStation instead of config.API [#3721](https://github.com/iotexproject/iotex-core/pull/3721) 105 | 24. remove nonce field [#3714](https://github.com/iotexproject/iotex-core/pull/3714) 106 | 25. move IsValidCandidateName to action package [#3706](https://github.com/iotexproject/iotex-core/pull/3706) 107 | -------------------------------------------------------------------------------- /changelog/v1.10.1-release-note.md: -------------------------------------------------------------------------------- 1 | # v1.10.1 Release Note 2 | 3 | ## Summary 4 | v1.10.1 is a maintenance release, with couple of improvements: 5 | 6 | 1. Added ChatGPT code review, leveraging the latest AI technology to safeguard 7 | the code quality. 8 | 2. Implemented 2 web3js API: `debug_traceCall` and `debug_traceTransaction` which 9 | further increased our chain's compatibility with the Ethereum ecosystem. 10 | 3. Limited batch size for web3 API request, to help rate-limit the API endpoint and 11 | protect against potential DDoS attack. 12 | 13 | ## Upgrade Priority 14 | Upgrade is not necessary, nodes can continue to run normally. 15 | 16 | | Node type | Action | 17 | | ---------- | ------------ | 18 | | Delegate | Not required | 19 | | Fullnode | Not required | 20 | 21 | ## Commits In This Release 22 | 1. [context] remove EnableWeb3Rewarding flag [#3852](https://github.com/iotexproject/iotex-core/pull/3852) 23 | 2. [context] remove FixRewardErroCheckPosition flag [#3851](https://github.com/iotexproject/iotex-core/pull/3851) 24 | 3. [api] ServerV2.Stop() use correct context [#3837](https://github.com/iotexproject/iotex-core/pull/3837) 25 | 4. add chatgpt code review [#3824](https://github.com/iotexproject/iotex-core/pull/3824) 26 | 5. [API] add limit batch request for web3 API [#3822](https://github.com/iotexproject/iotex-core/pull/3822) 27 | 6. [API] implement web3 API debug_traceCall [#3813](https://github.com/iotexproject/iotex-core/pull/3813) 28 | 7. [consensus] Add proposer role [#3814](https://github.com/iotexproject/iotex-core/pull/3814) 29 | 8. [API] implement web3 API debug_traceTransaction [#3779](https://github.com/iotexproject/iotex-core/pull/3779) 30 | 9. [state] remove unnecessary new(big.Int) [#3778](https://github.com/iotexproject/iotex-core/pull/3778) 31 | -------------------------------------------------------------------------------- /changelog/v1.11.1-release-note.md: -------------------------------------------------------------------------------- 1 | # v1.11.1 Release Note 2 | 3 | ## Summary 4 | **v1.11.1 is an important maintenance release, which fixes a bug in the system 5 | staking contract.** The issue was discovered in a pro-active manner, and 6 | precautionary actions are taken to make sure that no actual harm/damage is done 7 | to the system staking. 8 | 9 | All nodes **must** upgrade to this release, otherwise the node runs the risk of 10 | not being able to sync with the IoTeX blockchain after other nodes have upgraded. 11 | 12 | **Note:** 13 | There's no change to the latest config.yaml and genesis.yaml. You only need to 14 | restart the node with the new image. 15 | 16 | ## Other Improvements 17 | v1.11.1 release also comes with a couple of improvements: 18 | 1. Enforce height check for system staking indexer to increase error detection 19 | and handling robustness 20 | 2. Fix revert message in eth_call 21 | 3. Fix panic: concurrent write to websocket connection 22 | 4. Fix staking action ToEthTx() panic 23 | 5. `ioctl] action transfer` now supports 0x address format 24 | 6. Added a new `ioctl ins register` command for INS service 25 | 26 | ## Upgrade Priority 27 | v1.11.1 contains a mandatory bug fix, so all nodes **must** upgrade in order to 28 | keep syncing with the IoTeX blockchain 29 | 30 | | Node type | Action | 31 | | ---------- | ------------ | 32 | | Delegate | Must upgrade | 33 | | Fullnode | Must upgrade | 34 | 35 | ## Important Commits (not a complete list) 36 | 1. [blockindex] return empty result before contract deploy height [#3928](https://github.com/iotexproject/iotex-core/pull/3928) 37 | 2. [blockindex] restrict height for sgdindexer during write and read operation [#3926](https://github.com/iotexproject/iotex-core/pull/3926) 38 | 3. [blockindex] restrict height for contract_staking_indexer during read operation [#3927](https://github.com/iotexproject/iotex-core/pull/3927) 39 | 4. [contractstaking] fix transaction for merge after create bucket [#3924](https://github.com/iotexproject/iotex-core/pull/3924) 40 | 5. [blockindex] introduce indexergroup [#3906](https://github.com/iotexproject/iotex-core/pull/3906) 41 | 6. [api] fix revert message in eth_call [#3922](https://github.com/iotexproject/iotex-core/pull/3922) 42 | 7. [ioctl] action transfer supports 0x address [#3917](https://github.com/iotexproject/iotex-core/pull/3917) 43 | 8. [action] simplify address generation [#3913](https://github.com/iotexproject/iotex-core/pull/3913) 44 | 9. [chainservice] build contract staking indexer only when staking protocol enabled [#3886](https://github.com/iotexproject/iotex-core/pull/3886) 45 | 10. [api] fix panic: concurrent write to websocket connection [#3908](https://github.com/iotexproject/iotex-core/pull/3908) 46 | 11. [staking] fix ToEthTx() panic [#3910](https://github.com/iotexproject/iotex-core/pull/3910) 47 | 12. [ioctl] support querying delegate by operator address [#3904](https://github.com/iotexproject/iotex-core/pull/3904) 48 | 13. [ioctl] Add INS register cmd [#3903](https://github.com/iotexproject/iotex-core/pull/3903) 49 | 14. [staking] make contract staking indexer nullable [#3883](https://github.com/iotexproject/iotex-core/pull/3883) 50 | 15. [iip15] improve sgd indexer test coverage [#3893](https://github.com/iotexproject/iotex-core/pull/3893) 51 | 52 | -------------------------------------------------------------------------------- /changelog/v1.11.2-release-note.md: -------------------------------------------------------------------------------- 1 | # v1.11.2 Release Note 2 | 3 | ## Summary 4 | v1.11.2 is a minor release, which fixes a format issue in the return data of 5 | eth_getTransactionByHash API call. 6 | 7 | Only API nodes need to upgrade to this release. Delegate nodes can continue to 8 | run v1.11.1 normally, and are **NOT** required to upgrade. 9 | 10 | ## Bug Fix 11 | 1. TransactionByHash returns error [#3932](https://github.com/iotexproject/iotex-core/issues/3932) 12 | 13 | ## Upgrade Priority 14 | v1.11.2 contains fix for an API return data format issue. Only API nodes need to 15 | upgrade to this release. 16 | 17 | | Node type | Action | 18 | | ---------- | ------------ | 19 | | Delegate | Not needed | 20 | | API node | Recommended | 21 | 22 | ## Commits in This Release 23 | 1. [api] fix json unmarshal error when calling TransactionByHash via ethclient [#3933](https://github.com/iotexproject/iotex-core/pull/3933) 24 | -------------------------------------------------------------------------------- /changelog/v1.12.0-release-note.md: -------------------------------------------------------------------------------- 1 | # v1.12.0 Release Note 2 | 3 | ## Summary 4 | **v1.12.0 has a hardfork, which will be activated at block height 5 | 26,704,441 (ETA is around 11/05/2023 23:59pm UTC) on IoTeX mainnet.** 6 | 7 | All nodes **must** upgrade to this release, otherwise the node runs the risk of 8 | not being able to sync with the IoTeX blockchain after other nodes have upgraded. 9 | 10 | **Note:** 11 | There's no change to the mainnet config.yaml and genesis.yaml. You only need to 12 | restart your node with the new image. 13 | 14 | v1.12.0 marks a substantial advancement by upgrading the EVM to the Bellatrix 15 | release, surpassing the previous London release. Furthermore, our team is actively 16 | preparing for the imminent Shanghai release, with more desired features planned 17 | for subsequent releases. 18 | 19 | v1.12.0 has also enabled weighted vote counting for the Staking Bucket NFT, a 20 | feature newly launched in July with version 1.11.0. As a result, buckets created 21 | under this new feature will now enjoy an equal voting power and receive identical 22 | rewards as those of native buckets with equal balances. 23 | 24 | ## Other Improvements 25 | v1.12.0 release also comes with a couple of improvements: 26 | 1. Add `ioctl bc delegate` command, allowing users to conveniently access the 27 | detailed information of any delegate by name or operator address 28 | 2. Fix json unmarshal error when calling `eth_getTransactionByHash` via ethclient 29 | 30 | ## Upgrade Priority 31 | v1.12.0 comes with a hardfork, so all nodes **must** upgrade in order to keep 32 | syncing with the IoTeX blockchain 33 | 34 | | Node type | Action | 35 | | ---------- | ------------ | 36 | | Delegate | Must upgrade | 37 | | Fullnode | Must upgrade | 38 | 39 | ## Important Commits (not a complete list) 40 | 1. [genesis] set Redsea to activate at 11-05-2023 23:59pm UTC [#3949](https://github.com/iotexproject/iotex-core/pull/3949) 41 | 2. [emv] enable Bellatrix at Redsea height [#3942](https://github.com/iotexproject/iotex-core/pull/3942) 42 | 3. [staking] fix weighted votes of contract staking bucket [#3936](https://github.com/iotexproject/iotex-core/pull/3936) 43 | 4. [config] Add RedseaHeight [#3934](https://github.com/iotexproject/iotex-core/pull/3934) 44 | 5. [api] fix json unmarshal error when calling TransactionByHash via ethclient [#3933](https://github.com/iotexproject/iotex-core/pull/3933) 45 | -------------------------------------------------------------------------------- /changelog/v1.12.1-release-note.md: -------------------------------------------------------------------------------- 1 | # v1.12.1 Release Note 2 | 3 | ## Summary 4 | v1.12.1 is the first maintenance release after the latest release v1.12.0. It 5 | comes with several important improvements and fixes for the API functionality. 6 | This release introduces a significant enhancement to the transaction pool 7 | functionality. First, pending transactions that can soon be included in upcoming 8 | blocks will no longer be expired. Secondly, a mechanism has been implemented to 9 | replace less favorable pending transactions with more promising ones when the 10 | transaction pool approaches its capacity limit. This helps to ensure a higher 11 | likelihood of executing more successful transactions on the blockchain. With these 12 | improvement, we anticipate a relatively more stable block size, and legitimate 13 | transactions with higher gas prices stand a better chance of being swiftly processed 14 | on the blockchain, thereby enhancing the end user's experience. 15 | 16 | ## Major Improvements 17 | 1. Correct signature's V value in returned web3 transaction, to fix the transaction 18 | hash calculation 19 | 2. Support "input" field in web3 request params to increase the compatibility with 20 | latest web3js standard 21 | 3. Set gRPC MaxConnectionIdle time to 5 minutes to improve the API server performance 22 | and responsiveness 23 | 24 | ## Upgrade Priority 25 | v1.12.1 does not have a hardfork, but contains important feature improvements to boost 26 | the transaction pool functionality. All delegate nodes and API nodes are strongly 27 | recommended to upgrade to v1.12.1 in order to provide the best up-to-date service 28 | 29 | | Node type | Action | 30 | | ---------- | ------------ | 31 | | Delegate | Recommended | 32 | | Fullnode | Not required | 33 | | API node | Recommended | 34 | 35 | ## Important Commits (not a complete list) 36 | 1. [api] correct signature's V value in returned web3 transaction [#3952](https://github.com/iotexproject/iotex-core/pull/3952) 37 | 2. [api] fix typo should use EVMNetworkID() [#3960](https://github.com/iotexproject/iotex-core/pull/3960) 38 | 3. [log] fix JSON log, better trace log [#3914](https://github.com/iotexproject/iotex-core/pull/3914) 39 | 4. [evm] refactor evm parameters [#3958](https://github.com/iotexproject/iotex-core/pull/3958) 40 | 5. [util] implement block time calculator [#3951](https://github.com/iotexproject/iotex-core/pull/3951) 41 | 6. remove ValidateRewardProtocol flag [#3946](https://github.com/iotexproject/iotex-core/pull/3946) 42 | 7. [config] add SumatraHeight [#3962](https://github.com/iotexproject/iotex-core/pull/3962) 43 | 8. [action] add NewEthSigner() and pass Signer as input to rlpRawHash() and rlpSignedHash() [#3967](https://github.com/iotexproject/iotex-core/pull/3967) 44 | 9. fix Dockerfile [#3970](https://github.com/iotexproject/iotex-core/pull/3970) 45 | 10. [api] support "input" field in web3 request params [#3971](https://github.com/iotexproject/iotex-core/pull/3971) 46 | 11. set gprc MaxConnectionIdle to 5 min [#4023](https://github.com/iotexproject/iotex-core/pull/4023) -------------------------------------------------------------------------------- /changelog/v1.13.0-release-note.md: -------------------------------------------------------------------------------- 1 | # v1.13.0 Release Note 2 | 3 | ## Summary 4 | **v1.13.0 has a hardfork, which will be activated at block height 28,516,681 5 | (ETA is around 02/19/2024 00:58am UTC) on IoTeX mainnet.** 6 | 7 | All nodes **must** upgrade to this release, otherwise the node runs the risk of 8 | not being able to sync with the IoTeX blockchain after other nodes have upgraded. 9 | 10 | **Note:** 11 | There's no change to the mainnet config.yaml and genesis.yaml. You only need to 12 | restart your node with the new v1.13.0 image. 13 | 14 | v1.13.0 marks a substantial advancement by upgrading IoTeX network's EVM to the 15 | latest Shanghai version. This upgrade brings in the new opcodes and improvements 16 | in Shanghai EVM, reducing gas cost with enhanced efficiency and reliability of 17 | smart contract execution, ultimately leading to a smoother and more cost-effective 18 | experience on the IoTeX network. 19 | 20 | We are also excited to announce that v1.13.0 has enabled deterministic deployment 21 | functionality on the IoTeX network! This feature would deploy a proxy contract 22 | at a fixed address (same for all blockchains), and then it can be used to deploy 23 | any contract to a deterministic address using CREATE2. This ensures that any 24 | contract could be deployed consistently across different blockchain platforms to 25 | the same address, eliminates possible variations, and greatly enhance the 26 | predictability and reliability of smart contract deployment processes, providing 27 | developers with greater confidence in their deployments and facilitating seamless 28 | integration with other systems and protocols. 29 | 30 | ## Other Improvements 31 | v1.13.0 release also comes with a couple of improvements: 32 | 1. Supported javascript tracing for web3 api `debug_traceCall` 33 | 2. `ioctl` commandline tool added more w3bstream project commands, and set 34 | default endpoint to IoTeX mainnet 35 | 3. Add operator address into node's metrics reporting 36 | 4. Updated gas station logic to give a dynamic gas price suggestion 37 | 5. Increase max code deployment size to 48kB, same as Ethereum's limit 38 | 39 | ## Upgrade Priority 40 | v1.13.0 comes with a hardfork, so all nodes **must** upgrade in order to keep 41 | syncing with the IoTeX blockchain 42 | 43 | | Node type | Action | 44 | | ---------- | ------------ | 45 | | Delegate | Must upgrade | 46 | | Fullnode | Must upgrade | 47 | 48 | ## Important Commits (not a complete list) 49 | 1. [actpool] skip adding accounts if pending acts is empty [#4027](https://github.com/iotexproject/iotex-core/pull/4027) 50 | 2. [action] Define CandidateSelfStake Action [#4007](https://github.com/iotexproject/iotex-core/pull/4007) 51 | 3. feat(ioctl): upgrade ws apis [#4021](https://github.com/iotexproject/iotex-core/pull/4021) 52 | 4. [actpool] fix typo for worker queue [#4028](https://github.com/iotexproject/iotex-core/pull/4028) 53 | 5. feat(ioctl): project register contract addr config [#4039](https://github.com/iotexproject/iotex-core/pull/4039) 54 | 6. feat(ioctl): ipfs endpoint and ipfs gateway config [#4038](https://github.com/iotexproject/iotex-core/pull/4038) 55 | 7. feat(ioctl): optimize w3bstream project subcommand [#4013](https://github.com/iotexproject/iotex-core/pull/4013) 56 | 8. [staking] Define Endorsement State [#4017](https://github.com/iotexproject/iotex-core/pull/4017) 57 | 9. [action] Define CandidateEndorsement Action [#4016](https://github.com/iotexproject/iotex-core/pull/4016) 58 | 10. [evm] remove NotCheckPutStateErrorOption() [#4040](https://github.com/iotexproject/iotex-core/pull/4040) 59 | 11. Bump golang.org/x/crypto from 0.14.0 to 0.17.0 [#4022](https://github.com/iotexproject/iotex-core/pull/4022) 60 | 12. feat(ioctl): bc version [#4005](https://github.com/iotexproject/iotex-core/pull/4005) 61 | 13. update github [#4048](https://github.com/iotexproject/iotex-core/pull/4048) 62 | 14. [api] web3 api debug_traceCall support javascript tracing [#3931](https://github.com/iotexproject/iotex-core/pull/3931) 63 | 15. [api] Get Pending Action by eth_getTransactionByHash [#4025](https://github.com/iotexproject/iotex-core/pull/4025) 64 | 16. [ioctl] set default endpoint to iotex mainnet [#4050](https://github.com/iotexproject/iotex-core/pull/4050) 65 | 17. [ioctl] ioctl ws code cmd support project config version [#4042](https://github.com/iotexproject/iotex-core/pull/4042) 66 | 18. [server] add operator address into node's metrics [#4056](https://github.com/iotexproject/iotex-core/pull/4056) 67 | 19. Improve action pool [#4030](https://github.com/iotexproject/iotex-core/pull/4030) 68 | 20. feat(ioctl): ioctl ws message with did vc token [#4052](https://github.com/iotexproject/iotex-core/pull/4052) 69 | 21. feat(ioctl): use ipfs cid as project config url [#4053](https://github.com/iotexproject/iotex-core/pull/4053) 70 | 22. chore: change default ws register contract address [#4054](https://github.com/iotexproject/iotex-core/pull/4054) 71 | 23. [log] mute some user request related logs [#4033](https://github.com/iotexproject/iotex-core/pull/4033) 72 | 24. Replace with sort.Slice [#4034](https://github.com/iotexproject/iotex-core/pull/4034) 73 | 25. [state] convert clean address to zero-nonce type [#3991](https://github.com/iotexproject/iotex-core/pull/3991) 74 | 26. [genesis] whitelist replay deployer [#4009](https://github.com/iotexproject/iotex-core/pull/4009) 75 | 27. [gasstation] Update gas station logic [#4035](https://github.com/iotexproject/iotex-core/pull/4035) 76 | 28. replace golint with go vet [#4058](https://github.com/iotexproject/iotex-core/pull/4058) 77 | 29. enable 48kB execution data limit, EIP-2930 tx, and deterministic deployment at Sumatra height [#4070](https://github.com/iotexproject/iotex-core/pull/4070) 78 | 30. [action] check calldata size instead of total size for 48kB init code limit [#4075](https://github.com/iotexproject/iotex-core/pull/4075) 79 | 31. [action] defer access list tx enabling [#4129](https://github.com/iotexproject/iotex-core/pull/4129) 80 | 32. [genesis] set Sumatra to activate at 02-19-2024 00:58AM UTC [#4128](https://github.com/iotexproject/iotex-core/pull/4128) 81 | -------------------------------------------------------------------------------- /changelog/v1.13.1-release-note.md: -------------------------------------------------------------------------------- 1 | # v1.13.1 Release Note 2 | 3 | ## Summary 4 | v1.13.1 is the first maintenance release after the latest release v1.13.0. It 5 | comes with a bug fix and improvement of ioctl commandline tool. 6 | 7 | ## Bug fix 8 | With the launch of v1.13.0 some user reported issue with old wallet address ( 9 | see issue [#4156](https://github.com/iotexproject/iotex-core/issues/4156) for 10 | details). The issue is quickly identified to relate to nonce calculation for 11 | certain wallet address, and is properly fixed in this release. 12 | 13 | ## Other Improvements 14 | In v1.13.1, the ioctl commandline tool has enabled querying delegate's reward 15 | amount by name. As of now you can only query the reward amount by the actual 16 | reward address. With the functionality of querying by name, it makes delegate 17 | more convinient to check their reward and improves user experience. 18 | 19 | ## Upgrade Priority 20 | v1.13.1 does not have a hardfork, but contains a bug fix to ensure prompt transaction 21 | processing. All delegate nodes and API nodes are recommended to upgrade to v1.13.1 22 | in order to provide the best up-to-date service 23 | 24 | | Node type | Action | 25 | | ---------- | ------------ | 26 | | Delegate | Recommended | 27 | | Fullnode | Not required | 28 | | API node | Recommended | 29 | 30 | ## Important Commits (not a complete list) 31 | 1. [actpool] fix bug in worker.Reset() [#4159](https://github.com/iotexproject/iotex-core/pull/4159) 32 | 2. [ioctl] node reward unclaimed support name query [#4150](https://github.com/iotexproject/iotex-core/pull/4150) 33 | -------------------------------------------------------------------------------- /changelog/v1.14.1-release-note.md: -------------------------------------------------------------------------------- 1 | # v1.14.1 Release Note 2 | 3 | ## Summary 4 | v1.14.1 is the first maintenance release after the latest release v1.14.0. It 5 | comes with enhancements across various components such as blockdao, staking, 6 | API. Also, ioctl commandline tool has a fresh upgrade that supports two new 7 | powerful functions: ioID and w3bstream. The ioID function enables seamless 8 | integration and management of decentralized identities on the IoTeX blockchain. 9 | The w3bstream functions allows for efficient management of w3bstream project 10 | on the chain, from project creation, device registration, to message operation 11 | and prover management. 12 | 13 | ## Bug Fix and Performance Improvements: 14 | 1. bumped go version to 1.21 15 | 2. Resolved an issue where the blockdao process could become unresponsive while 16 | checking the indexer. This fix ensures that the node process can receive the 17 | break signal and exit if needed. 18 | 3. Fixed an issue where the response ID type in the JSON-RPC API did not match 19 | the request type. This ensures consistency and reliability in web3js API. 20 | 4. Enhanced the deserialization process when retrieving block receipts, resulting 21 | in faster access and improved overall performance of the blockdao component. 22 | 5. Fixed wrong cache for API readState at tip height, now the cache always returns 23 | most accurate and latest result. 24 | 25 | ## New Features and Enhancements 26 | 1. Added endorsement details to the bucket fetch APIs, providing more comprehensive 27 | information for stakeholders and improving transparency within the staking process. 28 | 2. Implemented rate limiting for the WebSocket API to prevent abuse and ensure 29 | fair usage. This enhancement protects the network from potential overload and 30 | improves service stability. 31 | 3. Enabled the ToEthTx function for grantReward action, allowing it to be processed 32 | as an Ethereum-compatible transaction. This improvement facilitates interoperability 33 | and expands the utility of the IoTeX blockchain. 34 | 4. Added 2 new commands `ioid` and `ws` to ioctl commandline tool. Enables the ioID 35 | management and w3bstream project functions. 36 | 37 | ## Upgrade Priority 38 | v1.14.1 does not have a hardfork, but contains several bug fixes, performance 39 | improvements, and new feature enhancements. All delegate nodes and API nodes are 40 | recommended to upgrade to v1.14.1 in order to provide the best up-to-date service 41 | 42 | | Node type | Action | 43 | | ---------- | ------------ | 44 | | Delegate | Recommended | 45 | | Fullnode | Not required | 46 | | API node | Recommended | 47 | 48 | ## Important Commits (not a complete list) 49 | 1. [ioctl] Add CandidateEndorsement and CandidateActivate action [#4194](https://github.com/iotexproject/iotex-core/pull/4194) 50 | 2. [blockdao] Fix program unstopable when blockdao is checking indexer [#4217](https://github.com/iotexproject/iotex-core/pull/4217) 51 | 3. [blockdao] Optimize derialization when retrieving receipts [#4221](https://github.com/iotexproject/iotex-core/pull/4221) 52 | 4. [staking] Add endorsement info in bucket fetch apis [#4207](https://github.com/iotexproject/iotex-core/pull/4207) 53 | 5. [api] Support for tracer and tracerConfig in debug_traceTransaction API [#4216](https://github.com/iotexproject/iotex-core/pull/4216) 54 | 6. [api] fix JsonRPC api response id type doesn't match request type [#4168](https://github.com/iotexproject/iotex-core/pull/4168) 55 | 7. [api] Add ratelimit for websocket API [#4031](https://github.com/iotexproject/iotex-core/pull/4031) 56 | 8. [action] Add grantReward ToEthTx() [#4047](https://github.com/iotexproject/iotex-core/pull/4047) 57 | 9. [api] Fix wrong cache for api readState at tip height [#4253](https://github.com/iotexproject/iotex-core/pull/4253) 58 | 10. feat(wsctl): add project configuration cmd [#4195](https://github.com/iotexproject/iotex-core/pull/4195) 59 | 11. [ioctl]: update ws project format [#4224](https://github.com/iotexproject/iotex-core/pull/4224) 60 | 12. feat(ioctl/ws): sync latest w3bstream contract abis and generate go code [#4279](https://github.com/iotexproject/iotex-core/pull/4279) 61 | 13. [ioctl][ws][#2] add w3bstream contracts address configurations [#4280](https://github.com/iotexproject/iotex-core/pull/4280) 62 | 14. [ioctl][ws][#3] project sub command to support interaction with ws contracts [#4281](https://github.com/iotexproject/iotex-core/pull/4281) 63 | 15. [ioctl][ws][#4] prover sub commands to support interaction with ws contracts [#4282](https://github.com/iotexproject/iotex-core/pull/4282) 64 | 16. [ioctl][ws][#5] project device sub commands to support interaction with ws contracts [#4283](https://github.com/iotexproject/iotex-core/pull/4283) 65 | 17. [ioctl][ioid][#1] ioid sub commands [#4284](https://github.com/iotexproject/iotex-core/pull/4284) 66 | 18. [ioctl][ws] update ws default value [#4285](https://github.com/iotexproject/iotex-core/pull/4285) 67 | 68 | 69 | -------------------------------------------------------------------------------- /changelog/v1.14.2-release-note.md: -------------------------------------------------------------------------------- 1 | # v1.14.2 Release Note 2 | 3 | ## Summary 4 | v1.14.2 comes with new feature for ioID function. 5 | 6 | ## Bug Fix and Performance Improvements: 7 | 1. fixed an issue of not properly closing file. 8 | 9 | ## New Features and Enhancements 10 | 1. Added new function to set project name for the `ioctl ioid` commandline tool. 11 | 12 | ## Upgrade Priority 13 | v1.14.2 release is primarily for the new `ioctl ioid` command. Delegate nodes 14 | and API nodes are not required to upgrade to v1.14.2 15 | 16 | | Node type | Action | 17 | | ---------- | ------------ | 18 | | Delegate | Not required | 19 | | Fullnode | Not required | 20 | | API node | Not required | 21 | 22 | ## Important Commits (not a complete list) 23 | 1. [patchstore] fix close files [#4268](https://github.com/iotexproject/iotex-core/pull/4268) 24 | 2. Update README.md [#4269](https://github.com/iotexproject/iotex-core/pull/4269) 25 | 3. refactor ioID cmd [#4287](https://github.com/iotexproject/iotex-core/pull/4287) 26 | 4. [ioctl] ioID setName [#4293](https://github.com/iotexproject/iotex-core/pull/4293) 27 | -------------------------------------------------------------------------------- /changelog/v1.2-instruction.md: -------------------------------------------------------------------------------- 1 | 2 | ## Instruction for Mainnet v1.2.0 Upgrade 3 | First, go to the `iotex-var` folder on your node (where it has 3 sub-folders `etc`, `data`, `log`) 4 | ``` 5 | export IOTEX_HOME=$PWD 6 | ``` 7 | stop the running node: 8 | ``` 9 | docker stop iotex 10 | docker rm iotex 11 | ``` 12 | 13 | #### Option 1 - if you are running the node WITHOUT API gateway enabled 14 | Check files under `$IOTEX_HOME/data`, if you don't see a file named `index.db`, 15 | then your node is **not** running as gateway. In this case, simply start the 16 | node using image v1.2.0. 17 | ``` 18 | docker run -d --restart on-failure --name iotex \ 19 | -p 4689:4689 \ 20 | -p 8080:8080 \ 21 | -v=$IOTEX_HOME/data:/var/data:rw \ 22 | -v=$IOTEX_HOME/log:/var/log:rw \ 23 | -v=$IOTEX_HOME/etc/config.yaml:/etc/iotex/config_override.yaml:ro \ 24 | -v=$IOTEX_HOME/etc/genesis.yaml:/etc/iotex/genesis.yaml:ro \ 25 | iotex/iotex-core:v1.2.0 \ 26 | iotex-server \ 27 | -config-path=/etc/iotex/config_override.yaml \ 28 | -genesis-path=/etc/iotex/genesis.yaml 29 | ``` 30 | Verify the node is up and running by: 31 | ``` 32 | docker logs iotex --tail=100 33 | ``` 34 | You should see log output from the node. 35 | 36 | **If your node is syncing blocks very slow, see [here](#slow-sync)** 37 | 38 | #### Option 2 - if you are running the node WITH API gateway enabled 39 | In this case, you'll need to wipe out the data and start from latest snapshot, due to index file in v1.2 is not backward-compatible. 40 | ``` 41 | rm -rf $IOTEX_HOME/data 42 | curl -L https://t.iotex.me/mainnet-data-with-idx-latest > $IOTEX_HOME/data.tar.gz 43 | tar -xzf data.tar.gz 44 | ``` 45 | then start the node using image v1.2.0 46 | ``` 47 | docker run -d --restart on-failure --name iotex \ 48 | -p 4689:4689 \ 49 | -p 14014:14014 \ 50 | -p 8080:8080 \ 51 | -v=$IOTEX_HOME/data:/var/data:rw \ 52 | -v=$IOTEX_HOME/log:/var/log:rw \ 53 | -v=$IOTEX_HOME/etc/config.yaml:/etc/iotex/config_override.yaml:ro \ 54 | -v=$IOTEX_HOME/etc/genesis.yaml:/etc/iotex/genesis.yaml:ro \ 55 | iotex/iotex-core:v1.2.0 \ 56 | iotex-server \ 57 | -config-path=/etc/iotex/config_override.yaml \ 58 | -genesis-path=/etc/iotex/genesis.yaml \ 59 | -plugin=gateway 60 | ``` 61 | Since downloading and extracting data may take quite some time, we **strongly** 62 | recommend you do the upgrade in an epoch when the node is not chosen as active 63 | delegate. This would prevent your node from being possibly probated and lose 64 | productivity. 65 | 66 | Verify the node is up and running by: 67 | ``` 68 | docker logs iotex --tail=100 69 | ``` 70 | You should see log output from the node. 71 | 72 | **If your node is syncing blocks very slow, see [here](#slow-sync)** 73 | 74 | ## Instruction for Testnet v1.2.0 Upgrade 75 | To upgrade to testnet v1.2.0, the procedure is same as that of mainnet, except these 2: 76 | 77 | 1. Download the snapshot from `https://t.iotex.me/testnet-data-with-idx-latest` if needed 78 | 2. Update the config and genesis files like below 79 | 80 | * Save the private key and external IP address, i.e., the `producerPrivKey:` and `externalHost` line in file `$IOTEX_HOME/etc/config.yaml` 81 | 82 | * Get the new config and genesis files 83 | ``` 84 | curl https://raw.githubusercontent.com/iotexproject/iotex-bootstrap/v1.2.0/config_testnet.yaml > $IOTEX_HOME/etc/config.yaml 85 | curl https://raw.githubusercontent.com/iotexproject/iotex-bootstrap/v1.2.0/genesis_testnet.yaml > $IOTEX_HOME/etc/genesis.yaml 86 | ``` 87 | 88 | * Set the private key and external IP back into `$IOTEX_HOME/etc/config.yaml` 89 | 90 | 91 | **If your node is syncing blocks very slow, see [here](#slow-sync)** 92 | 93 | ### Troubleshoot for Slow Sync 94 | 95 | Under certain network conditions, the node may sync slower as it should be. Follow the steps below to config it the sync mechanism to be more aggresive. 96 | 97 | 1. stop the node 98 | ``` 99 | docker stop iotex 100 | ``` 101 | 2. open file `$IOTEX_HOME/etc/config.yaml`, add the following line under 102 | `blockSync:` 103 | 104 | ![image](/changelog/sync-interval.png) 105 | 106 | 3. restart the node 107 | ``` 108 | docker restart iotex 109 | ``` 110 | -------------------------------------------------------------------------------- /changelog/v1.2-release-note.md: -------------------------------------------------------------------------------- 1 | # v1.2 Release Note 2 | 3 | ### v1.2.0 Release Note 4 | **Note that v1.2.0 has a hardfork, which will be activated at block height 11,267,641 (5/24/2021 ~9am PDT) on IoTeX mainnet.** 5 | 1. web3js compatibility. With v1.2 user can connect their favorite tools in the 6 | Ethereum eco-system (such as Metamask, Subgraph) to IoTeX blockchain simply by 7 | setting up RPC endpoint to IoTeX endpoint 8 | 2. Support multiple chain DB files. v1.2 will now generate 1 db file for every 9 | 1,000,000 accumulated blocks added to the blockchain. This prevents one single 10 | overly large db file in the long run, and opens up possibility for faster and 11 | incremental download (only need to download new latest db files) 12 | 3. Reduced DB file size. Together with the multiple DB files feature, the DB file 13 | itself has been overhaualed by using an improved block storage with better 14 | compression. The estimated storage saving is about 30~40% when enabling v1.2 15 | 4. Added EVM revert message in transaction receipt. For contract calls that get 16 | reverted in the middle, we can now see the actual revert error message from the 17 | transaction receipt 18 | 5. Improved transaction indexing scheme. As a result, certain API queries (for 19 | example, pull all transactions from an address within a block range) now get a 20 | much faster response 21 | 6. Improved p2p connection reliability and network robustness 22 | 7. Fix ioctl crashes in Ubuntu when creating an action 23 | -------------------------------------------------------------------------------- /changelog/v1.3-release-note.md: -------------------------------------------------------------------------------- 1 | # v1.3 Release Note 2 | 3 | ## v1.3.0 Release Note 4 | **Note that v1.3.0 has a hardfork, which will be activated at block height 5 | 12,289,321 (ETA is 7/22/2021 around 2pm UTC-7:00) on IoTeX mainnet.** 6 | 1. v1.3 has upgraded to latest EVM version so user can confidently deploy their 7 | DApps to IoTeX blockchain. This EVM upgrade supports the ChainID opcode to 8 | prevent relay attacks and enable cross-chain transparency, and has optimized gas 9 | costs of certain opcodes, especially privacy and zk computations. See below for 10 | details 11 | 2. Optimized block sync strategy to make it more robust 12 | 3. Fixed a bug that API query needs to wait a little while to return the latest 13 | committed block 14 | 4. Fixed a bug that node stops working after network connectivity is lost. Now 15 | the node can detect the network loss/reconnect event, and automatically resume 16 | working after network connectivity is restored 17 | 18 | ## EVM upgrade 19 | Starting v1.3 the IoTeX blockchain supports EVM Istanbul, which brings upgrades 20 | that improve denial-of-service attack resilience, and adjust gas costs for EVM 21 | storage and zk-SNARKs and zk-STARKs, allowing privacy applications based on 22 | SNARK and STARK to scale at a cheaper cost. 23 | 24 | Here's the list of EIP adopted in the Istanbul upgrade: 25 | 26 | - [EIP-152](https://eips.ethereum.org/EIPS/eip-152) -- precompiled Blake2b to 27 | facilitate Zcash 28 | - [EIP-1108](https://eips.ethereum.org/EIPS/eip-1108) -- better bn256 library 29 | for faster EC computation and reduced gas cost 30 | - [EIP-1344](https://eips.ethereum.org/EIPS/eip-1344) -- adds the CHAINID opcode 31 | to return current chain's EIP-155 unique identifier inside smart contract 32 | - [EIP-1884](https://eips.ethereum.org/EIPS/eip-1884) -- repricing for trie-size 33 | -dependent opcodes 34 | - [EIP-2028](https://eips.ethereum.org/EIPS/eip-2028) -- transaction data gas cost 35 | reduction 36 | - [EIP-2200](https://eips.ethereum.org/EIPS/eip-2200) -- cost reduction of storage 37 | in the EVM 38 | 39 | ### Gas cost change 40 | Here's a summary of gas cost change as a result of these EIPs 41 | 42 | | Precompiled contract | Address | Current gas cost | Updated gas cost | 43 | | --- | --- | --- | --- | 44 | | ECADD | 0x06 | 500 | 150 | 45 | | ECMUL | 0x07 | 40000 | 6000 | 46 | | Pairing check | 0x08 | 80000*k* + 100000 | 34000*k* + 45000 | 47 | 48 | *k* is the number of pairings being computed 49 | 50 | | Opcode | Address | Current gas cost | Updated gas cost | 51 | | --- | --- | --- | --- | 52 | | SLOAD | 0x54 | 200 | 800 | 53 | | BALANCE | 0x31 | 400 | 700 | 54 | | EXTCODEHASH | 0x3F | 400 | 700 | 55 | | SELFBALANCE | 0x47 | n/a | 5 | 56 | | Calldata | n/a | 68 per byte | 16 per byte | 57 | 58 | -------------------------------------------------------------------------------- /changelog/v1.4-release-note.md: -------------------------------------------------------------------------------- 1 | # v1.4 Release Note 2 | 3 | ## v1.4.0 Release Note 4 | **Note that v1.4.0 has a hardfork, which will be activated at block height 5 | 13,685,401 (ETA is 10/11/2021 around 10pm UTC) on IoTeX mainnet.** 6 | 1. Incorporated the fix for the [consensus bug](https://github.com/ethereum/go-ethereum/blob/master/docs/postmortems/2021-08-22-split-postmortem.md) 7 | that caused the minority chain split on Ethereum at Aug 17, 2021 8 | 2. More detailed error reporting for contract execution failure 9 | 3. Improved block sync speed by setting the proper target range 10 | 4. Fixed API gas estimation inconsistency by honoring the input's gas limit 11 | and price 12 | -------------------------------------------------------------------------------- /changelog/v1.5-release-note.md: -------------------------------------------------------------------------------- 1 | # v1.5 Release Note 2 | 3 | ## v1.5.0 Release Note 4 | **Note that v1.5.0 has a hardfork, which will be activated at block height 5 | 13,816,441 (ETA is 10/19/2021 around 1pm UTC) on IoTeX mainnet.** 6 | 1. Approved the long-awaited community proposal to extend foundation bonus 7 | for another year starting from v1.5 activation 8 | 2. Improved the action indexer performance, smart contract query has become 9 | faster as a result 10 | -------------------------------------------------------------------------------- /changelog/v1.6-release-note.md: -------------------------------------------------------------------------------- 1 | # v1.6 Release Note 2 | 3 | ## v1.6.0 Release Note 4 | **Note that v1.6.0 has a hardfork, which will be activated at block height 5 | 13,979,161 (ETA is 10/28/2021 around 11pm UTC) on IoTeX mainnet.** 6 | 1. Added API tracing functionality, which enables measuring and visualizing the 7 | break-down of API call timing. We'll work on API performance improvement based 8 | on the observability this tool provides in future releases 9 | 2. Exposed gRPC health check point in the API server 10 | 3. Fixed contract read issue for certain smart contracts we've seen earlier 11 | 4. ioctl tool can export private key from HDWallet now 12 | 13 | ## v1.6.1 Release Note 14 | 1. Separated the p2p network for Mainnet and Testnet, this reduces the network 15 | traffic interference and noise between 2 networks 16 | 2. Rectified transaction error message to be compatible with chainlink 17 | 3. API service added ReadContractStorage() interface 18 | 19 | ## v1.6.2 Release Note 20 | 1. fixed EVM calldata dump issue 21 | 22 | ## v1.6.3 Release Note 23 | 1. Implemented HTTP server to support [Ethereum's JSON-RPC protocol](https://eth.wiki/json-rpc/API) 24 | inside iotex-core (this removes the need of intermediate Babel bridge/service) 25 | 2. Added `eth_getStorageAt` method 26 | 3. Instrumented tracing to measure timing on critical code path 27 | 4. Enabled EVM tracing to collect calling stacks inside EVM 28 | 5. Performance improvement of ActPool 29 | 6. Enabled log rotate 30 | 7. Corrected nested context usage in transaction processing loop 31 | 32 | ## v1.6.4 Release Note 33 | 1. Fixed certain hardcode values in original babel service ([#3038](https://github.com/iotexproject/iotex-core/pull/3038)) 34 | 2. Correctly handle array in web3 request ([#3050](https://github.com/iotexproject/iotex-core/pull/3050)) 35 | 3. Added more tracing for slow API ([#3057](https://github.com/iotexproject/iotex-core/pull/3057)) 36 | 4. Fixed log query (with large block range) causing high memory usage ([#3062](https://github.com/iotexproject/iotex-core/pull/3062)) 37 | 5. Added gasFee info into GetActions() API ([#3063](https://github.com/iotexproject/iotex-core/pull/3063)) 38 | -------------------------------------------------------------------------------- /changelog/v1.7-release-note.md: -------------------------------------------------------------------------------- 1 | # v1.7 Release Note 2 | 3 | ## v1.7.0 Release Note 4 | **Note that v1.7.0 has a hardfork, which will be activated at block height 5 | 16,509,241 (ETA is 03/24/2022 around 11pm UTC) on IoTeX mainnet.** 6 | 7 | 1. Corrected the GetHashFunc implementation in EVM ([#2998](https://github.com/iotexproject/iotex-core/pull/2998)) 8 | 2. The transaction receipt and EVM log now bear correct index values ([#2923](https://github.com/iotexproject/iotex-core/pull/2923)) 9 | 3. When transaction is reverted, the corresponding logs are also removed ([#3014](https://github.com/iotexproject/iotex-core/pull/3014)) 10 | 11 | ## v1.7.1 Release Note 12 | 1. Improved snapshot performance ([#3125](https://github.com/iotexproject/iotex-core/pull/3125)) 13 | 2. Faster DB operation using sorted list and saving hash value ([#3143](https://github.com/iotexproject/iotex-core/pull/3143), 14 | [#3160](https://github.com/iotexproject/iotex-core/pull/3160), [#3170](https://github.com/iotexproject/iotex-core/pull/3170), 15 | [#3172](https://github.com/iotexproject/iotex-core/pull/3172)) 16 | 3. Added crash log functionality ([#3185](https://github.com/iotexproject/iotex-core/pull/3185)) 17 | -------------------------------------------------------------------------------- /changelog/v1.8-release-note.md: -------------------------------------------------------------------------------- 1 | # v1.8 Release Note 2 | 3 | ## v1.8.0 Release Note 4 | **Note that v1.8.0 has a hardfork, which will be activated at block height 5 | 17,662,681 (ETA is 05/30/2022 around 11pm UTC) on IoTeX mainnet.** 6 | 7 | 1. Added chain ID into transaction for enhanced transaction security ([#3188](https://github.com/iotexproject/iotex-core/pull/3188)) 8 | 2. Supported staking transactions via web3 protocol ([#3209](https://github.com/iotexproject/iotex-core/pull/3209)) 9 | 3. Improved p2p connection robustness ([#3371](https://github.com/iotexproject/iotex-core/pull/3371)) 10 | 4. Multiple API improvements ([#3073](https://github.com/iotexproject/iotex-core/pull/3073), [#3174](https://github.com/iotexproject/iotex-core/pull/3174), 11 | [#3205](https://github.com/iotexproject/iotex-core/pull/3205), [#3217](https://github.com/iotexproject/iotex-core/pull/3217)) 12 | 5. Introduced chainservice builder to better manage service start-up and shut-down ([#3235](https://github.com/iotexproject/iotex-core/pull/3235), 13 | [#3364](https://github.com/iotexproject/iotex-core/pull/3364) ) 14 | 15 | ## v1.8.1 Release Note 16 | v1.8.1 is a regular maintenance release 17 | 18 | 1. Added websocket support for web3.js protocol ([#3252](https://github.com/iotexproject/iotex-core/pull/3252), 19 | [#3298](https://github.com/iotexproject/iotex-core/pull/3298)) 20 | 2. Cleaned up protection code for v1.8.0 hard-fork ([#3188](https://github.com/iotexproject/iotex-core/pull/3188), 21 | [#3390](https://github.com/iotexproject/iotex-core/pull/3390),[#3436](https://github.com/iotexproject/iotex-core/pull/3436)) 22 | 3. Implemented crash log ([#3456](https://github.com/iotexproject/iotex-core/pull/3456)) 23 | 4. Added ChainID metrics ([#3438](https://github.com/iotexproject/iotex-core/pull/3438)), and multiple API improvements 24 | ([#3347](https://github.com/iotexproject/iotex-core/pull/3347), [#3426](https://github.com/iotexproject/iotex-core/pull/3426), 25 | [#3484](https://github.com/iotexproject/iotex-core/pull/3484)) 26 | 5. Code refactor and improvements ([#3397](https://github.com/iotexproject/iotex-core/pull/3397), 27 | [#3400](https://github.com/iotexproject/iotex-core/pull/3400),[#3404](https://github.com/iotexproject/iotex-core/pull/3404)) 28 | 29 | ## v1.8.2 Release Note 30 | v1.8.2 is a regular maintenance release 31 | 32 | 1. Enhanced p2p network robustness by adding GroupID to DHT protocol in peer discovery ([#3409](https://github.com/iotexproject/iotex-core/pull/3409), 33 | [#3580](https://github.com/iotexproject/iotex-core/pull/3580)) 34 | 2. Multiple API improvments and code refactor ([#3303](https://github.com/iotexproject/iotex-core/pull/3303), 35 | [#3432](https://github.com/iotexproject/iotex-core/pull/3432),[#3433](https://github.com/iotexproject/iotex-core/pull/3433), 36 | [#3434](https://github.com/iotexproject/iotex-core/pull/3434),[#3441](https://github.com/iotexproject/iotex-core/pull/3441), 37 | [#3442](https://github.com/iotexproject/iotex-core/pull/3442),[#3443](https://github.com/iotexproject/iotex-core/pull/3443), 38 | [#3485](https://github.com/iotexproject/iotex-core/pull/3485)) 39 | 3. Remove the global config.EVMNetworkID() ([#3431](https://github.com/iotexproject/iotex-core/pull/3431), 40 | [#3437](https://github.com/iotexproject/iotex-core/pull/3437),[#3460](https://github.com/iotexproject/iotex-core/pull/3460), 41 | [#3491](https://github.com/iotexproject/iotex-core/pull/3491)) 42 | 4. Use internal caching to speed up action.Address(), action.Hash(), and action.SenderAddress() ([#3420](https://github.com/iotexproject/iotex-core/pull/3420), 43 | [#3446](https://github.com/iotexproject/iotex-core/pull/3446)) 44 | 5. Clean-up of certain obsolete code ([#3453](https://github.com/iotexproject/iotex-core/pull/3453), 45 | [#3463](https://github.com/iotexproject/iotex-core/pull/3463),[#3464](https://github.com/iotexproject/iotex-core/pull/3464), 46 | [#3465](https://github.com/iotexproject/iotex-core/pull/3465)) 47 | 48 | ## v1.8.4 Release Note 49 | v1.8.4 is a hot-fix release, see [here](https://github.com/iotexproject/iotex-bootstrap/blob/v1.8.4/184_patch/patch.md) 50 | for details and upgrade instruction. 51 | -------------------------------------------------------------------------------- /changelog/v1.9.1-release-note.md: -------------------------------------------------------------------------------- 1 | # v1.9.1 Release Note 2 | 3 | ## Summary 4 | v1.9.1 is a maintenance release, with 2 fixes: 5 | 6 | 1. Certain build config is accidently deleted, causing git version and commit_id 7 | being missed from the software binary. This is a quick fix to restore that info 8 | so delegate nodes can correctly report the binary version they are running. 9 | 2. `ioctl node delegate` command can correctly show all probated delegates now. 10 | 11 | ## Upgrade Priority 12 | All delegate nodes **must** upgrade in order to correctly report the binary version 13 | they are running. 14 | 15 | | Node type | Action | 16 | | ---------- | ------------ | 17 | | Delegate | Must upgrade | 18 | | Fullnode | Not required | 19 | 20 | ## Commits In This Release 21 | 1. update docker build command [#3751](https://github.com/iotexproject/iotex-core/pull/3751) 22 | 2. [ioctl] use candidate.OperatorAddress to show probated delegates [#3727](https://github.com/iotexproject/iotex-core/pull/3727) 23 | -------------------------------------------------------------------------------- /changelog/v1.9.2-release-note.md: -------------------------------------------------------------------------------- 1 | # v1.9.2 Release Note 2 | 3 | ## Summary 4 | v1.9.2 is a maintenance release, with the following fix: 5 | 6 | 1. Limit the maximum size of RPC response data to prevent node from running out 7 | of memory. 8 | 9 | ## Upgrade Priority 10 | If your node is running as gateway, it is recommended to upgrade to v1.9.2 to 11 | better protect it from potential out-of-memory attack. 12 | 13 | | Node type | Action | 14 | | ---------- | ------------ | 15 | | Delegate | Not required | 16 | | Gateway | Recommended | 17 | | Fullnode | Not required | 18 | 19 | ## Commits In This Release 20 | 1. [API] add batch size limit for jsonrpc [#3805](https://github.com/iotexproject/iotex-core/pull/3805) 21 | -------------------------------------------------------------------------------- /changelog/v2.0.1-release-note.md: -------------------------------------------------------------------------------- 1 | # v2.0.1 Release Note 2 | 3 | ## Summary 4 | v2.0.1 is the first maintenance release after the latest release v2.0.0. It 5 | comes with several API fixes to maintain backward-compatibility with existing 6 | ioPay and web staking portal. 7 | 8 | ## Bug Fix and Performance Improvements: 9 | 1. Corrected return data of readCandidates API to maintain backward-compatibility 10 | with existing ioPay and web staking portal. 11 | 2. Fixed the issue of log loss when querying the latest logs by eth_getLogs. 12 | 3. Fixed the issue of not cleaning up the self-stake bucket after the bucket is 13 | unstaked. 14 | 4. Fixed invalid contract address causing SimulateExecution to panic. 15 | 16 | ## Upgrade Priority 17 | v2.0.1 does not have a hardfork, but contains several API fixes. All API nodes are 18 | recommended to upgrade to v2.0.1 in order to provide the best up-to-date service 19 | 20 | | Node type | Action | 21 | | ---------- | ------------ | 22 | | Delegate | Not required | 23 | | Fullnode | Not required | 24 | | API node | Recommended | 25 | 26 | ## Important Commits (not a complete list) 27 | 1. [api] correct candidate selfstake in api [#4335](https://github.com/iotexproject/iotex-core/pull/4335) 28 | 2. [api] fix inaccurate result of getLogs [#4334](https://github.com/iotexproject/iotex-core/pull/4334) 29 | 3. [evm] fix invalid contract address causing SimulateExecution panic [#4333](https://github.com/iotexproject/iotex-core/pull/4333) 30 | 4. [staking] candidates v1 compatability [#4332](https://github.com/iotexproject/iotex-core/pull/4332) 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /changelog/v2.0.2-release-note.md: -------------------------------------------------------------------------------- 1 | # v2.0.2 Release Note 2 | 3 | ## Summary 4 | v2.0.2 is the second maintenance release after the latest release v2.0.0. It 5 | comes with an API fix to return correct number of total votes for delegate, 6 | and two ioctl command improvements. 7 | 8 | ## Bug Fix and Performance Improvements: 9 | 1. Corrected delegate's total votes for ioctl and API query. 10 | 2. Fixed the issue that certain ioctl commands are missing transaction hash in 11 | the send result display. 12 | 3. Showed delegate's ID in `ioctl bc delegate` command output. 13 | 14 | ## Upgrade Priority 15 | v2.0.2 does not have a hardfork, but contains several API and ioctl command fixes. 16 | All API nodes are recommended to upgrade to v2.0.2 in order to provide the most 17 | up-to-date results and service 18 | 19 | | Node type | Action | 20 | | ---------- | ------------ | 21 | | Delegate | Not required | 22 | | Fullnode | Not required | 23 | | API node | Recommended | 24 | 25 | ## Important Commits (not a complete list) 26 | 1. [ioctl] add ID into candidate display [#4348](https://github.com/iotexproject/iotex-core/pull/4348) 27 | 2. [ioctl] print act hash when execute act [#4347](https://github.com/iotexproject/iotex-core/pull/4347) 28 | 3. [api] Fix nft bucket votes counting [#4346](https://github.com/iotexproject/iotex-core/pull/4346) 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /changelog/v2.0.3-release-note.md: -------------------------------------------------------------------------------- 1 | # v2.0.3 Release Note 2 | 3 | ## Summary 4 | v2.0.3 is also an maintenance release after the latest release v2.0.0. It 5 | comes with an API fix. 6 | 7 | ## Bug Fix and Performance Improvements: 8 | 1. fix logs mismatched in `eth_getLogs` API 9 | 10 | ## Upgrade Priority 11 | v2.0.3 does not have a hardfork, but contains an API fix. 12 | All API nodes are recommended to upgrade to v2.0.3 in order to provide the most 13 | up-to-date results and service 14 | 15 | | Node type | Action | 16 | | ---------- | ------------ | 17 | | Delegate | Not required | 18 | | Fullnode | Not required | 19 | | API node | Recommended | 20 | 21 | ## Important Commits (not a complete list) 22 | 1. [api] Fix parsing of log filter [#4376](https://github.com/iotexproject/iotex-core/pull/4376) 23 | -------------------------------------------------------------------------------- /changelog/v2.0.4-release-note.md: -------------------------------------------------------------------------------- 1 | # v2.0.3 Release Note 2 | 3 | ## Summary 4 | v2.0.4 is also an maintenance release after the latest release v2.0.3. It 5 | comes with two API fixes. 6 | 7 | ## Bug Fix and Performance Improvements: 8 | 1. [API] increase limit for `eth_subscribe` (#4374) 9 | 2. [API] fix estimateGas for migrateStake transaction (#4377) 10 | 11 | ## Upgrade Priority 12 | v2.0.4 does not have a hardfork, but contains an API fix. 13 | All API nodes are recommended to upgrade to v2.0.4 in order to provide the most 14 | up-to-date results and service 15 | 16 | | Node type | Action | 17 | | ---------- | ------------ | 18 | | Delegate | Not required | 19 | | Fullnode | Not required | 20 | | API node | Recommended | 21 | 22 | ## Important Commits (not a complete list) 23 | 1. [API] increase api listener limit [#4374](https://github.com/iotexproject/iotex-core/pull/4374) 24 | 2. [api] fix estimateGas for migrateStake [#4377](https://github.com/iotexproject/iotex-core/pull/4377) 25 | -------------------------------------------------------------------------------- /changelog/v2.1.0-release-note.md: -------------------------------------------------------------------------------- 1 | # v2.1.0 Release Note 2 | 3 | ## Summary 4 | **v2.1.0 has a hardfork, which will be activated at block height 33,730,921 5 | (ETA is around 12/17/2024 02:20:40 AM +UTC) on IoTeX L1 mainnet.** 6 | 7 | All nodes **must** upgrade to this release, otherwise the node runs the risk of 8 | not being able to sync with the IoTeX blockchain after other nodes have upgraded. 9 | 10 | **Note:** 11 | There's no change to the mainnet config.yaml and genesis.yaml. You only need to 12 | restart your node with the new v2.1.0 image. 13 | 14 | This release introduces support for the Cancun EVM upgrade, bringing compatibility 15 | with the latest opcodes and Solidity compiler, and enabling more advanced smart 16 | contract functionality. A key highlight is the integration of EIP-4844, which 17 | supports BlobTx transactions. This allows users to send transactions with blob 18 | data that is stored on-chain for at least 20 days, optimizing data availability 19 | and on-chain storage. Additional improvements includes staking enhancements, 20 | network stability, and overall transaction processing efficiency. 21 | 22 | ## Key Features and Enhancements 23 | 24 | 1. Cancun EVM Compatibility: Implements the latest EVM opcodes, allowing developers 25 | to compile contracts with the most recent Solidity compiler and take advantage of 26 | the newest protocol capabilities. 27 | 2. Support for EIP-4844 Blob Transactions: Enables users to send transactions 28 | containing blob data, which is verified and stored on-chain for a minimum of 20 29 | days, optimizing data availability and chain storage efficiency. 30 | 3. Support for EIP-1559 Dynamic Fee Transactions: Allows users to send transactions 31 | with dynamic fees, where the priority fee is rewarded directly to the block miner, 32 | ensuring fair and efficient fee allocation. 33 | 4. Support for EIP-2930 Access List Transactions: Reduces gas consumption by allowing 34 | users to specify an access list in transactions, making execution more cost-effective. 35 | 36 | ## Bug Fix and Performance Improvements: 37 | 1. Staking Bucket Reset: Resolved an issue where staking bucket amounts were not 38 | properly cleared after an unstake, ensuring accurate tracking. 39 | 2. Fix for Unlimited Native Staking Duration: Corrected the staking duration limit 40 | for native assets to prevent indefinite staking periods. 41 | 3. LibP2P Upgrade: Enhanced the P2P network by upgrading LibP2P, leading to improved 42 | connectivity and network stability. 43 | 4. Consistency Between Minting and Validation: Standardized behavior between minting 44 | and validation processes to prevent potential discrepancies and ensure stable operation. 45 | 46 | ## Upgrade Priority 47 | v2.1.0 comes with a hardfork, so all nodes **must** upgrade in order to keep 48 | syncing with the IoTeX blockchain 49 | 50 | | Node type | Action | 51 | | ---------- | ------------ | 52 | | Delegate | Must upgrade | 53 | | Fullnode | Must upgrade | 54 | | API node | Must upgrade | 55 | 56 | ## Commits 57 | https://github.com/iotexproject/iotex-core/compare/v2.0.8...v2.1.0 -------------------------------------------------------------------------------- /changelog/v2.1.2-release-note.md: -------------------------------------------------------------------------------- 1 | # v2.1.2 Release Note 2 | 3 | ## Summary 4 | **v2.1.2 is a major maintenance release to improve IoTeX network stability and 5 | robustness, and expanding API support.** 6 | 7 | All nodes are **strongly recommended** to upgrade to this release, to make sure 8 | the node is update-to-date with latest release and ensure smooth block producing. 9 | 10 | **Note:** 11 | There's no change to the mainnet config.yaml and genesis.yaml. You only need to 12 | restart your node with the new v2.1.2 image. 13 | 14 | This release introduces key enhancements to improve p2p network robustness, expand 15 | Ethereum API compatibility, and refine API service readiness for better system 16 | reliability. 17 | 18 | ## Key Features and Enhancements 19 | 20 | 1. p2p robustness enhancement: add a rate-limit mechanism at p2p netowrk level. 21 | This helps to regulate network traffic effectively, mitigate potential congestion, 22 | and enhance security by reducing the risk of malicious attacks. 23 | 2. implementation of 2 new Ethereum-Compatible APIs: 24 | `eth_blobBaseFee`: returns the base fee per gas for blob transactions (EIP-4844). 25 | `eth_feeHistory`: provides historical gas fee data for improved fee estimation. 26 | 3. API service readiness refinement: during the start-up, the API will wait all 27 | necessary internal components are fully initialized and ready before start accepting 28 | requests, reducing potential API error after service restart 29 | 30 | ## Upgrade Priority 31 | v2.1.2 comes with an important functional upgrade, all nodes are **strongly recommended** 32 | to upgrade in order to keep update-to-date with latest release and ensure smooth block 33 | producing. 34 | 35 | | Node type | Action | 36 | | ---------- | ------------ | 37 | | Delegate | Recommended | 38 | | Fullnode | Recommended | 39 | | API node | Recommended | 40 | 41 | ## Commits 42 | https://github.com/iotexproject/iotex-core/compare/v2.1.0...v2.1.2 -------------------------------------------------------------------------------- /claim_reward_distribute_voters.md: -------------------------------------------------------------------------------- 1 | This doc will guide you how to claim rewards and distribute to your voters. Here's a sneak peek of all the topics this guide will cover: 2 | * [Prerequisite](#prerequisite) 3 | * [Claim Rewards](#claim-rewards) 4 | * [Swap to Ethereum ERC20 Token](#swap-to-ethereum-erc20-token) 5 | * [Distribution to Voters](#distribution-to-voters) 6 | 7 | # Prerequisite 8 | 9 | Before moving onto any of the following sections, please install our `ioctl` commandline tool 10 | 11 | ## Install ioctl Tool 12 | 13 | `ioctl` is a tool to create/manage IoTeX address and interact with our mainnet Blockchain. For more details, please refer to [How to install ioctl](https://github.com/iotexproject/iotex-bootstrap#interact-with-blockchain) 14 | 15 | After installation, be sure to point to our mainnet secure endpoint `api.iotex.one:443` by running the following in terminal: 16 | 17 | ```ioctl config set endpoint api.iotex.one:443``` 18 | 19 | ### Import Your Account 20 | 21 | **We recommend that you use the ioctl tool to create your IoTeX Rewards/Beneficiary address.** If your IoTeX address is created using the ioctl tool, skip the rest in this subsection. Otherwise, if your IoTeX address is mapped from your ETH address, you need to import the ETH address's private key in order to manage the IoTeX address. 22 | 23 | Rest assured that the `ioctl` tool does not store your private key in cleartext, the key is imported in an encrypted format using Ethereum's keystore package and protected by a password set by you. To import your account, run the following command in the terminal: 24 | 25 | ```ioctl account import ${account_name}``` 26 | 27 | For example, if you want to name your account as `my_primary_account`, you can type: 28 | 29 | ```ioctl account import my_primary_account``` 30 | 31 | After hitting `Enter`, you will be prompted to enter your private key. Copy your ETH private key (a hex string) and paste it (it won't show up on the screen); hit `Enter` you will be prompted to set password. Enter a strong password, hit `Enter` you will be prompted to re-enter password, enter the same password, hit Enter you will see 32 | 33 | ```New account #my_primary_account is created. Keep your password, or you will lose your private key.``` 34 | 35 | ### Check Your Balance 36 | 37 | Run the following command in terminal to query the balance in your address: 38 | 39 | ```ioctl account balance ${io_address|account_name}``` 40 | 41 | For example, you can use the following command to check the balance of your account `my_primary_account`: 42 | 43 | ```ioctl account balance my_primary_account``` 44 | 45 | You will find your balance in IOTX in the output. 46 | 47 | --- 48 | 49 | # Claim Rewards 50 | 51 | All `Delegate Rewards` (block rewards, epoch bonus reward, foundation bonus) will be sent to your rewards address as “unclaimed rewards”. You must claim these rewards from the blockchain before you can swap/distribute them. The rewards will remain “unclaimed” until you claim them with the following steps. 52 | 53 | ## Query Your Unclaimed Rewards 54 | 55 | Run the following command in terminal to query the unclaimed rewards in your account: 56 | 57 | ```ioctl node reward ${io_address|account_name}``` 58 | 59 | You will find the unclaimed reward amount in IOTX in the output. 60 | 61 | ## Claim Your Rewards 62 | 63 | To claim your reward, run in terminal: 64 | 65 | ```ioctl action claim ${amount_in_iotx} -l 10000 -p 1 -s ${io_address|name}``` 66 | 67 | For example, if you want ot claim 1200 IOTX from your account `my_primary_account`, you can type the following command: 68 | 69 | ```ioctl action claim 1200 -l 10000 -p 1 -s my_primary_account``` 70 | 71 | If your claim is successful, you will notice an increase of the balance in your account. 72 | 73 | --- 74 | 75 | # Swap to Ethereum ERC20 Token 76 | 77 | We provide a service to swap the IoTeX mainnet coin to the [IoTeX Network ERC20 token](https://etherscan.io/token/0x6fb3e0a217407efff7ca062d46c26e5d60a14d69) via a lock contract **io1p99pprm79rftj4r6kenfjcp8jkp6zc6mytuah5**. 78 | ``` 79 | ioctl action invoke io1p99pprm79rftj4r6kenfjcp8jkp6zc6mytuah5 ${amountInIOTX} -s ${ioAddress|alias} -l 400000 -p 1 -b d0e30db0 80 | ``` 81 | We recommend that you use our [web portal](https://member.iotex.io/tools/iotex) to do the swap. Click [IoTeX Tube docs](https://github.com/iotexproject/iotex-bootstrap/blob/master/tube/tube.md) for detailed documentation of the tube service. 82 | 83 | --- 84 | 85 | # Distribution to Voters 86 | 87 | To distribute rewards to your voters, you need to first export the distribution with `bookkeeping`, and then send out tokens with some multi-send tool or send them one by one. 88 | 89 | ## Export Distribution with `bookkeeping` GraphQL web interface 90 | You can use our GraphQL interface tool to get the reward distributions. The usage is: 91 | 92 | ``` 93 | query { 94 | delegate(startEpoch: START_EPOCH_NUMBER, epochCount: EPOCH_COUNT, delegateName: DELEGATE_NAME){ 95 | bookkeeping(percentage: PERCENTAGE_OF_DISTRIBUTION, includeFoundationBonus: WHETHER_DISTRIBUTE_FOUNDATION_BONUS){ 96 | exist 97 | rewardDistribution(pagination: {skip: START_INDEX_OF_DISPLAYING_REWARD_DISTRIBUTION_LIST, first: NUMBER_OF_REWARD_DISTRIBUTIONS_TO_DISPLAY}){ 98 | voterEthAddress 99 | voterIotexAddress 100 | amount 101 | } 102 | count 103 | } 104 | } 105 | } 106 | ``` 107 | 108 | Note that you can add the optional return field **exist** as above to check wether the delegate has bookkeeping information within the specified epoch range. Specifying the optional argument **pagination** would only show you part of the reward distribution list while the optional return field **count** would tell the total number of reward distributions. If you don't specify **pagination** argument, by default you will get the complete reward distribution list sorted by voter's ETH address. 109 | 110 | Once you specify all the arguments and return information, click the PLAY button, and you will see the reward information on the right. 111 | Screen Shot 2019-06-16 at 4 52 48 PM 112 | 113 | You can find the GraphQL web tool [here](https://analytics.iotexscan.io/). 114 | 115 | ## Send ERC20 Tokens to Voters 116 | 117 | To send tokens to your voters, you may choose one of the following tools 118 | 119 | ### IoTeX MultiSend Tool 120 | 121 | [multi-send](https://member.iotex.io/tools/multi-send) is a tool developed by __IoTeX Foundation__ to send IOTX tokens on Ethereum to multi accounts. To use this tool, you need to sign into Metamask. After that, paste the csv file from the above step into "Recipients and Amounts". After clicking the button "Distribute ERC-20 IOTX", follow instructions from Metamask to finish sending tokens. 122 | 123 | > Note: A fee in ETH will be charged automatically. 124 | 125 | ### Third Party MultiSend Tool 126 | 127 | You can also try some third party multi-send tools, e.g., https://multisender.app. 128 | -------------------------------------------------------------------------------- /claim_reward_distribute_voters_CN.md: -------------------------------------------------------------------------------- 1 | 本文档将指导您如何领取奖励并分发给您的投票者。以下是本指南将涵盖的所有主题的预览: 2 | * [必要条件](#prerequisite) 3 | * [领取奖励](#claim-rewards) 4 | * [转换到ETH-erc20代币](#swap-to-ethereum-erc20-token) 5 | * [分发给投票者](#distribution-to-voters) 6 | 7 | # 必要条件 8 | 9 | 在进行以下任何一个步骤之前,请安装我们的`ioctl`命令行工具 10 | 11 | ##安装ioctl工具 12 | 13 | `ioctl` 是一个创建/管理IoTeX地址并与我们的主网区块链交互的工具。如要了解更多细节,请参阅[如何安装ioctl](https://github.com/iotexproject/iotex-bootstrap#interact-with-blockchain) 14 | 15 | 在安装之后,确保ioctl指向我们的主网安全端点 `api.iotex.one:443` 您可以使用如下命令设置: 16 | 17 | `ioctl config set endpoint api.iotex.one:443` 18 | 19 | ### 导入您的账户 20 | 21 | **我们推荐您使用ioctl工具创建您的IoTeX奖励地址。**如果您的IoTeX地址是使用ioctl工具创建的,请跳过本小节中的其余部分。否则,如果您使用通过ETH地址映射IoTeX地址,则需要导入ETH地址的私钥以管理IoTeX地址。 22 | 23 | 请放心,`ioctl`工具不会将您的私钥存储为明文,密钥是使用以太坊的密钥库包以加密格式导入的,并受您设置的密码保护。要导入您的帐户,请在终端中运行以下命令: 24 | 25 | ```ioctl account import ${account_name}``` 26 | 27 | 例如,您如果想命名您的账户为 `my_primary_account`, 你可以输入: 28 | 29 | ```ioctl account import my_primary_account``` 30 | 31 | 点击`Enter`后,系统将提示您输入私钥。复制您的ETH私钥(十六进制字符串)并粘贴它(它不会显示在屏幕上);按`Enter`,系统将提示您设置密码。输入一个强密码,点击`Enter`,系统会提示您重新输入密码,输入相同的密码,按Enter键即可看到。 32 | 33 | ```New account #my_primary_account is created. Keep your password, or you will lose your private key.``` 34 | 35 | ### 核查您的余额 36 | 37 | 在终端中运行以下命令以查询地址中的余额: 38 | 39 | ```ioctl account balance ${io_address|account_name}``` 40 | 41 | 例如,您可以使用以下命令核查您的帐户`my_primary_account`的余额: 42 | 43 | ```ioctl account balance my_primary_account``` 44 | 45 | 您将在输出中找到IOTX中的余额。 46 | 47 | --- 48 | 49 | # 领取奖励 50 | 51 | 所有节点奖励(block rewards, epoch bonus reward, foundation bonus)将作为“未被领取的奖励”发送到您的奖励地址。在交换/分发区块链之前,您必须从区块链中获得这些奖励。您将通过如下步骤领取。 52 | 53 | ## 查询您的奖励 54 | 55 | 在终端中运行以下命令以查询帐户中的奖励: 56 | 57 | ```ioctl node reward ${io_address|account_name}``` 58 | 59 | 您将在输出中找到IOTX中未被领取的奖励金额。 60 | 61 | ## 领取您的奖励 62 | 63 | 为了领取您的奖励,在终端中输入以下命令: 64 | 65 | ```ioctl action claim ${amount_in_iotx} -l 10000 -p 1 -s ${io_address|name}``` 66 | 67 | 例如,如果您希望从帐户`my_primary_account`中提取1200 IOTX,则可以输入以下命令: 68 | 69 | ```ioctl action claim 1200 -l 10000 -p 1 -s my_primary_account``` 70 | 71 | 如果您领取成功,您会发现帐户余额有所增加。 72 | 73 | --- 74 | 75 | # 交换为ETH ERC代币 76 | 我们提供服务,通过固定合约将IoTeX主网代币交换到[IoTeX网络ERC20令牌](https://etherscan.io/token/0x6fb3e0a217407efff7ca062d46c26e5d60a14d69) 77 | **io1p99pprm79rftj4r6kenfjcp8jkp6zc6mytuah5** 78 | 79 | ## 转换IOTX代币到固定合约 80 | 81 | 要调用固定合约,请在终端中运行以下命令: 82 | 83 | ```ioctl action invoke io1p99pprm79rftj4r6kenfjcp8jkp6zc6mytuah5 ${amount} -s ${io_address|account_name} -l 400000 -p 1 -b d0e30db0``` 84 | 85 | 命令中的`amount`应该等于您要交换的金额加上费用(20 IOTX)。例如,如果要从帐户`my_primary_account`交换30000 IOTX,则可以输入: 86 | 87 | ```ioctl action invoke io1p99pprm79rftj4r6kenfjcp8jkp6zc6mytuah5 30020 -s my_primary_account -l 400000 -p 1 -b d0e30db0``` 88 | 89 | 系统将提示您输入密码,然后输入`yes`进行确认。 90 | 91 | >注意:固定合约规定最低金额为1020,最高金额为1,000,020 IOTX。不在此范围内的金额将自动被拒绝。合约将收取20个代币作为每次交易的手续费,因此最小/最大范围是帮助用户以经济的方式进行交换。 92 | 93 | 由于这个原因,不要转移IoTeX地址中的全部余额,这将被拒绝(因为这不会留下足够的余额来支付手续费)。我们建议在IoTeX地址留下大约100个代币,这样您就可以有足够的余额来支付手续费并在下次使用它。 94 | 95 | 请保留您的转移的交易代号以供将来核查,尤其是在一些少见的情况下,例如ERC20代币转账失败并且您要求重新执行。 96 | 97 | ## 核查您收到的ERC20代币 98 | 每个IoTeX地址本身与ETH地址相关联,共享相同的私钥。 99 | 100 | 使用ioctl命令行工具获取与IoTeX地址关联的ETH地址,在终端中运行以下命令: 101 | 102 | ```ioctl account ethaddr ${io_address|account_name}``` 103 | 104 | 例如,要获取帐户`my_primary_account`的ETH地址: 105 | 106 | ```ioctl account ethaddr my_primary_account``` 107 | 108 | 您将在输出中找到您的IoTeX地址和相应的ETH地址。然后,您可以在https://etherscan.io上查看ETH地址,以验证您收到的IoTeX Network ERC20代币。 109 | 110 | --- 111 | 112 | #分发给投票者 113 | 114 | 要向投票者分发奖励,您需要首先使用`bookkeeping`导出分发明细,然后使用一些多重发送工具发送代币或逐个发送。 115 | 116 | ## 使用`bookkeeping`GraphQL网页工具导出分发明细 117 | 您可以使用bookkeeping GraphQL工具计算投票者的奖励。用法是: 118 | 119 | ``` 120 | query { 121 | delegate(startEpoch: START_EPOCH_NUMBER, epochCount: EPOCH_COUNT, delegateName: DELEGATE_NAME){ 122 | bookkeeping(percentage: PERCENTAGE_OF_DISTRIBUTION, includeFoundationBonus: WHETHER_DISTRIBUTE_FOUNDATION_BONUS){ 123 | exist 124 | rewardDistribution(pagination: {skip: START_INDEX_OF_DISPLAYING_REWARD_DISTRIBUTION_LIST, first: NUMBER_OF_REWARD_DISTRIBUTIONS_TO_DISPLAY}){ 125 | voterEthAddress 126 | voterIotexAddress 127 | amount 128 | } 129 | count 130 | } 131 | } 132 | } 133 | ``` 134 | 135 | 如上所示,您可以通过添加可选返回项**exist**来查看节点在周期范围内是否拥有奖励分发所需的数据记录。您可以通过设置可选参数**pagination**来获取部分奖励分发明细。与此同时,添加可选返回项**count**以用来返回奖励分发的个数。如果选择不设置参数**pagination**,您将会默认收到按投票人以太坊地址排序的完整奖励明细列表。 136 | 137 | 当您设置好所有参数和返回项后,点击PLAY按钮,奖励明细会出现在界面右边。 138 | Screen Shot 2019-06-16 at 4 52 48 PM 139 | 140 | 您可以在[这里](https://analytics.iotexscan.io/)找到GraphQL网页工具。 141 | 142 | 143 | ## 发送ERC20代币到投票者 144 | 145 | 要向您的选民发送代币,您可以选择以下工具之一 146 | 147 | ### IoTeX MultiSend 工具 148 | 149 | [multi-send](https://member.iotex.io/multi-send) 是由__IoTeX Foundation__开发的工具,用于将以太坊上的IOTX令牌发送到多个帐户。要使用此工具,您需要登录Metamask。之后,将上述步骤中的csv文件粘贴到“收件人和金额”中。单击“分发ERC-20 IOTX”按钮后,按照Metamask中的说明完成发送代币。 150 | 151 | >注意:将自动收取ETH费用。 152 | 153 | ### 第三方Multisend工具 154 | 155 | 您还可以尝试一些第三方多发送工具,例如:https://multisender.app 156 | 157 | 158 | -------------------------------------------------------------------------------- /config_archive_mainnet.yaml: -------------------------------------------------------------------------------- 1 | network: 2 | # externalHost: SET YOUR EXTERNAL IP HERE (e.g., 12.34.56.78) 3 | externalPort: 4689 4 | bootstrapNodes: 5 | - /dns4/bootnode-0.mainnet.iotex.one/tcp/4689/p2p/12D3KooWPfQDF8ASjd4r7jS9e7F1wn6zod7Mf4ERr8etoY6ctQp5 6 | - /dns4/bootnode-1.mainnet.iotex.one/tcp/4689/p2p/12D3KooWN4TQ1CWRA7yvJdQCdti1qARLXXu2UEHJfycn3XbnAnRh 7 | - /dns4/bootnode-2.mainnet.iotex.one/tcp/4689/p2p/12D3KooWSiktocuUke16bPoW9zrLawEBaEc1UriaPRwm82xbr2BQ 8 | - /dns4/bootnode-3.mainnet.iotex.one/tcp/4689/p2p/12D3KooWEsmwaorbZX3HRCnhkMPjMAHzwu3om1pdGrtVm2QaM35n 9 | - /dns4/bootnode-4.mainnet.iotex.one/tcp/4689/p2p/12D3KooWHRcgNim4Nau73EEu7aKJZRZPZ21vQ7BE3fG6vENXkduB 10 | - /dns4/bootnode-5.mainnet.iotex.one/tcp/4689/p2p/12D3KooWGeHkVDQQFxXpTX1WpPhuuuWYTxPYDUTmaLWWSYx5rmUY 11 | 12 | chain: 13 | # If you are a delegate, make sure producerPrivKey is the key for the operator address you have registered. 14 | # producerPrivKey: SET YOUR PRIVATE KEY HERE (e.g., 96f0aa5e8523d6a28dc35c927274be4e931e74eaa720b418735debfcbfe712b8) 15 | enableStakingIndexer: true 16 | chainDBPath: "/var/iotex-archive/data/chain.db" 17 | trieDBPatchFile: "/var/iotex-archive/data/trie.db.patch" 18 | trieDBPath: "/var/iotex-archive/data/archive.db" 19 | stakingPatchDir: "/var/iotex-archive/data", 20 | indexDBPath: "/var/iotex-archive/data/index.db" 21 | blobStoreDBPath: "/var/iotex-archive/data/blob.db" 22 | bloomfilterIndexDBPath: "/var/iotex-archive/data/bloomfilter.index.db" 23 | candidateIndexDBPath: "/var/iotex-archive/data/candidate.index.db" 24 | stakingIndexDBPath: "/var/iotex-archive/data/staking.index.db" 25 | contractStakingIndexDBPath: "/var/iotex-archive/data/contractstaking.index.db" 26 | enableArchiveMode: true 27 | maxCacheSize: 1000 28 | committee: 29 | gravityChainAPIs: 30 | # please change the infura key to your key (e.g., https://mainnet.infura.io/v3/YOUR_KEY) 31 | - https://mainnet.infura.io/v3/b355cae6fafc4302b106b937ee6c15af 32 | numOfRetries: 20 33 | paginationSize: 255 34 | cacheSize: 1000 35 | gravityChainDB: 36 | dbPath: "/var/iotex-archive/data/poll.db" 37 | numRetries: 8 38 | 39 | actPool: 40 | minGasPrice: "1000000000000" 41 | store: 42 | datadir: "/var/iotex-archive/data/actpool.cache" 43 | 44 | api: 45 | gasStation: 46 | defaultGas: 1000000000000 47 | 48 | consensus: 49 | scheme: ROLLDPOS 50 | rollDPoS: 51 | fsm: 52 | unmatchedEventTTL: 3s 53 | unmatchedEventInterval: 100ms 54 | acceptBlockTTL: 4s 55 | acceptProposalEndorsementTTL: 2s 56 | acceptLockEndorsementTTL: 2s 57 | delay: 10s 58 | consensusDBPath: "/var/iotex-archive/data/consensus.db" 59 | 60 | blockSync: 61 | interval: 2s 62 | bufferSize: 400 63 | maxRepeat: 3 64 | repeatDecayStep: 3 65 | 66 | log: 67 | zap: 68 | level: info 69 | encoding: json 70 | disableStacktrace: true 71 | outputPaths: ["stderr", "stdout"] 72 | errorOutputPaths: ["stderr"] 73 | stderrRedirectFile: /var/iotex-archive/log/s.log 74 | stdLogRedirect: true 75 | -------------------------------------------------------------------------------- /config_mainnet.yaml: -------------------------------------------------------------------------------- 1 | network: 2 | # externalHost: SET YOUR EXTERNAL IP HERE (e.g., 12.34.56.78) 3 | externalPort: 4689 4 | bootstrapNodes: 5 | - /dns4/bootnode-0.mainnet.iotex.one/tcp/4689/p2p/12D3KooWPfQDF8ASjd4r7jS9e7F1wn6zod7Mf4ERr8etoY6ctQp5 6 | - /dns4/bootnode-1.mainnet.iotex.one/tcp/4689/p2p/12D3KooWN4TQ1CWRA7yvJdQCdti1qARLXXu2UEHJfycn3XbnAnRh 7 | - /dns4/bootnode-2.mainnet.iotex.one/tcp/4689/p2p/12D3KooWSiktocuUke16bPoW9zrLawEBaEc1UriaPRwm82xbr2BQ 8 | - /dns4/bootnode-3.mainnet.iotex.one/tcp/4689/p2p/12D3KooWEsmwaorbZX3HRCnhkMPjMAHzwu3om1pdGrtVm2QaM35n 9 | - /dns4/bootnode-4.mainnet.iotex.one/tcp/4689/p2p/12D3KooWHRcgNim4Nau73EEu7aKJZRZPZ21vQ7BE3fG6vENXkduB 10 | - /dns4/bootnode-5.mainnet.iotex.one/tcp/4689/p2p/12D3KooWGeHkVDQQFxXpTX1WpPhuuuWYTxPYDUTmaLWWSYx5rmUY 11 | 12 | chain: 13 | # If you are a delegate, make sure producerPrivKey is the key for the operator address you have registered. 14 | # producerPrivKey: SET YOUR PRIVATE KEY HERE (e.g., 96f0aa5e8523d6a28dc35c927274be4e931e74eaa720b418735debfcbfe712b8) 15 | chainDBPath: "/var/data/chain.db" 16 | trieDBPath: "/var/data/trie.db" 17 | indexDBPath: "/var/data/index.db" 18 | bloomfilterIndexDBPath: "/var/data/bloomfilter.index.db" 19 | candidateIndexDBPath: "/var/data/candidate.index.db" 20 | stakingIndexDBPath: "/var/data/staking.index.db" 21 | contractStakingIndexDBPath: "/var/data/contractstaking.index.db" 22 | sgdIndexDBPath: "/var/data/sgd.index.db" 23 | maxCacheSize: 1000 24 | committee: 25 | gravityChainAPIs: 26 | # please change the infura key to your key (e.g., https://mainnet.infura.io/v3/YOUR_KEY) 27 | - https://mainnet.infura.io/v3/b355cae6fafc4302b106b937ee6c15af 28 | numOfRetries: 20 29 | paginationSize: 255 30 | cacheSize: 1000 31 | gravityChainDB: 32 | dbPath: "/var/data/poll.db" 33 | numRetries: 8 34 | 35 | actPool: 36 | minGasPrice: "1000000000000" 37 | maxNumActsPerAcct: 100 38 | maxNumActsPerPool: 32000 39 | maxGasLimitPerPool: 320000000 40 | actionExpiry: 5m 41 | 42 | api: 43 | gasStation: 44 | defaultGas: 1000000000000 45 | 46 | consensus: 47 | scheme: ROLLDPOS 48 | rollDPoS: 49 | fsm: 50 | unmatchedEventTTL: 3s 51 | unmatchedEventInterval: 100ms 52 | acceptBlockTTL: 4s 53 | acceptProposalEndorsementTTL: 2s 54 | acceptLockEndorsementTTL: 2s 55 | delay: 10s 56 | consensusDBPath: "/var/data/consensus.db" 57 | 58 | blockSync: 59 | interval: 10s 60 | bufferSize: 400 61 | maxRepeat: 3 62 | repeatDecayStep: 3 63 | 64 | log: 65 | zap: 66 | level: info 67 | encoding: json 68 | disableStacktrace: true 69 | outputPaths: ["stderr", "stdout"] 70 | errorOutputPaths: ["stderr"] 71 | stderrRedirectFile: /var/log/s.log 72 | stdLogRedirect: true 73 | -------------------------------------------------------------------------------- /config_testnet.yaml: -------------------------------------------------------------------------------- 1 | network: 2 | # externalHost: SET YOUR EXTERNAL IP HERE (e.g., 12.34.56.78) 3 | externalPort: 4689 4 | bootstrapNodes: 5 | - /dns4/bootnode-0.testnet.iotex.one/tcp/4689/ipfs/12D3KooWFnaTYuLo8Mkbm3wzaWHtUuaxBRe24Uiopu15Wr5EhD3o 6 | - /dns4/bootnode-1.testnet.iotex.one/tcp/4689/ipfs/12D3KooWS7hkdFozeUqriUxv7zw8Y6NCeV8E5HUbgmVkGJUv4jHS 7 | 8 | chain: 9 | # producerPrivKey: SET YOUR PRIVATE KEY HERE (e.g., 96f0aa5e8523d6a28dc35c927274be4e931e74eaa720b418735debfcbfe712b8) 10 | id: 2 11 | evmNetworkID: 4690 12 | chainDBPath: "/var/data/chain.db" 13 | trieDBPath: "/var/data/trie.db" 14 | trieDBPatchFile: "" 15 | indexDBPath: "/var/data/index.db" 16 | bloomfilterIndexDBPath: "/var/data/bloomfilter.index.db" 17 | candidateIndexDBPath: "/var/data/candidate.index.db" 18 | stakingIndexDBPath: "/var/data/staking.index.db" 19 | contractStakingIndexDBPath: "/var/data/contractstaking.index.db" 20 | maxCacheSize: 1000 21 | committee: 22 | gravityChainAPIs: 23 | # please change the infura key to your key (e.g., https://mainnet.infura.io/v3/YOUR_KEY) 24 | - https://mainnet.infura.io/v3/b355cae6fafc4302b106b937ee6c15af 25 | numOfRetries: 20 26 | paginationSize: 255 27 | cacheSize: 1000 28 | gravityChainDB: 29 | dbPath: "/var/data/poll.db" 30 | numRetries: 8 31 | persistStakingPatchBlock: 18446744073709551615 32 | 33 | actPool: 34 | minGasPrice: "1000000000000" 35 | 36 | consensus: 37 | scheme: ROLLDPOS 38 | rollDPoS: 39 | fsm: 40 | unmatchedEventTTL: 3s 41 | unmatchedEventInterval: 100ms 42 | acceptBlockTTL: 4s 43 | acceptProposalEndorsementTTL: 2s 44 | acceptLockEndorsementTTL: 2s 45 | delay: 10s 46 | consensusDBPath: "/var/data/consensus.db" 47 | 48 | blockSync: 49 | interval: 10s 50 | bufferSize: 400 51 | maxRepeat: 3 52 | repeatDecayStep: 3 53 | 54 | log: 55 | zap: 56 | level: info 57 | encoding: json 58 | disableStacktrace: true 59 | outputPaths: ["stderr", "stdout"] 60 | errorOutputPaths: ["stderr"] 61 | stderrRedirectFile: /var/log/s.log 62 | stdLogRedirect: true 63 | -------------------------------------------------------------------------------- /deployment/contracts.md: -------------------------------------------------------------------------------- 1 | # Smart Contracts On IoTeX Blockchain 2 | 3 | ## Reward Distribution Ratio Contract 4 | 5 | `io1lfl4ppn2c3wcft04f0rk0jy9lyn4pcjcm7638u` 6 | 7 | This is the smart contract that managed how much a delegate will share the rewards with his/her voters, which can be set via member.iotex.io and will be used by hermes when distributing rewards. 8 | 9 | 10 | 11 | ## VITA Bidding Pool 12 | `io16alj8sw7pt0d5wv22gdyphuyz9vas5dk8czk88` 13 | 14 | This is the smart contract that managed bidding of VITA token. 15 | 16 | ## Native Staking Version 1 (nsv1) Contracts 17 | 18 | `io1xpq62aw85uqzrccg9y5hnryv8ld2nkpycc3gza` 19 | `io1zn9mn4v63jg3047ylqx9nqaqz0ev659777q3xc` 20 | 21 | These two smart contracts were used for staking and voting before mainnet GA which are now deprecated. **All IOTX here are locked/burned**. 22 | -------------------------------------------------------------------------------- /designdoc/blockdao.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iotexproject/iotex-bootstrap/b27aef5305b38c4af2cebe9df5d6703fc8498289/designdoc/blockdao.jpg -------------------------------------------------------------------------------- /designdoc/blockdao.md: -------------------------------------------------------------------------------- 1 | # BlockDAO 2 | BlockDAO manages data access to the blockchain, for example reading a raw data block, querying a transaction by hash, and committing a block to the blockchain 3 | 4 | The blockchain data consist of multiple block files (chain.db, chain-00000001.db, etc), the state trie db file (trie.db), and the index db (index.db) 5 | 6 | We'll be focusing on block file in the following 7 | 8 | ## Legacy file (before db split activation at Ithaca height) 9 | Each db file is a key-value db storing raw data in multiple buckets, using *block hash as the key* 10 | 1. block header in bucket named "bhr" 11 | 2. block body in bucket named "bbd" 12 | 3. block footer in bucket named "bfr" 13 | 4. block receipt in bucket named "rpt" 14 | 15 | In particular, the very first db file (`chain.db`) stores the additional information: 16 | 1. the height and hash of the tip block is stored in bucket named "blk" 17 | 2. the height/hash mapping of all blocks in bucket named "h2h" 18 | 3. transaction log of all blocks in bucket named "syl" 19 | 20 | When committing a block, 2 things happen sequentially: 21 | 1. block data are written into corresponding db file (like chain-00000001.db) 22 | 2. height/hash of the new block, height/hash mapping, and transaction log are written to `chain.db` 23 | 24 | ## New file (after db split activation) 25 | The request of a new file format design comes from 2 observations: 26 | 27 | - Storing the height/hash mapping of all blocks in the first file (chain.db) has led to dependency of the BlockDAO service on this special file, which is a dependency we want to remove 28 | - Using hash as primary key and breaking a block into 3 parts has brought about the following issues: 29 | 1) it costs 3 DB reads to fetch a block 30 | 2) it consumed more storage space. Earlier testing result shows that using block height as (single incrementing) key and storing the whole block can reduce file size by 30% (10GB chain.db reduced to 7GB using new file format) 31 | 32 | The new file is still a key-value db, but *using block height as the key* 33 | 1. the height/hash mapping, and transaction log are written in the file itself (to remove dependency on `chain.db`) 34 | 2. in addition to height/hash of tip block, we also store the height of the starting block in this file. Doing so allows us to quickly know if a block is stored within a particular db file (starting height <= height <= tip height) 35 | 36 | With these adjustments, each block db file is autonomous, meaning it can serve block/transaction query in itself, without having to rely on any other special db or index db 37 | 38 | Here's the comparison 39 | 40 | File | Primary key | Height/hash mapping | Transaction log | Start height 41 | --- | --- | :---: | :---: | :---: 42 | Legacy | block hash | No (except `chain.db') | No (except `chain.db') | No 43 | New | block height | Yes | Yes | Yes 44 | 45 | ## Starting the chain soley from state DB 46 | Given the chain db size steadily increasing (today about 30GB), it could become curbersome that a node has to carry on all the history files for it to work. 47 | Now with the help of autonomous db file restructure, we want to achieve a more flexible and lightweight configuration: 48 | 49 | 1. chain db are broken into multiple data files with user-defined segment size (default 4GB) 50 | 2. build the intelligence into BlockDAO, such that a node is able to start up and running from any block db file, or even without a block db file (in which case BlockDAO will create a new one and start from there) 51 | 52 | Here are 3 examples: 53 | 54 | 1. node starts from `chain-00000002.db` which is the latest db file, node continues to add blocks, creating new file `chain-00000003.db` once the current file size grows to defined segment size 55 | 2. node starts without any chain db file. BlockDAO will create new file `chain.db` and starts adding blocks into it. Once the file size grows to defined segment size, a new file `chain-00000001.db` will be created 56 | 3. node starts from `chain-00000002.db` which has height 500. The next block comes in with height = 1000, BlockDAO will create a new file `chain-00000003.db` and starts adding blocks into it. Once the file size grows to defined segment size, a new file `chain-00000004.db` will be created 57 | 58 | In example 3 above, blocks 501~1000 are missing, we might consider improving blocksync module's functionality to reconcile this kind of data missing/inconsistency. This could be another topic for enhancement 59 | 60 | ## Managing legacy and new files in BlockDAO 61 | In order to handle each individual db file we abstract a FileDAO interface, which contains API to read/write block/action in current BlockDAO interface 62 | ```go 63 | FileDAO interface { 64 | Start(ctx context.Context) error 65 | Stop(ctx context.Context) error 66 | Height() (uint64, error) 67 | GetBlockHash(uint64) (hash.Hash256, error) 68 | GetBlockHeight(hash.Hash256) (uint64, error) 69 | GetBlock(hash.Hash256) (*block.Block, error) 70 | GetBlockByHeight(uint64) (*block.Block, error) 71 | GetReceipts(uint64) ([]*action.Receipt, error) 72 | ContainsTransactionLog() bool 73 | TransactionLogs(uint64) (*iotextypes.TransactionLogs, error) 74 | PutBlock(context.Context, *block.Block) error 75 | DeleteTipBlock() error 76 | } 77 | ``` 78 | 79 | and a FileDAONew interface for the new db file 80 | 81 | ```go 82 | FileDAONew interface { 83 | FileDAO 84 | Bottom() (uint64, error) 85 | ContainsHeight(uint64) bool 86 | } 87 | ``` 88 | 89 | the fileDAO object to implement the interface 90 | 91 | ```go 92 | // fileDAO implements FileDAO 93 | fileDAO struct { 94 | currFd FileDAO 95 | legacyFd FileDAO 96 | newFd map[uint64]FileDAONew 97 | } 98 | ``` 99 | 100 | 1. legacyFd is the interface that manages **all** legacy files 101 | 2. newFd is a map of FileDAONew interface, each of which points to **one** new file 102 | 3. currFd points to the newest db file (that commit block should write to) 103 | 104 | ![BlockDAO](/designdoc/blockdao.jpg "BlockDAO example") 105 | -------------------------------------------------------------------------------- /genesis_mainnet.yaml: -------------------------------------------------------------------------------- 1 | account: 2 | initBalances: 3 | io1uqhmnttmv0pg8prugxxn7d8ex9angrvfjfthxa: "9800000000000000000000000000" 4 | # The balances on following test accounts will be burned into the all-zero address. 5 | # Check https://github.com/iotexproject/iotex-bootstrap/blob/master/postmortem/1.md for more details. 6 | io1v3gkc49d5vwtdfdka2ekjl3h468egun8e43r7z: "100000000000000000000000000" 7 | io1vrl48nsdm8jaujccd9cx4ve23cskr0ys6urx92: "100000000000000000000000000" 8 | io1llupp3n8q5x8usnr5w08j6hc6hn55x64l46rr7: "100000000000000000000000000" 9 | io1ns7y0pxmklk8ceattty6n7makpw76u770u5avy: "100000000000000000000000000" 10 | io1xuavja5dwde8pvy4yms06yyncad4yavghjhwra: "100000000000000000000000000" 11 | io1cdqx6p5rquudxuewflfndpcl0l8t5aezen9slr: "100000000000000000000000000" 12 | io1hh97f273nhxcq8ajzcpujtt7p9pqyndfmavn9r: "100000000000000000000000000" 13 | io1yhvu38epz5vmkjaclp45a7t08r27slmcc0zjzh: "100000000000000000000000000" 14 | io1cl6rl2ev5dfa988qmgzg2x4hfazmp9vn2g66ng: "100000000000000000000000000" 15 | io1skmqp33qme8knyw0fzgt9takwrc2nvz4sevk5c: "100000000000000000000000000" 16 | io1fxzh50pa6qc6x5cprgmgw4qrp5vw97zk5pxt3q: "100000000000000000000000000" 17 | io1jh0ekmccywfkmj7e8qsuzsupnlk3w5337hjjg2: "100000000000000000000000000" 18 | io1juvx5g063eu4ts832nukp4vgcwk2gnc5cu9ayd: "100000000000000000000000000" 19 | io19d0p3ah4g8ww9d7kcxfq87yxe7fnr8rpth5shj: "100000000000000000000000000" 20 | io1ed52svvdun2qv8sf2m0xnynuxfaulv6jlww7ur: "100000000000000000000000000" 21 | io158hyzrmf4a8xll7gfc8xnwlv70jgp44tzy5nvd: "100000000000000000000000000" 22 | io19kshh892255x4h5ularvr3q3al2v8cgl80fqrt: "100000000000000000000000000" 23 | io1ph0u2psnd7muq5xv9623rmxdsxc4uapxhzpg02: "100000000000000000000000000" 24 | io1znka733xefxjjw2wqddegplwtefun0mfdmz7dw: "100000000000000000000000000" 25 | io13sj9mzpewn25ymheukte4v39hvjdtrfp00mlyv: "100000000000000000000000000" 26 | io14gnqxf9dpkn05g337rl7eyt2nxasphf5m6n0rd: "100000000000000000000000000" 27 | io1l3wc0smczyay8xq747e2hw63mzg3ctp6uf8wsg: "100000000000000000000000000" 28 | io1q4tdrahguffdu4e9j9aj4f38p2nee0r9vlhx7s: "100000000000000000000000000" 29 | io1k9y4a9juk45zaqwvjmhtz6yjc68twqds4qcvzv: "100000000000000000000000000" 30 | io15flratm0nhh5xpxz2lznrrpmnwteyd86hxdtj0: "100000000000000000000000000" 31 | io1eq4ehs6xx6zj9gcsax7h3qydwlxut9xcfcjras: "100000000000000000000000000" 32 | io10a298zmzvrt4guq79a9f4x7qedj59y7ery84he: "100000000000000000000000000" 33 | blockchain: 34 | actionGasLimit: 5000000 35 | blockGasLimit: 20000000 36 | blockInterval: 10s 37 | numCandidateDelegates: 36 38 | numDelegates: 24 39 | numSubEpochs: 15 40 | timeBasedRotation: true 41 | timestamp: 1553558500 42 | poll: 43 | delegates: [] 44 | enableGravityChainVoting: true 45 | gravityChainHeightInterval: 100 46 | gravityChainStartHeight: 7614500 47 | registerContractAddress: 0x95724986563028deb58f15c5fac19fa09304f32d 48 | scoreThreshold: "2000000000000000000000000" 49 | selfStakingThreshold: "1200000000000000000000000" 50 | stakingContractAddress: 0x87c9dbff0016af23f5b1ab9b8e072124ab729193 51 | voteThreshold: "100000000000000000000" 52 | nativeStakingContractAddress: io1xpq62aw85uqzrccg9y5hnryv8ld2nkpycc3gza 53 | rewarding: 54 | blockReward: "16000000000000000000" 55 | epochReward: "12500000000000000000000" 56 | exemptAddrsFromEpochReward: 57 | - io15fqav3tugm96ge7anckx0k4gukz5m4mqf0jpv3 58 | - io1x9kjkr0qv2fa7j4t2as8lrj223xxsqt4tl7xp7 59 | - io1ar5l5s268rtgzshltnqv88mua06ucm58dx678y 60 | - io1xsx5n94kg2zv64r7tm8vyz9mh86amfak9ka9xx 61 | - io1vtm2zgn830pn6auc2cvnchgwdaefa9gr4z0s86 62 | - io159fv8mu9d5djk8u2t0flgw4yqmt6fg98uqjka8 63 | - io1c3r4th3zrk4uhv83a9gr4gvn3y6pzaj6mc84ea 64 | - io14vmhs9c75r2ptxdaqrtk0dz7skct30pxmt69d9 65 | - io1gf08snppu2a2wfd50pjas2j6q2kcxjzqph3pep 66 | - io1u5ff879gg2dw9vfpxr2tsmuaz07e2rea6gvl7s 67 | - io1du4eq4f88n4wyc026l3gamjwetlgsg4jz7j884 68 | - io12yxdwewry70gr9fs6fphyfaky9c7gurmzk8f4f 69 | - io1lx53nfgq2dnzrz5ecz2ecs7vvl6qll0mkn970w 70 | - io1u5xy0ecnrjrdkzyctfqh37lgr5pcfzphgqrdwt 71 | - io1aj8arp07xw6s9rgh42af5xf98csyuehnnwlk52 72 | - io18gdmv5g0xhkuj2cdyvp8076uwhl7h3gesmzh8u 73 | - io1td5fvamm3qf22r5h93gay6ggqdh9z0edeqx63u 74 | - io1qs785af9k9xf3xgd6vut7um9zcthtrvsn2xap2 75 | - io127ftn4ry6wgxdrw4hcd6gdwqlq70ujk98dvtw5 76 | - io1wv5m0xyermvr2n0wjx2cjsqwyk863drdl5qfyn 77 | - io1v0q5g2f8z6l3v25krl677chdx7g5pwt9kvqfpc 78 | - io1xsdegzr2hdj5sv5ad4nr0yfgpsd98e40u6svem 79 | - io1fks575kklxafq4fwjccmz5d3pmq5ynxk5h6h0v 80 | - io15npzu93ug8r3zdeysppnyrcdu2xssz0lcam9l9 81 | - io1gh7xfrsnj6p5uqgjpk9xq6jg9na28aewgp7a9v 82 | - io1nyjs526mnqcsx4twa7nptkg08eclsw5c2dywp4 83 | - io1jafqlvntcxgyp6e0uxctt3tljzc3vyv5hg4ukh 84 | - io1z7mjef7w528nasnsafan0rp6yuvkvq405l6r8j 85 | - io1cup9k8hl8fp40vrj29ex8djc346780dk223end 86 | - io1scs89jur7qklzh5vfrmha3c40u8yajjx6kvzg9 87 | - io10kyvvzu08pjeylymq4umknjal25ea3ptfknrpf 88 | - io18mvepyxkcd5jkyplfqn27ydkpsendrey3xe2l8 89 | - io1nz40npqa3yvek4zdasmqaetl2j4h6urejfkera 90 | - io1m7p9yrejngxyvxhvn7p9g9uwlvd7uuamg8wcjd 91 | - io1cwwm08dwv9phh3wt5vsdhu9gcypw9q2sc7pl9s 92 | - io14aj46jjmtt83vts9syhrs9st80czumg40cjasl 93 | foundationBonus: "80000000000000000000" 94 | foundationBonusLastEpoch: 8760 95 | initBalance: "200000000000000000000000000" 96 | numDelegatesForEpochReward: 100 97 | numDelegatesForFoundationBonus: 36 98 | productivityThreshold: 85 99 | -------------------------------------------------------------------------------- /genesis_testnet.yaml: -------------------------------------------------------------------------------- 1 | account: 2 | initBalances: 3 | io10t7juxazfteqzjsd6qjk7tkgmngj2tm7n4fvrd: "1000000000000000000000000000" 4 | io120au9ra0nffdle04jx2g5gccn6gq8qd4fy03l4: "7000000000000000000000000000" 5 | io1yrzvkucxpytn4fru35lc8r8jk4jtue4syg8d4h: "800000000000000000000000000" 6 | replayDeployerWhitelist: 7 | - 0x3fab184622dc19b6109349b94811493bf2a45362 8 | - 0x4c8d290a1b368ac4728d83a9e8321fc3af2b39b1 9 | - 0xa71ec2ea4a0df8ba132dfe15bb76f6408a2f887f 10 | blockchain: 11 | actionGasLimit: 5000000 12 | aleutianHeight: 1 13 | beringHeight: 1 14 | blockGasLimit: 20000000 15 | blockInterval: 10s 16 | cookHeight: 1801 17 | dardanellesHeight: 100081 18 | daytonaBlockHeight: 1713601 19 | easterHeight: 2696401 20 | fbkMigrationHeight: 3250081 21 | fairbankHeight: 3252241 22 | greenlandHeight: 4794481 23 | hawaiiHeight: 8613361 24 | icelandHeight: 9291601 25 | jutlandHeight: 10649521 26 | kamchatkaHeight: 10928881 27 | lordHoweHeight: 11052721 28 | midwayHeight: 13020481 29 | newfoundlandHeight: 14268961 30 | okhotskHeight: 17666641 31 | palauHeight: 19165681 32 | quebecHeight: 20562481 33 | redseaHeight: 22919041 34 | sumatraHeight: 24527521 35 | tsunamiHeight: 25226641 36 | upernavikHeight: 26984161 37 | vanuatuHeight: 28820881 38 | numCandidateDelegates: 36 39 | numDelegates: 24 40 | numSubEpochs: 15 41 | pacificHeight: 1 42 | timeBasedRotation: true 43 | timestamp: 1571036400 44 | poll: 45 | delegates: [] 46 | enableGravityChainVoting: true 47 | gravityChainHeightInterval: 100 48 | gravityChainStartHeight: 8740900 49 | gravityChainCeilingHeight: 10022000 50 | nativeStakingContractAddress: io1w97pslyg7qdayp8mfnffxkjkpapaf83wmmll2l 51 | registerContractAddress: 0x92adef0e5e0c2b4f64a1ac79823f7ad3bc1662c4 52 | scoreThreshold: "2000000000000000000000000" 53 | selfStakingThreshold: "1200000000000000000000000" 54 | stakingContractAddress: 0x3bbe2346c40d34fc3f66ab059f75a6caece2c3b3 55 | voteThreshold: "100000000000000000000" 56 | systemStakingContractAddress: io1224slckr49ryfhsg3z3m484pgsm89esl2nd4jh 57 | systemStakingContractHeight: 20645456 58 | systemSGDContractAddress: io1d82m3ywplzfcw9fxlh497jve5ljsud2rg4gute 59 | systemSGDContractHeight: 20315706 60 | systemStakingContractV2Address: io1l45vd72wykrxkculmh4m9ekudqrml0jles7mkm 61 | systemStakingContractV2Height: 26978830 62 | staking: 63 | withdrawWaitingPeriod: "336h" 64 | rewarding: 65 | aleutianEpochReward: "15000000000000000000000" 66 | blockReward: "16000000000000000000" 67 | epochReward: "12500000000000000000000" 68 | exemptAddrsFromEpochReward: 69 | - io1rm223d7jyflpg0cvkja4zmgnjz8hrrdgm09pu0 70 | - io1dg65erd07hrvyme0493f2kqj2utuvpyf6jeuhd 71 | - io1343pwahz73s7vzd3l8jxxrjwcugxae2nx58zwf 72 | - io15ccuntztkkuu0xnfhqf2qt8y28kpu0mnr65050 73 | - io1se72frs5kn0j6gh0g3fk2usngu48sh2wjt4qgq 74 | - io1az8tln8432h42vf54e0c0fmaqcytwm2nk82g95 75 | - io1vdw0q7dv82g3jhmapvze99fdxeyztjrxdp7wse 76 | - io1qendhfjmpmug6ywde0590lakvxp3ph869ehlyp 77 | - io1jhcm9au9u77l27pgkqe6kqdf58dh64d0k5kf2x 78 | - io1y4punwfvhxzee08a034922vwr48wz0p6ruy0ke 79 | - io1c5a8kv4nljt4dy2mnxk23rj0255a9x4uvn4x5m 80 | - io13n3382cjhaawmqfk4vmvvgllnryw4tf56qdtks 81 | - io1gakgrsnsxmg9ed0tlcc2ukxzxdg6v8z2glw82e 82 | - io1dh8uwmva79vhk8mec998f7qgfud7jyz9v8lede 83 | - io1m8rge0h4xvmfzkc4yup766slcvn5cwymqeenpe 84 | - io1etc9ffzsg7lvph3j4ncczg08llvame8k3asyzc 85 | - io1959ykdhkene09at5nfl42a7xjwf5wgplpg7eh9 86 | - io1j07xpufsj03sc0dg020jahacx2pnt6m8cdl6qt 87 | - io1s3z2pr47u47p69zn7phshgenckw6tr70tex80k 88 | - io1e5uh4sfkgemds4fannncujcdylerdynddj3f43 89 | - io1eckfc699y4shqkc9ms8ts9sa254e5vtqyazkar 90 | - io14jp9s6mp85g2x00spq66cmdds4qe2ge5r0p72d 91 | - io1pgth3m3e4klanwdrfrgk6yelw03ws64ml8c22y 92 | - io1gn450vcrjkh7r35gcjyt93tp3u2dadz3k07wzw 93 | foundationBonus: "80000000000000000000" 94 | foundationBonusLastEpoch: 8760 95 | initBalance: "1200000000000000000000000000" 96 | numDelegatesForEpochReward: 100 97 | numDelegatesForFoundationBonus: 36 98 | productivityThreshold: 85 99 | -------------------------------------------------------------------------------- /infra/infra.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iotexproject/iotex-bootstrap/b27aef5305b38c4af2cebe9df5d6703fc8498289/infra/infra.png -------------------------------------------------------------------------------- /infra/infraguide.md: -------------------------------------------------------------------------------- 1 | ## IoTeX Delegates Infrastructure Guide 2 | 3 | 1. Run your node behind a commercial cloud load balancer. 4 | 5 | Cloud provider like amazon AWS[^1], google GCE[^2] or Cloudflare[^3], etc provide good protection against a large amounts of L3, L4 DDoS attack including SYN floods, IP fragment floods, port exhaustion, etc out in the market. We suggest using these solutions network experts built to help you protect your node. 6 | 7 | 2. Put Envoy Proxy in front of your node as an edge proxy. 8 | 9 | [Envoy](https://www.envoyproxy.io/) combines with [ratelimit](https://github.com/lyft/ratelimit) provides request rate limiting on HTTP/HTTP2 and connection limits on all network traffic. Put your IoTeX node behind an Envoy proxy give you another layer of protection against attackers. Also, since IoTeX node API use GRPC, if you want to become a service node and serve API request for browser single page application, you will need Envoy's [grpc-web](https://github.com/grpc/grpc-web) filter to enable this functionality. 10 | 11 | In our testnet cluster, we set a 20 requests per second per IP rate limit on HTTP/HTTP2 requests 12 | 13 | ```yaml 14 | domain: iotex-api 15 | descriptors: 16 | - key: remote_address 17 | rate_limit: 18 | unit: second 19 | requests_per_unit: 20 20 | --- 21 | domain: iotex-stats 22 | descriptors: 23 | - key: remote_address 24 | rate_limit: 25 | unit: second 26 | requests_per_unit: 20 27 | ``` 28 | 29 | And the max connection numbers are set to 50 30 | 31 | ```yaml 32 | circuit_breakers: 33 | thresholds: 34 | max_connections: 50 35 | max_pending_requests: 500 36 | max_requests: 100 37 | max_retries: 3 38 | ``` 39 | 40 | 41 | 42 | Here is the full configuration: [envoy config](https://gist.github.com/yutongp/c61292bf5c9c6e3058df96989365cb0c) 43 | 44 | 3. Use Kubernetes for deployment and health monitoring. 45 | 46 | [Kubernetes](https://kubernetes.io)(k8s) is a very powerful tool to manage your containerized services. It is very convenient to deploy and upgrade service running in docker container in Kubernetes. 47 | 48 | k8s will also do the health check and automatically restart the falling node to maximize your uptime. 49 | 50 | We heavily rely on k8s in our test environment. With our own experience, we can tell that k8s will for sure reduce your operation cost. 51 | 52 | These are the probe configuration we use in our deployment.yaml: 53 | 54 | ```yaml 55 | livenessProbe: 56 | httpGet: 57 | path: "/liveness" 58 | port: 8080 59 | initialDelaySeconds: 15 60 | timeoutSeconds: 2 61 | periodSeconds: 15 62 | failureThreshold: 5 63 | readinessProbe: 64 | httpGet: 65 | path: "/readiness" 66 | port: 8080 67 | initialDelaySeconds: 30 68 | timeoutSeconds: 2 69 | periodSeconds: 15 70 | failureThreshold: 5 71 | ``` 72 | 73 | The delegate bots we currently run for our testnet have a setup is very similar to following graph:![infra](infra.png?raw=true) 74 | 75 | ## High Availability 76 | 77 | It's likely that one IoTeX node could be in outage because of code bugs, insufficient compute resource, host failure, network failure and etc, or you have to shutdown a node to do some maintenance work. Running multiple IoTeX nodes is the way to guarantee high availability (zero downtime) of your delegation. We provide the feature to run these nodes conveniently. 78 | 79 | Assuming that you will run 3 nodes for your delegate, 1 will run actively and participant into the consensus work, and 2 will standby and only listen to the blocks. 80 | 81 | All nodes can use the SAME `producerPrivKey`. For all nodes, add the following settings in `config.yaml`: 82 | 83 | ```yaml 84 | ... 85 | network: 86 | ... 87 | masterKey: producer_private_key-replica_id 88 | ... 89 | ... 90 | ``` 91 | 92 | For the active node, add the following settings in `config.yaml`: 93 | 94 | ```yaml 95 | ... 96 | system: 97 | ... 98 | active: true 99 | ... 100 | ... 101 | ``` 102 | 103 | For the standby nodes, add the following settings in `config.yaml`: 104 | 105 | ```yaml 106 | ... 107 | system: 108 | ... 109 | active: false 110 | ... 111 | ... 112 | ``` 113 | 114 | Additionally, export `9009` port from the node's docker container. Once the active node is down, use `http://ip-to-one-node:9009/ha?activate=true` to turn a standby node into active mode. Similarly, you can turn an active node into standby mode by using `http://ip-to-one-node:9009/ha?activate=false`. `http://ip-to-one-node:9009/ha` can tell you the mode of a node. 115 | 116 | If you have quite a few nodes, and want to get rid of the tedious manual operation from your nodes or just want to try out the fancy setup of a high availability cluster, please check out the leader election solution [here](https://github.com/zjshen14/iotex-leader-election). 117 | 118 | ## Decentralized Gravity Chain Binding 119 | 120 | IoTeX relies on the election result on our contract deployed on Ethereum, so that the server needs to a list of Ethereum JSON-RPC endpoints to consume the relevant data. While we provide a list of default JSON-RPC endpoints, delegates are encouraged to 121 | setup their own endpoint, to be more decentralized, secured and performant. 122 | 123 | There are two approaches that we have experimented before and you could consider of: 124 | 125 | - Setup an Ethereum node (no need to mine) ([geth](https://github.com/ethereum/go-ethereum/wiki/Installing-Geth) and [parity](https://wiki.parity.io/Setup)) for your own, and expose the JSON-RPC endpoint. 126 | - Use [Infura](https://infura.io/) Ethereum blockchain infrasturcture: signing up an account and creating an project. The JSON-RPC endpoint would be https://mainnet.infura.io/v3/YOUR-PROJECT-ID. For more details of setting up Infura endpoint, please check [here](https://ethereumico.io/knowledge-base/infura-api-key-guide/). 127 | 128 | After getting your own JSON-RPC endpoint, you could add it into following place in `config.yaml` and restart your server. Then, your IoTeX server will read from this endpoint to get Ethereum data. You could also create and add multiple endpoints for the sake of robustness. 129 | 130 | ```yaml 131 | ... 132 | chain: 133 | ... 134 | committee: 135 | ... 136 | gravityChainAPIs: 137 | - [YOUR JSON-RPC ENDPOINT] 138 | ... 139 | ... 140 | ... 141 | ... 142 | ``` 143 | 144 | ## Make It Even Better 145 | We are still new in the area of running decentralized infrastructure. There are still many things we can learn and improve. And since it is decentralized, we will need options and ideas from different perspectives. That means we need a lot of help form your guys to help us getting better. 146 | 147 | 148 | [^1]: https://aws.amazon.com/answers/networking/aws-ddos-attack-mitigation/ 149 | [^2]: https://cloud.google.com/files/GCPDDoSprotection-04122016.pdf 150 | [^3]: https://www.cloudflare.com/ddos/ 151 | -------------------------------------------------------------------------------- /infra/infraguide_CN.md: -------------------------------------------------------------------------------- 1 | ## IoTeX 代表(delegate)基础设施指南 2 | 3 | 1. 基于商业云负载均衡器运行您的节点。 4 | 5 | 像amazon AWS[^1], google GCE[^2] or Cloudflare[^3] 等云提供商会提供良好的保护, 防止大量的包括 SYN floods, IP fragment floods, port exhaustion在内的 L3, L4 DDoS 攻击, 我们建议使用这些专业解决方案来帮助您保护您的节点 6 | 7 | 2. 将Envoy Proxy作为边缘代理放在节点前面。 8 | 9 | [Envoy](https://www.envoyproxy.io/) 与 [ratelimit](https://github.com/lyft/ratelimit) 对HTTP / HTTP2和所有网络流量的连接限制提供请求速率限制。将您的IoTeX节点置于Envoy代理后面,为您提供针对攻击者的另一层保护。此外,由于IoTeX节点API使用GRPC,如果您想成为服务器节点并为浏览器单页面应用程序提供API请求, 您将需要Envoy的 [grpc-web](https://github.com/grpc/grpc-web) 过滤器以启用此功能。 10 | 11 | 在我们的测试网络集群中,我们设置HTTP / HTTP2请求速率上限为每个IP每秒20个请求 12 | 13 | ```yaml 14 | domain: iotex-api 15 | descriptors: 16 | - key: remote_address 17 | rate_limit: 18 | unit: second 19 | requests_per_unit: 20 20 | --- 21 | domain: iotex-stats 22 | descriptors: 23 | - key: remote_address 24 | rate_limit: 25 | unit: second 26 | requests_per_unit: 20 27 | ``` 28 | 29 | 并且最大连接数设置为50 30 | 31 | ```yaml 32 | circuit_breakers: 33 | thresholds: 34 | max_connections: 50 35 | max_pending_requests: 500 36 | max_requests: 100 37 | max_retries: 3 38 | ``` 39 | 40 | 41 | 42 | 以下是完整配置: [envoy config](https://gist.github.com/yutongp/c61292bf5c9c6e3058df96989365cb0c) 43 | 44 | 3. 使用Kubernetes进行部署和运行状况监控。 45 | 46 | [Kubernetes](https://kubernetes.io)(k8s) 是一个非常强大的用于管理您的容器化服务器的工具。在Kubernetes中部署和升级在docker容器中运行的服务器非常方便。 47 | 48 | k8s 还将执行运行状况检查并自动重启下降的节点以最大化正常运行时间。 49 | 50 | 我们在测试环境中非常依赖k8s。根据我们自己的经验,我们可以确定k8s肯定会降低您的运营成本。 51 | 52 | 53 | 这些是我们在deployment.yaml中使用的探测器配置: 54 | 55 | ```yaml 56 | livenessProbe: 57 | httpGet: 58 | path: "/liveness" 59 | port: 8080 60 | initialDelaySeconds: 15 61 | timeoutSeconds: 2 62 | periodSeconds: 15 63 | failureThreshold: 5 64 | readinessProbe: 65 | httpGet: 66 | path: "/readiness" 67 | port: 8080 68 | initialDelaySeconds: 30 69 | timeoutSeconds: 2 70 | periodSeconds: 15 71 | failureThreshold: 5 72 | ``` 73 | 74 | 我们目前在testnet运行的代理机器人设置与下图非常相似:![infra](infra.png?raw=true) 75 | 76 | ## 高可用性 77 | 78 | 由于代码错误,计算资源不足,主机故障,网络故障等原因,或者您必须关闭节点以执行某些维护工作,一个IoTeX节点可能处于中断状态。运行多个IoTeX节点是保证高可用性(零停机时间)的一种有效方法。我们提供了能方便运行这些节点的功能。 79 | 80 | 假设您将作为共识代表运行3个节点,1个将主动运行并参与共识工作,2个将待机并且仅监听块。 81 | 82 | 所有节点可以使用同样的 `producerPrivKey`. 对于所有的节点,添加下述设置到 `config.yaml`: 83 | 84 | ```yaml 85 | ... 86 | network: 87 | ... 88 | masterKey: producer_private_key-replica_id 89 | ... 90 | ... 91 | ``` 92 | 93 | 对于主动节点,添加以下命令到 `config.yaml`: 94 | 95 | ```yaml 96 | ... 97 | system: 98 | ... 99 | active: true 100 | ... 101 | ... 102 | ``` 103 | 104 | 对于待机节点,添加以下命令到 `config.yaml`: 105 | 106 | ```yaml 107 | ... 108 | system: 109 | ... 110 | active: false 111 | ... 112 | ... 113 | ``` 114 | 115 | 除此之外, 从节点的docker container导出 `9009` 端口. 一旦主动节点关闭,使用`http://ip-to-one-node:9009/ha?activate=true` 将待机节点变为主动模式。同样,您可以使用`http://ip-to-one-node:9009/ha?activate=false`将主动节点转为待机模式。 `http://ip-to-one-node:9009/ha`可以告诉你节点的模式。 116 | 117 | 如果您有相当多的节点,并希望从您的节点中删除繁琐的手动操作,或者只是想尝试高可用性集群的设置,请在[此处](https://github.com/zjshen14/iotex-leader-election)查看领导者选举解决方案。 118 | 119 | ## 去中心化重力链绑定 120 | 121 | IoTeX 依赖于我们部署在以太坊合约上的选举结果,因此服务器需要以太坊 JSON-RPC 终端列表来使用相关数据。虽然我们提供了一份默认的 JSON-RPC 终端列表,但建议共识代表设置自己的终端,以便能够实现更加去中心化、安全且具有执行性的目的。 122 | 123 | 我们之前尝试过两种方法,您可以加以考虑: 124 | 125 | - 为自己设置一个以太坊节点(无需挖掘)([geth](https://github.com/ethereum/go-ethereum/wiki/Installing-Geth) and [parity](https://wiki.parity.io/Setup)),并公开 JSON-RPC 终端。 126 | - 使用[Infura](https://infura.io/)以太坊区块链基础设施:注册帐户并创建一个项目。JSON-RPC 终端将是 https://mainnet.infura.io/v3/YOUR-PROJECT-ID。 127 | 128 | 获得自己的 JSON-RPC 终端后,可以将其添加到`config.yaml` 并重新启动服务器。这样,您的 IoTeX 服务器将从此终端读取获得以太坊数据。您还可以创建和添加多个终端,以便保持稳定。 129 | 130 | 131 | ```yaml 132 | ... 133 | chain: 134 | ... 135 | committee: 136 | ... 137 | gravityChainAPIs: 138 | - [YOUR JSON-RPC ENDPOINT] 139 | ... 140 | ... 141 | ... 142 | ... 143 | ``` 144 | 145 | 146 | ## 让它变得更好 147 | 运行去中心化基础设施仍在起步阶段,我们还有很多东西需要学习和改进。由于它是去中心化的,我们需要获得不同角度的观点和想法,希望大家集思广益,与我们共同建立一个更开放的高性能网络。 148 | 149 | 150 | [^1]: https://aws.amazon.com/answers/networking/aws-ddos-attack-mitigation/ 151 | [^2]: https://cloud.google.com/files/GCPDDoSprotection-04122016.pdf 152 | [^3]: https://www.cloudflare.com/ddos/ 153 | -------------------------------------------------------------------------------- /infra/monitoring/README.md: -------------------------------------------------------------------------------- 1 | # Visualize Metrics of Your Fullnode 2 | 3 | ## Precondition 4 | 5 | - docker installed 6 | - full node connected to mainnet-rehearsal (https://github.com/iotexproject/iotex-bootstrap) 7 | 8 | ## Setup Prometheus 9 | Prometheus is an open-source systems monitoring and alerting toolkit originally built at SoundCloud. Since its inception in 2012, many companies and organizations have adopted Prometheus, and the project has a very active developer and user community. It is now a standalone open source project and maintained independently of any company. We use prometheus as the backend for the monitoring of IoTeX fullnodes. 10 | 11 | 12 | ### Custom Config 13 | reference: https://prometheus.io/docs/prometheus/latest/configuration/configuration/ 14 | 15 | **get system eth0 ip** 16 | 17 | hostip=$(hostname -i|awk '{print$1}') 18 | 19 | cat < ~/prometheus.yml 20 | global: 21 | alerting: 22 | alertmanagers: 23 | - static_configs: 24 | - targets: 25 | rule_files: 26 | scrape_configs: 27 | - job_name: 'prometheus' 28 | static_configs: 29 | - targets: ['localhost:9090'] 30 | - job_name: 'iotex-testnet' 31 | static_configs: 32 | - targets: ["${hostip}:8080"] 33 | EOF 34 | 35 | ### Download and run prometheus 36 | 37 | sudo docker pull prom/prometheus 38 | 39 | sudo docker run -d \ 40 | -p 9090:9090 \ 41 | -v ~/prometheus.yml:/etc/prometheus/prometheus.yml \ 42 | prom/prometheus \ 43 | --config.file=/etc/prometheus/prometheus.yml 44 | 45 | ### Check Prometheus status 46 | sudo netstat -nltp|grep 9090 47 | open http://${hostip}:9090/targets 48 | 49 | ![](iotex_targets.png) 50 | 51 | ![](iotex_metric.png) 52 | 53 | ## Setup Grafana 54 | Grafana is an open source metric analytics & visualization suite. It is most commonly used for visualizing time series data for infrastructure and application analytics but many use it in other domains including industrial sensors, home automation, weather, and process control. We use prometheus as the frontend for the monitoring of IoTeX fullnodes. 55 | 56 | 57 | ### Download and run Grafana 58 | docker pull grafana/grafana 59 | docker run -d --name=grafana -p 3000:3000 grafana/grafana 60 | 61 | ### Check Grafana status 62 | sudo netstat -nltp|grep 3000 63 | open http://${hostip}:3000 64 | 65 | - download iotex template: [iotex-grafana.json](https://raw.githubusercontent.com/iotexproject/iotex-bootstrap/master/monitoring/iotex-grafana.json) 66 | 67 | - import you grafana 68 | 69 | ![](grafana_01.png) 70 | 71 | ![](grafana_02.png) 72 | 73 | 74 | ## Setup in Kubernetes 75 | You can use [prometheus operator](https://github.com/coreos/prometheus-operator) in k8s. 76 | To set it up, you can install this helm chart: https://github.com/helm/charts/tree/master/stable/prometheus-operator 77 | -------------------------------------------------------------------------------- /infra/monitoring/grafana_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iotexproject/iotex-bootstrap/b27aef5305b38c4af2cebe9df5d6703fc8498289/infra/monitoring/grafana_01.png -------------------------------------------------------------------------------- /infra/monitoring/grafana_02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iotexproject/iotex-bootstrap/b27aef5305b38c4af2cebe9df5d6703fc8498289/infra/monitoring/grafana_02.png -------------------------------------------------------------------------------- /infra/monitoring/iotex_metric.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iotexproject/iotex-bootstrap/b27aef5305b38c4af2cebe9df5d6703fc8498289/infra/monitoring/iotex_metric.png -------------------------------------------------------------------------------- /infra/monitoring/iotex_targets.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iotexproject/iotex-bootstrap/b27aef5305b38c4af2cebe9df5d6703fc8498289/infra/monitoring/iotex_targets.png -------------------------------------------------------------------------------- /infra/security_practice.md: -------------------------------------------------------------------------------- 1 | # Best Security Practice 2 | 3 | Any server exposed to the public can become a potential target to hackers. This guide provides basic instructions and tips for securing the nodes. 4 | 5 | ## System Updates 6 | Keeping the system updated is vital before starting anything on your system. This will prevent people to use known vulnerabilities to enter in your system. 7 | ``` 8 | sudo apt-get update 9 | sudo apt-get upgrade 10 | sudo apt-get autoremove 11 | sudo apt-get autoclean 12 | ``` 13 | 14 | ## Enable Firewall 15 | A good place to start is to install a Firewall. UFW - Uncomplicated Firewall is a basic firewall that works very well. 16 | ``` 17 | sudo apt-get install ufw 18 | sudo ufw allow ssh 19 | # allow P2P and metrics ports 20 | sudo ufw enable 21 | sudo ufw status verbose 22 | ``` 23 | 24 | ## Identify and Verify Open Ports 25 | NMAP ("Network Mapper") is a free and open source utility for network discovery and security auditing. It would be useful to understand if certain ports are open as expected. 26 | ``` 27 | sudo apt-get install nmap 28 | nmap -v -sT [NODE IP] 29 | ``` 30 | 31 | ## SSH Hardening 32 | SSH can be very helpful when configuring your server, and it also one of the first point of entry of hackers. This is why it is very important to secure your SSH. The basic rules of hardening SSH are: 33 | 34 | - No password for SSH access (use private key) 35 | - Don't allow root to SSH (the appropriate users should SSH in, then su or sudo) 36 | - Use sudo for users so commands are logged 37 | - Log unauthorised login attempts (and consider software to block/ban users who try to access your server too many times, like fail2ban) 38 | - Lock down SSH to only the ip range your require (if you feel like it) 39 | 40 | 41 | ## Prevent IP Spoofing 42 | ``` 43 | sudo vi /etc/host.conf 44 | order bind,hosts 45 | nospoof on 46 | ``` 47 | 48 | ## Secure Shared Memory 49 | Shared memory allows data to be passed between applications. Sometimes, multiple processes can share the same memory space and this can lead to exploitation. To secure shared memory, 50 | ``` 51 | sudo nano /etc/fstab 52 | # add the below line at the end of your file 53 | tmpfs /run/shm tmpfs defaults,noexec,nosuid 0 0 54 | ``` 55 | 56 | ## Defending Network Attacks 57 | To prevent a source routing attack on your server, 58 | ``` 59 | sudo nano /etc/sysctl.conf 60 | ``` 61 | and make sure the following values are set: 62 | ``` 63 | # IP Spoofing protection 64 | net.ipv4.conf.all.rp_filter = 1 65 | net.ipv4.conf.default.rp_filter = 1 66 | # Ignore ICMP broadcast requests 67 | net.ipv4.icmp_echo_ignore_broadcasts = 1 68 | # Disable source packet routing 69 | net.ipv4.conf.all.accept_source_route = 0 70 | net.ipv6.conf.all.accept_source_route = 0 71 | net.ipv4.conf.default.accept_source_route = 0 72 | net.ipv6.conf.default.accept_source_route = 0 73 | # Ignore send redirects 74 | net.ipv4.conf.all.send_redirects = 0 75 | net.ipv4.conf.default.send_redirects = 0 76 | # Block SYN attacks 77 | net.ipv4.tcp_syncookies = 1 78 | net.ipv4.tcp_max_syn_backlog = 2048 79 | net.ipv4.tcp_synack_retries = 2 80 | net.ipv4.tcp_syn_retries = 5 81 | # Log Martians 82 | net.ipv4.conf.all.log_martians = 1 83 | net.ipv4.icmp_ignore_bogus_error_responses = 1 84 | # Ignore ICMP redirects 85 | net.ipv4.conf.all.accept_redirects = 0 86 | net.ipv6.conf.all.accept_redirects = 0 87 | net.ipv4.conf.default.accept_redirects = 0 88 | net.ipv6.conf.default.accept_redirects = 0 89 | # Ignore Directed pings 90 | net.ipv4.icmp_echo_ignore_all = 1 91 | ``` 92 | then restart the service with `sudo systctl -p`. 93 | -------------------------------------------------------------------------------- /infra/security_practice_CN.md: -------------------------------------------------------------------------------- 1 | # 安全配置指导 2 | 3 | 任何公开的服务器都可能成为黑客的潜在目标。本指南提供了保护节点的基本说明和方法。 4 | 5 | ## 系统升级 6 | 在系统上启动任何操作之前,保持系统更新至关重要。这将阻止人们使用已知漏洞进入您的系统。 7 | ``` 8 | sudo apt-get update 9 | sudo apt-get upgrade 10 | sudo apt-get autoremove 11 | sudo apt-get autoclean 12 | ``` 13 | 14 | ## 使用防火墙 15 | 一个好的方法是安装防火墙。 UFW-防火墙是一个非常好用的基本防火墙。 16 | ``` 17 | sudo apt-get install ufw 18 | sudo ufw allow ssh 19 | # allow P2P and metrics ports 20 | sudo ufw enable 21 | sudo ufw status verbose 22 | ``` 23 | 24 | ## 识别并验证开放端口 25 | NMAP(“网络映射器”)是一种用于网络发现和安全审计的免费开源实用程序。了解某些端口是否按预期打开会很有用。 26 | ``` 27 | sudo apt-get install nmap 28 | nmap -v -sT [NODE IP] 29 | ``` 30 | 31 | ## SSH 强化 32 | 配置服务器时SSH非常有用,它也是黑客进入的第一站。这就是为什么保护SSH非常重要的原因。加强SSH的基本规则是: 33 | 34 | - 不设置SSH访问密码(使用私钥) 35 | - 不允许root用户进入SSH(相应的用户应该SSH,然后使用su或sudo) 36 | - 为用户使用sudo,以便记录命令 37 | - 记录未经授权的登录尝试(并考虑阻止/禁止试图访问您的服务器太多次的用户的软件,例如fail2ban) 38 | - 将SSH锁定到您需要的ip范围(如果您愿意的话) 39 | 40 | ## 防止IP欺骗 41 | ``` 42 | sudo vi /etc/host.conf 43 | order bind,hosts 44 | nospoof on 45 | ``` 46 | 47 | ## 保护共享内存 48 | 共享内存允许数据在应用程序之间传递。有时,多个进程可以共享相同的内存空间,这可能会导致漏洞利用。为了保护共享内存, 49 | ``` 50 | sudo nano /etc/fstab 51 | # add the below line at the end of your file 52 | tmpfs /run/shm tmpfs defaults,noexec,nosuid 0 0 53 | ``` 54 | 55 | ## 防御网络攻击 56 | 为了防御服务器上的源路由攻击, 57 | ``` 58 | sudo nano /etc/sysctl.conf 59 | ``` 60 | 请确保设置以下命令: 61 | ``` 62 | # IP Spoofing protection 63 | net.ipv4.conf.all.rp_filter = 1 64 | net.ipv4.conf.default.rp_filter = 1 65 | # Ignore ICMP broadcast requests 66 | net.ipv4.icmp_echo_ignore_broadcasts = 1 67 | # Disable source packet routing 68 | net.ipv4.conf.all.accept_source_route = 0 69 | net.ipv6.conf.all.accept_source_route = 0 70 | net.ipv4.conf.default.accept_source_route = 0 71 | net.ipv6.conf.default.accept_source_route = 0 72 | # Ignore send redirects 73 | net.ipv4.conf.all.send_redirects = 0 74 | net.ipv4.conf.default.send_redirects = 0 75 | # Block SYN attacks 76 | net.ipv4.tcp_syncookies = 1 77 | net.ipv4.tcp_max_syn_backlog = 2048 78 | net.ipv4.tcp_synack_retries = 2 79 | net.ipv4.tcp_syn_retries = 5 80 | # Log Martians 81 | net.ipv4.conf.all.log_martians = 1 82 | net.ipv4.icmp_ignore_bogus_error_responses = 1 83 | # Ignore ICMP redirects 84 | net.ipv4.conf.all.accept_redirects = 0 85 | net.ipv6.conf.all.accept_redirects = 0 86 | net.ipv4.conf.default.accept_redirects = 0 87 | net.ipv6.conf.default.accept_redirects = 0 88 | # Ignore Directed pings 89 | net.ipv4.icmp_echo_ignore_all = 1 90 | ``` 91 | 之后使用`sudo systctl -p`重启服务 92 | -------------------------------------------------------------------------------- /launch_playbook_mainnet.md: -------------------------------------------------------------------------------- 1 | # Playbook for Mainnet Launch 2 | 3 | This is the playbook for bootstrapping IoTeX mainnet. It is the most comprehensive collection of knowledge regarding IoTeX mainnet launch. 4 | 5 | # Register as A Delegate Candidate and Get Voted 6 | To being with, one should register as a delegate at the member portal, which are: 7 | 8 | - MainNet: https://member.iotex.io/profile/name-registration 9 | - MainNet Rehearsal: https://member-reherasal.iotex.io/profile/name-registration 10 | - TestNet: https://member-testnet.iotex.io/profile/name-registration 11 | 12 | Once registered, your delegate node will be displayed on https://member.iotex.io, https://member-reherasal.iotex.io or https://member-testnet.iotex.io respectively, and can be voted by voters. Make sure you have operator address (for consensus node to operate) and reward address (for getting rewards) included. They are both addresses started with `io` and can be generated by [ioctl](https://docs.iotex.io/#create-account-s). It is recommended they are different for better security. 13 | 14 | To be concrete, there are four types of roles involved, where the latter covers the former: 15 | - Active Consensus Delegates: the 24 nodes that are responsible for producing blocks for a certain epoch (which is one hour), selected randomly from consensus delegates 16 | - Consensus Delegates: the top 36 delegates who get voted most 17 | - Delegates: the candidates who received more than 2,000,000 votes and have at least 1,200,000 IOTX self-staked (i.e., staked and voted for itself). 18 | - Candidates: all registered node. 19 | 20 | For launching the mainnet, **top 18 candidates should be participated**; **top 12 candidates work together with 24 robots as consensus delegates to produce blocks**. Once the launching succeeded and the mainnet is stabilized, all top 36 ranked candidates will be enrolled in. 21 | 22 | # Prepare Qualified Machines 23 | Recommended Hardware: 24 | ``` 25 | Server: primary server and backup server 26 | • Memory: 16 GB of RAM 27 | • Local Storage: 200 GB SSD with 1000+ IOPS 28 | • Processor: 4 cores (2.4 GHz each) 29 | • Network: 100 Mb/sec 30 | ``` 31 | 32 | You could run [this script](https://raw.githubusercontent.com/iotexproject/iotex-bootstrap/master/scripts/get_systemstat.sh) to get the basic hardware information. Note that slow network and slow local storage have prominent negative impact on the productivity of a node. 33 | 34 | # Setup Operating Nodes 35 | Please follow [this guide](https://github.com/iotexproject/iotex-bootstrap/blob/master/README.md) for the basic setup of an operating node. 36 | 37 | Once the node if fully synced, please fill in its domain name/static IP together with your contact information at [here](https://member.iotex.io/profile/technical/). This is for us to monitoring consensus delegates and notify you if something is wrong. DO NOT SHARE this information with anybody else! 38 | 39 | # Produce Blocks and Earn Rewards 40 | Once the node is up and running and ranked in the top 12, it will participates the consensus. [ioctl](https://docs.iotex.io/#cli-command-line-interface) is the best tool to make sure if your node is enrolled in. If so, it starts to produce blocks starting from a certain epoch. Note that one epoch contains 360 blocks, and is roughly one hour. Each block is produced every 10 seconds and the block producer gets 16 IOTX for producing a valid block. After each epoch is done, an epoch reward of 12,500 IOTX is splitted by all delegates, proportional to their respective percentage of total votes. In addition, a foundation bonus of 2,880 IOTX is splitted by at most top 36 consensus delegates for first 8760 epochs (roughly a year). 41 | 42 | **If a node is participating consensus (as an active consensus delegate) and missed more than 2 blocks in this epoch, all its epoch reward will be slashed**, although block reward (if it actually produced blocks) and foundation bonus are granted. More information can be found [here](https://iotex.io/consensus-delegate-handbook.pdf). 43 | 44 | Therefore, it is always a great practice to have multiple operating nodes up and running. One elected master participants the consensus while other slaves passively syncing. If the master fails (e.g., software crash, hardware error), one of the slaves will be automatically promoted to master and keep participating in the consensus. Please refer to [this](infra/infraguide.md#high-availability) for master election and failover. 45 | 46 | Please use ioctl tool to [check](https://docs.iotex.io/#query-reward) and [claim](https://docs.iotex.io/#claim-reward) reward, and use iotex-tube serivce (TBD) to swap native IOTX to ERC20 IOTX for staking and trading. 47 | 48 | # Infrastructure Best Practice 49 | Please refer to [this guide](https://github.com/iotexproject/iotex-bootstrap/blob/master/infra/infraguide.md) to setup an infrastructure (rather than a solo node) to have high block productivity. 50 | 51 | Please refer to [this guide](https://github.com/iotexproject/iotex-bootstrap/tree/master/infra/monitoring) to setup a dashboard for monitoring your nodes. 52 | 53 | # Security Best Practice 54 | Please refer to [this guide](https://github.com/iotexproject/iotex-bootstrap/blob/master/infra/security_practice.md) to make sure your node is operating in a secure way. 55 | -------------------------------------------------------------------------------- /launch_playbook_mainnet_CN.md: -------------------------------------------------------------------------------- 1 | # 主网上线操作手册 2 | 3 | 这是IoTeX主网上线的指导手册。它是关于IoTeX主网上线最全面的知识手册 4 | 5 | # 注册成为节点候选人并获得投票 6 | 一开始,您应该在门户网站注册成为一个节点,您可以通过以下地址进入: 7 | 8 | - 主网: https://member.iotex.io/profile/name-registration 9 | - 主网预演: https://member-reherasal.iotex.io/profile/name-registration 10 | - 测试网络: https://member-testnet.iotex.io/profile/name-registration 11 | 12 | 一经注册,您的节点就会分别被显示在 https://member.iotex.io, https://member-reherasal.iotex.io 13 | 或者 https://member-testnet.iotex.io 上,并且可以接受投票。确保您有填写操作地址(用于操作 14 | 节点)和奖励地址(用于获得奖励)。这两个地址都是以 `io` 开头,并且可以由[ioctl](https://docs.iotex.io/#create-account-s) 15 | 工具产生。为了更高的安全性,他们应该是不同的地址。 16 | 17 | 具体而言,共有四种角色,并且后者包含前者: 18 | - 活跃共识节点:24个从共识节点中随机选取的,且负责在每个周期(一小时)产生区块的节点 19 | - 共识节点:获得票数最多的前36个节点 20 | - 节点:获得2,000,000选票且自我质押1,200,000IOTX到自己节点的候选人 21 | - 候选人:所有注册的节点 22 | 23 | 为了主网成功上线, **前18名候选人必须要参加**;**前12名候选人和24名机器人作为共识节点一起工作,产生区块**。一旦 24 | 成功上线,主网保持稳定后,所有前36名候选人都会参加。 25 | 26 | # 准备合格的机器 27 | 推荐配置: 28 | ``` 29 | 服务器:主服务器和备份服务器 30 | • 内存:32 GB RAM 31 | • 本地存储:1 TB SSD,具有1000+ IOPS 32 | • 处理器:8核(每个2.4 GHz) 33 | • 网络:100 Mb /秒 34 | ``` 35 | 36 | 你应该运行[这个脚本](https://raw.githubusercontent.com/iotexproject/iotex-bootstrap/master/scripts/get_systemstat.sh) 37 | 获取基本硬件信息。请注意,慢速网络和慢速本地存储会对节点的生产率产生显着的负面影响。 38 | 39 | # 设置操作节点 40 | 请遵循[这个指导](https://github.com/iotexproject/iotex-bootstrap/blob/master/README.md) 来设置操作节点 41 | 42 | 一旦节点完全同步,请在[这里](https://member.iotex.io/profile/technical/) 填写其域名/静态IP以及您的联系信息。我们可以监控共识节点状态,并在出现问题时通知您。请勿与其他人分享此信息! 43 | 44 | # 产生区块并且获得奖励 45 | 一旦节点启动并运行并排在前12位,它将参与共识。 [ioctl](https://docs.iotex.io/#cli-command-line-interface)是确保您的节点注册的最佳工具。如果是这样,它开始从某个时期生成块。请注意,一个周期包含360个块,大约一个小时。每10秒生成一个块,每个块会获得16个IOTX。在每个时代完成之后,所有节点将会按各自投票占比共同分享12,500 IOTX的周期奖励。此外,至多36名共识节点将会在前8760个周期(大约一年),每个周期分享2,880IOTX的基金奖励。 46 | 47 | **如果一个节点正在参与共识(作为一个活跃的共识代表)并且在这个周期错过了超过2个区块,那么它的所有周期奖励将被剥夺**, 48 | 虽然区块奖励(如果它实际产生了块)和基金奖励还可以获得。可以在[这里](https://iotex.io/consensus-delegate-handbook.pdf)获得更多信息 49 | 50 | 51 | 因此,启动并运行多个操作节点始终是一种很好的做法。一位当选主设备参与了共识,而其他附属设备被动同步。如果主设备发生故障(例如,软件崩溃,硬件错误),其中一个从设备将自动升级为主设备并继续参与共识。请参阅[这里](infra / infraguide.md#high-availability)进行主设备选举和故障转移。 52 | 53 | 请使用ioctl工具来核查[check](https://docs.iotex.io/#query-reward)和取出[claim](https://docs.iotex.io/#claim-reward)奖励,并使用iotex- tube服务(TBD)将本地IOTX兑换成ERC20 IOTX以进行质押和交易。 54 | 55 | # 基础设施配置指导 56 | 请参阅[本指南](https://github.com/iotexproject/iotex-bootstrap/blob/master/infra/infraguide.md)设置基础架构(而不是单独节点)以获得高出块效率。 57 | 58 | 请参阅[本指南](https://github.com/iotexproject/iotex-bootstrap/tree/master/infra/monitoring)设置仪表板以监控节点。 59 | 60 | # 安全措施配置指导 61 | TBD 62 | 63 | Stanford CPC 贡献 64 | -------------------------------------------------------------------------------- /monitor/.env: -------------------------------------------------------------------------------- 1 | IOTEX_IMAGE=iotex/iotex-core 2 | IOTEX_HOME=~/iotex-var 3 | IOTEX_MONITOR_HOME=~/iotex-var/monitor 4 | 5 | -------------------------------------------------------------------------------- /monitor/alert.rules: -------------------------------------------------------------------------------- 1 | groups: 2 | - name: Block chain height 3 | rules: 4 | - alert: Block chain height is abnormal 5 | expr: avg(delta(iotex_heartbeat_status{status_type="blockchainHeight"}[5m])) < 5 and avg(avg_over_time(iotex_heartbeat_status{status_type="blockchainHeight"}[1m])) > 0 6 | for: 1m 7 | labels: 8 | status_type: blockchainHeight 9 | annotations: 10 | summary: "Instance {{ $labels.instance }} Block chain height is abnormal" 11 | description: "{{ $labels.instance }} of job {{ $labels.job }} block chain height is {{ $value }}." 12 | -------------------------------------------------------------------------------- /monitor/docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '2' 2 | 3 | services: 4 | iotex: 5 | container_name: iotex 6 | image: ${IOTEX_IMAGE} 7 | restart: unless-stopped 8 | ports: 9 | - 8080:8080 10 | - 4689:4689 11 | volumes: 12 | - $IOTEX_HOME/data:/var/data:rw 13 | - $IOTEX_HOME/log:/var/log:rw 14 | - $IOTEX_HOME/etc/config.yaml:/etc/iotex/config_override.yaml:ro 15 | - $IOTEX_HOME/etc/genesis.yaml:/etc/iotex/genesis.yaml:ro 16 | command: iotex-server -config-path=/etc/iotex/config_override.yaml -genesis-path=/etc/iotex/genesis.yaml 17 | 18 | monitor: 19 | container_name: iotex-monitor 20 | image: iotex/iotex-monitor:v1 21 | ports: 22 | - 3000:3000 23 | - 9090:9090 24 | volumes: 25 | - $IOTEX_MONITOR_HOME/prometheus.yml:/prometheus/prometheus-2.14.0.linux-amd64/prometheus.yml:ro 26 | - $IOTEX_MONITOR_HOME/alert.rules:/prometheus/prometheus-2.14.0.linux-amd64/alert.rules:ro 27 | links: 28 | - iotex 29 | -------------------------------------------------------------------------------- /monitor/docker-compose.yml.gateway: -------------------------------------------------------------------------------- 1 | version: '2' 2 | 3 | services: 4 | iotex: 5 | container_name: iotex 6 | image: ${IOTEX_IMAGE} 7 | restart: unless-stopped 8 | ports: 9 | - 8080:8080 10 | - 4689:4689 11 | - 14014:14014 12 | volumes: 13 | - $IOTEX_HOME/data:/var/data:rw 14 | - $IOTEX_HOME/log:/var/log:rw 15 | - $IOTEX_HOME/etc/config.yaml:/etc/iotex/config_override.yaml:ro 16 | - $IOTEX_HOME/etc/genesis.yaml:/etc/iotex/genesis.yaml:ro 17 | command: iotex-server -config-path=/etc/iotex/config_override.yaml -genesis-path=/etc/iotex/genesis.yaml -plugin=gateway 18 | 19 | monitor: 20 | container_name: iotex-monitor 21 | image: iotex/iotex-monitor:v1 22 | ports: 23 | - 3000:3000 24 | - 9090:9090 25 | volumes: 26 | - $IOTEX_MONITOR_HOME/prometheus.yml:/prometheus/prometheus-2.14.0.linux-amd64/prometheus.yml:ro 27 | - $IOTEX_MONITOR_HOME/alert.rules:/prometheus/prometheus-2.14.0.linux-amd64/alert.rules:ro 28 | links: 29 | - iotex 30 | -------------------------------------------------------------------------------- /monitor/docker-compose.yml.marketplace: -------------------------------------------------------------------------------- 1 | version: '2' 2 | 3 | services: 4 | iotex: 5 | container_name: iotex 6 | image: ${IOTEX_IMAGE} 7 | restart: on-failure 8 | ports: 9 | - 8080:8080 10 | - 4689:4689 11 | - 14014:14014 12 | volumes: 13 | - $IOTEX_HOME/data:/var/data:rw 14 | - $IOTEX_HOME/log:/var/log:rw 15 | - $IOTEX_HOME/etc/config.yaml:/etc/iotex/config_override.yaml:ro 16 | - $IOTEX_HOME/etc/genesis.yaml:/etc/iotex/genesis.yaml:ro 17 | command: iotex-server -config-path=/etc/iotex/config_override.yaml -genesis-path=/etc/iotex/genesis.yaml -plugin=gateway -------------------------------------------------------------------------------- /monitor/example/example_dashboards.yaml: -------------------------------------------------------------------------------- 1 | # # config file version 2 | apiVersion: 1 3 | 4 | providers: 5 | - name: 'IoteX' 6 | # orgId: 1 7 | # folder: '' 8 | # folderUid: '' 9 | type: file 10 | options: 11 | path: /tmp/grafana/dashboards 12 | -------------------------------------------------------------------------------- /monitor/example/example_datasource.yaml: -------------------------------------------------------------------------------- 1 | # # config file version 2 | apiVersion: 1 3 | 4 | # # list of datasources that should be deleted from the database 5 | #deleteDatasources: 6 | # - name: Graphite 7 | # orgId: 1 8 | 9 | # # list of datasources to insert/update depending 10 | # # on what's available in the database 11 | datasources: 12 | # # name of the datasource. Required 13 | - name: Iotex 14 | # # datasource type. Required 15 | type: prometheus 16 | # # access mode. direct or proxy. Required 17 | access: proxy 18 | # # org id. will default to orgId 1 if not specified 19 | # orgId: 1 20 | # # url 21 | url: http://localhost:9090 22 | # # database password, if used 23 | # password: 24 | # # database user, if used 25 | # user: 26 | # # database name, if used 27 | # database: 28 | # # enable/disable basic auth 29 | basicAuth: false 30 | # # basic auth username 31 | # basicAuthUser: 32 | # # basic auth password 33 | # basicAuthPassword: 34 | # # enable/disable with credentials headers 35 | # withCredentials: 36 | # # mark as default datasource. Max one per org 37 | isDefault: true 38 | # # fields that will be converted to json and stored in json_data 39 | jsonData: 40 | # graphiteVersion: "1.1" 41 | # tlsAuth: true 42 | # tlsAuthWithCACert: true 43 | # httpHeaderName1: "Authorization" 44 | httpMethod: "GET" 45 | # # json object of data that will be encrypted. 46 | # secureJsonData: 47 | # tlsCACert: "..." 48 | # tlsClientCert: "..." 49 | # tlsClientKey: "..." 50 | # # 51 | # httpHeaderValue1: "Bearer xf5yhfkpsnmgo" 52 | version: 1 53 | # # allow users to edit datasources from the UI. 54 | # editable: false -------------------------------------------------------------------------------- /monitor/example/example_monitor_dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:18.04 2 | 3 | RUN \ 4 | apt-get update && \ 5 | apt-get install -y curl software-properties-common && \ 6 | curl https://packages.grafana.com/gpg.key | apt-key add - && \ 7 | add-apt-repository "deb https://packages.grafana.com/oss/deb stable main" && \ 8 | apt-get update && \ 9 | apt-get install -y grafana && \ 10 | curl -LO https://github.com/prometheus/prometheus/releases/download/v2.14.0/prometheus-2.14.0.linux-amd64.tar.gz && \ 11 | mkdir /prometheus && \ 12 | tar xzvf prometheus-2.14.0.linux-amd64.tar.gz -C /prometheus && \ 13 | mkdir -p /tmp/grafana/dashboards 14 | 15 | COPY ./prometheus.yml /prometheus/prometheus-2.14.0.linux-amd64/ 16 | COPY ./datasource.yaml /etc/grafana/provisioning/datasources 17 | COPY ./dashboards.yaml /etc/grafana/provisioning/dashboards 18 | COPY ./IoTeX.json /tmp/grafana/dashboards 19 | COPY ./run.sh / 20 | 21 | EXPOSE 9090 22 | EXPOSE 3000 23 | 24 | ENTRYPOINT ["/run.sh"] 25 | -------------------------------------------------------------------------------- /monitor/example/example_run.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Start Grafana 4 | service grafana-server start 5 | 6 | # Start Prometheus 7 | cd /prometheus/prometheus-2.14.0.linux-amd64 8 | ./prometheus 9 | -------------------------------------------------------------------------------- /monitor/prometheus.yml: -------------------------------------------------------------------------------- 1 | global: 2 | scrape_interval: 15s # By default, scrape targets every 15 seconds. 3 | evaluation_interval: 15s # Evaluate rules every 15 seconds. 4 | 5 | # Attach these extra labels to all timeseries collected by this Prometheus instance. 6 | external_labels: 7 | monitor: 'iotex-node-monitor' 8 | 9 | scrape_configs: 10 | - job_name: 'iotex-monitor' 11 | 12 | # Override the global default and scrape targets from this job every 5 seconds. 13 | scrape_interval: 5s 14 | 15 | static_configs: 16 | - targets: ['iotex:8080'] 17 | -------------------------------------------------------------------------------- /native-to-erc20.abi: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "constant": false, 4 | "inputs": [], 5 | "name": "deposit", 6 | "outputs": [], 7 | "payable": true, 8 | "stateMutability": "payable", 9 | "type": "function" 10 | }, 11 | { 12 | "constant": false, 13 | "inputs": [], 14 | "name": "pause", 15 | "outputs": [], 16 | "payable": false, 17 | "stateMutability": "nonpayable", 18 | "type": "function" 19 | }, 20 | { 21 | "constant": false, 22 | "inputs": [], 23 | "name": "resume", 24 | "outputs": [], 25 | "payable": false, 26 | "stateMutability": "nonpayable", 27 | "type": "function" 28 | }, 29 | { 30 | "constant": false, 31 | "inputs": [ 32 | { 33 | "name": "_fee", 34 | "type": "uint256" 35 | } 36 | ], 37 | "name": "setDepositFee", 38 | "outputs": [], 39 | "payable": false, 40 | "stateMutability": "nonpayable", 41 | "type": "function" 42 | }, 43 | { 44 | "constant": false, 45 | "inputs": [ 46 | { 47 | "name": "_gasLimit", 48 | "type": "uint256" 49 | } 50 | ], 51 | "name": "setGasLimit", 52 | "outputs": [], 53 | "payable": false, 54 | "stateMutability": "nonpayable", 55 | "type": "function" 56 | }, 57 | { 58 | "constant": false, 59 | "inputs": [ 60 | { 61 | "name": "_maxAmount", 62 | "type": "uint256" 63 | } 64 | ], 65 | "name": "setMaxAmount", 66 | "outputs": [], 67 | "payable": false, 68 | "stateMutability": "nonpayable", 69 | "type": "function" 70 | }, 71 | { 72 | "constant": false, 73 | "inputs": [ 74 | { 75 | "name": "_minAmount", 76 | "type": "uint256" 77 | } 78 | ], 79 | "name": "setMinAmount", 80 | "outputs": [], 81 | "payable": false, 82 | "stateMutability": "nonpayable", 83 | "type": "function" 84 | }, 85 | { 86 | "constant": false, 87 | "inputs": [ 88 | { 89 | "name": "_safe", 90 | "type": "address" 91 | } 92 | ], 93 | "name": "setSafe", 94 | "outputs": [], 95 | "payable": false, 96 | "stateMutability": "nonpayable", 97 | "type": "function" 98 | }, 99 | { 100 | "constant": false, 101 | "inputs": [ 102 | { 103 | "name": "newOwner", 104 | "type": "address" 105 | } 106 | ], 107 | "name": "transferOwnership", 108 | "outputs": [], 109 | "payable": false, 110 | "stateMutability": "nonpayable", 111 | "type": "function" 112 | }, 113 | { 114 | "constant": false, 115 | "inputs": [ 116 | { 117 | "name": "amount", 118 | "type": "uint256" 119 | } 120 | ], 121 | "name": "withdraw", 122 | "outputs": [], 123 | "payable": false, 124 | "stateMutability": "nonpayable", 125 | "type": "function" 126 | }, 127 | { 128 | "inputs": [ 129 | { 130 | "name": "_safe", 131 | "type": "address" 132 | }, 133 | { 134 | "name": "_fee", 135 | "type": "uint256" 136 | }, 137 | { 138 | "name": "_minAmount", 139 | "type": "uint256" 140 | }, 141 | { 142 | "name": "_maxAmount", 143 | "type": "uint256" 144 | } 145 | ], 146 | "payable": false, 147 | "stateMutability": "nonpayable", 148 | "type": "constructor" 149 | }, 150 | { 151 | "payable": true, 152 | "stateMutability": "payable", 153 | "type": "fallback" 154 | }, 155 | { 156 | "anonymous": false, 157 | "inputs": [ 158 | { 159 | "indexed": true, 160 | "name": "customer", 161 | "type": "address" 162 | }, 163 | { 164 | "indexed": false, 165 | "name": "amount", 166 | "type": "uint256" 167 | }, 168 | { 169 | "indexed": false, 170 | "name": "fee", 171 | "type": "uint256" 172 | } 173 | ], 174 | "name": "Receipt", 175 | "type": "event" 176 | }, 177 | { 178 | "anonymous": false, 179 | "inputs": [ 180 | { 181 | "indexed": true, 182 | "name": "previousOwner", 183 | "type": "address" 184 | }, 185 | { 186 | "indexed": true, 187 | "name": "newOwner", 188 | "type": "address" 189 | } 190 | ], 191 | "name": "OwnershipTransferred", 192 | "type": "event" 193 | }, 194 | { 195 | "constant": true, 196 | "inputs": [], 197 | "name": "depositFee", 198 | "outputs": [ 199 | { 200 | "name": "", 201 | "type": "uint256" 202 | } 203 | ], 204 | "payable": false, 205 | "stateMutability": "view", 206 | "type": "function" 207 | }, 208 | { 209 | "constant": true, 210 | "inputs": [], 211 | "name": "gasLimit", 212 | "outputs": [ 213 | { 214 | "name": "", 215 | "type": "uint256" 216 | } 217 | ], 218 | "payable": false, 219 | "stateMutability": "view", 220 | "type": "function" 221 | }, 222 | { 223 | "constant": true, 224 | "inputs": [ 225 | { 226 | "name": "_offset", 227 | "type": "uint256" 228 | }, 229 | { 230 | "name": "_limit", 231 | "type": "uint256" 232 | } 233 | ], 234 | "name": "getRecords", 235 | "outputs": [ 236 | { 237 | "name": "_addrs", 238 | "type": "address[]" 239 | }, 240 | { 241 | "name": "_amounts", 242 | "type": "uint256[]" 243 | }, 244 | { 245 | "name": "_fees", 246 | "type": "uint256[]" 247 | } 248 | ], 249 | "payable": false, 250 | "stateMutability": "view", 251 | "type": "function" 252 | }, 253 | { 254 | "constant": true, 255 | "inputs": [], 256 | "name": "maxAmount", 257 | "outputs": [ 258 | { 259 | "name": "", 260 | "type": "uint256" 261 | } 262 | ], 263 | "payable": false, 264 | "stateMutability": "view", 265 | "type": "function" 266 | }, 267 | { 268 | "constant": true, 269 | "inputs": [], 270 | "name": "minAmount", 271 | "outputs": [ 272 | { 273 | "name": "", 274 | "type": "uint256" 275 | } 276 | ], 277 | "payable": false, 278 | "stateMutability": "view", 279 | "type": "function" 280 | }, 281 | { 282 | "constant": true, 283 | "inputs": [], 284 | "name": "owner", 285 | "outputs": [ 286 | { 287 | "name": "", 288 | "type": "address" 289 | } 290 | ], 291 | "payable": false, 292 | "stateMutability": "view", 293 | "type": "function" 294 | }, 295 | { 296 | "constant": true, 297 | "inputs": [], 298 | "name": "safe", 299 | "outputs": [ 300 | { 301 | "name": "", 302 | "type": "address" 303 | } 304 | ], 305 | "payable": false, 306 | "stateMutability": "view", 307 | "type": "function" 308 | } 309 | ] -------------------------------------------------------------------------------- /pharos.md: -------------------------------------------------------------------------------- 1 | # pharos 2 | Gateway server bridging REST and gRPC 3 | 4 | Pharos is an HTTP endpoint for developer and 3rd-party integrator to access address and transaction data on IoTeX blockchain 5 | 6 | ## APIs 7 | Currently Pharos has the following 3 APIs: 8 | 9 | 1. get an address 10 | 11 | GET: https://pharos.iotex.io/v1/accounts/io1e2nqsyt7fkpzs5x7zf2uk0jj72teu5n6aku3tr 12 | 13 | Response is a JSON blob like below: 14 | > `{"accountMeta":{"address":"io1e2nqsyt7fkpzs5x7zf2uk0jj72teu5n6aku3tr","balance":"8804142945000000000000","nonce":"18","pendingNonce":"19","numActions":"35"}}` 15 | 16 | 2. get a transaction by hash 17 | 18 | GET: https://pharos.iotex.io/v1/actions/hash/53e729d28b0c69fc66c4317fdc6ee7af292980ce781b56b502e2ee2e0b9ca48a 19 | 20 | Response is a JSON blob like below: 21 | > `{"total":"1","actionInfo":[{"action":{"core":{"version":1,"nonce":"1","gasLimit":"20000","gasPrice":"1000000000000","transfer":{"amount":"1000000000000000","recipient":"io1e2nqsyt7fkpzs5x7zf2uk0jj72teu5n6aku3tr"}},"senderPubKey":"BLhgbOGdny7iNzyHe9axp5KWTb8sMJzad78+bc5cTYRAUqVNF6igy5t9z2jqM2Zneiw17d6xSgbokcDnVRxmuM8=","signature":"awRLFCvU4X5SVyz2IDU5rdjmKjUk3BOchmt/3bmvgi9GJJW3pat4I0i/qqROowPbVJ8nj+eZNQ5Okhgt6ezPgAE="},"actHash":"53e729d28b0c69fc66c4317fdc6ee7af292980ce781b56b502e2ee2e0b9ca48a","blkHash":"33e1d2858cec24059f22348b862a2f415a21bb14b7d96733249a12e96c542969","blkHeight":"222656","sender":"io1e2nqsyt7fkpzs5x7zf2uk0jj72teu5n6aku3tr","gasFee":"10000000000000000","timestamp":"2019-05-17T23:26:20Z"}]}` 22 | 23 | 3. get a list of transactions of an address 24 | 25 | GET: https://pharos.iotex.io/v1/actions/addr/io1e2nqsyt7fkpzs5x7zf2uk0jj72teu5n6aku3tr?count=1&start=9 26 | 27 | Note: the first API returns `numActions:` the total number of actions of an address. Here the params in HTTP request body need to satisfy `start + count <= numActions` 28 | 29 | Response is a JSON blob like below: 30 | > `{"total":"35","actionInfo":[{"action":{"core":{"version":1,"nonce":"10","gasLimit":"10000","gasPrice":"1000000000000","transfer":{"amount":"466555000000000000","recipient":"io1j0d0lvx7493426zfdk43fdt6wmnp502p96m9c0"}},"senderPubKey":"BLhgbOGdny7iNzyHe9axp5KWTb8sMJzad78+bc5cTYRAUqVNF6igy5t9z2jqM2Zneiw17d6xSgbokcDnVRxmuM8=","signature":"pJoeZx7UnrqFngxm91q6EtP7WlBznHCkKQg4zlFYTxUtUbIkH5mbps2ZU8eQ/MXRjarwzOLorC1el5P/pT3t8gA="},"actHash":"211b56cc9ae0e35a59bd71d8d888d1eba48183340478e8c23908bb2cd7921449","blkHash":"9da5c800137c25b7b6b9f5cd745afa37a183526c5f7f5867705fda32ce052afd","blkHeight":"251783","sender":"io1e2nqsyt7fkpzs5x7zf2uk0jj72teu5n6aku3tr","gasFee":"10000000000000000","timestamp":"2019-05-21T08:24:30Z"}]}` 31 | 32 | ## Send transfer to IoTeX blockchain 33 | Please click [here](https://github.com/iotexproject/iotex-proto/) and refer to the example at the end of readme. 34 | 35 | -------------------------------------------------------------------------------- /pharos/pharos.md: -------------------------------------------------------------------------------- 1 | # pharos 2 | Gateway server bridging REST and gRPC 3 | 4 | ## Account/address 5 | The URL is https://pharos.iotex.io/v1/accounts/_address 6 | 7 | Here's an example: https://pharos.iotex.io/v1/accounts/io1e2nqsyt7fkpzs5x7zf2uk0jj72teu5n6aku3tr 8 | 9 | `{"accountMeta":{"address":"io1e2nqsyt7fkpzs5x7zf2uk0jj72teu5n6aku3tr","balance":"123180000000000000000","nonce":"45","pendingNonce":"46","numActions":"59"}}` 10 | 11 | ## Transaction by hash 12 | The URL is https://pharos.iotex.io/v1/actions/hash/_hash 13 | 14 | Here's an example: https://pharos.iotex.io/v1/actions/hash/53e729d28b0c69fc66c4317fdc6ee7af292980ce781b56b502e2ee2e0b9ca48a 15 | 16 | `{"total":"1","actionInfo":[{"action":{"core":{"version":1,"nonce":"1","gasLimit":"20000","gasPrice":"1000000000000","transfer":{"amount":"1000000000000000","recipient":"io1e2nqsyt7fkpzs5x7zf2uk0jj72teu5n6aku3tr"}},"senderPubKey":"BLhgbOGdny7iNzyHe9axp5KWTb8sMJzad78+bc5cTYRAUqVNF6igy5t9z2jqM2Zneiw17d6xSgbokcDnVRxmuM8=","signature":"awRLFCvU4X5SVyz2IDU5rdjmKjUk3BOchmt/3bmvgi9GJJW3pat4I0i/qqROowPbVJ8nj+eZNQ5Okhgt6ezPgAE="},"actHash":"53e729d28b0c69fc66c4317fdc6ee7af292980ce781b56b502e2ee2e0b9ca48a","blkHash":"33e1d2858cec24059f22348b862a2f415a21bb14b7d96733249a12e96c542969","blkHeight":"222656","sender":"io1e2nqsyt7fkpzs5x7zf2uk0jj72teu5n6aku3tr","gasFee":"10000000000000000","timestamp":"2019-05-17T23:26:20Z"}]}` 17 | 18 | ## Transaction by address 19 | The URL is https://pharos.iotex.io/v1/actions/addr/addr?count=_num&start=_start 20 | 21 | Here's an example: https://pharos.iotex.io/v1/actions/addr/io1e2nqsyt7fkpzs5x7zf2uk0jj72teu5n6aku3tr?count=2&start=0 22 | 23 | `{"total":"2","actionInfo":[{"action":{"core":{"version":1,"nonce":"135","gasLimit":"200000","gasPrice":"2000000000000","transfer":{"amount":"18000000000000000000","recipient":"io1e2nqsyt7fkpzs5x7zf2uk0jj72teu5n6aku3tr"}},"senderPubKey":"BMG9A8WXR3flEqOP8gN+qJdyrIHe5tIEr8be5grHMjihJ/3zg719Yzh+xeIhAmsrMU0wSc8wRSjVSOqSbqioNMI=","signature":"ToTUr+uOjflIIUagaEEW7HccSt8+UJmXqbrGK2kr8vxyHbuRTjBcq/b0KrnF8JcztqDkQ+ohjJqtdXpJQH2PUAE="},"actHash":"0f4e20bdc0e91e65242eb08c5475292962bf92d3d624b2bc5ae61cd6e73e8161","blkHash":"a43825aa49a4a688f136f77bcdfcdb101d41a7c9886badff57ca5c0d605f3042","blkHeight":"216825","sender":"io17ch0jth3dxqa7w9vu05yu86mqh0n6502d92lmp","gasFee":"20000000000000000","timestamp":"2019-05-17T07:14:10Z"},{"action":{"core":{"version":1,"nonce":"1","gasLimit":"20000","gasPrice":"1000000000000","transfer":{"amount":"1000000000000000","recipient":"io1e2nqsyt7fkpzs5x7zf2uk0jj72teu5n6aku3tr"}},"senderPubKey":"BLhgbOGdny7iNzyHe9axp5KWTb8sMJzad78+bc5cTYRAUqVNF6igy5t9z2jqM2Zneiw17d6xSgbokcDnVRxmuM8=","signature":"awRLFCvU4X5SVyz2IDU5rdjmKjUk3BOchmt/3bmvgi9GJJW3pat4I0i/qqROowPbVJ8nj+eZNQ5Okhgt6ezPgAE="},"actHash":"53e729d28b0c69fc66c4317fdc6ee7af292980ce781b56b502e2ee2e0b9ca48a","blkHash":"33e1d2858cec24059f22348b862a2f415a21bb14b7d96733249a12e96c542969","blkHeight":"222656","sender":"io1e2nqsyt7fkpzs5x7zf2uk0jj72teu5n6aku3tr","gasFee":"10000000000000000","timestamp":"2019-05-17T23:26:20Z"}]}` 24 | 25 | ## Transfer in block 26 | The URL is https://pharos.iotex.io/v1/transfers/block/_blocknum 27 | 28 | Here's an example: https://pharos.iotex.io/v1/transfers/block/222669 29 | 30 | `{"total":"1","actionInfo":[{"action":{"core":{"version":1,"nonce":"2","gasLimit":"20000","gasPrice":"1000000000000","transfer":{"amount":"1000000000000000","recipient":"io1e2nqsyt7fkpzs5x7zf2uk0jj72teu5n6aku3tr"}},"senderPubKey":"BLhgbOGdny7iNzyHe9axp5KWTb8sMJzad78+bc5cTYRAUqVNF6igy5t9z2jqM2Zneiw17d6xSgbokcDnVRxmuM8=","signature":"7eIiG8ahlBUi+QUXJRQKpRpGPfi96aR3RGwWf043M7UYETaAF8FNhRN2cQutN3hsXpVSqsl373bxfbygeuv6egE="},"actHash":"fa8faa5524e5e9c7891514fbbe3c16ffd28f42bd945858533fd0b5287083faee","blkHash":"9c41f01ce090927df0e9e4669a110555f8f918f76884e16d2939354876e2d57b","blkHeight":"222669","sender":"io1e2nqsyt7fkpzs5x7zf2uk0jj72teu5n6aku3tr","timestamp":"2019-05-17T23:28:30Z"}]}` 31 | 32 | ## Blockchain metadata 33 | The URL is https://pharos.iotex.io/v1/chainmeta 34 | 35 | `{"height":"5099107","numActions":"5416087","tps":"1","epoch":{"num":"9605","height":"5098681","gravityChainStartHeight":"10158100"},"tpsFloat":0.16666667}` 36 | 37 | ## Votes by address 38 | The URL is https://pharos.iotex.io/v1/votes/addr/_address 39 | 40 | Here's an example: https://pharos.iotex.io/v1/votes/addr/io1t56twy23yjuqscljpjc869hyqw3gpswwj0g228 41 | 42 | `{"buckets":[{"candidateAddress":"io1t56twy23yjuqscljpjc869hyqw3gpswwj0g228","stakedAmount":"2000000000000000000000000","stakedDuration":7,"createTime":"2020-05-07T19:00:20Z","stakeStartTime":"2020-05-07T19:00:20Z","unstakeStartTime":"1970-01-01T00:00:00Z","autoStake":true,"owner":"io1t56twy23yjuqscljpjc869hyqw3gpswwj0g228"}]}` 43 | 44 | ## Vote by index 45 | The URL is https://pharos.iotex.io/v1/votes/index/_index 46 | 47 | Here's an example: https://pharos.iotex.io/v1/votes/index/47 48 | 49 | `{"candidateAddress":"io1t56twy23yjuqscljpjc869hyqw3gpswwj0g228","stakedAmount":"2000000000000000000000000","stakedDuration":7,"createTime":"2020-05-07T19:00:20Z","stakeStartTime":"2020-05-07T19:00:20Z","unstakeStartTime":"1970-01-01T00:00:00Z","autoStake":true,"owner":"io1t56twy23yjuqscljpjc869hyqw3gpswwj0g228"}` 50 | -------------------------------------------------------------------------------- /poll/community-poll.md: -------------------------------------------------------------------------------- 1 | # Self-serving Community Poll on IoTeX blockchain 2 | 3 | Follow the steps in this guide to create a community poll for IOTX voters. 4 | 5 | ## Step 1: Draft the poll and publish in IoTeX forum 6 | 7 | 1. Draft the poll with your favorite text editor. 8 | 9 | 2. Post a forum thread under “Ecosystem” and tag it with “delegates” and “governance”, entitled it with “[Community Poll] a great enhancement - Proposal #X”. See this [example](https://community.iotex.io/t/community-poll-self-staking-bonus-and-extend-unstaking-period-proposal-5/724). 10 | 11 | 3. Paste the content of poll to https://emn178.github.io/online-tools/keccak_256.html and generate a keccak-256 hash. **This hash would be the unique ID for the poll's content**. Post the content hash back to the forum thread. 12 | 13 | ## Step 2: Register the poll on IoTeX blockchain 14 | 15 | 1. Go to https://abi.hashex.org/, copy&paste the poll registration contract [ABI](https://github.com/iotexproject/iotex-bootstrap/blob/master/poll/poll.abi) there. 16 | 17 | 2. Select function register() from the “Function type” drop-down, and fill in the parameter. 18 | 19 | 3. bytecode will be generated in the text box at the bottom, click Copy. 20 | 21 | 4. Register the poll to the poll manager at [io17nq7vnm3wcs5a2cmhwhcnhwtwv4s6lxuv7qqj5](https://iotexscan.io/address/io17nq7vnm3wcs5a2cmhwhcnhwtwv4s6lxuv7qqj5), by running the following command: (paste the bytecode after -b). 22 | 23 | `ioctl action invoke io17nq7vnm3wcs5a2cmhwhcnhwtwv4s6lxuv7qqj5 -s {YOUR_ADDRESS} -l 3000000 --endpoint api.iotex.one:443 -b bytecode` 24 | 25 | ## Step 3: Update the poll hash in IoTeX forum 26 | 27 | 1. Post the tx hash returned above to the same forum thread. **This tx hash would be the unique ID for the poll's registration on the blockchain**. 28 | 29 | 2. Fill out the following JSON blob and post it to the same forum thread and [frontend](https://member.iotex.io/polls) will be populated. Replace **TODO** with the actual content/option of your poll. 30 | 31 | `{ 32 | "status": 1, 33 | "contractAddress": "TODO: YOUR CONTRACT ADDRESS", 34 | "title": "TODO: your proposal's title", 35 | "description": "TODO: your proposal's content in plain text or HTML", 36 | "start": "TODO: start date with timezone", 37 | "end": "TODO: end date with timezone", 38 | "proposer": "TODO: your name", 39 | "category": "General", 40 | "maxNumOfChoices": 2, // TODO: max number of choices 41 | "options": [{"id": "1", "description": "TODO"}, {"id": "2", "description": "TODO"}], 42 | "id": 5, //TODO: your proposal ID 43 | }` 44 | 45 | 3. Give it 24 hour, the poll will show up on https://member.iotex.io/polls, hooray! 46 | -------------------------------------------------------------------------------- /postmortem/2019-04-23.md: -------------------------------------------------------------------------------- 1 | --- 2 | Postmortem ID: 1 3 | Title: Accidentally Including Test Account Balances 4 | Author: Zhijie Shen 5 | Status: Mitigated 6 | Created: 2019-04-23 7 | Updated: 2019-04-23 8 | --- 9 | 10 | 11 | # Abstract 12 | 13 | When launching mainnet alpha, we created the genesis states, which have included 27 test accounts and they totally have 2.7 Billion IOTX tokens. We have burned all those tokens into the all-zero address (`io1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqd39ym7`) to mitigate the issue. No loss happened before the issue was mitigated. 14 | 15 | # Cause 16 | 17 | Software uses golang map data structure to store the initial balances in genesis, and have 27 test accounts by default. When the software loads the initial balance from the genesis yaml file, it does not overwrite the map, but append additional data to it. Therefore, these 27 test accounts which holds 2.7 Billion IOTX tokens were accidentally be set to the blockchain. 18 | 19 | # Solution 20 | 21 | `io1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqd39ym7` decodes to the all-zero address, and nobody holds the key for this address. We sentc all the balances on these 27 test accounts into this all-zero address. Therefore, 2.7 Billion additional IOTX tokens were cryptographically burned. 22 | 23 | # Impact 24 | 25 | The problem was identified, and mitigated before people steal tokens from the test accounts, so that there was no economic damage happened. The transfer actions that we burned these extra tokens will be permanently recorded on the blockchain. 26 | 27 | # Activities 28 | 29 | - 2019-04-23 08:30 PDT: the test accounts were found 30 | - 2019-04-23 09:00 PDT: the root cause was identified 31 | - 2019-04-23 09:10 PDT: API endpoints were shutdown and tube was shutdown 32 | - 2019-04-23 10:00 PDT: the test accounts were audited and there was no loss 33 | - 2019-04-23 10:20 PDT: burned all balances into the all-zero address 34 | - 2019-04-23 11:00 PDT: verified all test account balances are cleared 35 | - 2019-04-23 12:00 PDT: re-enable API endpoints and tube 36 | 37 | # What Went Well 38 | 39 | - This issue has been identified and throughly fixed within a few hours after reporting. We also validated all testing private keys within the repo and found no coins associated. 40 | - The communication of the core members was effective. 41 | 42 | # Follow-ups 43 | 44 | - Bookkeep the total tokens minted on the blockchain 45 | - Development a tool/service for monitoring the total number of coins by scanning all accounts on IoTeX blockchain 46 | - Fix the genesis initial balance data structure to overwrite instead of append 47 | https://github.com/iotexproject/iotex-core/pull/1079 48 | - Exclude `io1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqd39ym7` from being an action initiator 49 | https://crypto.stackexchange.com/questions/47809/why-havent-any-sha-256-collisions-been-found-yet 50 | 51 | # Appendix 52 | ## Action hashes for burning extra coins. 53 | ``` 54 | ef8a45ee8b1044e17eb68c27f8d10040a8952ad9d181aabc9df0f6fdd84926e2 55 | 7a93542b1c6e479e6ec2e9fcf88449f2f3505effc8d06fa56cda2b718f076304 56 | c51f6fc3df74b68f55274e12a156882e148ca4d72d5002c359e4f15ae1073e5b 57 | 7ed0639ab6e1b4d7890cd25fe5d2da511cd60f968f6dd9bc72a485b2f00037b0 58 | d6d85c00f8566af14418e156e27595e269aa696cc8d9ccd6e45391a9a6b65169 59 | 983bcf77fd72a50f39759986138cd67a4f5a5ed5b940ccfc75c5a890247d271f 60 | 5bb51aadb65902c54c3d50d33dfca2cd17358b09cf32f7f4069a4772aceebd0b 61 | a0e221c81e142b3072dbd83e11316477b0c7e8d440dd8ccbe144b5b5e317504e 62 | e6a25347fbff1c0b16dd872f9df643bbf948fe96bb1a3066ef876fc5ea2558a2 63 | 41066bdf120897b6a7a154f99b8c9393240de27fcc3e5557ec4579bca0c97ea4 64 | 1b865f337341ba8f3a2eb8654af71978d9ada3625810b49136f8585aa851dd54 65 | 368a6cc7433a3c2e6c65bdadecdc1775007450a702883bb3bb8cd3c730f23d8f 66 | 2c5f02c2df6d29493eafb0854260babd99a5677f81f53553633ae3db3bb96808 67 | 7e53c002058411411ebf6035aa9b977626b7fdfad86e3df4b30025b69be6624b 68 | cb20b5c6780dec4f0943d3fb13d43f80d99f1f0ca1e874ea299c9d8d338ceade 69 | 48ee191f856901523081fe6e8c8ab8cb2e5b5a6ebfc83f6e7de1f12846377ccf 70 | 7bb347d0d90b2daadff2c860ac60e7c381bece9effd3692d9fe2dc2bd6e7889d 71 | c6f2e9258ec6b4d2662a8cbfb51eff4bf03da9cbd514cd8d8a70150c8ffe572c 72 | 4dd6fdd47225d75fb5d5d2088939b1d773b41ffdc76c9119b0677f2491030ef4 73 | 10341506b6a783ff5e4785ae743c5d2a0565ac61f0328fb30ddcc29adfbd594c 74 | 86862ccc20942fcc3dbc89aa80b8fba61df6170bba236105982bb4acfaf558ca 75 | 7ea37b5c6b06ea6ae7afd9a936bbeede8a298bd061c9f463a2e4fcb943dd644f 76 | 65c97b6b5be86460a19e2a43119593aa07ca700f31bd95fba8018367b58c1403 77 | 139b584ff000003d0f672379fbc8981cb86adf8ab44452f7c6e27f329a0c0ddf 78 | f3e3d2cb9b059a0e6fdd772b5e0a877493287a139a4b7cf292d5db536c5d2832 79 | 2817777d144239ee42de814ce7742285c30fc2b77f09ae94ae280461e407fefc 80 | 6614c4a6ec06feb6b8c4a67ca5970c6cf92159cc999dbba5ee6ee11a51ea8863 81 | 9ad79279f6e9c63a877c392f697bb232c84999b567015be8d0c8cad4e0905f1c 82 | ``` 83 | -------------------------------------------------------------------------------- /postmortem/2019-06-11.md: -------------------------------------------------------------------------------- 1 | --- 2 | Postmortem ID: 6 3 | Title: Double execution gas before Pacific 4 | Author: Yutong Pei 5 | Status: Mitigated 6 | Created: 2020-07-15 7 | Updated: 2020-07-15 8 | --- 9 | 10 | This is a record keeping for an issue we had before 2019-06-11 on the mainnet chain. 11 | 12 | # Abstract 13 | 14 | Before Pacific height(432001), execution action pay double amout of gas, only half of the double amount go to rewarding pool, other half got burned. 15 | 16 | # Cause 17 | 18 | This was a code bug which subtract sender gas twice for execution. Only execution had this issue at that time, transfer didn't. Because in the old transfer code, this is what happened: 19 | 20 | 1. transfer protocol read out sender balance from statedb into memory as inMemSenderA 21 | 2. transfer protocol sub inMemSenderA's gas fee 22 | 3. rewarding protocol read out sender balance from statedb into memory as inMemSenderB 23 | 4. rewarding protocol sub inMemSenderB's gas fee, add gas fee to rewarding pool. Then store both in mem state to statedb. 24 | 5. transfer protocol sub inMemSenderA with transfer token amount, then store inMemSenderA to statedb which overwrote the sender state rewarding protocol had stored in previous step. 25 | 6. In the end we have sender (init balance - gas - sent amount), rewarding pool (init balance + gas) in statedb which is correct. 26 | 27 | # Solution 28 | Fixed in https://github.com/iotexproject/iotex-core/pull/1141. 29 | 30 | Deployed and activated on mainnet after Pacific height(432001) at 2019-06-11. 31 | -------------------------------------------------------------------------------- /postmortem/2019-06-25.md: -------------------------------------------------------------------------------- 1 | --- 2 | Postmortem ID: 2 3 | Title: ERC20-to-native tube: 106 swaps being mistakenly re-issued 4 | Author: Dustin 5 | Created: 2019-06-25 6 | Updated: 2019-06-25 7 | --- 8 | 9 | # Abstract 10 | 11 | 106 ERC20-to-Native swaps are sent to V2 contract and correctly serviced. However, these are mistakenly treated as swaps sent to V1 (direct transfer to safe address *0xb9071b7016d29b2672e3796a4c4f41838cbb6fc3*) and manually re-issued again. 12 | 13 | # Impact 14 | 15 | A total of 1029394.54900444 IOTX native tokens have been issued to 78 addresses. Details of these 106 swap transaction on Ethereum: http://api.etherscan.io/api?module=account&action=tokentx&address=0xb9071b7016d29b2672e3796a4c4f41838cbb6fc3&startblock=7986997&endblock=8016481&sort=asc 16 | 17 | # Root-cause 18 | 19 | V1 tube works by monitoring IOTX ERC20 token transfer to safe address *0xb9071b7016d29b2672e3796a4c4f41838cbb6fc3*, and a transfer of equal amount of IOTX native token is triggered for each new transfer. 20 | 21 | V2 tube records transfer in a smart contract, the service keeps pulling tranfser record by reading the contract. The safe address of V2 is set to the same address *0xb9071b7016d29b2672e3796a4c4f41838cbb6fc3* 22 | 23 | When reviewing the 106 transfers, Etherscan API is used to pull the data and convert to CSV file for easy review. Etherscan API used our ERC20 token contract *0x6fb3e0a217407efff7ca062d46c26e5d60a14d69* in the data field "contractAddress", causing us to mistaken them as direct transfer sent to V1, while in fact they are sent to new V2 service. 24 | 25 | # Remedies 26 | 27 | 1. V1 tube service has been turned off. We'll only review transaction upon user report. 28 | 2. We'll require a second person review before issuing manual swap. 29 | 3. The V2 service has been re-deployed with 78 addresses (and re-issue amount) added to a "credit list". Request from this list will be held off for manual review, and only amount in excess of the credit amount will be issued. 30 | 31 | # Timeline 32 | 33 | - 2019-06-18 05:52 PDT: received report that a user sent 100 IOTX-E to V1 and received 300 IOTX native token 34 | - 2019-06-18 11:36 PDT: after reviewing all V1 swap records, 2 extra issues have been identified: 35 | > fe7bcb3676aabe9a6b39cb23f3a5fa41eed7ad1b: 214 native tokens 36 | > 4fd10cc0cd952b53fbaacd11c7da9733289b3f1d:200 native tokens 37 | - 2019-06-18 12:40 PDT: code change deployed to V1 service to disable monitoring new transfer, this effectively turned off V1 service since no new record will be added to the swap DB 38 | - 2019-06-18 19:53 PDT: reviewed history of safe address *0xb9071b7016d29b2672e3796a4c4f41838cbb6fc3*. 6 new transfers are verified, manually added to DB, and issued 39 | - 2019-06-19 20:00 PDT: announced new V2 service and contract address to community 40 | - 2019-06-23 18:47 PDT: reviewed history of safe address again, 106 new transfers are identified, manaully added to DB, and mistakenly issued 41 | 42 | # What could be done better 43 | 44 | - If the history review was done earlier like on 06-20, then we would end up with less than 106 new transfers. There will still be loss but it would be much smaller. **Small frequent checkup is better than big infrequent batch job, in terms of earlier issue detection and lower the impact and loss** 45 | - Should ask for another team member review when transactions of significant amount/value are involved 46 | 47 | # Follow-ups 48 | 49 | - We should consider changing the safe address of V2 tube contract. This would eradicate the issue from happening b/c V2 transfer won't be appear in V1's safe address history 50 | - Development monitoring tool/service to keep track of the swap amount/activity on tube and raise alert if any suspicious/concerning transaction 51 | -------------------------------------------------------------------------------- /postmortem/2019-10-30.md: -------------------------------------------------------------------------------- 1 | --- 2 | Postmortem ID: 3 3 | Title: Mainnet Stuck at Height 1641780 4 | Author: Raullen 5 | Created: 2019-10-30 6 | Updated: 2019-10-30 7 | --- 8 | 9 | # Abstract 10 | 11 | In ~7am PDT of Oct. 30 2019, Mainnet stuck at height 1641780. Protocol dev quicky figured out the root cause (more than 1/3 delegates were not upgraded to 0.9.1 or 0.9.2). After notifying delegates and having them upgrading their nodes, chain operation came back round ~11am PDT of Oct. 30 2019. 12 | 13 | # Impact 14 | Chain stalled for about 4 hours and no damage has been reported so far. 15 | 16 | # Root Cause 17 | More than 1/3 delegates were not upgraded to 0.9.1 or 0.9.2 correctly: 18 | 1. They have not upgraded the binary even though IoTeX Foundation made the official announcement about 3 weeks ago. 19 | 2. They have not upgrade genesis.yaml when upgrading to 0.9.1 (or 0.9.2), i.e., `nativeStakingContractAddress: io1xpq62aw85uqzrccg9y5hnryv8ld2nkpycc3gza` is not in the genesis.yaml which causes the node's ignorance of the delegates status. `curl https://raw.githubusercontent.com/iotexproject/iotex-bootstrap/master/genesis_mainnet.yaml > $IOTEX_HOME/etc/genesis.yaml` and restart the docker address this issue. 20 | 21 | 22 | # Mitigation 23 | IoTeX Foundation outreached to these delegates and helped them to upgrade to 0.9.1/2; and the chain started to operate right after enough delegates come back online. Although there are stragllers still, the number of them is less than 1/3 of delegates. IoTeX Foundation will keep outreaching to the stragllers. 24 | 25 | After ~12 hours, all delegates have upgraded. 26 | 27 | # Next Steps 28 | **Better Communication With Delegates*** 29 | 1. Collect valid contact information from all delegates. 30 | 31 | **Easier Upgrade*** 32 | 1. Tie config/genensis yaml versions with iotex-core binary - https://github.com/iotexproject/iotex-core/issues/1585 33 | 2. Develope a cli tool to validate node status - https://github.com/iotexproject/iotex-core/issues/1590 34 | 35 | **Effective Governance*** 36 | 1. Make more status of nodes available on member.iotex.io - https://github.com/iotexproject/web-bp/issues/1391 37 | 2. Slashing of delegates who failed to produce blocks (above a threshold) and so on. The design of slashing is in progress. 38 | 3. The protocol rewards the first (perhaps) 24 delegates who upgrade. 39 | 4. More decentralized and more delegates. 40 | -------------------------------------------------------------------------------- /postmortem/2020-01-29.md: -------------------------------------------------------------------------------- 1 | --- 2 | Postmortem ID: 4 3 | Title: Mainnet native staking not present in voting total result 4 | Author: Yutong 5 | Created: 2020-1-29 6 | Updated: 2020-1-29 7 | --- 8 | 9 | # Abstract 10 | 11 | Since 01/23/2020 @ 11:53pm (UTC) epoch 6593, native stakings are not included in total votes in vote counting, only stakings on Ethereum are counted in. 12 | 13 | # Impact 14 | For each epoch, the epoch rewards are distributed to all delegates participating in this epoch's block creation, according to the percentage of their total votes. 15 | 16 | Now IoTeX staking in native contract are not counted in delegates’ total votes, this caused the percentage to be calculated inaccurately, and hence voters/delegates are not rewarded correctly for the affected epochs. 17 | 18 | # Root Cause 19 | Native staking buckets are stored in a smart contract on iotex mainnet. The gas limit to read buckets data from the contract is set to 1,000,000. 1,000,000 is enough to read out buckets data when the total number of buckets are small, but not enough when the number of buckets grows to a certain threshold. On epoch 6593, we had more than 120 buckets in contract, and with 1,000,000 gas limit we are not able to read out the buckets data at all, so we end up with read out empty data. 20 | 21 | # Timeline (PST) 22 | 01/23/2020 4AM Chain was unable to read native staking data from native staking contract 23 | 24 | 01/28/2020 11AM IoTeXLab(Simone) reached out to report that their native staking votes are not reflected in their rewards 25 | 26 | 01/28/2020 11AM Protocol dev started the investigation 27 | 28 | 01/29/2020 5PM Protocol dev identified the root cause 29 | 30 | 01/29/2020 5PM Protocol dev began working on a patch to fix the issue 31 | 32 | 01/31/2020 3PM Fix was merged in and a new version v0.10.2 was released 33 | 34 | 02/10/2020 3PM Fix takes effective on mainnet 35 | 36 | # Mitigation 37 | A new version v0.10.2 is targeting to fix the issue. In this version, the gas limit to read native staking buckets is increased to 10 times as before (10,000,000). End-to-end test which reads 1200 buckets is also introduced to cover this case, and we verified on mainnet the fix can read out staking buckets correctly. 38 | 39 | Protocol dev team is working on a tool to re-count the correct total votes (and percentage) for the affected epochs (from 6593 to when the fix takes place), and re-calculate the correct amount of rewards each delegate should have received. The difference amount will be paid to affected delegates shortly after the fix takes place. 40 | 41 | # Next Steps 42 | **Native staking with native go code *** 43 | Native implementation of staking will have a much more predictable behavior, and thanks to it’s high performance, we can also simplify logic and avoid pagination. 44 | **Better testing on edge conditions*** 45 | We thought we tested native staking pretty well, but we were wrong, we didn’t test enough. If we did test buckets with the number of pagination size, we could find the issue in first place. In future, we need to make sure we no only test end to end but also test corner to corner. 46 | -------------------------------------------------------------------------------- /release_flow.md: -------------------------------------------------------------------------------- 1 | # Release Flow 2 | This doc lists out the steps for preparing, cutting and rolling out a release 3 | of iotex-core. 4 | 5 | ## Testing release candidate 6 | 1. Cut release candidate, e.g., v1.2.1_rc1 7 | ``` 8 | git tag v1.2.1_rc1 9 | git push origin v1.2.1_rc1 10 | ``` 11 | 12 | 2. Roll out the release candidate to testnet. There are 4 clusters to upgrade: 13 | - testnet-gcp (cluster name: "gke_iotex-servers_us-west1-a_iotex-testnet-gcp") 14 | - testnet-gcp-2 (cluster name: "gke_iotex-servers_asia-east1-a_iotex-testnet-gcp-2") 15 | - testnet-london (arn:aws:eks:eu-west-2:363205959602:cluster/testnet-london) 16 | - testnet-sg (arn:aws:eks:ap-southeast-1:363205959602:cluster/testnet-sg) 17 | 18 | 3. If a release contains a hard-fork, make a release in iotex-analyser repo, 19 | like [this](https://github.com/iotexproject/iotex-analyser/releases/tag/v1.8.0-rc1), and upgrade the 20 | testnet iotex-analyser backend 21 | 22 | 4. Test the release candidate, observe all chain metrics. If a bug is found or 23 | perf improvement is needed, check-in fix to iotex-core, go back to step 1. 24 | 25 | 5. Repeat the above testing cycle until all bugs/issues are solved, and the release candidate code is 26 | running stable 27 | 28 | ## Prepare release note and instruction 29 | The following are prep work in [bootstrap](https://github.com/iotexproject/iotex-bootstrap) repo 30 | 1. Add a release note, like [this](https://github.com/iotexproject/iotex-bootstrap/blob/master/changelog/v1.2-release-note.md) 31 | 32 | 2. Make necessary change to config and genesis if needed, like [this](https://github.com/iotexproject/iotex-bootstrap/commit/e06bc1f846a6eb1cec4b852c46c411c954d51e79) 33 | 34 | 3. Update the version in README.md to the new release, and add an instruction if necessary, 35 | like [this](https://github.com/iotexproject/iotex-bootstrap/commit/bb52592f501e45b2f52bc084622f355414793df1) 36 | 37 | 4. File a PR to include all these changes, get approvals (but **do not merge yet**) 38 | 39 | ## Make the final release 40 | 1. Tag the final release candidate code by the new release version, e.g., v1.2.1, and push to iotex-core 41 | ``` 42 | git tag v1.2.1 43 | git push origin v1.2.1 44 | ``` 45 | this will automatically trigger a build of the image (for the new release tag) on dockerhub, 46 | wait about 20 minutes for the new image to be successfully built and ready 47 | 48 | 2. Merge the approved PR in bootstrap repo, and make a release same as the **new release version**, 49 | like [this](https://github.com/iotexproject/iotex-bootstrap/releases/tag/v1.2.1) 50 | 51 | 3. Make a release in iotex-core repo same as the **new release version**, 52 | like [this](https://github.com/iotexproject/iotex-core/releases/tag/v1.2.1) 53 | 54 | 4. Make a release in iotex-analyser repo same as the **new release version**, 55 | like [this](https://github.com/iotexproject/iotex-analyser/releases/tag/v1.4.1), and upgrade 56 | the mainnet iotex-analyser backend 57 | 58 | 5. Rollout the release to mainnet. There are 3 clusters to upgrade: 59 | - mainnet-gcp (cluster name: "gke_iotex-servers_us-east1-b_iotex-prod-gcp") 60 | - mainnet-gcp-2 (cluster name: "gke_iotex-servers_us-central1_iotex-prod-gcp-2") 61 | - mainnet-gcp-delegates (cluster name: "gke_iotex-servers_us-west1-a_iotex-prod-delegates") 62 | 63 | ## Rollout 64 | 1. Notify the community. Marketing team to announce in Twitter/TG/Discord/wechat/email 65 | 2. Notify all delegates. We'll ping delegate contact in group conversation 66 | 3. Notify all exchanges who run IoTeX nodes 67 | - binance 68 | - huobi 69 | - KuCoin 70 | - mxc 71 | - coinone 72 | - upbit 73 | - bittrex 74 | -------------------------------------------------------------------------------- /rollbacks/testnet-2021-05-08.md: -------------------------------------------------------------------------------- 1 | --- 2 | Rollback ID: 2 3 | Title: contract creation address incompatibility 4 | Author: Dustin Xie 5 | Rollback height: 8638993 6 | Happened: 2021-05-08 7 | --- 8 | 9 | # Abstract 10 | With release v1.2.0, testnet cannot commit block 8638994. 11 | 12 | # Root-cause 13 | v1.2.0 has a new feature "web3js compatibility", which allows our chain to 14 | process transactions sent in web3js format. 15 | 16 | To be compatible with the web3js protocol, the contract creation will need to 17 | use the sender's pending nonce (instead of confirmed nonce as in the current 18 | codebase) to calculate the new contract's address. As a result, the resulting 19 | contract's address will change. 20 | 21 | The first such transaction happened on block height 8638994, causing that block 22 | not able to be committed with v1.2.0 release code. 23 | 24 | # Solution 25 | The testnet DB was rolled-back to height 8638993. This clears all earlier 26 | incompatible transactions and after that, it continues to produce new blocks 27 | starting at height 8638994. 28 | 29 | # Impact 30 | Testnet blocks after 8638994 are cleared off the chain, no other direct impact 31 | to testnet funds, stability, etc. 32 | -------------------------------------------------------------------------------- /scripts/get_systemstat.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Define variables 4 | LSB=/usr/bin/lsb_release 5 | log=~/systemstat.log 6 | # Purpose: Display pause prompt 7 | # $1-> Message (optional) 8 | function pause(){ 9 | local message="$@" 10 | [ -z $message ] && message="Press [Enter] key to continue..." 11 | read -p "$message" readEnterKey 12 | } 13 | 14 | # Purpose - Display a menu on screen 15 | function show_menu(){ 16 | date 17 | echo "---------------------------" 18 | echo " Main Menu" 19 | echo "---------------------------" 20 | echo "1. OS and Kernel info" 21 | echo "2. Cpu info" 22 | echo "3. Network info and iperf test" 23 | echo "4. Disk info and fio test" 24 | echo "5. Free and used memory info" 25 | echo "6. exit" 26 | } 27 | 28 | # Purpose - Display header message 29 | # $1 - message 30 | function write_header(){ 31 | local h="$@" 32 | echo "---------------------------------------------------------------" 33 | echo -e "\033[31m ${h} \033[0m" 34 | echo "---------------------------------------------------------------" 35 | } 36 | 37 | # Purpose - Get info about your operating system 38 | function os_info(){ 39 | write_header " System and Kernel information " 40 | [ -x $LSB ] && $LSB -a || echo "$LSB command is not insalled (set \$LSB variable)" 41 | echo "Kernel information : $(uname -r)" 42 | 43 | #pause "Press [Enter] key to continue..." 44 | # pause 45 | } 46 | 47 | function tool_install(){ 48 | tool_name=$1 49 | tool_version=$2 50 | url=$3/${1}-${2}.tar.gz 51 | wget $url 52 | mkdir ${1}-${2} 53 | tar -xzf ${1}-${2}.tar.gz -C ${1}-${2} --strip-components 1 54 | cd ${1}-${2} && ./configure && make && sudo make install 55 | } 56 | # Purpose - Get info about host such as dns, IP, and hostname 57 | function disk_info(){ 58 | write_header " Disk information " 59 | local disks=$(df -lh|grep -v "loop\|tmpfs\|udev\|Filesystem") 60 | echo "Disk : $disks" 61 | write_header " Disk Test Iops " 62 | #echo " check tools fio exists ......" 63 | 64 | if ! type "fio" > /dev/null; then 65 | echo "Will install fio tool " 66 | pause 67 | tool_install "fio" "3.13" "https://github.com/axboe/fio/archive" > /dev/null 2>&1 68 | 69 | else 70 | echo "fio version $(fio --version)" 71 | fi 72 | local diskparts=$(df -lh|grep -v "loop\|tmpfs\|udev\|Filesystem"|awk '{print$NF}'|sed '$!N;s/\n/ "OR" /') 73 | #echo "Select disk part: $diskparts" 74 | 75 | while read -p "Select the node data partition : $diskparts ? " datanode_dir ;do 76 | 77 | local cpucore=$(lscpu|grep "^CPU(s)"|awk '{print $2}') 78 | if [[ "$diskparts" =~ "${datanode_dir}" ]]; then 79 | echo "fio test write ${datanode_dir} cpucore=$cpucore size=1G bs=16k runtime=30s : " 80 | sudo fio -filename=${datanode_dir}/fio.test -direct=1 -iodepth 1 -thread -rw=write -ioengine=psync -bs=16k -size=1G -numjobs=$cpucore -runtime=30 -group_reporting -name=write|grep 'IOPS' 81 | echo "fio test read ${datanode_dir} cpucore=$cpucore size=1G bs=16k runtime=30s :" 82 | sudo fio -filename=${datanode_dir}/fio.test -direct=1 -iodepth 1 -thread -rw=read -ioengine=psync -bs=16k -size=1G -numjobs=$cpucore -runtime=30 -group_reporting -name=write|grep 'IOPS' 83 | break; 84 | 85 | fi 86 | done 87 | pause 88 | } 89 | 90 | function net_info(){ 91 | devices=$(netstat -i | cut -d" " -f1 | egrep -v "^Kernel|Iface|lo") 92 | write_header " Network information " 93 | echo "Total network interfaces found : $(wc -w <<<${devices})" 94 | 95 | echo "*** IP Addresses Information ***" 96 | ip -4 address show 97 | 98 | echo "***********************" 99 | echo "*** Network routing ***" 100 | echo "***********************" 101 | netstat -nr 102 | 103 | echo "**************************************" 104 | echo "*** Interface traffic information ***" 105 | echo "**************************************" 106 | netstat -i 107 | 108 | echo "check iperf tool exists ......" 109 | if ! type "iperf" > /dev/null;then 110 | echo "will install iperf " 111 | pause 112 | sudo apt-get install iperf 113 | else 114 | iperf --version 115 | fi 116 | 117 | # echo "start iPerf in server open iptable port 5001" 118 | # iperf -s & 119 | # wth=$(curl ip.sb) 120 | # echo "other server as client connect iperf server: iperf -c $wth" 121 | echo "connect test iperf server us-west 18.144.21.59 " 122 | iperf -c 18.144.21.59 123 | #pause 124 | } 125 | function cpu_info(){ 126 | write_header " Cpu core and Model " 127 | lscpu |grep "Model name:\|^CPU(s)" 128 | #pause 129 | } 130 | 131 | # Purpose - Display used and free memory info 132 | function mem_info(){ 133 | write_header " Free and used memory " 134 | free -m 135 | 136 | echo "*********************************" 137 | echo "*** Virtual memory statistics ***" 138 | echo "*********************************" 139 | vmstat 140 | echo "***********************************" 141 | echo "*** Top 5 memory eating process ***" 142 | echo "***********************************" 143 | ps auxf | sort -nr -k 4 | head -5 144 | #pause 145 | } 146 | # Purpose - Get input via the keyboard and make a decision using case..esac 147 | function read_input(){ 148 | local c 149 | read -p "Enter your choice [ 1 - 6 ] " c 150 | case $c in 151 | 1) os_info ;; 152 | 2) cpu_info ;; 153 | 3) net_info ;; 154 | 4) disk_info ;; 155 | 5) mem_info ;; 156 | 6) echo "Bye!"; exit 0 ;; 157 | *) 158 | echo "Please select between 1 to 6 choice only." 159 | pause 160 | esac 161 | } 162 | 163 | # ignore CTRL+C, CTRL+Z and quit singles using the trap 164 | trap '' SIGINT SIGQUIT SIGTSTP 165 | 166 | os_info |tee $log 167 | cpu_info | tee -a $log 168 | mem_info | tee -a $log 169 | disk_info | tee -a $log 170 | net_info | tee -a $log 171 | 172 | write_header " Please send us the log file $log !!!! " 173 | pause 174 | # main logic 175 | #while true 176 | #do 177 | # clear 178 | # show_menu # display memu 179 | # read_input # wait for user input 180 | #done 181 | -------------------------------------------------------------------------------- /scripts/setup_fullnode_marketplace.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ## User local: source/bash/sh 3 | ## If remote: source/bash/sh <(curl -s https://raw.githubusercontent.com/iotexproject/iotex-bootstrap/master/scripts/setup_fullnode.sh) 4 | 5 | # Colour codes 6 | YELLOW='\033[0;33m' 7 | RED='\033[0;31m' 8 | NC='\033[0m' # No Color 9 | 10 | pushd () { 11 | command pushd "$@" > /dev/null 12 | } 13 | 14 | popd () { 15 | command popd "$@" > /dev/null 16 | } 17 | 18 | function sedCheck() { 19 | sed --version > /dev/null 2>&1 20 | if [ $? -eq 0 ];then 21 | sed --version|grep 'GNU sed' > /dev/null 2>&1 22 | if [ $? -eq 0 ];then 23 | SED_IS_GNU=1 24 | fi 25 | fi 26 | } 27 | 28 | function checkDockerPermissions() { 29 | docker ps > /dev/null 2>&1 30 | if [ $? = 1 ];then 31 | echo -e "your $RED [$USER] $NC not privilege docker" 32 | echo -e "please run $RED [sudo bash] $NC first" 33 | echo -e "Or docker not install " 34 | exit 1 35 | fi 36 | } 37 | 38 | function checkDockerCompose() { 39 | docker-compose --version > /dev/null 2>&1 40 | if [ $? -eq 127 ];then 41 | echo -e "$RED docker-compose command not found $NC" 42 | echo -e "Please install it first" 43 | exit 1 44 | fi 45 | } 46 | 47 | function setVar() { 48 | producerPrivKey="" 49 | externalHost="" 50 | defaultdatadir="$HOME/iotex-var" 51 | IOTEX_IMAGE=363205959602.dkr.ecr.us-east-1.amazonaws.com/iotex-core:latest 52 | } 53 | 54 | function determinIotexHome() { 55 | ##Input Data Dir 56 | echo "The current user of the input directory must have write permission!!!" 57 | echo -e "${RED} If Upgrade ; input your old directory \$IOTEX_HOME !!! ${NC}" 58 | 59 | #while True: do 60 | read -p "Input your \$IOTEX_HOME [e.g., $defaultdatadir]: " inputdir 61 | IOTEX_HOME=${inputdir:-"$defaultdatadir"} 62 | IOTEX_MONITOR_HOME=$IOTEX_HOME/monitor 63 | } 64 | 65 | function preDockerCompose() { 66 | # set monitor home 67 | mkdir -p $IOTEX_MONITOR_HOME 68 | 69 | export IOTEX_HOME IOTEX_MONITOR_HOME IOTEX_IMAGE 70 | 71 | curl -Ss https://raw.githubusercontent.com/iotexproject/iotex-bootstrap/master/monitor/docker-compose.yml.marketplace > $IOTEX_MONITOR_HOME/docker-compose.yml 72 | curl -Ss https://raw.githubusercontent.com/iotexproject/iotex-bootstrap/master/monitor/.env > $IOTEX_MONITOR_HOME/.env 73 | } 74 | 75 | function determineExtIp() { 76 | findip=$(curl -Ss ip.sb) 77 | read -p "SET YOUR EXTERNAL IP HERE [$findip]: " inputip 78 | ip=${inputip:-$findip} 79 | externalHost="externalHost: $ip" 80 | } 81 | 82 | function determinPrivKey() { 83 | echo "If you are a delegate, make sure producerPrivKey is the key for the operator address you have registered." 84 | echo "SET YOUR PRIVATE KEY HERE(e.g., 96f0aa5e8523d6a28dc35c927274be4e931e74eaa720b418735debfcbfe712b8)" 85 | read -p ": " inputkey 86 | privKey=${inputkey:-"96f0aa5e8523d6a28dc35c927274be4e931e74eaa720b418735debfcbfe712b8"} 87 | producerPrivKey="producerPrivKey: $privKey" 88 | } 89 | 90 | function downloadConfig() { 91 | echo "download new config" 92 | curl -Ss https://raw.githubusercontent.com/iotexproject/iotex-bootstrap/v1.1.1/config_mainnet.yaml > $IOTEX_HOME/etc/config.yaml 93 | curl -Ss https://raw.githubusercontent.com/iotexproject/iotex-bootstrap/v1.1.1/genesis_mainnet.yaml > $IOTEX_HOME/etc/genesis.yaml 94 | # https://raw.githubusercontent.com/iotexproject/iotex-bootstrap/v0.9.2/config_mainnet.yaml 95 | 96 | SED_IS_GNU=0 97 | sedCheck 98 | echo "Update your externalHost,producerPrivKey to config.yaml" 99 | if [ $SED_IS_GNU -eq 1 ];then 100 | sed -i "/^network:/a\ \ $externalHost" $IOTEX_HOME/etc/config.yaml 101 | sed -i "/^chain:/a\ \ $producerPrivKey" $IOTEX_HOME/etc/config.yaml 102 | else 103 | sed -i '' "/^network:/a\ 104 | \ \ $externalHost 105 | " $IOTEX_HOME/etc/config.yaml 106 | sed -i '' "/^chain:/a\ 107 | \ \ $producerPrivKey 108 | " $IOTEX_HOME/etc/config.yaml 109 | fi 110 | } 111 | 112 | function donwloadBlockDataFile() { 113 | NODE_GATEWAY_MAINNET_DATA_URL=https://t.iotex.me/mainnet-data-with-idx-latest 114 | 115 | SAVE_DIR=$IOTEX_HOME/tmp 116 | mkdir -p $SAVE_DIR 117 | DATA_FILE_PATH=$SAVE_DIR/data.tar.gz 118 | 119 | UNZIP_FILE_CMD="tar xvf $SAVE_DIR/data.tar.gz -C $IOTEX_HOME" 120 | 121 | echo -e "${YELLOW} Downloading the db file from a snapshot...${NC}" 122 | curl -sSL $NODE_GATEWAY_MAINNET_DATA_URL > $DATA_FILE_PATH 123 | echo -e "${YELLOW} Unzipping...${NC}" 124 | $UNZIP_FILE_CMD 125 | echo -e "${YELLOW} Done.${NC}" 126 | } 127 | 128 | function startup() { 129 | echo -e "Start iotex-server." 130 | pushd $IOTEX_MONITOR_HOME 131 | docker-compose up -d iotex 132 | popd 133 | } 134 | 135 | function startupNode() { 136 | startup 137 | #check node running 138 | sleep 5 139 | pushd $IOTEX_MONITOR_HOME 140 | docker-compose ps iotex 141 | popd 142 | } 143 | 144 | function main() { 145 | # Check and clean 146 | checkDockerPermissions # Determine the current user can run docker 147 | checkDockerCompose # Determin the docker-compose is installed 148 | setVar # Set global variable 149 | 150 | determinIotexHome # Determine the $IOTEX_HOME 151 | determineExtIp 152 | determinPrivKey 153 | 154 | echo -e "${YELLOW} ****** Install Iotex Node ***** ${NC}" 155 | echo -e "${YELLOW} if installed, Confirm Input IOTEX_HOME directory $IOTEX_HOME True ${NC};" 156 | read -p "[Ctrl + c exit!]; else Enter anykey ..." anykey 157 | 158 | mkdir -p ${IOTEX_HOME} 159 | pushd ${IOTEX_HOME} 160 | mkdir data log etc > /dev/null 2>&1 161 | popd 162 | 163 | wantdownload=N 164 | read -p "Do you prefer to start from a snapshot, Download the db file. [Y/N] (Default: N)? " wantdownload 165 | if [ "${wantdownload}X" = "YX" ] || [ "${wantdownload}X" = "yX" ];then 166 | # Download db file 167 | donwloadBlockDataFile 168 | fi 169 | 170 | echo -e "Confirm your externalHost: ${YELLOW} $ip ${NC}" 171 | echo -e "Confirm your producerPrivKey: ${RED} $privKey ${NC}" 172 | read -p "Press any key to continue ... [Ctrl + c exit!] " key2 173 | 174 | echo "docker pull iotex-core" 175 | docker pull $IOTEX_IMAGE 176 | # or use gcr.io/iotex-servers/iotex-core:${version} 177 | #Set the environment with the following commands: 178 | 179 | downloadConfig 180 | preDockerCompose 181 | 182 | startupNode 183 | } 184 | 185 | main $@ 186 | -------------------------------------------------------------------------------- /scripts/setup_monitor_alert.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ##Setup monitor alert 3 | ## User local: source/bash/sh $0 4 | ## If remote: source/bash/sh <(curl -s https://raw.githubusercontent.com/iotexproject/iotex-bootstrap/master/scripts/setup_monitor_alert.sh) 5 | 6 | # Colour codes 7 | YELLOW='\033[0;33m' 8 | RED='\033[0;31m' 9 | NC='\033[0m' # No Color 10 | 11 | DOCKER_CMD="docker" 12 | DOCKER_PS_CMD="$DOCKER_CMD ps -a" 13 | DOCKER_KILL="$DOCKER_CMD kill" 14 | DOCKER_RM="$DOCKER_CMD rm" 15 | DOCKER_RUN_CMD="$DOCKER_CMD run" 16 | NAME="alert" 17 | 18 | function checkDockerPermissions() { 19 | docker ps > /dev/null 20 | if [ $? = 1 ];then 21 | echo -e "your $RED [$USER] $NC not privilege docker" 22 | echo -e "please run $RED [sudo bash] $NC first" 23 | echo -e "Or docker not install " 24 | exit 1 25 | fi 26 | } 27 | 28 | function checkDockerCompose() { 29 | docker-compose --version > /dev/null 2>&1 30 | if [ $? -eq 127 ];then 31 | echo -e "$RED docker-compose command not found $NC" 32 | echo -e "Please install it first" 33 | exit 1 34 | fi 35 | } 36 | 37 | function check-runing() { 38 | $DOCKER_PS_CMD | grep $NAME > /dev/null 2>&1 39 | if [ $? -eq 0 ];then 40 | echo -e "${RED} alert server is running ${NC}" 41 | read -p "[Ctrl + c exit!]; Enter any key to stop it." anykey 42 | echo "Stopping..." 43 | stop 44 | read -p "[Ctrl + c exit!]; Enter any key to continue the setup." anykey 45 | fi 46 | } 47 | 48 | function stop() { 49 | $DOCKER_KILL $NAME > /dev/null 2>&1 50 | } 51 | 52 | function clean() { 53 | $DOCKER_RM $NAME > /dev/null 2>&1 54 | } 55 | 56 | function set-var() { 57 | HOSTNAME=$(hostname) 58 | MKDIR="mkdir -p" 59 | 60 | IOTEX_ALERT_HOME="$IOTEX_HOME/alert" 61 | MONITOR_CONTAINER="iotex-monitor" 62 | ALERTMANAGER_IMAGE="prom/alertmanager" 63 | 64 | IOTEX_PROM_CONGIF_FILE="$IOTEX_HOME/monitor/prometheus.yml" 65 | IOTEX_PROM_RULE_FILE="$IOTEX_HOME/monitor/alert.rules" 66 | 67 | DOCKER_RUN_OPTS="-d --restart on-failure --name $NAME -v ${IOTEX_ALERT_HOME}:/alertmanager -p 9093:9093" 68 | ALERT_PARAMS="--config.file=/alertmanager/etc/alertmanager.yml --storage.path=/alertmanager" 69 | } 70 | 71 | function check-monitor() { 72 | $DOCKER_PS_CMD | grep $MONITOR_CONTAINER > /dev/null 73 | if [ $? -ne 0 ];then 74 | echo -e "${RED} Your monitor $MONITOR_CONTAINER is not running or created.${NC}" 75 | exit 1 76 | fi 77 | } 78 | 79 | function make-workspace() { 80 | $MKDIR ${IOTEX_ALERT_HOME}/{etc,template} 81 | chmod o+w ${IOTEX_ALERT_HOME} -R 82 | } 83 | 84 | function download-files() { 85 | curl -Ss https://raw.githubusercontent.com/iotexproject/iotex-bootstrap/master/alert/alertmanager.yml.tmpl > $IOTEX_ALERT_HOME/etc/alertmanager.yml.tmpl || exit 1 86 | curl -Ss https://raw.githubusercontent.com/iotexproject/iotex-bootstrap/master/monitor/alert.rules > $IOTEX_HOME/monitor/alert.rules || exit 1 87 | curl -Ss https://raw.githubusercontent.com/prometheus/alertmanager/master/template/default.tmpl > $IOTEX_ALERT_HOME/template/default.tmpl || exit 1 88 | curl -Ss https://raw.githubusercontent.com/prometheus/alertmanager/master/template/email.html > $IOTEX_ALERT_HOME/template/email.html || exit 1 89 | } 90 | 91 | function setup-config() { 92 | sed -e "s/_SMTP_HOST_/$USER_EMAIL_HOST/" \ 93 | -e "s/_SMTP_PORT_/$USER_EMAIL_PORT/" \ 94 | -e "s/_EMAIL_/$USER_EMAIL_NAME/" \ 95 | -e "s/_PASSWORD_/$USER_EMAIL_PASS/" \ 96 | $IOTEX_ALERT_HOME/etc/alertmanager.yml.tmpl > $IOTEX_ALERT_HOME/etc/alertmanager.yml 97 | } 98 | 99 | function startup() { 100 | $DOCKER_PS_CMD | grep $NAME > /dev/null 2>&1 101 | if [ $? -eq 0 ];then 102 | stop 103 | clean 104 | fi 105 | 106 | $DOCKER_RUN_CMD $DOCKER_RUN_OPTS \ 107 | $ALERTMANAGER_IMAGE \ 108 | $ALERT_PARAMS 109 | } 110 | 111 | function add-alert() { 112 | echo -e "${YELLOW} Now, The settings will change the monitor server's configuration file ${NC}" 113 | echo -e "${YELLOW} and add the address of the link alert service. ${NC}" 114 | echo -e "${YELLOE} Please enter the address to connect to this service from the monitor server ${NC}" 115 | read -p "The host of this alert server [ Default is hostname $HOSTNAME ]:" alertserver 116 | alert=${alertserver:-"$HOSTNAME"} 117 | if [ -f $IOTEX_PROM_CONGIF_FILE ]; then 118 | grep 'alerting' $IOTEX_PROM_CONGIF_FILE > /dev/null 2>&1 119 | if [ $? -ne 0 ];then 120 | echo ' 121 | 122 | alerting: 123 | alertmanagers: 124 | - scheme: http 125 | static_configs: 126 | - targets: 127 | - "'$alert':9093" 128 | 129 | rule_files: 130 | - "alert.rules" 131 | ' >> $IOTEX_PROM_CONGIF_FILE 132 | fi 133 | else 134 | echo -e "${RED} There is no prometheus.yml file ${NC}" 135 | echo -e "${RED} You need to setup the monitor server first ${NC}" 136 | exit 1 137 | fi 138 | } 139 | 140 | function restart-monitor () { 141 | echo -e "${YELLOW} Need restart monitor ${NC}" 142 | echo -e "${YELLOW} Monitor server is restarting... ${NC}" 143 | $DOCKER_CMD restart $MONITOR_CONTAINER || exit 1 144 | } 145 | 146 | function main() { 147 | checkDockerPermissions 148 | checkDockerCompose 149 | 150 | check-runing 151 | 152 | defaultdatadir="$HOME/iotex-var" 153 | read -p "Input your \$IOTEX_HOME [e.g., $defaultdatadir]: " inputdir 154 | IOTEX_HOME=${inputdir:-"$defaultdatadir"} 155 | 156 | while : 157 | do 158 | read -p "[Ctrl + c exit!]; else input email smtp host:" emailhost 159 | if [ -x $emailhost ];then 160 | echo -e "${YELLOW} Email smtp host must be set." 161 | else 162 | break 163 | fi 164 | done 165 | 166 | read -p "[Ctrl + c exit!]; else input email smtp port [ Default is 587 ]:" emailport 167 | 168 | while : 169 | do 170 | read -p "[Ctrl + c exit!]; else input email user name:" username 171 | if [ -x $username ];then 172 | echo -e "${YELLOW} Email user name must be set." 173 | else 174 | break 175 | fi 176 | done 177 | 178 | while : 179 | do 180 | echo "[Ctrl + c exit!]; else input email user password:" 181 | read -s userpass 182 | if [ -x $userpass ];then 183 | echo -e "${YELLOW} Email user password must be set." 184 | else 185 | break 186 | fi 187 | done 188 | 189 | USER_EMAIL_HOST=${emailhost} 190 | USER_EMAIL_PORT=${emailport:-"587"} 191 | USER_EMAIL_NAME=${username} 192 | USER_EMAIL_PASS=${userpass} 193 | 194 | set-var 195 | 196 | check-monitor 197 | 198 | make-workspace 199 | 200 | download-files 201 | 202 | setup-config 203 | 204 | startup 205 | 206 | add-alert 207 | 208 | restart-monitor 209 | 210 | echo -e "${YELLOW} Alert server is running ${NC}" 211 | echo -e "${YELLOW} You can visit http://localhost:9090/alerts to view alerts. ${NC}" 212 | } 213 | 214 | main 215 | -------------------------------------------------------------------------------- /scripts/stop_fullnode.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ## User local: source/bash/sh [$0] 3 | ## If remote: source/bash/sh <(curl -s https://raw.githubusercontent.com/iotexproject/iotex-bootstrap/master/scripts/stop_fullnode.sh) 4 | 5 | # Colour codes 6 | YELLOW='\033[0;33m' 7 | RED='\033[0;31m' 8 | NC='\033[0m' # No Color 9 | 10 | pushd () { 11 | command pushd "$@" > /dev/null 12 | } 13 | 14 | popd () { 15 | command popd "$@" > /dev/null 16 | } 17 | 18 | function checkDockerPermissions() { 19 | docker ps > /dev/null 20 | if [ $? = 1 ];then 21 | echo -e "your $RED [$USER] $NC not privilege docker" 22 | echo -e "please run $RED [sudo bash] $NC first" 23 | echo -e "Or docker not install " 24 | exit 1 25 | fi 26 | } 27 | 28 | function checkDockerCompose() { 29 | docker-compose --version > /dev/null 2>&1 30 | if [ $? -eq 127 ];then 31 | echo -e "$RED docker-compose command not found $NC" 32 | echo -e "Please install it first" 33 | exit 1 34 | fi 35 | } 36 | 37 | function setVar() { 38 | defaultdatadir="$HOME/iotex-var" 39 | } 40 | 41 | 42 | function determinIotexHome() { 43 | ##Input Data Dir 44 | echo "The current user of the input directory must have write permission!!!" 45 | echo -e "${RED} Input your directory \$IOTEX_HOME !!! ${NC}" 46 | 47 | #while True: do 48 | read -p "Input your \$IOTEX_HOME [e.g., $defaultdatadir]: " inputdir 49 | IOTEX_HOME=${inputdir:-"$defaultdatadir"} 50 | } 51 | 52 | function confirmEnvironmentVariable() { 53 | echo -e "Confirm version: ${RED} ${version} ${NC}" 54 | echo -e "Confirm IOTEX_HOME directory: ${RED} ${IOTEX_HOME} ${NC}" 55 | read -p "Press any key to continue ... [Ctrl + c exit!] " key1 56 | } 57 | 58 | function stopNode() { 59 | echo -e "${YELLOW}Stopping iotex-server.${NC}" 60 | pushd $IOTEX_HOME/monitor 61 | docker-compose stop 62 | 63 | # stop auto-updatem, if it is running. 64 | ps -ef | grep "$IOTEX_HOME/bin/auto-update" > /dev/null 65 | if [ $? -eq 0 ];then 66 | echo -e "${YELLOW} stopping auto-update service... ${NC}" 67 | pid=$(ps -ef | grep "$IOTEX_HOME/bin/auto-update" | grep -v grep | awk '{print $2}') 68 | kill -9 $pid 69 | echo -e "${YELLOW} auto-update stopped.${NC}" 70 | fi 71 | popd 72 | echo -e "${YELLOW}Iotex-server. stopped.${NC}" 73 | } 74 | 75 | 76 | function main() { 77 | checkDockerPermissions 78 | checkDockerCompose 79 | 80 | setVar 81 | determinIotexHome 82 | confirmEnvironmentVariable 83 | 84 | stopNode 85 | } 86 | 87 | main 88 | -------------------------------------------------------------------------------- /scripts/update_silence.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ## Upgrade Iotex MainNet / TestNet Silence none params 3 | 4 | # Colour codes 5 | YELLOW='\033[0;33m' 6 | RED='\033[0;31m' 7 | NC='\033[0m' # No Color 8 | 9 | 10 | # set it in run auto-update 11 | #echo -e "ENV IOTEX_HOME must be set." 12 | [ $IOTEX_HOME ] || exit 2 13 | #echo -e "ENV _ENV_ must be set." 14 | [ $_ENV_ ] || exit 2 15 | #echo -e "ENV _GREP_STRING_ must be set." 16 | [ $_GREP_STRING_ ] || exit 2 17 | 18 | pushd () { 19 | command pushd "$@" > /dev/null 20 | } 21 | 22 | popd () { 23 | command popd "$@" > /dev/null 24 | } 25 | 26 | function sedCheck() { 27 | sed --version > /dev/null 2>&1 28 | if [ $? -eq 0 ];then 29 | sed --version|grep 'GNU sed' > /dev/null 2>&1 30 | if [ $? -eq 0 ];then 31 | SED_IS_GNU=1 32 | fi 33 | fi 34 | } 35 | 36 | function checkDockerPermissions() { 37 | docker ps > /dev/null 38 | if [ $? = 1 ];then 39 | echo -e "your $RED [$USER] $NC not privilege docker" 40 | echo -e "please run $RED [sudo bash] $NC first" 41 | echo -e "Or docker not install " 42 | exit 1 43 | fi 44 | } 45 | 46 | function checkDockerCompose() { 47 | docker-compose --version > /dev/null 2>&1 48 | if [ $? -eq 127 ];then 49 | echo -e "$RED docker-compose command not found $NC" 50 | echo -e "Please install it first" 51 | exit 1 52 | fi 53 | } 54 | 55 | function setVar() { 56 | IOTEX_MONITOR_HOME=$IOTEX_HOME/monitor 57 | 58 | producerPrivKey="" 59 | externalHost="" 60 | } 61 | 62 | function isNotRunning() { 63 | pushd $IOTEX_MONITOR_HOME 64 | docker-compose ps iotex 65 | if [ $? -eq 0 ];then 66 | return 0 67 | fi 68 | popd 69 | return 1 70 | } 71 | 72 | function cleanOldVersion() { 73 | echo -e "${YELLOW} ****** Upgrade IoTeX Node ******* ${NC}" 74 | echo -e "${YELLOW} *** Will stop, delete old iotex container; ${NC}" 75 | echo -e "${YELLOW} *** download new config and recover your externalHost producerPrivKey ${NC}" 76 | echo "Stop old iotex-core" 77 | docker stop iotex 78 | echo "delete old iotex docker container" 79 | docker rm iotex 80 | producerPrivKey=$(grep '^ producerPrivKey:' ${IOTEX_HOME}/etc/config.yaml|sed 's/^ //g') 81 | externalHost=$(grep '^ externalHost:' ${IOTEX_HOME}/etc/config.yaml|sed 's/^ //g') 82 | } 83 | 84 | function downloadConfig() { 85 | #(Optional) If you prefer to start from a snapshot, run the following commands: 86 | #curl -LSs https://t.iotex.me/${env}-data-latest > $IOTEX_HOME/data.tar.gz 87 | #cd ${IOTEX_HOME} && tar -xzf data.tar.gz 88 | echo "download new config" 89 | curl -Ss --connect-timeout 10 \ 90 | --max-time 10 \ 91 | --retry 10 \ 92 | --retry-delay 0 \ 93 | --retry-max-time 40 \ 94 | https://raw.githubusercontent.com/iotexproject/iotex-bootstrap/${version}/config_${_ENV_}.yaml > $IOTEX_HOME/etc/config.yaml 95 | 96 | response=$? 97 | if test "$response" != "0"; then 98 | echo -e "${RED} Download of default configuration failed with: $response" 99 | exit 1 100 | fi 101 | 102 | curl -Ss --connect-timeout 10 \ 103 | --max-time 10 \ 104 | --retry 10 \ 105 | --retry-delay 0 \ 106 | --retry-max-time 40 \ 107 | https://raw.githubusercontent.com/iotexproject/iotex-bootstrap/${version}/genesis_${_ENV_}.yaml > $IOTEX_HOME/etc/genesis.yaml 108 | 109 | response=$? 110 | if test "$response" != "0"; then 111 | echo -e "${RED} Download of genesis configuration failed with: $response" 112 | exit 1 113 | fi 114 | # https://raw.githubusercontent.com/iotexproject/iotex-bootstrap/v0.9.2/config_mainnet.yaml 115 | 116 | SED_IS_GNU=0 117 | sedCheck 118 | echo "Update your externalHost,producerPrivKey to config.yaml" 119 | if [ $SED_IS_GNU -eq 1 ];then 120 | sed -i "/^network:/a\ \ $externalHost" $IOTEX_HOME/etc/config.yaml 121 | sed -i "/^chain:/a\ \ $producerPrivKey" $IOTEX_HOME/etc/config.yaml 122 | else 123 | sed -i '' "/^network:/a\ 124 | \ \ $externalHost 125 | " $IOTEX_HOME/etc/config.yaml 126 | sed -i '' "/^chain:/a\ 127 | \ \ $producerPrivKey 128 | " $IOTEX_HOME/etc/config.yaml 129 | fi 130 | } 131 | 132 | function startup() { 133 | echo -e "Start iotex-server." 134 | pushd $IOTEX_MONITOR_HOME 135 | docker-compose up -d iotex 136 | popd 137 | } 138 | 139 | function startupNode() { 140 | startup 141 | #check node running 142 | sleep 5 143 | pushd $IOTEX_MONITOR_HOME 144 | docker-compose ps iotex 145 | popd 146 | } 147 | 148 | function main() { 149 | checkDockerPermissions 150 | checkDockerCompose 151 | 152 | setVar 153 | 154 | # Not running, not update. 155 | isNotRunning || exit 0 156 | 157 | version=$(curl -sS https://raw.githubusercontent.com/iotexproject/iotex-bootstrap/master/README.md|grep "^- $_GREP_STRING_:"|awk '{print $3}') 158 | 159 | echo -e "Current operating environment: ${YELLOW} $env ${NC}" 160 | 161 | runversion=$(docker ps -a |grep "iotex/iotex-core:v"|awk '{print$2}'|awk -F'[:]' '{print$2}') 162 | 163 | if [ "$version"X = "$runversion"X ];then 164 | echo -e "${YELLOW} Current running version is latest. Don't need update. ${NC}" 165 | exit 0 166 | fi 167 | 168 | echo -e "${YELLOW} Current runing version ( $runversion ) need update ( latest $version ), ${NC}" 169 | 170 | cleanOldVersion 171 | 172 | IOTEX_IMAGE=iotex/iotex-core:${version} 173 | export IOTEX_IMAGE 174 | 175 | echo "docker pull iotex-core ${version}" 176 | docker pull $IOTEX_IMAGE 177 | 178 | downloadConfig 179 | 180 | startupNode 181 | } 182 | 183 | main 184 | -------------------------------------------------------------------------------- /tools/auto-update/Makefile: -------------------------------------------------------------------------------- 1 | default: build 2 | 3 | build: ## Build static 4 | GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -ldflags "-extldflags '-static'" -o auto-update_linux-amd64 main.go 5 | GOOS=darwin GOARCH=amd64 CGO_ENABLED=0 go build -ldflags "-extldflags '-static'" -o auto-update_darwin-amd64 main.go 6 | CGO_ENABLED=0 go build -ldflags "-extldflags '-static'" -o auto-update main.go 7 | -------------------------------------------------------------------------------- /tools/auto-update/README.md: -------------------------------------------------------------------------------- 1 | # Auto Update 2 | Useage: 3 | 4 | ./auto-update -------------------------------------------------------------------------------- /tools/auto-update/auto-update: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iotexproject/iotex-bootstrap/b27aef5305b38c4af2cebe9df5d6703fc8498289/tools/auto-update/auto-update -------------------------------------------------------------------------------- /tools/auto-update/auto-update_darwin-amd64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iotexproject/iotex-bootstrap/b27aef5305b38c4af2cebe9df5d6703fc8498289/tools/auto-update/auto-update_darwin-amd64 -------------------------------------------------------------------------------- /tools/auto-update/auto-update_linux-amd64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iotexproject/iotex-bootstrap/b27aef5305b38c4af2cebe9df5d6703fc8498289/tools/auto-update/auto-update_linux-amd64 -------------------------------------------------------------------------------- /tools/auto-update/go.mod: -------------------------------------------------------------------------------- 1 | module github.com/iotexproject/iotex-bootstrap/tools/auto-update 2 | 3 | go 1.13 4 | 5 | require github.com/jasonlvhit/gocron v0.0.0-20191228163020-98b59b546dee 6 | -------------------------------------------------------------------------------- /tools/auto-update/go.sum: -------------------------------------------------------------------------------- 1 | github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= 2 | github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= 3 | github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= 4 | github.com/go-redis/redis v6.15.5+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8wamY7mA7PouImQ2Jvg6kA= 5 | github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= 6 | github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= 7 | github.com/jasonlvhit/gocron v0.0.0-20191228163020-98b59b546dee h1:vIYpscVc1753m7svyoDldyaEi2MDa7808yh3hMXVZjg= 8 | github.com/jasonlvhit/gocron v0.0.0-20191228163020-98b59b546dee/go.mod h1:1nXLkt6gXojCECs34KL3+LlZ3gTpZlkPUA8ejW3WeP0= 9 | github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= 10 | github.com/onsi/ginkgo v1.10.1/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= 11 | github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= 12 | github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= 13 | github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= 14 | github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= 15 | github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk= 16 | github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= 17 | golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= 18 | golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 19 | golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 20 | golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= 21 | gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= 22 | gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= 23 | gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= 24 | gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= 25 | gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= 26 | gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= 27 | gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= 28 | -------------------------------------------------------------------------------- /tools/auto-update/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "os" 6 | "os/exec" 7 | 8 | "github.com/jasonlvhit/gocron" 9 | ) 10 | 11 | func update() { 12 | envIotexHome := os.Getenv("IOTEX_HOME") 13 | envNetwork := os.Getenv("_GREP_STRING_") 14 | envENV := os.Getenv("_ENV_") 15 | 16 | if envIotexHome == "" || envNetwork == "" || envENV == "" { 17 | fmt.Printf("ENV $IOTEX_HOME=%s $_GREP_STRING_=%s $_ENV_%s must be set.", 18 | envIotexHome, envNetwork, envENV) 19 | return 20 | } 21 | 22 | cmdStr := envIotexHome + "/bin/update_silence.sh" 23 | cmd := exec.Command("/bin/sh", "-c", cmdStr) 24 | cmd.Env = append(os.Environ()) 25 | 26 | cmd.Stdout = os.Stdout 27 | cmd.Stderr = os.Stderr 28 | cmd.Run() 29 | } 30 | 31 | func main() { 32 | fmt.Println("Auto-update is running...") 33 | // start scheduler 34 | gocron.Every(3).Days().Do(update) 35 | 36 | <-gocron.Start() 37 | // block main func 38 | select {} 39 | } 40 | -------------------------------------------------------------------------------- /tube/erc20-to-native.md: -------------------------------------------------------------------------------- 1 | ## The swap contract 2 | 3 | We have deployed a swap contract [0x450caB2535D57cE9df625297D796aee266611728](https://etherscan.io/address/0x450caB2535D57cE9df625297D796aee266611728) on Ethereum. The abi of this contract is available [here](https://github.com/iotexproject/iotex-bootstrap/blob/master/tube/e2n.abi) 4 | 5 | We recommend that you use our [web portal](https://member.iotex.io/tools/iotex) to do the swap. 6 | 7 | ## Swap to same address 8 | 9 | Usually if you use our [web portal](https://member.iotex.io/tools/iotex) (which prompts you to sign into Metamask), or our [web wallet](https://iotexscan.io/wallet), you may want to receive IOTX token in the same address. In this case, just use the ETH address in Metamask or web wallet as receiving address. 10 | 11 | In our [web portal](https://member.iotex.io/tools/iotex), click the `Current IO address:` radio button (it is the default case). This calls the contract's `deposit` method with `_amount = amount you want to swap`. 12 | 13 | Make sure you have enough amount of IoTeX ERC20 token and Ether (to cover transaction fee on Ethereum) in your sending address. 14 | 15 | ## Swap to different address 16 | 17 | If you use wallet app on mobile phone and wish to receive IOTX native token in the same wallet, you will need to use `ioctl` commandline tool to get the ETH address from the IoTeX native token address, and convert to IoTeX address, as introduced in [tube](https://github.com/iotexproject/iotex-bootstrap/blob/master/tube/tube.md). 18 | 19 | In our [web portal](https://member.iotex.io/tools/iotex), click the `Another IO address` radio button and enter the receiving IoTeX address. This calls the contract's `depositTo` method with `_amount = amount you want to swap`, and `_to = receiving address`. 20 | 21 | Make sure you have enough amount of IoTeX ERC20 token and Ether (to cover transaction fee on Ethereum) in your sending address. 22 | 23 | ## Verify receiving of IOTX native token 24 | 25 | The swap should take effect in about 2 minutes. You can check the IOTX native token in the receiving IoTeX address (use *io14s0vgnj0pjnazu4hsqlksdk7slah9vcfscn9ks* as example): 26 | 27 | `ioctl account balance io14s0vgnj0pjnazu4hsqlksdk7slah9vcfscn9ks` -------------------------------------------------------------------------------- /tube/native-to-erc20.md: -------------------------------------------------------------------------------- 1 | You can interact with our mainnet smart contract `io1p99pprm79rftj4r6kenfjcp8jkp6zc6mytuah5` to swap native token to ERC20 token. The abi of this contract is available [here](https://github.com/iotexproject/iotex-bootstrap/blob/master/tube/n2e.abi) 2 | 3 | The swap can be done either by the `ioctl` commaindline tool or on our [web portal](https://member.iotex.io/tools/iotex). 4 | 5 | ## Swap to same address 6 | 7 | Usually if you use our [web portal](https://member.iotex.io/tools/iotex) (which prompts you to sign into Metamask), or our [web wallet](https://iotexscan.io/wallet), you may want to receive IOTX ERC20 token in the same address. 8 | 9 | Here's the commandline: 10 | 11 | `ioctl action invoke io1p99pprm79rftj4r6kenfjcp8jkp6zc6mytuah5 ${amount} -s ${io_address|account_name} -l 400000 -p 1 -b d0e30db0` 12 | 13 | The `amount` in the command should be equal to the amount you want to swap plus a fee (20 IOTX). For example, if you want to swap 30000 IOTX from you account `my_primary_account`, run the following command in terminal: 14 | 15 | `ioctl action invoke io1p99pprm79rftj4r6kenfjcp8jkp6zc6mytuah5 30020 -s my_primary_account -l 400000 -p 1 -b d0e30db0` 16 | 17 | In our [web portal](https://member.iotex.io/tools/iotex), click the `Current ETH address:` radio button (it is the default case). 18 | 19 | > OR, you can program to call the contract's `deposit` method with the same amount, gas limit, and gas price setting as that in commandline. 20 | 21 | ## Swap to different address 22 | 23 | If you use wallet app on mobile phone and wish to receive IOTX ERC20 token in the same wallet, you will need to get the ETH address of your IoTeX ERC20 token in your wallet. 24 | 25 | Below is the example of swap 30000 IOTX native token to ETH address *0xac1ec44e4f0ca7d172b7803f6836de87fb72b309* 26 | 27 | > Important: replace *ac1ec44e4f0ca7d172b7803f6836de87fb72b309* with your ETH address, remove '0x' in front of ETH address, keep `b760faf9000000000000000000000000` intact 28 | 29 | `ioctl action invoke io1p99pprm79rftj4r6kenfjcp8jkp6zc6mytuah5 30020 -s my_primary_account -l 400000 -p 1 -b b760faf9000000000000000000000000ac1ec44e4f0ca7d172b7803f6836de87fb72b309` 30 | 31 | In our [web portal](https://member.iotex.io/tools/iotex), click the `Another ETH address` radio button and enter the receiving ETH address. 32 | 33 | > OR, you can program to call the contract's `depositTo` method with the same amount, address, gas limit, and gas price setting as that in commandline. 34 | 35 | ## Verify receiving of IOTX ERC20 token 36 | 37 | The swap should take effect in about 2 minutes. You can check the ETH address on https://etherscan.io to verify you have received the IoTeX ERC20 tokens. 38 | -------------------------------------------------------------------------------- /tube/tube.md: -------------------------------------------------------------------------------- 1 | # tube 2 | Tube is a bi-directional service that allows our users to swap the IoTeX mainnet native token to the [IoTeX Network ERC20 token](https://etherscan.io/token/0x6fb3e0a217407efff7ca062d46c26e5d60a14d69), or vice versa. 3 | 4 | Basically you send certain amount of token (ERC20 or native) to a special smart contract, and you'll receive the other type of token in equal amount. 5 | 6 | ## Getting started 7 | Before using the service let's first introduce some basic facts of the IoTeX address. 8 | 9 | An IoTeX address is inherently associated with an underlying ETH address. You can use our `ioctl` commandline tool to check the associated ETH address of an IoTeX address, or vice versa. If you are a first-time user of IoTeX, refer to [How to install ioctl](https://github.com/iotexproject/iotex-bootstrap#interact-with-blockchain) 10 | 11 | `ioctl account ethaddr io14s0vgnj0pjnazu4hsqlksdk7slah9vcfscn9ks` 12 | 13 | it shows that that underlying ETH address is *0xAc1ec44E4f0ca7D172B7803f6836De87Fb72b309* 14 | 15 | `io14s0vgnj0pjnazu4hsqlksdk7slah9vcfscn9ks - 0xAc1ec44E4f0ca7D172B7803f6836De87Fb72b309` 16 | 17 | Or use the ETH address as input: 18 | 19 | `ioctl account ethaddr 0xAc1ec44E4f0ca7D172B7803f6836De87Fb72b309` 20 | 21 | You will see the same output showing the mapping of these 2 addresses. 22 | 23 | These 2 addresses are an alias to each other. They share the **same private key**, this same private key gives you full access/control of the IOTX ERC20 and native token on these 2 addresses. 24 | 25 | When you swap token using Metamask, or our [web wallet](https://iotexscan.io/wallet), you are operating the same private key so everything is fine. 26 | 27 | Now here's the **caveat:** in most wallet software when you generate address from the seed phrase, the address of the IOTX native token is *NOT* same as the IoTeX ERC20 token, i.e., there are *2 different private keys* behind these 2! 28 | 29 | In other words, when you swap tokens in your wallet and expect to receive the other type of token in the same wallet, you will need to **specify a correct receiving address**. 30 | 31 | > Knowing this distinction is extremely important for correctly operating your swap and prevent loss of token! 32 | 33 | ## [Swap ERC20 to native](https://github.com/iotexproject/iotex-bootstrap/blob/master/tube/erc20-to-native.md) 34 | 35 | ## [Swap native to ERC20](https://github.com/iotexproject/iotex-bootstrap/blob/master/tube/native-to-erc20.md) 36 | 37 | 38 | 39 | --------------------------------------------------------------------------------