Go to file
swelf19 5099c15f73
fix: non consistent keyring (#10844)
## Description

Normally keyring module creates two record for each public key created in keyringdb.
The first one with an address as a key witch contains only name of the second key, wich actually contains a public key
![Screenshot_20211227_173827](https://user-images.githubusercontent.com/62722506/147482783-ffd495e6-7f16-4497-b1a3-50e9db90e1e8.png)

But a couple of times we have faced an issue, when the first record exists, and the second for some reason does not. 
![Screenshot_20211227_173846](https://user-images.githubusercontent.com/62722506/147482893-ffe159fd-9eeb-493f-a9db-75c7ccedbf80.png)

In such case you are unable to import public key due to error
```shell
$ go run ./cmd/terrad/ keys --keyring-backend kwallet add swelf --pubkey '{"@type":"/cosmos.crypto.secp256k1.PubKey","key":"Ap1W7ww/FaZVpAd487QUVXh7Nmxk4FlREr5IGPuzEnJu"}'
Error: public key already exists in keybase
```
in the same time terrad cli do not see any keys in the keyring
```shell
$ go run ./cmd/terrad/ keys --keyring-backend kwallet list
[]
```
The error occurs when the record with address still exists in the keyring db.

I would like to resolve the error.
I see at least three different ways to do it.
1) Informing the user about situation and recreate public key
```shell
$ go run ./cmd/terrad/ keys --keyring-backend kwallet add swelf --pubkey '{"@type":"/cosmos.crypto.secp256k1.PubKey","key":"Ap1W7ww/FaZVpAd487QUVXh7Nmxk4FlREr5IGPuzEnJu"}'
**address "7cc4633deb18c0531b382a50275ad94e05f84580" exists but pubkey itself does not
recreating pubkey record**

- name: swelf
  type: offline
  address: terra10nzxx00trrq9xxec9fgzwkkefczls3vqkpkjl4
  pubkey: '{"@type":"/cosmos.crypto.secp256k1.PubKey","key":"Ap1W7ww/FaZVpAd487QUVXh7Nmxk4FlREr5IGPuzEnJu"}'
  mnemonic: ""
```
with notifying user about an issue
2) Asking the user to confirm procedure of restoring public key
3) Just informing user about an issue and do nothing.

I prefer the first way, i do not see a reason when user do not want to fix an issue.

---

