ChainMovers / suibase

Sui development environment and cookbook.
https://suibase.io
Apache License 2.0
35 stars 6 forks source link

Invalid private key format error #93

Closed georgescharlesbrain closed 4 months ago

georgescharlesbrain commented 4 months ago

I'm adding my own private keys with add_private_keys in the suibase.yaml It stopped working after I updated today (didn't update for 4 months though). "Error: Invalid private key format [0x3" Did you change the support or format of the private keys? Or what do you think is the error?

mario4tier commented 4 months ago

You can now do "~/suibase/update" to get the fix.

The problem was a recent change in the JSON output from the Sui keytool command.

The fix to Suibase was: image

I should have detected that earlier... so I will add today an automated test for the add_private_key.

Thanks for reporting this.

mario4tier commented 4 months ago

Take note that "sui client addresses" now show only address with an alias (this is not something I control, I think the Sui binary should instead display all addresses).

So "add_private_keys" works. The key is added to sui.keystore and can be used, but it needs also an entry in sui.aliases to show up with "sui client addresses".

I think it is a minor problem, but I will try to fix it by tomorrow (I will create dummy "suibase-yaml-x" aliases).

===

As a workaround you can see the address with "sui keytool list". That one shows addresses even without alias (Mysten Lab is not consistent on this).

georgescharlesbrain commented 4 months ago

It seems "lsui client addresses" does give me an output with auto generated aliases.
Where should I be able to edit sui.aliases?

mario4tier commented 4 months ago

Yes, the auto-generated ones have aliases, so they are shown.

I have to modify the code to do the same with the ones added with "add_private_keys".

In meantime, may be you can edit the alias with "lsui keytool update-alias"?

sui.aliases is co-located with its sui.keystore.

So for localnet:   ~/suibase/workdirs/localnet/config/sui.aliases

georgescharlesbrain commented 4 months ago

Your advice is much appreciated thanks.

mario4tier commented 4 months ago

With latest Suibase, the add_private_keys entries will now have an "alias-\<number>" generated.

Example: image