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

Problem: Missing testnet specific HD path and address prefix #155

Closed
calvinaco opened this issue Oct 8, 2020 · 4 comments
Closed

Problem: Missing testnet specific HD path and address prefix #155

calvinaco opened this issue Oct 8, 2020 · 4 comments

Comments

@calvinaco
Copy link
Contributor

calvinaco commented Oct 8, 2020

Right now it is using cro prefixed address and the mainnet HD path all the time. To avoid confusion and accidentally spending mainnet funds in the future, we should support tcro and/or dcro prefix.

For the Testnet we are setting up, a quick solution could be to replace all cro prefix to tcro in master branch. In the future we have a more dynamic approach of doing so.

After discussing with @lezzokafka @allthatjazzleo , we have two potential long-term solutions:

  1. Use Idflag to control the prefix on compile time, we will have multiple binaries for different network
  2. Support runtime flag --network to dynamically switch between network

Updated

  1. Configurable HD path and prefix in genesis file (@yihuang )
@yihuang
Copy link
Collaborator

yihuang commented Oct 8, 2020

make the prefix configurable in genesis?

@tomtau
Copy link
Contributor

tomtau commented Oct 9, 2020

Also the HD path?

@calvinaco calvinaco changed the title Problem: Missing testnet specific address prefix Problem: Missing testnet specific HD path and address prefix Oct 9, 2020
@tomtau
Copy link
Contributor

tomtau commented Oct 9, 2020

btw that "global prefix" config is going away in some future version: cosmos/cosmos-sdk#7448

@tomtau
Copy link
Contributor

tomtau commented Oct 12, 2020

given the API around this is in flux (there may not be a "global config" in the future), maybe the option 1 is the simplest initially (later when the API stabilises, perhaps option 2), e.g. have prefix.mainnet.go and prefix.testnet.go with something like // +build mainnet and // +build !mainnet in their top?

@calvinaco calvinaco self-assigned this Oct 12, 2020
tomtau added a commit that referenced this issue Oct 12, 2020
)

Solution: removed hardcoded names
+ testnet-specific config -- can be active if built with "-tags testnet"
@calvinaco calvinaco removed their assignment Oct 12, 2020
tomtau added a commit that referenced this issue Oct 13, 2020
)

Solution: removed hardcoded names
+ testnet-specific config -- can be active if built with "-tags testnet"
@tomtau tomtau closed this as completed in fa72e8c Oct 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants