BitShares Forum

Main => General Discussion => Topic started by: tm22 on July 30, 2014, 11:12:28 am

Title: How to import .json?
Post by: tm22 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
Title: Re: How to import .json?
Post by: svk 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
Title: Re: How to import .json?
Post by: tm22 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?



Title: Re: How to import .json?
Post by: tm22 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.
Title: Re: How to import .json?
Post by: 38PTSWarrior on July 30, 2014, 04:42:41 pm
thanks
Title: Re: How to import .json?
Post by: tm22 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.
Title: Re: How to import .json?
Post by: gamey 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.
Title: Re: How to import .json?
Post by: ripplexiaoshan 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
Title: Re: How to import .json?
Post by: bytemaster 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 (http://tapatalk.com/m?id=1)
Title: Re: How to import .json?
Post by: bitbro on August 01, 2014, 03:56:51 am
Any idea when will the windows wallet be idiot proof, please?