-
Notifications
You must be signed in to change notification settings - Fork 127
/
upgrade.md
103 lines (69 loc) · 3.48 KB
/
upgrade.md
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
# Software Upgrade User Guide
## Basic Function Description
The module supports the infrastructure of the blockchain software upgrade. It will be upgraded to the new version through voting at UpgradeProposal and is fully compatible with the historical data on the blockchain.
## Interaction Process
### Governance process of software upgrade proposal
1. Submit a software upgrade proposal and vote to make the proposal pass
2. More details about governance process is in GOV [User Guide](governance.md)
### The process of software upgrade
1. Install a new software.
2. Once reach the limited time, it will be counted whether the proportion of voting power of upgraded software exceeds 95%.
3. If it exceeds 95%, the software will be upgraded, otherwise the upgrade fails.
4. The validators who didn't upgrade in time need to re-download the new software and blocks synchronized.
## Usage Scenarios
### Create an environment
```
rm -rf iris
rm -rf .iriscli
iris init gen-tx --name=x --home=iris
iris init --gen-txs --chain-id=upgrade-test -o --home=iris
iris start --home=iris
```
### Submit a software upgrade proposal
```
# Send an upgrade proposal
iriscli gov submit-proposal --title=Upgrade --description="SoftwareUpgrade" --type="SoftwareUpgrade" --deposit=10iris --from=x --chain-id=upgrade-test --fee=0.05iris --gas=20000 --software=https://github.com/irisnet/irishub/tree/v0.9.0 --version=2 --switch-height=80
# Deposit for a proposal
iriscli gov deposit --proposal-id=1 --deposit=1iris --from=x --chain-id=upgrade-test --fee=0.05iris --gas=20000
# Vote for a proposal
iriscli gov vote --proposal-id=1 --option=Yes --from=x --chain-id=upgrade-test --fee=0.05iris --gas=20000
# Query the state of a proposal
iriscli gov query-proposal --proposal-id=1 --trust-node
```
### Upgrade software
* Scenario 1
Implement following operations at the certain height(80 block height):
```
# 1. Download the new version:iris1
# 2. Close the old one
kill -f iris
# 3. Install the new version,iris1 and start it(copy to bin)
iris1 start --home=iris
# 4. Upgrade automatically when reach the preset time
# 5. Query whether the current version has been successfully upgraded
iriscli upgrade info --trust-node
```
* Scenario 2
The operations in Scenario 1 haven't been implemented at the certain time (80 block height), report apphash conflicts errors after the new version become valid:
```
# 1. Download the new version, iris1
# 2. Close the old one
kill -f iris
# 3. Install the new version iris1 and start it
iris1 start --home=iris --replay-last-block
# 4. Query whether the current version has been successfully upgraded
iriscli upgrade info --trust-node
```
## Command details
```
iriscli gov submit-proposal --title=Upgrade --description="SoftwareUpgrade" --type="SoftwareUpgrade" --deposit=10iris --from=x --chain-id=upgrade-test --fee=0.05iris --gas=20000 --software=https://github.com/irisnet/irishub/tree/v0.9.0 --version=2 --switch-height=80
```
* `--type` "SoftwareUpgrade" The type of Software upgrade proposals
* `--version` The version of the new protocol
* `--software` The software of the new protocol
* `--switch-height` The switchheight of the new protocol
* Other parameters can be referrenced in [Gov User Guide](governance.md)
Query the version details of current software
```
iriscli upgrade info --trust-node
```