This guide provides step-by-step instructions for generating validator registration signatures using an existing validator mnemonic or keystore files and submitting them to the Gnosis Chain using a DApp. It also includes an optional step for uploading registration files when the DApp is hosted on a separate machine.
The workflow consists of two main components:
- Validator Script:
- Uses an existing validator mnemonic or keystore files to create the
signedRegistrations.jsonfile required for registration.
- Uses an existing validator mnemonic or keystore files to create the
- Validator Registration DApp:
- Uploads the
signedRegistrations.jsonfile. - Submits the registration to the
VALIDATOR_REGISTRY_ADDRESSsmart contract.
- Uploads the
- Uses an existing BIP-39 mnemonic or pre-generated keystore files to generate registration signatures.
- Creates the
signedRegistrations.jsonfile with validator registration data. - Preconfigured with Gnosis Chain endpoints and contract addresses.
- Docker installed on your system.
- Access to:
- An existing BIP-39 mnemonic or keystore files for your validator keys.
- The password for the keystore files.
The script/.env.example file is provided with preconfigured values. Copy it to create your own .env file.
cp script/.env.example script/.env# Gnosis Chain Execution Layer (EL) RPC Endpoint
EL_ENDPOINT=https://rpc.gnosis.gateway.fm
# Gnosis Chain Consensus Layer (CL) RPC Endpoint
CL_ENDPOINT=https://rpc-gbc.gnosischain.com
# Validator Registry Contract Address
VALIDATOR_REGISTRY_ADDRESS=0xefCC23E71f6bA9B22C4D28F7588141d44496A6D6
# Chain Configuration
CHAIN_ID=100
# Validator Keystore Password
KEYSTORE_PASSWORD=your-keystore-password
# Path to Keystore Files or Mnemonic
KEYSTORE_DIR=/path/to/validator_keys/ # If using keystore files
MNEMONIC="your twelve word mnemonic here" # If using a mnemonic
Build the validator script Docker image:
docker build -t validator-script -f docker/Dockerfile.script .Run the Docker container to generate registration signatures:
# Using existing keystore files
docker run --rm -v $(pwd)/output:/app/output -v $(pwd)/validator_keys:/app/validator_keys validator-script
# Using a mnemonic
docker run --rm -v $(pwd)/output:/app/output validator-script --use-mnemonic-
signedRegistrations.json:- Contains the
messageandsignaturerequired for registration.
- Contains the
-
validatorInfo.json:- Contains metadata for configuring your validator node.
If you are generating registration files on a remote server (e.g., via SSH) and need to upload them to a machine running the DApp, follow these steps:
- On your local machine, run:
scp -r user@server:/path/to/output/signedRegistrations.json /local/path/
- Replace
userwith your SSH username. - Replace
/path/to/output/with the directory where the registration files are saved on the server. - Replace
/local/path/with the directory on your local machine where the file should be copied.
- Replace
- Open an SFTP session:
sftp user@server
- Navigate to the output directory:
cd /path/to/output/ - Download the file:
get signedRegistrations.json
- Provides a simple interface for submitting
signedRegistrations.json. - Integrates with Web3 wallets like MetaMask.
- Displays transaction status and confirmation.
The dapp/.env.example file is provided with preconfigured values. Copy it to create your own .env file.
cp dapp/.env.example dapp/.envREACT_APP_EL_ENDPOINT=https://rpc.gnosis.gateway.fm
REACT_APP_VALIDATOR_REGISTRY_ADDRESS=0xefCC23E71f6bA9B22C4D28F7588141d44496A6D6
-
Navigate to the
dapp/directory:cd dapp/ -
Install dependencies:
npm install
-
Start the development server:
npm start
-
Open the DApp in your browser:
http://localhost:3000
-
Build the Docker image:
docker build -t validator-dapp -f docker/Dockerfile.dapp . -
Run the Docker container:
docker run --rm -p 3000:3000 validator-dapp
-
Open the DApp in your browser:
http://localhost:3000
-
Upload
signedRegistrations.json:- Use the file upload button to select the
signedRegistrations.jsonfile generated by the script.
- Use the file upload button to select the
-
Connect Wallet:
- Connect your Web3 wallet (e.g., MetaMask).
- Ensure the wallet has sufficient funds to cover gas fees.
-
Submit Signatures:
- Click the "Submit" button to send the registration data.
- Wait for the transaction confirmation.
-
View Transaction:
- The DApp will display the transaction hash.
- You can view it on GnosisScan.
Use the validatorInfo.json file generated by the script to configure your validator node.
nethermind --Shutter.Enabled=true --Shutter.ValidatorInfoFile=/path/to/output/validatorInfo.jsonproject-root/
├── output/
│ ├── signedRegistrations.json # Registration signatures
│ ├── validatorInfo.json # Validator configuration
├── dapp/
│ ├── public/
│ ├── src/
│ │ ├── components/
│ │ ├── App.js
│ │ ├── index.js
│ ├── .env # DApp configuration (ignored in Git)
│ ├── .env.example # Example DApp configuration
│ ├── Dockerfile
│ ├── package.json
├── script/
│ ├── validator_script.js # Main validator script
│ ├── .env # Script configuration (ignored in Git)
│ ├── .env.example # Example script configuration
├── docker/
│ ├── Dockerfile.script # Dockerfile for the script
│ ├── Dockerfile.dapp # Dockerfile for the DApp
├── README.md # This documentation