### 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/master/CONTRIBUTING.md#pr-targeting))
- [ ] provided a link to the relevant issue or specification
- [ ] followed the guidelines for [building modules](https://github.com/cosmos/cosmos-sdk/blob/master/docs/building-modules)
- [x] included the necessary unit and integration [tests](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#testing)
- [ ] 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
- [ ] 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)
2022-02-15 10:16:41 +00:00
.github build(deps): Bump actions/setup-go from 2.1.5 to 2.2.0 (#11154) 2022-02-10 09:46:33 +01:00
api refactor: Align on gov/group Proposals and Vote syntax (#11097) 2022-02-14 13:48:17 +00:00
baseapp refactor!: remove 'keep-every' from pruning (#11152) 2022-02-12 10:54:04 -05:00
client feat: Add debug pubkey-raw cli command (#11006) 2022-02-14 10:36:52 +00:00
codec fix: remove grpc replace directive (#11089) 2022-02-04 10:54:32 +00:00
container refactor(container)!: rename Scope -> ModuleKey (#11073) 2022-01-31 17:12:08 +00:00
contrib docs: Improve markdownlint configuration (#11104) 2022-02-10 12:07:01 +00:00
cosmovisor docs: Code blocks in SDK docs are broken (#11189) 2022-02-14 23:39:35 +01:00
crypto fix: non consistent keyring (#10844) 2022-02-15 10:16:41 +00:00
db feat: use cosmos/rocksdb rather than replace trick (#10927) 2022-01-11 22:29:53 +00:00
doc docs: Improve markdownlint configuration (#11104) 2022-02-10 12:07:01 +00:00
docs docs: Code blocks in SDK docs are broken (#11189) 2022-02-14 23:39:35 +01:00
errors docs: Improve markdownlint configuration (#11104) 2022-02-10 12:07:01 +00:00
internal feat: ADR-040: Add RootStore implementation (#10430) 2021-12-16 13:09:57 +00:00
orm refactor(orm)!: rename table interfaces from Store -> Table in codegen (#11176) 2022-02-14 15:23:52 +00:00
proto docs: Code blocks in SDK docs are broken (#11189) 2022-02-14 23:39:35 +01:00
scripts docs: Code blocks in SDK docs are broken (#11189) 2022-02-14 23:39:35 +01:00
server refactor!: remove 'keep-every' from pruning (#11152) 2022-02-12 10:54:04 -05:00
simapp docs: Improve markdownlint configuration (#11104) 2022-02-10 12:07:01 +00:00
snapshots refactor!: remove 'keep-every' from pruning (#11152) 2022-02-12 10:54:04 -05:00
std fix: register evidence regression (#10595) 2021-12-14 14:25:31 +00:00
store docs: Code blocks in SDK docs are broken (#11189) 2022-02-14 23:39:35 +01:00
telemetry refactor!: Keyring migration (#9695) 2021-09-20 12:02:15 +00:00
tests feat: ADR-040: Add RootStore implementation (#10430) 2021-12-16 13:09:57 +00:00
testutil chore: move server.GenerateCoinKey and server.GenerateSaveCoinKey to … (#10957) 2022-01-18 15:24:16 +00:00
third_party/proto feat: full api module building alongside gogo proto files with buf schema registry support (#10669) 2022-01-06 14:57:55 -05:00
types fix: Fix raw_log when ABCIMessageLog.MsgIndex is 0 (#11147) 2022-02-12 20:29:42 +00:00
version refactor: Implementing sigs.k8s.io YAML to remove .proto yaml annotations (#9780) 2021-09-24 14:37:34 +00:00
x docs: Code blocks in SDK docs are broken (#11189) 2022-02-14 23:39:35 +01:00
.build.sh fix library file path (#8301) 2021-01-12 10:08:42 +00:00
.clang-format Fix clang-format to specific version (#7350) 2020-10-27 10:04:34 +00:00
.codecov.yml CI: Fix codecov flag project config (#7994) 2020-11-20 09:13:25 -05:00
.deepsource.toml chore: refactor code quality issues (#8932) 2021-03-22 09:30:27 +00:00
.dockerignore Add basic Dockerfile to build all binaries and export gaiad 2018-04-10 12:39:47 +02:00
.gitattributes Merge PR #6426: Migrate API Server 2020-06-15 13:39:09 -04:00
.gitignore feat: standalone errors go.mod (#10779) 2021-12-17 21:53:08 +00:00
.golangci.yml chore: bump TM to v0.35.0 release candidate (#10210) 2021-11-16 11:24:38 -08:00
.goreleaser.yml ci: automate release post tag push (#6230) 2020-05-25 20:02:08 +02:00
.markdownlint.json docs: Code blocks in SDK docs are broken (#11189) 2022-02-14 23:39:35 +01:00
.markdownlintignore docs: Improve markdownlint configuration (#11104) 2022-02-10 12:07:01 +00:00
.mergify.yml chore: Remove deprecated strict mode from mergify (#10694) 2021-12-08 11:35:28 +01:00
buf.work.yaml feat: full api module building alongside gogo proto files with buf schema registry support (#10669) 2022-01-06 14:57:55 -05:00
CHANGELOG.md fix: non consistent keyring (#10844) 2022-02-15 10:16:41 +00:00
CODE_OF_CONDUCT.md Update CODE_OF_CONDUCT.md (#7381) 2020-09-28 11:28:30 +02:00
CODING_GUIDELINES.md docs: Improve markdownlint configuration (#11104) 2022-02-10 12:07:01 +00:00
CONTRIBUTING.md docs: Code blocks in SDK docs are broken (#11189) 2022-02-14 23:39:35 +01:00
docker-compose.yml build: add remote debugging with delve (#10587) 2021-12-01 12:44:54 +00:00
Dockerfile build: Update Dockerfile (#9839) 2021-08-03 09:46:16 -04:00
go.mod build(deps): Bump github.com/jhump/protoreflect from 1.10.2 to 1.10.3 (#11155) 2022-02-10 10:12:34 +00:00
go.sum refactor!: remove 'keep-every' from pruning (#11152) 2022-02-12 10:54:04 -05:00
LICENSE docs: 10180 Fix SDK (#10237) 2021-09-28 19:33:58 +02:00
Makefile feat(orm): add mock hooks (#11135) 2022-02-08 11:56:53 -05:00
README.md chore: add meeting list and working groups to contributing doc (#10315) 2021-10-13 13:01:29 +00:00
RELEASE_PROCESS.md docs: Improve markdownlint configuration (#11104) 2022-02-10 12:07:01 +00:00
SECURITY.md docs: Improve markdownlint configuration (#11104) 2022-02-10 12:07:01 +00:00

Cosmos SDK

banner

The Cosmos SDK is a framework for building blockchain applications. Tendermint Core (BFT Consensus) and the Cosmos SDK are written in the Golang programming language. Cosmos SDK is used to build Gaia, the first implementation of the Cosmos Hub.

WARNING: The Cosmos SDK has mostly stabilized, but we are still making some breaking changes.

Note: Requires Go 1.17+

Quick Start

To learn how the Cosmos SDK works from a high-level perspective, see the Cosmos SDK High-Level Intro.

If you want to get started quickly and learn how to build on top of Cosmos SDK, visit Cosmos SDK Tutorials. You can also fork the tutorial's repository to get started building your own Cosmos SDK application.

For more information, see the Cosmos SDK Documentation.

Contributing

See CONTRIBUTING.md for details how to contribute and participate in our dev calls. If you want to follow the updates or learn more about the latest design then join our Discord.

Tools and Frameworks

The Cosmos ecosystem is vast. We will only make a few notable mentions here.

  • Tools: notable frameworks and modules.
  • CosmJS: the Swiss Army knife to power JavaScript based client solutions.

Cosmos Hub Mainnet

The Cosmos Hub application, gaia, has moved to its own cosmos/gaia repository. Go there to join the Cosmos Hub mainnet and more.

Inter-Blockchain Communication (IBC)

The IBC module for the Cosmos SDK has moved to its own cosmos/ibc-go repository. Go there to build and integrate with the IBC module.

Starport

Starport is the all-in-one platform to build, launch, and maintain any crypto application on a sovereign and secured blockchain. If you are building a new app or a new module, use Starport to get started and speed up development.

Disambiguation

This Cosmos SDK project is not related to the React-Cosmos project (yet). Many thanks to Evan Coury and Ovidiu (@skidding) for this Github organization name. As per our agreement, this disambiguation notice will stay here.