How to change shield addresses on secure node?

Hi,

i run a horizen securenode and i want to change the shield addresses.
everytime I tried to import the key, I got an error.

zen-cli z_importkey <z_private_key>
error: couldn't connect to server: timeout reached (code 0)

first: how can I delete the old addresses?
second: how can I add existing addresses with private key?

Thanks!

@kurtme
The following is the correct formatting.
zen-cli z_importkey "privatekey"
Replace privatekey with the shielded private key you’re trying to import but keep the quotes.

You cannot delete old addresses from the wallet.dat. What you can do is stop zend, then rename the wallet.dat to something like walletb.dat to create a backup, then start zend back up. You will then have a fresh wallet.dat generated to which you can import your private keys.

For transparent addresses (T Addresses), you can use the following to import using their private keys:
zen-cli importprivkey "horizenprivkey"
Replace horizenprivkey with the key you need to import., be sure to include the quotes.

Thanks for your quick reply.

When I run the z importkey command, the node crashes.
I use the WhenLamboMoon / docker-zen-node.

Here are my bash commands and outputs:

# systemctl stop zen-node
# cp /mnt/zen/wallet.dat /mnt/zen/wallet.dat.backup
# rm /mnt/zen/wallet.dat
# ls -lah /mnt/zen | grep wallet
-rw-------  1   9001   9001    84K Aug  2 08:17 wallet.dat.backup
# systemctl start zen-node
# ls -lah /mnt/zen | grep wallet
-rw-------  1   9001   9001  80K Aug  2 08:22 wallet.dat
-rw-------  1   9001   9001  84K Aug  2 08:17 wallet.dat.backup
# docker exec -it zen-node gosu user zen-cli z_importkey "Abcde1234567890aBcDeFgHiJkLmmNoPqRsTuVwXyZ"
error: couldn't connect to server: timeout reached (code 0)
(make sure server is running and you are connecting to the correct RPC port)

it takes about 10 minutes before the timeout message appears

@kurtme
Sorry, we do not provide any support to any third party tools such as the WhenLamboMoon docker container. If you want support for that configuration, you will need to go through the originating author.
We only provide support for configurations setup following the official guide.

Thanks for the answer.
I have now set up a node manually and it works directly.

can you finally tell me what address is in the wallet after it has been created?
If I delete it and the wallet is created again, it is never empty, there is always another address in it.