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

feat(config): add HD wallet parameters address index and account number to the chain account config #3999

Merged
merged 3 commits into from
Mar 6, 2024

Conversation

Pantani
Copy link
Collaborator

@Pantani Pantani commented Mar 2, 2024

close #3967

Description

Add address index and account number to the chain config to be added into the key add command flag.

How to test

Scaffold a mars chain (ignite s chain mars) and use this test config.yml file:

version: 1
accounts:
  - name: alice
    mnemonic: apple pony round crazy boil solid inch beef equal attract soul accuse nice thumb shadow egg drum valley grace wish elbow hat salute pair
    cointype: 118
    account_number: 1
    address_index: 2
    coins:
      - 20000token
      - 200000000stake
  - name: bob
    coins:
      - 10000token
      - 100000000stake
client:
  openapi:
    path: docs/static/openapi.yml
faucet:
  name: bob
  coins:
    - 5token
    - 100000stake
validators:
  - name: alice
    bonded: 100000000stake
  • run the chain with ignite: ignite c serve --clear-cache --reset-once, and you can see the Alice address will be cosmos19jn5wrfgd0tgrh083u0qe54tj03esg68kyu6tz:
  Blockchain is running
  
  ✔ Added account alice with address cosmos19jn5wrfgd0tgrh083u0qe54tj03esg68kyu6tz and mnemonic:
  apple pony round crazy boil solid inch beef equal attract soul accuse nice thumb shadow egg drum valley grace wish elbow hat salute pair
  
  ✔ Added account bob with address cosmos1ns5jkh9hqpxnpqkz34yt0wlzwvnfu8nfej0fd7 and mnemonic:
  birth various position huge derive sugar endorse cliff group muscle report festival there trash fluid morning trend bargain razor sister aunt melody injur
  
  🌍 Tendermint node: http://0.0.0.0:26657
  🌍 Blockchain API: http://0.0.0.0:1317
  🌍 Token faucet: http://0.0.0.0:4500
  
  ⋆ Data directory: /Users/danilopantani/.mars
  ⋆ App binary: /Users/danilopantani/Desktop/go/bin/marsd
  
  Press the 'q' key to stop serve

You can check the wallet generation using the Ian Coleman tool

@Pantani Pantani self-assigned this Mar 2, 2024
@github-actions github-actions bot added component:ci CI/CD workflow and automated jobs. component:configs type:services Service-related issues. type:internal component:packages labels Mar 2, 2024
@Pantani Pantani marked this pull request as ready for review March 2, 2024 10:54
@Pantani Pantani changed the title feat: add address index and account number HD parameters feat: add address index and account number HD wallet parameters Mar 4, 2024
@Pantani Pantani changed the title feat: add address index and account number HD wallet parameters feat: add HD wallet parameters address index and account number Mar 4, 2024
@Pantani Pantani changed the title feat: add HD wallet parameters address index and account number feat: add HD wallet parameters address index and account number to the chain account config Mar 4, 2024
@Pantani Pantani requested review from salmad3 and toschdev as code owners March 4, 2024 14:38
@Pantani Pantani changed the title feat: add HD wallet parameters address index and account number to the chain account config feat(config): add HD wallet parameters address index and account number to the chain account config Mar 4, 2024
@Pantani Pantani enabled auto-merge (squash) March 5, 2024 16:33
Copy link

codecov bot commented Mar 5, 2024

Codecov Report

Attention: Patch coverage is 0% with 37 lines in your changes are missing coverage. Please review.

Project coverage is 26.11%. Comparing base (bd734bb) to head (d8e3b30).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3999      +/-   ##
==========================================
- Coverage   26.13%   26.11%   -0.03%     
==========================================
  Files         304      304              
  Lines       25303    25331      +28     
==========================================
  Hits         6614     6614              
- Misses      18112    18140      +28     
  Partials      577      577              
Files Coverage Δ
ignite/config/chain/base/config.go 88.88% <ø> (ø)
ignite/services/chain/faucet.go 0.00% <0.00%> (ø)
ignite/pkg/chaincmd/runner/account.go 0.00% <0.00%> (ø)
ignite/services/chain/init.go 0.00% <0.00%> (ø)
ignite/pkg/cosmosfaucet/cosmosfaucet.go 0.00% <0.00%> (ø)
ignite/pkg/chaincmd/chaincmd.go 0.00% <0.00%> (ø)

Copy link
Member

@julienrbrt julienrbrt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

@Pantani Pantani merged commit d8c3cac into main Mar 6, 2024
46 checks passed
@Pantani Pantani deleted the feat/wallet-index branch March 6, 2024 12:31
julienrbrt pushed a commit that referenced this pull request May 29, 2024
…umber` to the chain account config (#3999)

* add address index and account number flags to the add keys command

* add changelog

---------

Co-authored-by: Pantani <Pantani>
@Pantani Pantani added the backport/v28.x.y Backport to v28.x.y label Jul 2, 2024
mergify bot pushed a commit that referenced this pull request Jul 2, 2024
…umber` to the chain account config (#3999)

* add address index and account number flags to the add keys command

* add changelog

---------

Co-authored-by: Pantani <Pantani>
(cherry picked from commit d8c3cac)
@Pantani Pantani removed the backport/v28.x.y Backport to v28.x.y label Jul 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Dynamic Account Index Selection
2 participants