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

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

Open
zwong91 opened this issue Jan 11, 2024 · 5 comments

Comments

@zwong91
Copy link

zwong91 commented Jan 11, 2024

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

@frol
Copy link
Collaborator

frol commented Jan 11, 2024

@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
Copy link
Collaborator

frol commented Jan 11, 2024

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

@VlodkoMr
Copy link

VlodkoMr commented Feb 9, 2024

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"?

@frol
Copy link
Collaborator

frol commented Feb 10, 2024

@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
Copy link
Collaborator

frol commented Feb 10, 2024

@VlodkoMr Do you try to use it from WSL? That might not have system keychain #299

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: NEW❗
Development

No branches or pull requests

3 participants