Hop
Search…
Keystore
Hop Node keystore documentation

Generate Keystore

Use the keystore generate command to generate an encrypted keystore:
Docker
Node
1
docker run -it -v ~/.hop-node:/root hopprotocol/hop-node keystore generate --path /root/keystore.json
Copied!
1
hop-node keystore generate
Copied!
It will prompt you for a passphrase:
1
Enter new keystore encryption passphrase: ********
2
Confirm passphrase: ********
Copied!
Then it will display your seed phrase. This only displayed once here so make sure to copy it.
1
This is your seed phrase. Write it down and store it safely.
2
3
inquiry leisure hurry trade leave gown add sad feel salad seat west scare filter swear siege buyer funny detect noble scene index traffic extend
4
5
Press [Enter] when you have written down your mnemonic.
Copied!
Next you will have to paste in the mnemonic you copied to confirm:
1
Please type mnemonic (separated by spaces) to confirm you have written it down
2
3
: nice grow shine drift recycle survey piano rifle soccer business evidence stand pave belt room size neither volume odor sorry ten flash deliver rack
Copied!
Your keystore should now be generated and stored in the default location~/.hop-node/keystore.json
1
Creating your keys
2
Creating your keystore
3
Public address: 0x2c2c2420128945403197a768a39fe5a8fda60f39
4
Your keys can be found at: /home/mota/.hop-node/keystore.json
5
6
Keystore generation is complete.
7
Press [Enter] to exit.
Copied!

Use a custom keystore location

To use a custom keystore location, use the -path flag:
Docker
Node
1
docker run -it -v ~/.hop-node:/root hopprotocol/hop-node keystore generate --path /root/keystore.json
Copied!
1
hop-node keystore generate --path ~/.hop-node/keystore.json
Copied!
The default location is ~/.hop-node/keystore.json

Use an existing private key

You may generate an encrypted keystore using an existing private key by using the --private-key flag:
Docker
Node
1
docker run -it -v ~/.hop-node:/root hopprotocol/hop-node keystore generate --path /root/keystore.json --private-key=0x4f3edf983ac636a65a842ce7c78d9aa706d3b113bce9c46f30d7d21715b23b1d
Copied!
1
hop-node keystore generate --private-key=0x4f3edf983ac636a65a842ce7c78d9aa706d3b113bce9c46f30d7d21715b23b1d
Copied!
Note that you will no be prompted with the mnemonic in this case.

Decrypt keystore

Use the keystore decrypt command to decrypt an encrypted keystore:
Docker
Node
1
docker run -it -v ~/.hop-node:/root hopprotocol/hop-node keystore decrypt --path /root/keystore.json
Copied!
1
hop-node keystore decrypt
Copied!
It will prompt you for the passphrase required to decrypt it:
1
keystore passphrase: ********
Copied!
It will display the private key if the passphrase is correct:
1
4f3edf983ac636a65a842ce7c78d9aa706d3b113bce9c46f30d7d21715b23b1d
Copied!

Re-encrypt keystore with a new passphrase

Use the keystore reencrypt command to re-encrypt an encrypted keystore with a new passphrase:
Docker
Node
1
docker run -it -v ~/.hop-node:/root hopprotocol/hop-node keystore reencrypt --path /root/keystore.json
Copied!
1
hop-node keystore reencrypt
Copied!
asdf

View keystore address

Use the keystore address command to print the keystore public address:
Docker
Node
1
docker run -v ~/.hop-node:/root hopprotocol/hop-node keystore address --path /root/keystore.json
Copied!
1
hop-node keystore address
Copied!
Example output:
1
0x90f8bf6a479f320ead074411a4b0e7944ea8c9c1
Copied!