Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

How to setup and use Horcrux

You should follow these steps in order for transforming a validator to horcrux signer. You can use a single sentry (but more are recommended), and three cosigners. If you want to use more sentries/cosigners you should adjust the script and env variables slightly.

Set up environment variables

There's a .env.example file that you should use as template. Set COSIGNER_X, NODE_URL, and NETWORK mainly. Make use of public ips.

Configure open ports correctly

In order for the cosigners and sentry to work properly you need to open ports:

  • In the validator/sentry node, open the port specified in the NODE_URL variable for each cosigner server.
  • In each cosigner server, open the port specified in the COSIGNER_X variable in a circular manner (eg. cosigner 1 open ports for cosigner 2 and 3, and so on...)

Set up horcrux and keys

First we need to setup horcrux, and generate the required keys+shards. This needs to be run locally, and only once.

./init-configure.sh

Distribute the shards to the servers

You need to distribute the keys generated on the previous step to each of the cosigner servers. Keys are generated in folder ./secrets/cosigner_X. Clone the repo, and place each cosigner key on the folder ./horcrux/.horcrux/. You can do it by running:

cp ./secrets/cosigner_X ./horcrux/.horcrux

Stop validator and copy priv_validator_state.json file

On each cosigner, place in the folder ./horcrux/.horcrux/state/{chain-id}_priv_validator_state.json (replace {chain-id} for the chain-id). And adjust the values for height, rount, and step according to the ./celestia/data/priv_validator_state.json file in your validator. NOTE: make sure round is set as STRING value.

Start horcrux on the cosigner

On each of the servers, once the ./horcrux/.horcrux folder is properly setup, you should start on each server the cosigners roughly at the same time.

docker compose up -d

Set the validator priv_validator_laddr

sed -i 's#priv_validator_laddr = ""#priv_validator_laddr = "tcp://0.0.0.0:12323"#g' $NODE_HOME/config/config.toml

Restart the celestia validator node

Once all is set, you should be able to restart the celestia 'validator' node, that will act as sentry with external signer (horcrux cosigners).

Troubleshoot

If need to understand things more, there's a great guide in the official repo: MIGRATING.md

About

Simplify horcrux implementation with the included setup scripts.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages