Skip to content

Chain-Games/updateValidatorInfo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

14 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Set Validator Metadata and Node Image

This script helps you upload your validator's metadata and image to IPFS, then update the StakeManager contract on Polygon with the new metadata URI.


๐Ÿš€ Prerequisites

  • Validator private key from file: ./test-chain-5/consensus/validator.key in your validator node installation directory.
  • Polygon funds: Some $POL (MATIC) in the validator wallet

๐Ÿ›  Technical Requirements

  • Node.js: v18.20.x
  • npm

๐Ÿ“ฆ Installation

  1. Switch to Node 18
nvm use 18
  1. Configure environment

    • Update the .env file in the project root
    • Set your Polygon RPC endpoint (or use the default public RPC provided)
  2. Add your validator image

    • Place a PNG image (256ร—256px) in this directory alongside the script
    • Example: my-logo.png
  3. Install dependencies

npm install

โ–ถ๏ธ Usage

Run the updateValidatorInfo.js script with the following arguments:

node updateValidatorInfo.js <VALIDATOR_PRIVATE_KEY> "<VALIDATOR_NAME>" "<METADATA_JSON_OR_EMPTY>" <PATH_TO_VALIDATOR_IMAGE>
  • <VALIDATOR_PRIVATE_KEY>: Your node's private key (hex string)
  • <VALIDATOR_NAME>: A descriptive name for your validator (wrapped in quotes)
  • <METADATA_JSON_OR_EMPTY>: Any additional metadata as a JSON string, or " " for none
  • <PATH_TO_VALIDATOR_IMAGE>: Path to your 256ร—256 PNG image

Example

node updateValidatorInfo.js c9617b2f1dabf9f5501eba795008f587ecab164aeb31217a7b76448d62157209 "My Validator Node" " " ./my-logo.png

๐Ÿ“„ License

This project is licensed under the MIT License. Feel free to use and modify it as you see fit.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •