Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(cosmovisor): updates docs about path name #12921

Merged
merged 10 commits into from
Aug 20, 2022
6 changes: 2 additions & 4 deletions cosmovisor/.goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ before:

builds:
- main: ./cmd/cosmovisor
ldflags:
- -X 'github.com/cosmos/cosmos-sdk/cosmovisor/cmd/cosmovisor/cmd.Version={{ replace .Version "cosmovisor/" "" }}'
goos:
- linux
- windows
Expand All @@ -36,5 +34,5 @@ changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'
- "^docs:"
- "^test:"
6 changes: 1 addition & 5 deletions cosmovisor/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,9 @@ Ref: https://keepachangelog.com/en/1.0.0/
# Changelog

## [Unreleased]
<!-- NOTE: when creating a new release, update cosmovisor/cmd/cosmovisor/cmd/version.go:Version -->

## v1.2.1 2022-08-15

* [\12918](https://github.com/cosmos/cosmos-sdk/pull/12918) Fix failure when installing cosmovisor via `go install`.
* [\12921](https://github.com/cosmos/cosmos-sdk/pull/12918) Add documentation about expected plan path name.
* [\12918](https://github.com/cosmos/cosmos-sdk/pull/12918) Automatically set version using module version.
* [\12918](https://github.com/cosmos/cosmos-sdk/pull/12918) Fix plan path case sensitivity issue.

## v1.2.0 2022-07-26

Expand Down
20 changes: 10 additions & 10 deletions cosmovisor/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@
* [Design](#design)
* [Contributing](#contributing)
* [Setup](#setup)
* [Installation](#installation)
* [Command Line Arguments And Environment Variables](#command-line-arguments-and-environment-variables)
* [Folder Layout](#folder-layout)
* [Installation](#installation)
* [Command Line Arguments And Environment Variables](#command-line-arguments-and-environment-variables)
* [Folder Layout](#folder-layout)
* [Usage](#usage)
* [Initialization](#initialization)
* [Detecting Upgrades](#detecting-upgrades)
* [Auto-Download](#auto-download)
* [Initialization](#initialization)
* [Detecting Upgrades](#detecting-upgrades)
* [Auto-Download](#auto-download)
* [Example: SimApp Upgrade](#example-simapp-upgrade)
* [Chain Setup](#chain-setup)
* [Prepare Cosmovisor and Start the Chain](#prepare-cosmovisor-and-start-the-chain)
* [Update App](#update-app)
* [Chain Setup](#chain-setup)
* [Prepare Cosmovisor and Start the Chain](#prepare-cosmovisor-and-start-the-chain)
* [Update App](#update-app)

## Design

Expand Down Expand Up @@ -115,7 +115,7 @@ All arguments passed to `cosmovisor run` will be passed to the application binar
└── upgrade-info.json
```

The `cosmovisor/` directory incudes a subdirectory for each version of the application (i.e. `genesis` or `upgrades/<name>`). Within each subdirectory is the application binary (i.e. `bin/$DAEMON_NAME`) and any additional auxiliary files associated with each binary. `current` is a symbolic link to the currently active directory (i.e. `genesis` or `upgrades/<name>`). The `name` variable in `upgrades/<name>` is the URI-encoded name of the upgrade as specified in the upgrade module plan.
The `cosmovisor/` directory incudes a subdirectory for each version of the application (i.e. `genesis` or `upgrades/<name>`). Within each subdirectory is the application binary (i.e. `bin/$DAEMON_NAME`) and any additional auxiliary files associated with each binary. `current` is a symbolic link to the currently active directory (i.e. `genesis` or `upgrades/<name>`). The `name` variable in `upgrades/<name>` is the lowercased URI-encoded name of the upgrade as specified in the upgrade module plan. Note that the upgrade name path are normalized to be lowercased: for instance, `MyUpgrade` is normalized to `myupgrade`, and its path is `upgrades/myupgrade`.

Please note that `$DAEMON_HOME/cosmovisor` only stores the *application binaries*. The `cosmovisor` binary itself can be stored in any typical location (e.g. `/usr/local/bin`). The application will continue to store its data in the default data directory (e.g. `$HOME/.gaiad`) or the data directory specified with the `--home` flag. `$DAEMON_HOME` is independent of the data directory and can be set to any location. If you set `$DAEMON_HOME` to the same directory as the data directory, you will end up with a configuation like the following:

Expand Down
1 change: 0 additions & 1 deletion cosmovisor/RELEASE_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
### Bug Fixes

* Fix failure when installing cosmovisor via `go install`.
* Fix plan path case sensitivity issue.

### Changelog

Expand Down
3 changes: 3 additions & 0 deletions cosmovisor/scanner.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,5 +158,8 @@ func parseUpgradeInfoFile(filename string) (upgradetypes.Plan, error) {
return upgradetypes.Plan{}, fmt.Errorf("invalid upgrade-info.json content; name and height must be not empty; got: %v", ui)
}

// normalize name to prevent operator error in upgrade name case sensitivity errors.
ui.Name = strings.ToLower(ui.Name)

return ui, err
}
7 changes: 4 additions & 3 deletions cosmovisor/scanner_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ func TestParseUpgradeInfoFile(t *testing.T) {
expectErr: false,
},
{
filename: "f2-good.json",
expectUpgrade: upgradetypes.Plan{Name: "Upgrade2", Info: "some info", Height: 125},
filename: "f2-normalized-name.json",
expectUpgrade: upgradetypes.Plan{Name: "upgrade2", Info: "some info", Height: 125},
expectErr: false,
},
{
Expand Down Expand Up @@ -59,7 +59,8 @@ func TestParseUpgradeInfoFile(t *testing.T) {
filename: "unknown.json",
expectUpgrade: upgradetypes.Plan{},
expectErr: true,
}}
},
}

for i := range cases {
tc := cases[i]
Expand Down