ava-labs/subnet-cli

SubnetCLI generates hex key and expects cb58 format

aaronbuchwald opened this issue · 5 comments

The subnet-cli command subnet-cli create key generates a key in hex format as expected by MM, but then it expects the private key that it uses for other interactions to be in the PrivateKey-<CB58 string> format. We should fix this so that it either generates a private key in the expected format for interaction with the subnet-cli or allow the subnet-cli to read in both formats.

As the second option "... or allow the subnet-cli to read in both format" would probably ensue that create key would have to also allow both formats, adding to the complexity of having to probably specify the requested format in some form via cli param, I am opting for the first suggestion: "generates a private key in the expected format"

image

subnet-cli wizard --node-ids=NodeID-Gk9hqRt51oKinFJwxDPFj34akC5Aa54op --vm-genesis-path=networks/11111/genesis.json --vm-id=srEXiWaHuhNyGwPUi444Tu47ZEDwxTWrbQiuD7FmgSAQ6X7Dy --chain-name=subnetevm

i got error "invalid private key length (expect 64 bytes in hex)". 
It surely seems that the tool expects the private key in hex format which we have already tried.

Hi, when will this be deployed

Still facing this issue. Mentioning the details below.

Platform details:

  • OS - Ubuntu 20.04.4 LTS
  • Go version - go1.18.1 linux/amd64
  • Subnet-cli version - 0.0.3 (commit hash fe9e0dc)

Steps to reproduce

  1. git clone https://github.com/ava-labs/subnet-cli.git;
  2. cd subnet-cli;
  3. go install -v .;
  4. go/bin/subnet-cli create key

The create command generates a private key in hex format. Here is the generated key eab41ec52f9c7757cd3d7ba894f022253c9d480ff2224b882b687c6f18de8d19

I went through this flow and was not able to replicate any errors

git clone https://github.com/ava-labs/subnet-cli.git
cd subnet-cli
go install -v .;
subnet-cli create key

This creates a valid private key file for me that works with the wizard. I tested this on both go1.17.9 and go1.18.1. Could you please include the final command that gives you the error with the full output of every step?