Author Topic: How to import account to CLI client?  (Read 2053 times)

0 Members and 1 Guest are viewing this topic.

Offline clayop

  • Hero Member
  • *****
  • Posts: 2033
    • View Profile
    • Bitshares Korea
  • BitShares: clayop
Try doing a wallet_regenerate_keys. It should be registered.

I found the problem... I was on the wrong version. (Although I followed the instruction. Do I have to more?)

Here are commands I did

Code: [Select]
sudo apt-get update
sudo apt-get install cmake git libreadline-dev uuid-dev g++ libdb++-dev libdb-dev zip libssl-dev openssl build-essential python-dev autotools-dev libicu-dev libbz2-dev libboost-dev libboost-all-dev
git clone https://github.com/dacsunlimited/bitsharesx.git
cd bitsharesx
git submodule init
git submodule update
cmake .
make
Bitshares Korea - http://www.bitshares.kr
Vote for me and see Korean Bitshares community grows
delegate-clayop

Offline Riverhead

Try doing a wallet_regenerate_keys. It should be registered.

Offline clayop

  • Hero Member
  • *****
  • Posts: 2033
    • View Profile
    • Bitshares Korea
  • BitShares: clayop
Yes, but it doesn't work.

The situation is:
-I have one windows GUI wallet and one linux CLI wallet.
-Both have the same account with the same public Key
-While the account on windows GUI is registered, the account on linux CLI is not registered.

Bug??
Bitshares Korea - http://www.bitshares.kr
Vote for me and see Korean Bitshares community grows
delegate-clayop

Offline Riverhead

Did you try wallet_account_register?

Offline clayop

  • Hero Member
  • *****
  • Posts: 2033
    • View Profile
    • Bitshares Korea
  • BitShares: clayop
One more problem... I successfully import my account, but it seems not to be synced. (I import registered account but my account information reports that the account is not registered.
Bitshares Korea - http://www.bitshares.kr
Vote for me and see Korean Bitshares community grows
delegate-clayop

Offline clayop

  • Hero Member
  • *****
  • Posts: 2033
    • View Profile
    • Bitshares Korea
  • BitShares: clayop
wallet_import_private_key has 4 arguments:
Code: [Select]
(wallet closed) >>> help wallet_import_private_key
Usage:
wallet_import_private_key <wif_key> [account_name] [create_new_account] [rescan]
Loads the private key into the specified account. Returns which account it was actually imported to.

Parameters:
  wif_key (wif_private_key, required): A private key in bitcoin Wallet Import Format (WIF)
  account_name (account_name, optional, defaults to null): the name of the account the key should be imported into, if null then the key must belong to an active account
  create_new_account (bool, optional, defaults to false): If true, the wallet will attempt to create a new account for the name provided rather than import the key into an existing account
  rescan (bool, optional, defaults to false): If true, the wallet will rescan the blockchain looking for transactions that involve this private key


So, to import the key into an existing account you have to do what you have already tried.
If you want to create a new account with an existing key, you have to set the third argument to true (and usually also the fourth).

Great thanks!!!
Bitshares Korea - http://www.bitshares.kr
Vote for me and see Korean Bitshares community grows
delegate-clayop

Offline pc

  • Hero Member
  • *****
  • Posts: 1530
    • View Profile
    • Bitcoin - Perspektive oder Risiko?
  • BitShares: cyrano
wallet_import_private_key has 4 arguments:
Code: [Select]
(wallet closed) >>> help wallet_import_private_key
Usage:
wallet_import_private_key <wif_key> [account_name] [create_new_account] [rescan]
Loads the private key into the specified account. Returns which account it was actually imported to.

Parameters:
  wif_key (wif_private_key, required): A private key in bitcoin Wallet Import Format (WIF)
  account_name (account_name, optional, defaults to null): the name of the account the key should be imported into, if null then the key must belong to an active account
  create_new_account (bool, optional, defaults to false): If true, the wallet will attempt to create a new account for the name provided rather than import the key into an existing account
  rescan (bool, optional, defaults to false): If true, the wallet will rescan the blockchain looking for transactions that involve this private key


So, to import the key into an existing account you have to do what you have already tried.
If you want to create a new account with an existing key, you have to set the third argument to true (and usually also the fourth).
Bitcoin - Perspektive oder Risiko? ISBN 978-3-8442-6568-2 http://bitcoin.quisquis.de

Offline clayop

  • Hero Member
  • *****
  • Posts: 2033
    • View Profile
    • Bitshares Korea
  • BitShares: clayop
I attempted to "wallet_import_private_key [PrivKey] [account name]" but it gave me the error message as follow,

current_account.valid(): You must create an account before importing a key

How can I resolve this problem? Any clues?
Bitshares Korea - http://www.bitshares.kr
Vote for me and see Korean Bitshares community grows
delegate-clayop