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

Atomkraft with provenance binary (help needed) #184

Closed
llama-del-rey opened this issue Nov 10, 2022 · 9 comments · Fixed by #185 or #186
Closed

Atomkraft with provenance binary (help needed) #184

llama-del-rey opened this issue Nov 10, 2022 · 9 comments · Fixed by #185 or #186
Assignees

Comments

@llama-del-rey
Copy link

Hi there,

Trying to setup atomkraft to run with the provenance binary. I have tried few different things but not getting past the following error:

👉  atomkraft init provenance-e2e
👉 cd provenance-e2e
👉 atomkraft chain testnet
node id: 655ea20acf1ad2c8db56b1874f3142892375d9b0
Using mainnet defaults
Genesis file created: .atomkraft/validator_nodes/val_q312_lth/node_0/config/genesis.json
Writing app config to: .atomkraft/validator_nodes/val_q312_lth/node_0/config/app.toml ... Done.
Writing tendermint config to: .atomkraft/validator_nodes/val_q312_lth/node_0/config/config.toml ... Done.
Writing client config to: .atomkraft/validator_nodes/val_q312_lth/node_0/config/client.toml ... Done.
Expecting value: line 1 column 1 (char 0)
Exit: 1

chain.toml looks like this:

chain_id = "testnet"
validators = 3
accounts = 2
binary = "../provenance/build/provenanced"
hrp_prefix = "provenance"
denom = "hash"
coin_type = 505

[config_node.app]
minimum-gas-prices = "1905hash"
api = { enable = true, swagger = true, enabled-unsafe-cors = true }
rosetta = { enable = false }

[config_node.config]
instrumentation = { prometheus = false }
p2p = { addr_book_strict = false, allow_duplicate_ip = true }

[config_genesis.app_state.gov]
voting_params = { voting_period = "600s" }

[config_genesis.app_state.mint]
minter = { inflation = "0.300000000000000000" }

Are there any other logs generated besides above? 😕

@rnbguy
Copy link
Member

rnbguy commented Nov 10, 2022

It looks like provenanced init doesn't generate any JSON output, which was expected on Atomkraft's side.

Anyway, I created a branch for its fix. But looks like the wallet addresses are not matching. I get this error finally.

...
Validators
-----------------------------------------
pb1y5pe60nx2yxv50663ys5yw0a943hu6fvpnzf0l
pb1zc0jpd7wu630h6tpu4qe7l2z3nfqlgd5xq73zu
pb10cwldaae2svl69uvffhmjgfph0nlzct6p9m4qz
Accounts
-----------------------------------------
pb120kuy85e0nvqr4n8d9l22u8e06dj70ef6g0njh
pb12ptlggsgsmf0za5j52uu0fm7axyvytfjc4vtpa
Non-zero return code 1
Error: failed to validate account in genesis: account pb12dwqnqvfumd3cjn6tdef5rdjufqs9wapywpk8l does not have a balance in the genesis state
...

Atomkraft uses the standard key-derivation used in cosmos-SDK. Can you share what is being used at Provenance?

I also created a personal Atomkraft repo for provenance binary - https://github.com/rnbguy/atomkraft-provenance

@llama-del-rey
Copy link
Author

Thank you for looking into this.

Atomkraft uses the standard key-derivation used in cosmos-SDK. Can you share what is being used at Provenance?
Provenance uses the same thing.

I did make some progress using the following chain.toml and hardcoding a flag for testnet in provenance.

....
hrp_prefix = "tp"
denom = "nhash"
coin_type = 1

[config_node.app]
minimum-gas-prices = "1905nhash"
...

And I get the following error:

node id: ac96cd5cce97158d7b9b1a9c6dbf9321bb8b31be
Using testnet defaults
Genesis file created: .atomkraft/validator_nodes/val_dl5tl0lh/node_0/config/genesis.json
Writing app config to: .atomkraft/validator_nodes/val_dl5tl0lh/node_0/config/app.toml ... Done.
Writing tendermint config to: .atomkraft/validator_nodes/val_dl5tl0lh/node_0/config/config.toml ... Done.
Writing client config to: .atomkraft/validator_nodes/val_dl5tl0lh/node_0/config/client.toml ... Done.
Error: failed to get address from Keybase: tp1y5pe60nx2yxv50663ys5yw0a943hu6fvjc89d4.info: key not found [cosmos/cosmos-sdk@v0.46.3/crypto/keyring/keyring.go:489], could not use address as bech32 string: invalid Bech32 prefix; expected pb, got tp
Usage:
  provenanced add-genesis-account [address_or_key_name] [coin][,[coin]] [flags]

Examples:
$ provenanced add-genesis-account mykey 10000000hash

Is there anyway to pass in flags to provenance binary during startup e.g. provenanced -t for testnet.

@llama-del-rey
Copy link
Author

I pulled your changes and installed the package locally. Reproduced the above error that you got as well. But not sure yet how to go about it

@rnbguy
Copy link
Member

rnbguy commented Nov 10, 2022

Hey, @llama-del-rey 🙂 thanks for reporting the issue 🙌

It was indeed a bug. Looks like Atomkraft was not setting up the custom coin type from chain.toml.

PR is coming 🚀

@llama-del-rey
Copy link
Author

@rnbguy Thank you for quick response.

I think this line is also causing issues: https://github.com/informalsystems/atomkraft/blob/dev/atomkraft/chain/node.py#L71

I wonder if python-hdwallet needs to be updated as well since HASH does not exist in symbols.py: https://github.com/meherett/python-hdwallet/blob/master/hdwallet/symbols.py

@rnbguy
Copy link
Member

rnbguy commented Nov 10, 2022

Yes, you're right. I fixed it in the PR 🙂

You can install the fixes directly from Github

pip uninstall atomkraft -y
pip install git+https://github.com/informalsystems/atomkraft@rano/provenance

@llama-del-rey
Copy link
Author

Oh nice. I think it worked 🙏

@rnbguy
Copy link
Member

rnbguy commented Nov 11, 2022

Awesome! We will release these patches soon, making them available via pypi directly.

Meanwhile, please reach out to us for any other help 🙂

@llama-del-rey
Copy link
Author

Thank you for quick fixes.

@rnbguy rnbguy self-assigned this Nov 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants