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

adding in ledger support #4290

Merged
merged 17 commits into from
Oct 12, 2020
Merged

adding in ledger support #4290

merged 17 commits into from
Oct 12, 2020

Conversation

whyrusleeping
Copy link
Member

@whyrusleeping whyrusleeping commented Oct 10, 2020

Still some work to do here, but this does work!

Basic instructions:

First build lotus-wallet (patched to use the ledger wallet code), configure your lotus daemon to use it, and run it.
Then,

lotus-shed ledger list #pick a path
lotus-shed ledger key-info "m/44'/461'/0'/0/0"

put the last line of that output into a file, ledgerkey.json or something
Start lotus-wallet:

lotus-wallet start --ledger

Setup config in lotus for remove wallet: $LOTUS_PATH/config.toml:

[Wallet]
RemoteBackend="http://127.0.0.1:1777" #address can be changed when running `lotus-wallet start`

Import the key info into the wallet:

lotus wallet import --format=json-lotus ledgerkey.json

Now the key should show up in lotus wallet list

If you try to sign anything with the key, for example:

lotus send --from=LEDGERADDR f010101 123

It will prompt you to approve the transaction on your ledger, blocking until you approve it.

Comment on lines 1252 to 1253
return nil
// TODO: this causes super slow startup...
Copy link
Contributor

Choose a reason for hiding this comment

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

TODO: Remove before merge (Tho I guess we can also fix this while here)

@magik6k magik6k force-pushed the feat/ledger-integration branch 2 times, most recently from 546f1f5 to de59d08 Compare October 10, 2020 11:07
cmd/lotus-shed/ledger.go Outdated Show resolved Hide resolved
}

func (m MultiWallet) WalletImport(ctx context.Context, info *types.KeyInfo) (address.Address, error) {
w := firstNonNil(m.Remote, m.Ledger, m.Local)
Copy link
Contributor

@Kubuxu Kubuxu Oct 10, 2020

Choose a reason for hiding this comment

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

This means that you cannot import to a normal key if you have a ledger, or ledger key if you have Remote (the latter I think might be fine).

Probably the solution is to make the Ledger key be different type of key.

whyrusleeping and others added 10 commits October 12, 2020 00:07
Signed-off-by: Jakub Sztandera <[email protected]>
Signed-off-by: Jakub Sztandera <[email protected]>
Signed-off-by: Jakub Sztandera <[email protected]>
Signed-off-by: Jakub Sztandera <[email protected]>
Signed-off-by: Jakub Sztandera <[email protected]>
Signed-off-by: Jakub Sztandera <[email protected]>
Signed-off-by: Jakub Sztandera <[email protected]>
@Kubuxu Kubuxu force-pushed the feat/ledger-integration branch from 644c914 to 2b21fde Compare October 11, 2020 22:08
Jakub Sztandera added 3 commits October 12, 2020 00:48
Signed-off-by: Jakub Sztandera <[email protected]>
Signed-off-by: Jakub Sztandera <[email protected]>
@Kubuxu Kubuxu changed the title WIP: adding in ledger support adding in ledger support Oct 11, 2020
@magik6k magik6k merged commit 65883cb into master Oct 12, 2020
@magik6k magik6k deleted the feat/ledger-integration branch October 12, 2020 13:09
@Kubuxu
Copy link
Contributor

Kubuxu commented Oct 12, 2020

It would be great to write some docs on this.

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