Cardano sl wallet restore


#1

I am migrating all wallet servers due to the security issue. But it seems ADA wallet is not migrated successfully.

I have tried below

POST https://127.0.0.1:8090/api/v1/wallets - Tried to restore my wallet with Mnemonic. Now I can see my wallet info.
GET https://127.0.0.1:8090/api/v1/wallets/{walletId}/accounts - There is only one account in my wallet. But I can see more than 600 accounts in the previous server.

Please anyone can help me to migrate my wallet and accounts?


#2

Do you see the keyword difference in your statements? If you had 600 wallets then you need to restore them 600 times with POST/api/v1/wallets.


#3

What it mean is I have to import my accounts after importing my wallet like below?

  1. import wallet: POST https://127.0.0.1:8090/api/v1/wallets
  2. import accounts 600 times: POST https://127.0.0.1:8090/api/v1/wallets/{walletId}/accounts/{accountId}

#4

Do you have 600 wallets, or 600 accounts?


#5

600 accounts in a single wallet


#6

{“Right”:{“cwId”:“xxx”,“cwMeta”:{“cwName”:“xxx”,“cwAssurance”:“CWAStrict”,“cwUnit”:0},“cwAccountsNumber”:602,“cwAmount”:{“getCCoin”:“241686967642”},“cwHasPassphrase”:xxx,“cwPassphraseLU”:xxx}}


#7

Oh… sorry 600 accounts in my previous server


#8

if account was already used (meaning that any address from this account had any transactions on it) then it would be visible automatically directly after restoring the wallet.

Btw, did you wait for the proper wallet restoration, after calling POST/api/v1/wallets?

If your wallet is restored properly and you don’t see your accounts - that just means you have no transaction in them. In that case if you still need them (empty) - then you need to re-create them by calling POST/api/v1/wallets/{walletId}/accounts

There’s no such endpoint. You cannot create an account with a specific ID. You can just ask wallet to create A new account and it will just use next ID. Having empty accounts is a weird use-case, usually new accounts are created on-demand meaning that you will only create an account when you need to send a transaction - in that case all accounts would be NON-empty and would be automatically restored.

Maybe you haven’t properly wait for the wallet restoration.


#9

Thank you for your reply!


#10

I could see only initial account… and syncState is “synced”

{“data”:{“id”:“xxx”,“name”:“coinchel”,“balance”:0,“hasSpendingPassword”:false,“spendingPasswordLastUpdate”:“2018-06-21T08:07:29.670715”,“createdAt”:“2018-06-21T08:07:29.670715”,“assuranceLevel”:“strict”,“syncState”:{“tag”:“synced”,“data”:null}},“status”:“success”,“meta”:{“pagination”:{“totalPages”:1,“page”:1,“perPage”:1,“totalEntries”:1}}}


#11

I could achieve my goal with the following APIs

  1. https://127.0.0.1:8090/api/backup/export/{walletId}
  2. https://127.0.0.1:8090/api/backup/import

restore didn’t actually restored my accounts.


#12

Because all of them are most definitely had no transactions and I have explained that it’s exactly how it works and they are not expected to be restored.

Glad it worked out for you.