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

Add account CLI #1110

Merged
merged 20 commits into from
Jul 14, 2020
Merged

Add account CLI #1110

merged 20 commits into from
Jul 14, 2020

Conversation

dapplion
Copy link
Contributor

@dapplion dapplion commented Jul 7, 2020

Adds an acount CLI feature-pair with lighthouse's account CLI.

How to test

Normal usage flow of the account CLI could be:

lodecli account wallet create --name wallet1 --passphraseFile wallet1.pass
lodecli account wallet list
lodecli account validator create --name wallet1 --passphraseFile wallet1.pass --count 1
lodecli account validator deposit --validator all --eth1Http http://your.unlock.node:8545

Available commands

Summary of the command hierarchy, use --help at any level to get full details and options.

account
  validator
    create    Creates new validators from an existing EIP-2386 wallet...
    deposit   Submits a deposit to an Eth1 validator...
  wallet
    create    Creates a new HD (hierarchical-deterministic) EIP-2386 wallet
    list      Lists the names of all wallets

Directory structure

All major directories are one level deep of the global rootDir path. This account directory structure is very similar to ethdo and ighthouse's, expect that this one mixes account data with db data.

.lodestar/
├── keystores
│   └── 0x871cb1c0b1e6b67473003ccfbdf9532d3b0d29bf51b07df6a3fae2ba25526d18e67a119babd44aa3b22b9bc4ef16f71f
│       ├── eth1-deposit-data.rlp
│       ├── eth1-deposit-gwei.txt
│       └── voting-keystore.json
├── secrets
│   └── 0x871cb1c0b1e6b67473003ccfbdf9532d3b0d29bf51b07df6a3fae2ba25526d18e67a119babd44aa3b22b9bc4ef16f71f
├── validator-db
│   └── 0x871cb1c0b1e6b67473003ccfbdf9532d3b0d29bf51b07df6a3fae2ba25526d18e67a119babd44aa3b22b9bc4ef16f71f
│       ├── 000003.log
│       ├── CURRENT
│       ├── LOCK
│       ├── LOG
│       └── MANIFEST-000002
└── wallets
    └── 05939fbd-923a-4559-b41f-2e43ad8fd80b
        └── 05939fbd-923a-4559-b41f-2e43ad8fd80b

Other minor changes

  • Clean CLI export style to prevent the use of 'as any' casting. Type-safety = 😄
  • CLI now prints help when no command is provided and it's required.
  • CLI now recommends possible command names if no command is matched
  • Added welcome message in help of the root command
🌟 Lodestar: Ethereum 2.0 TypeScript Implementation of the Beacon Chain

Next steps

  • Provide more options to broadcast a deposit data, i.e. connect to Metamask, IPC, Ledger?
  • Support non-HD wallets
  • Add tests

Copy link
Member

@wemeetagain wemeetagain left a comment

Choose a reason for hiding this comment

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

Looks really good, this is great work.
just minor comments and questions

@mpetrunic mpetrunic merged commit 693b3f1 into ChainSafe:master Jul 14, 2020
@dapplion dapplion deleted the dapplion/account-cli branch September 19, 2020 06:54
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

Successfully merging this pull request may close these issues.

3 participants