nervosnetwork / ckb-cli

CKB command line interface
MIT License
55 stars 35 forks source link

Compatibility issue with Ledger #542

Open Keith-CY opened 1 year ago

Keith-CY commented 1 year ago

CKB Cli is expected to be able to work with Ledger via ckb-plugin-ledger, but the plugin was declared out-of-date by @TheWaWaR, also confirmed by user @191855 (https://github.com/nervosnetwork/neuron/issues/2583#issuecomment-1418268986). An update on ckb-plugin-ledger is desired to re-enable this feature.

PS: This issue is opened here instead of https://github.com/obsidiansystems/ckb-plugin-ledger for better tracking, suggested by @quake

Keith-CY commented 7 months ago

Hi there, ckb-cli is the default signer of Kuai to deploy contracts.

Now we are going to support ledger for contract deployment, so I wonder if there's a plan to fix the compatibility issue.

If there isn't such a plan, we will add ledger support in Lumos first.

15168316096 commented 7 months ago

I tried to compile the ckb-plugin-ledger project using both cargo build and nix-build and found that the required version of the ckb-cli is too old, leading to compilation failures.

nix-build:

vbnet
Copy code
error: failed to sync

Caused by:
  failed to load pkg lockfile

Caused by:
  failed to get `ckb-cli-plugin-protocol` as a dependency of package `ckb-plugin-ledger v0.2.1 (/build/source)`

Caused by:
  failed to load source for dependency `ckb-cli-plugin-protocol`

Caused by:
  Unable to update https://github.com/nervosnetwork/ckb-cli?rev=babc52ae593474f7fddb80f7c229374203310d6a#babc52ae

Caused by:
  object not found - no match for id (babc52ae593474f7fddb80f7c229374203310d6a); class=Odb (9); code=NotFound (-3)
...
cargo build:

vbnet
Copy code
error: failed to get ckb-cli-plugin-protocol as a dependency of package ckb-plugin-ledger v0.2.1 (/workspace/ckb-plugin-ledger)

Caused by:
  failed to load source for dependency ckb-cli-plugin-protocol

Caused by:
  Unable to update https://github.com/nervosnetwork/ckb-cli?rev=babc52ae593474f7fddb80f7c229374203310d6a#babc52ae

Caused by:
  object not found - no match for id (babc52ae593474f7fddb80f7c229374203310d6a); class=Odb (9); code=NotFound (-3)

Afterward, I attempted to use the same Cargo.toml as ckb-cli, and I found that some internal implementations in ckb-plugin-ledger need to be adapted to the new development dependencies.

TheWaWaR commented 7 months ago

I think maybe the branch of committed id belong to already deleted, but the commit can browser in github page. You can try clone the repo and checkout the commit and push a special branch in you forked repo. Then you reference the commit id in your repo, it might works.

Keith-CY commented 7 months ago

Hi @15168316096 @TheWaWaR Any update on the plugin?

TheWaWaR commented 7 months ago

Hi @15168316096 @TheWaWaR Any update on the plugin?

I have no idea, please contact the current maintainer.

doitian commented 7 months ago

@code-monad said he will take a look at this problem

code-monad commented 7 months ago

I've made changes that makes this repo compiles without error. Need some testing tho. Trying to test with my handing ledge nano s now.

code-monad commented 7 months ago

I've made changes that makes this repo compiles without error. Need some testing tho. Trying to test with my handing ledge nano s now.

Just noticed I forgot to paste the PR link. Here it is: https://github.com/code-monad/ckb-plugin-ledger/pull/1

Also, this is tested and worked fine on my own Ledge Nano S.

See following example video

https://github.com/nervosnetwork/ckb-cli/assets/45656526/5f4c3401-abca-45cc-9ff3-48b59cf7a962

code-monad commented 7 months ago

update: it is recommended to move to cryptape's fork: https://github.com/cryptape/ckb-plugin-ledger since the original repo is inactive, and we'll take over the maintenance work