-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: make Cosmovisor use cobra (#11823)
## Description Closes: #11789 --- ### Author Checklist *All items are required. Please add a note to the item if the item is not applicable and please add links to any relevant follow up issues.* I have... - [x] included the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [ ] added `!` to the type prefix if API or client breaking change - [x] targeted the correct branch (see [PR Targeting](https://github.com/cosmos/cosmos-sdk/blob/main/CONTRIBUTING.md#pr-targeting)) - [x] provided a link to the relevant issue or specification - [ ] followed the guidelines for [building modules](https://github.com/cosmos/cosmos-sdk/blob/main/docs/building-modules) - [ ] included the necessary unit and integration [tests](https://github.com/cosmos/cosmos-sdk/blob/main/CONTRIBUTING.md#testing) - [x] added a changelog entry to `CHANGELOG.md` - [x] included comments for [documenting Go code](https://blog.golang.org/godoc) - [ ] updated the relevant documentation or specification - [x] reviewed "Files changed" and left comments if necessary - [ ] confirmed all CI checks have passed ### Reviewers Checklist *All items are required. Please add a note if the item is not applicable and please add your handle next to the items reviewed if you only reviewed selected items.* I have... - [ ] confirmed the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [ ] confirmed `!` in the type prefix if API or client breaking change - [ ] confirmed all author checklist items have been addressed - [ ] reviewed state machine logic - [ ] reviewed API design and naming - [ ] reviewed documentation is accurate - [ ] reviewed tests and test coverage - [ ] manually tested (if applicable)
- Loading branch information
1 parent
c0f65e1
commit 8076144
Showing
18 changed files
with
174 additions
and
430 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,7 +37,7 @@ To install a previous version, you can specify the version. IMPORTANT: Chains th | |
go install github.com/cosmos/cosmos-sdk/cosmovisor/cmd/[email protected] | ||
``` | ||
|
||
You can run `cosmovisor --version` to check the Cosmovisor version (works only with Cosmovisor >=1.0.0). | ||
You can run `cosmovisor version` to check the Cosmovisor version (works only with Cosmovisor >1.1.0). | ||
|
||
You can also install from source by pulling the cosmos-sdk repository and switching to the correct version and building as follows: | ||
|
||
|
@@ -62,7 +62,7 @@ The first argument passed to `cosmovisor` is the action for `cosmovisor` to take | |
|
||
* `help`, `--help`, or `-h` - Output `cosmovisor` help information and check your `cosmovisor` configuration. | ||
* `run` - Run the configured binary using the rest of the provided arguments. | ||
* `version`, or `--version` - Output the `cosmovisor` version and also run the binary with the `version` argument. | ||
* `version` - Output the `cosmovisor` version and also run the binary with the `version` argument. | ||
|
||
All arguments passed to `cosmovisor run` will be passed to the application binary (as a subprocess). `cosmovisor` will return `/dev/stdout` and `/dev/stderr` of the subprocess as its own. For this reason, `cosmovisor run` cannot accept any command-line arguments other than those available to the application binary. | ||
|
||
|
@@ -209,7 +209,6 @@ You can also use `sha512sum` if you would prefer to use longer hashes, or `md5su | |
|
||
The following instructions provide a demonstration of `cosmovisor` using the simulation application (`simapp`) shipped with the Cosmos SDK's source code. The following commands are to be run from within the `cosmos-sdk` repository. | ||
|
||
|
||
### Chain Setup | ||
|
||
Let's create a new chain using the `v0.44` version of simapp (the Cosmos SDK demo app): | ||
|
@@ -234,7 +233,7 @@ Set up app config: | |
``` | ||
|
||
Initialize the node and overwrite any previous genesis file (never do this in a production environment): | ||
|
||
<!-- TODO: init does not read chain-id from config --> | ||
|
||
```sh | ||
|
@@ -289,17 +288,15 @@ cp ./build/simd $DAEMON_HOME/cosmovisor/genesis/bin | |
|
||
Now you can run cosmovisor with simapp v0.44: | ||
|
||
|
||
```sh | ||
cosmovisor run start | ||
``` | ||
|
||
|
||
#### Update App | ||
|
||
Update app to the latest version (e.g. v0.45). | ||
|
||
Next, we can add a migration - which is defined using `x/upgrade` [upgrade plan](https://github.com/cosmos/cosmos-sdk/blob/main/docs/core/upgrade.md) (you may refer to a past version if you are using an older Cosmos SDK release). In a migration we can do any deterministic state change. | ||
Next, we can add a migration - which is defined using `x/upgrade` [upgrade plan](https://github.com/cosmos/cosmos-sdk/blob/main/docs/core/upgrade.md) (you may refer to a past version if you are using an older Cosmos SDK release). In a migration we can do any deterministic state change. | ||
|
||
Build the new version `simd` binary: | ||
|
||
|
@@ -314,7 +311,6 @@ mkdir -p $DAEMON_HOME/cosmovisor/upgrades/test1/bin | |
cp ./build/simd $DAEMON_HOME/cosmovisor/upgrades/test1/bin | ||
``` | ||
|
||
|
||
Open a new terminal window and submit an upgrade proposal along with a deposit and a vote (these commands must be run within 20 seconds of each other): | ||
|
||
```sh | ||
|
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.