2

Q.1 - This is just to confirm that which of the two methods below, is recommended ??

METHOD - 1

step 1 - cleos -u https://eos.greymass.com wallet create my-wallet

step 2 - cleos -u https://eos.greymass.com/ wallet import -n my-wallet 5ytR......


METHOD - 2

step 1 - cleos --wallet-url https://eos.greymass.com wallet create my-wallet

step 2 - cleos --wallet-url https://eos.greymass.com/ wallet import -n my-wallet 5ytR......

Q.2 - If method-1/method-2 is correct, then what's the point of introducing the other one?

Q.3 - And what about the password generated with a wallet. Does it encrypt the private key just like the way it happens in Greymass eos-voter App i.e. hot-wallet one out of 3 (Hot/Cold/Watch)?

NOTE: it is very essential to know a few details like this for the developers. I might have gone wrong but @Nat and @michaelyeates got me correct. That's why I thought of posting in this main EOS Dev discussion forum.

2 Answers 2

2

Q1/2. Don't connect to an API when dealing with private keys. It is completely unnecessary, and I don't think it will do anything anyway. Wallets are made to be locally stored, not on chain, so I would recommend --wallet-url localhost:8080 (8080 as nodeos comes pre configured to 8888). You can configure this in your wallet's config file or set the flag like I showed above. To find your config file you can go sudo find / -name config.ini and go for the wallet one. You'll also see the nodeos one if you'd like to edit that so you don't have to set flags when launching nodeos.

cleos wallet create -n <NAME_OF_WALLET_HERE>
cleos wallet import <ONWER_PRIVATE_KEY> -n <NAME_OF_WALLET_HERE>
cleos wallet import <ACTIVE_PRIVATE_KEY> -n <NAME_OF_WALLET_HERE>

Q3: Keosd will create an encrypted file when you create a wallet. It also provides you the encryption key to decrypt that wallet when you create it. When you open up your folder with your wallets in it and bring up the wallet file with a text editor, it's just characters.

Keosd will then use these keys to create signatures when it goes the request/response process with cleos.

Please let me know if you'd like additional clarity.

4
  • After your 1st step, why did it show like this- "/usr/local/bin/keosd" launched ? What is the use of this? Is the password generated the encrypting key for my wallet ?
    – abhi3700
    Jul 7, 2018 at 20:14
  • 1
    Yes, the password generated is the encryption key for the wallet. I believe keosd makes wallets with .wallet file name. This your_wallet.wallet file name is the encrypted file that your password decrypts.
    – Nat
    Jul 8, 2018 at 11:24
  • Okay!. Awesome!..thanks. From now on, I have to ensure this - Don't connect to an API when dealing with private keys.
    – abhi3700
    Jul 8, 2018 at 14:45
  • 1
    this answer should be updated Feb 1, 2022 at 8:30
0

I did this and working fine

cleos wallet import -n yourwalletname --private-key yourprivatekey
1
  • it worked, thanks Feb 1, 2022 at 8:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.