Author [EN] [ZH] [ES] [PT] [IT] [DE] [FR] [NL] [TR] [SR] [AR] [RU] [EN] [ZH] [ES] [PT] [IT] [DE] [FR] [NL] [TR] [SR] [AR] [RU] [EN] [ZH] [ES] [PT] [IT] [DE] [FR] [NL] [TR] [SR] [AR] [RU] Topic: How to import .json?  (Read 625 times)

0 Members and 1 Guest are viewing this topic.

Offline tm22

  • Newbie
  • *
  • Posts: 4
    • View Profile
How to import .json?
« on: July 30, 2014, 11:12:28 AM »

Hi,

I hope you can help me.

Today, I installed the BTSX-Client in an virtual machine running Windows 7 and imported my PTS-wallet. I got about 40k BTSX from the genesis-block.
Unfortunately the VM crashed and now I am getting an error when starting the client: "An error occured while trying to start."

Fortunately I created an export of the wallet as .json before this happened.

I reinstalled the client and now I am looking for a way to import that json-wallet.

Hope you can help me.

Thanks and best regards,
Toni

Offline svk

Re: How to import .json?
« Reply #1 on: July 30, 2014, 11:47:24 AM »
Hi,

You should be able to use the command "wallet_create_from_json":

Code: [Select]
Usage:
wallet_create_from_json <json_filename> <wallet_name> <imported_wallet_passphrase>
Creates a new wallet from an exported JSON file

Parameters:
  json_filename (filename, required): the full path and filename of JSON wallet to import
  wallet_name (wallet_name, required): name of the wallet to create
  imported_wallet_passphrase (passphrase, required): passphrase of the imported wallet

Returns:
  void
Worker: dev.bitsharesblocks

Offline tm22

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: How to import .json?
« Reply #2 on: July 30, 2014, 12:32:55 PM »
Hi svk,

Thank you for your response.

I already tried this. Maybe I am doing something wrong.

When I first started the new installed client it asked me for a new password and a name for the new wallet.
Then I opened the console and entered: wallet_create_from_json c:\users\***\desktop\btsx_wallet.json Password where *** is my username.

I am getting this error message:

20019 file_not_found: file not found
Filename to import from could not be found!
    {"filename":"C:Users***Desktopbtsx_wallet.json"}
    bitshares  wallet.cpp:1223 bts::wallet::wallet::create_from_json

    {"filename":"C:Users***Desktopbtsx_wallet.json","wallet_name":"my_walletname"}
    bitshares  wallet.cpp:1241 bts::wallet::wallet::create_from_json

    {}
    bitshares  common_api_client.cpp:723 bts::rpc_stubs::common_api_client::wallet_create_from_json

    {"command":"wallet_create_from_json"}
    bitshares  cli.cpp:540 bts::cli::detail::cli_impl::execute_command

Any idea?




Offline tm22

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: How to import .json?
« Reply #3 on: July 30, 2014, 02:07:41 PM »
Thanks. I think reached the next step.

Now the message is:
20015 password_too_short: password too short
Password too short!
    {"size":0}
    bitshares  wallet.cpp:1064 bts::wallet::wallet::create
Unable to create wallet 'my_walletname'
    {"wallet_name":"my_walletname"}
    bitshares  wallet.cpp:1077 bts::wallet::wallet::create

    {"filename":"c:/BTSXWA~1.JSO","wallet_name":"my_walletname"}
    bitshares  wallet.cpp:1241 bts::wallet::wallet::create_from_json

    {}
    bitshares  common_api_client.cpp:723 bts::rpc_stubs::common_api_client::wallet_create_from_json

    {"command":"wallet_create_from_json"}
    bitshares  cli.cpp:540 bts::cli::detail::cli_impl::execute_command

As the password I entered the one I used for the first wallet which I now try to import. It has more than 16 digits and it is definitely the one I used earlier.


EDIT: Found the solution here: http://wiki.bitshares.org/index.php/BitShares_X_Solutions#Importing_a_JSON_export_from_BitShares_X
You have to put the password in "". Now it worked.

Thanks again.
« Last Edit: July 30, 2014, 02:15:16 PM by tm22 »

38PTSWarrior

  • Guest
Re: How to import .json?
« Reply #4 on: July 30, 2014, 04:42:41 PM »
thanks

Offline tm22

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: How to import .json?
« Reply #5 on: July 31, 2014, 05:47:44 AM »
Today I realized that my balance is gone after restarting the client.

When I try to reimport the wallet again I get the message: 20003 wallet_already_exists: wallet already exists

When I import the wallet again (with the same parameter) it works and the client shows my balance. But after restarting the client the balance is gone and I have to import the wallet twice again.

Do I have to do something like save the balance?

EDIT: Ok, once again I found the solution while testing. I had to rename my new created wallet folder to "default". Now the account is available (including the balance) when starting the client.
« Last Edit: July 31, 2014, 06:33:29 AM by tm22 »

Offline gamey

  • Hero Member
  • *****
  • Posts: 2253
    • View Profile
Re: How to import .json?
« Reply #6 on: July 31, 2014, 06:29:44 PM »
Today I realized that my balance is gone after restarting the client.

When I try to reimport the wallet again I get the message: 20003 wallet_already_exists: wallet already exists

When I import the wallet again (with the same parameter) it works and the client shows my balance. But after restarting the client the balance is gone and I have to import the wallet twice again.

Do I have to do something like save the balance?

EDIT: Ok, once again I found the solution while testing. I had to rename my new created wallet folder to "default". Now the account is available (including the balance) when starting the client.

I'm trying to work up a list of questions about how wallets work together etc.  I've had similar issues.  I import from json, quit the client then my balance isn't there until I reimport from my backup.  It makes it that I do not want to do any transactions and thus vote because of my concerns.


Is there one database file per wallet ?
Can bitshares x client have more than one wallet open at one time ?
Briefly, what does it mean to import a wallet into your client? 
How does the new wallet interact with the previous one?  Are they merged?  Do you need to switch to the new wallet? 
What happens after the reboot/quitting of the client.  Which wallet is chosen as default ?

Maybe I can ask Dan during the dev hangout tomorrow but this sort of thing does't make compelling radio content.
I speak for myself and only myself.

Offline ripplexiaoshan

  • Board Moderator
  • Hero Member
  • *****
  • Posts: 2027
    • View Profile
  • BTS: xiaoshan
Re: How to import .json?
« Reply #7 on: July 31, 2014, 08:30:03 PM »
Your wallet is gone because you didn't log in the correct wallet.

Actually, there are two wallets on your PC, one is the default wallet(blank), the other is the one you just created. However, the wallet client always goes to the default wallet. So, you need to find the directory of wallet and change the wallet name of the newly created wallet to "default" after deleting the previous "default" wallet
BTS ID:xiaoshan

Offline bytemaster

Re: How to import .json?
« Reply #8 on: July 31, 2014, 11:55:25 PM »
Good practice is to never delete any wallet ever.  Just in case


Sent from my iPhone using Tapatalk
For the latest updates checkout my blog: http://bytemaster.bitshares.org
Anything said on these forums does not constitute an intent to create a legal obligation or contract between myself and anyone else.   These are merely my opinions and I reserve the right to change them at any time.

bitbro

  • Guest
Re: How to import .json?
« Reply #9 on: August 01, 2014, 03:56:51 AM »
Any idea when will the windows wallet be idiot proof, please?

 

Google+