near-cli-rs icon indicating copy to clipboard operation
near-cli-rs copied to clipboard

【BUG】Create a new account with Automatically generate a key pair and Save automatically generated key pair to keychain is not work

Open zwong91 opened this issue 1 year ago • 5 comments

sudo ./target/release/near

What are you up to? (select one of the options with the up-down arrows on your keyboard and press Enter) account - Manage accounts What do you want to do with an account? create-account - Create a new account How do you cover the costs of account creation? fund-myself - I would like fund myself to cover the cost of creating an account What is the new account ID? abc-keyring-ro

Do you want to check the existence of the specified account so that you don’t waste tokens with sending a transaction that won't succeed? No, I know that this account does not exist and I want to proceed.

Enter the amount of the NEAR tokens you want to fund the new account with (example: 10NEAR or 0.5near or 10000yoctonear): 0.1 NEAR Add an access key for this account: autogenerate-new-keypair - Automatically generate a key pair Save an access key for this account: save-to-keychain - Save automatically generated key pair to keychain What is the signer account ID? root What is the name of the network? aws-utility-test

Unsigned transaction:

signer_id: root receiver_id: testnet actions: -- function call: method name: create_account args: { "new_account_id": "abc-keyring-ro", "new_public_key": "ed25519:HDrsfw3BQ1fMLXLPBjV47WgGnDtoLVZCAWen56KN3Ste" } gas: 30.0 Tgas deposit: 0.1 NEAR

Select a tool for signing the transaction: sign-with-legacy-keychain - Sign the transaction with a key saved in legacy keychain (compatible with the old near CLI)

Your transaction was signed successfully. Public key: ed25519:BuKXfQ19qzKkx8Y7h5wamNzg5JU8QHzk7NYrz25zv5vp Signature: ed25519:4sc6hEzguExRqoNa7UdUo732T2G2mcwsCFApEBc63YjM1AyAZQTxYkSnxKMEETdSLuRPHpTfKQPtnq9BTk8Nj2uS

How would you like to proceed? send - Send the transaction to the network Here is your console command if you need to script it or re-run: ./target/release/near account create-account fund-myself abc-keyring-ro '0.1 NEAR' autogenerate-new-keypair save-to-keychain sign-as root network-config aws-utility-test sign-with-legacy-keychain send Error: 0: Failed to save password to keychain

Location: src/transaction_signature_options/mod.rs:111

Backtrace omitted. Run with RUST_BACKTRACE=1 environment variable to display it. Run with RUST_BACKTRACE=full to include source snippets

zwong91 avatar Jan 11 '24 07:01 zwong91

@zwong91 Please format the text as it is really hard to understand it. Also, provide details about your operating system and version of CLI

frol avatar Jan 11 '24 09:01 frol

@zwong91 There might be an issue with the system keychain not being configured for the root account, try running near cli without sudo

frol avatar Jan 11 '24 09:01 frol

The same issue on creating new account:

How would you like to proceed? create      - Create a new account
Here is your console command if you need to script it or re-run:
**near account create-account sponsor-by-faucet-service test-new-acc-v9.testnet autogenerate-new-keypair save-to-keychain network-config testnet create**

Error:
   0: Failed to save password to keychain
   1: Platform secure storage failure: no secret service provider or dbus session found
   2: no secret service provider or dbus session found

Location:
   src/common.rs:1150

Backtrace omitted. Run with RUST_BACKTRACE=1 environment variable to display it.
Run with RUST_BACKTRACE=full to include source snippets.

What does it mean in the error "no secret service provider or dbus session found"?

VlodkoMr avatar Feb 09 '24 09:02 VlodkoMr

@VlodkoMr It seems that there is no system secure keychain configured on your system. You can use legacy keychain (which will store keys in ~/.near-credentials folder)

frol avatar Feb 10 '24 22:02 frol

@VlodkoMr Do you try to use it from WSL? That might not have system keychain https://github.com/near/near-cli-rs/issues/299

frol avatar Feb 10 '24 23:02 frol