Change unlock password of wallet with active host.
-
Hello fellow Sia users,
I'm running a host on a headless server and want to change the wallet unlock pw from the long and bulky seed to a custom one.As far as I know the only way to set a custom pw is during the initialization "siac wallet init -p"
Is there another option?
If not, how can I create a new wallet and import the funds and host-contracts from the old wallet?kind regards
-
Currently there is no way to change the encryption password on an existing wallet. The workaround is, as you guessed, to create a new wallet. The API endpoint
/wallet/init/seedcan create a new wallet using your existing seed and a new password.Unfortunately,
siacdoes not currently support the--forceflag when using this endpoint. So you have two options:-
Use
curlto call the API endpoint:curl -A "Sia-Agent" -X POST "/wallet/init/seed?encryptionpassword=[pw]&seed=[seed]&force=true". I'm not sure if the seed needs to be manually URL-encoded (since it contains spaces) so this could take some fiddling. -
Manually delete your existing wallet folder (while
siadis stopped), then use thesiaccommandsiac wallet init-seed -p. You will be prompted for your old seed and new encryption password.
Afterwards, unlock your wallet using the new password and it will begin resyncing. This can take a while because the wallet has to process the whole blockchain. Also, you should backup your existing seed and wallet folder beforehand just in case something goes wrong.
EDIT: we just added the
--forceflag tosiac wallet init-seed. It will be included in the next release. Or if you're able to compile Sia from source, you can use it immediately by pulling the latest master branch. :)
-
-
thanks for your answer, I will just wait for the next release and do it the official way.
Anyway I will create a backup of the /wallet and /seed folder before the (re-) initialization.
-
hm I tried it after upgrading to 1.2.1. and it seems the -p flag is no option
tested command:
./siac wallet init-seed --force -poutput:
Error: unknown shorthand flag: 'p' in -p
Usage:
./siac wallet init-seed [flags]Flags:
--force destroy the existing walletGlobal Flags:
-a, --addr string which host/port to communicate with (i.e. the host/port siad is listening on) (default "localhost:9980")
-
Any thoughts on my issue?
-
yeah, looks like we need to add the
-pflag toinit-seed. Will have that released soon, alongside the other wallet fixes.