Git Product home page Git Product logo

use ignite/pkg/cosmosaccount and ignite/pkg/cosmosclient to BroadcastTx, but an error is raised that is "panic: rpc error: code = InvalidArgument desc = invalid Bech32 prefix; expected xxx, got cosmos: invalid request" about cli HOT 7 CLOSED

TraderWithPython avatar TraderWithPython commented on July 18, 2024
use ignite/pkg/cosmosaccount and ignite/pkg/cosmosclient to BroadcastTx, but an error is raised that is "panic: rpc error: code = InvalidArgument desc = invalid Bech32 prefix; expected xxx, got cosmos: invalid request"

from cli.

Comments (7)

TraderWithPython avatar TraderWithPython commented on July 18, 2024

I find a solution that is

import abdex_types "abdex/x/oracle/types"
sdktypes.SetAddrCacheEnabled(false)

but another error comes up

panic: rpc error: code = NotFound desc = rpc error: code = NotFound desc = account prefix1ekkxau47ztheg3c93xlgzph27uwnyl9v00knhr not found: key not found

why

from cli.

Pantani avatar Pantani commented on July 18, 2024

@TraderWithPython the account should be inside the keyring, like the example in the docs

    accountName := "alice" // alice account should exist into the keyring

    // Get account from the keyring
    account, err := client.Account(accountName)
    if err != nil {
        log.Fatal(err)
    }

    addr, err := account.Address(addressPrefix)
    if err != nil {
        log.Fatal(err)
    }

from cli.

TraderWithPython avatar TraderWithPython commented on July 18, 2024

@TraderWithPython the account should be inside the keyring, like the example in the docs

    accountName := "alice" // alice account should exist into the keyring

    // Get account from the keyring
    account, err := client.Account(accountName)
    if err != nil {
        log.Fatal(err)
    }

    addr, err := account.Address(addressPrefix)
    if err != nil {
        log.Fatal(err)
    }

I thought

registry, err := cosmosaccount.New(
		cosmosaccount.WithHome("./data"),
		cosmosaccount.WithKeyringServiceName("OracleClientService"),
		cosmosaccount.WithKeyringBackend(cosmosaccount.KeyringMemory),
	)

would create a new keyring with memory backend.
Because there is a line in "New function", which is

r.Keyring, err = keyring.New(r.keyringServiceName, string(r.keyringBackend), r.homePath, inBuf, cdc)

I just want to use custom MNEMONIC to interact with blockchain with cosmosclient. what should I do?

from cli.

TraderWithPython avatar TraderWithPython commented on July 18, 2024

@TraderWithPython the account should be inside the keyring, like the example in the docs

    accountName := "alice" // alice account should exist into the keyring

    // Get account from the keyring
    account, err := client.Account(accountName)
    if err != nil {
        log.Fatal(err)
    }

    addr, err := account.Address(addressPrefix)
    if err != nil {
        log.Fatal(err)
    }

If I use following commands to query

blockchaind query account prefix1ekkxau47ztheg3c93xlgzph27uwnyl9v00knhr

It raises a error that is

Error: your node may be syncing, please check node status using `/status`: rpc error: code = NotFound desc = rpc error: code = NotFound desc = account prefix1ekkxau47ztheg3c93xlgzph27uwnyl9v00knhr not found: key not found

I cant understand it.
Why can't a custom address be queried? It should return a default value of 0. Please translate this to English.

from cli.

TraderWithPython avatar TraderWithPython commented on July 18, 2024

@TraderWithPython the account should be inside the keyring, like the example in the docs

    accountName := "alice" // alice account should exist into the keyring

    // Get account from the keyring
    account, err := client.Account(accountName)
    if err != nil {
        log.Fatal(err)
    }

    addr, err := account.Address(addressPrefix)
    if err != nil {
        log.Fatal(err)
    }

If I use following commands to query

blockchaind query account prefix1ekkxau47ztheg3c93xlgzph27uwnyl9v00knhr

It raises a error that is

Error: your node may be syncing, please check node status using `/status`: rpc error: code = NotFound desc = rpc error: code = NotFound desc = account prefix1ekkxau47ztheg3c93xlgzph27uwnyl9v00knhr not found: key not found

I cant understand it. Why can't a custom address be queried? It should return a default value of 0. Please translate this to English.

The reason is that a new account need a tx to record in account module, such as transfer and using faucet.

from cli.

Pantani avatar Pantani commented on July 18, 2024

@TraderWithPython Do you have the Alice account in your chain config?

Use the blockchain keys list to check all accounts you have. Also, check if you have any state for this account in your chain.

from cli.

Pantani avatar Pantani commented on July 18, 2024

@TraderWithPython any update?

from cli.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.