If you’re on this page then you’ve probably become a Validator on Injective. Congratulations! Configuring peggo is the final step of your setup.Example of .env for peggo:
Copy
Ask AI
PEGGO_ENV="local" # environment name for metrics (dev/test/staging/prod/local)PEGGO_LOG_LEVEL="debug" # log level depthPEGGO_COSMOS_CHAIN_ID="injective-1" # chain ID of the Injective networkPEGGO_COSMOS_GRPC="tcp://localhost:9090" # gRPC of your injectived processPEGGO_TENDERMINT_RPC="http://localhost:26657" # Tendermint RPC of your injectived process# Note: omitting PEGGO_COSMOS_GRPC and PEGGO_TENDERMINT_RPC enables stand-alone peggo mode. In this mode,# peggo is connected to load balanced endpoints provided by the Injective network. This decouples peggo's connection from your injectived process.# Injective configPEGGO_COSMOS_FEE_DENOM="inj" # token used to pay fees on InjectivePEGGO_COSMOS_GAS_PRICES="160000000inj" # default --gas-prices flag value for sending messages to InjectivePEGGO_COSMOS_KEYRING="file" # keyring backends ("os", "file", "kwallet", "memory", "pass", "test")PEGGO_COSMOS_KEYRING_DIR= # path to your keyring dirPEGGO_COSMOS_KEYRING_APP="peggo" # arbitrary name for your keyring appPEGGO_COSMOS_FROM= # account address of your Validator (or your Delegated Orchestrator)PEGGO_COSMOS_FROM_PASSPHRASE= # keyring passphrasePEGGO_COSMOS_PK= # private key of your Validator (or your Delegated Orchestrator)PEGGO_COSMOS_USE_LEDGER=false# Ethereum configPEGGO_ETH_KEYSTORE_DIR= # path to your Ethereum keystorePEGGO_ETH_FROM= # your Ethereum address (must be Delegated Ethereum address if you're a Validator)PEGGO_ETH_PASSPHRASE= # passphrase of your Ethereum keystorePEGGO_ETH_PK= # private key of your Ethereum addressPEGGO_ETH_GAS_PRICE_ADJUSTMENT=1.3 # suggested Ethereum gas price will be adjusted by this factor (Relayer)PEGGO_ETH_MAX_GAS_PRICE="500gwei" # max gas price allowed for sending Eth transactions (Relayer)PEGGO_ETH_CHAIN_ID=1 # chain ID of Ethereum networkPEGGO_ETH_RPC="http://localhost:8545" # RPC of your Ethereum nodePEGGO_ETH_ALCHEMY_WS="" # optional websocket endpoint for listening pending transactions on Peggy.solPEGGO_ETH_USE_LEDGER=false# Price feed provider for token assets (Batch Creator)PEGGO_COINGECKO_API="https://api.coingecko.com/api/v3"# Relayer configPEGGO_RELAY_VALSETS=true # set to `true` to relay Validator SetsPEGGO_RELAY_VALSET_OFFSET_DUR="5m" # duration which needs to expire before a Valset is eligible for relaying PEGGO_RELAY_BATCHES=true # set to `true` to relay Token BatchesPEGGO_RELAY_BATCH_OFFSET_DUR="5m" # duration which needs to expire before a Token Batch is eligible for relayingPEGGO_RELAY_PENDING_TX_WAIT_DURATION="20m" # time to wait until a pending tx is processed# Batch Creator configPEGGO_MIN_BATCH_FEE_USD=23.2 # minimum amount of fee a Token Batch must satisfy to be created# Metrics configPEGGO_STATSD_PREFIX="peggo."PEGGO_STATSD_ADDR="localhost:8125"PEGGO_STATSD_STUCK_DUR="5m"PEGGO_STATSD_MOCKING=falsePEGGO_STATSD_DISABLED=true
IMPORTANT NOTE: if you’re running your own injectived (Injective node) and geth (Ethereum node) processes, ensure that they are in sync with the latest state. Outdated nodes can skew the business logic of peggo to display “false alarm” logs sometimes.
Ethereum configFirst, update the PEGGO_ETH_RPC in the .env file with a valid Ethereum EVM RPC Endpoint.To set up your own Ethereum full node, follow the instructions here. It’s possible to use an external Ethereum RPC provider such as Alchemy or Infura, but keep in mind that the Peggo bridge relayer makes a heavy use of eth_getLogs calls which may increase your cost burden, depending on your provider.
Peggo supports two options to provide signing key credentials - using the Geth keystore (recommended) or by providing a plaintext Ethereum private key.
You can find instructions for securely creating a new Ethereum account using a keystore in the Geth Documentation here.For convenience, an example is provided below.
Copy
Ask AI
geth account new --datadir=/home/ec2-user/.peggo/data/INFO [03-23|18:18:36.407] Maximum peer count ETH=50 LES=0 total=50Your new account is locked with a password. Please give a password. Do not forget this password.Password:Repeat password:Your new key was generatedPublic address of the key: 0x9782dc957DaE6aDc394294954B27e2118D05176CPath of the secret key file: /home/ec2-user/.peggo/data/keystore/UTC--2021-03-23T15-18-44.284118000Z--9782dc957dae6adc394294954b27e2118d05176c- You can share your public address with anyone. Others need it to interact with you.- You must NEVER share the secret key with anyone! The key controls access to your funds!- You must BACKUP your key file! Without the key, it's impossible to access account funds!- You must REMEMBER your password! Without the password, it's impossible to decrypt the key!
Make sure you heed the warnings that geth provides, particularly in backing up your key file so that you don’t lose your keys by mistake. We also recommend not using any quote or backtick characters in your passphrase for peggo compatibility purposes.You should now set the following env variables:
Copy
Ask AI
# example values, replace with your ownPEGGO_ETH_KEYSTORE_DIR=/home/ec2-user/.peggo/data/keystorePEGGO_ETH_FROM=0x9782dc957DaE6aDc394294954B27e2118D05176CPEGGO_ETH_PASSPHRASE=12345678
Then ensure that your Ethereum address has enough ETH.
Creating your delegated Cosmos Key for sending Injective transactions
Your peggo orchestrator can either:
Use an explicitly delegated account key specific for sending validator specific Peggy transactions (i.e., ValsetConfirm, BatchConfirm, and SendToCosmos transactions) or
Simply use your validator’s account key (“your Validator is your Orchestrator”)
For isolation purposes, we recommend creating a delegated Cosmos key to send Injective transactions instead of using your validator account key.To create a new key, run
Copy
Ask AI
injectived keys add $ORCHESTRATOR_KEY_NAME
Then ensure that your orchestrator inj address has INJ balance in it, so peggo orchestrator can send messages to Injective.To obtain your orchestrator’s inj address, run
Copy
Ask AI
injectived keys list $ORCHESTRATOR_KEY_NAME
You can transfer INJ from your validator account to orchestrator address using this command
In the .env file, first specify the PEGGO_COSMOS_FROM and PEGGO_COSMOS_FROM_PASSPHRASE corresponding to your peggo account signing key.If you are using a delegated account key configuration as recommended above, this will be your $ORCHESTRATOR_KEY_NAME and passphrase respectively. Otherwise, this should be your $VALIDATOR_KEY_NAME and associated validator passphrase.Please note that the default keyring backend is file and that as such peggo will try to locate keys on disk by default.To use the default injectived key configuration, you should set the keyring path to the home directory of your injectived node, e.g., ~/.injectived.You can also read more about the Cosmos Keyring setup here.
In the .env file, specify the PEGGO_COSMOS_PK corresponding to your peggo account signing key.If you are using a delegated account key configuration as recommended above, this will be your orchestrator account’s private key. Otherwise, this should be your validator’s account private key.To obtain your orchestrator’s Cosmos private key (if applicable), run
NOTE: Once you’ve registered your Orchestrator with the set-orchestrator-address message, you CANNOT register again. Once this step is complete, your Validator is bound to the provided Ethereum address (as well the Delegated address you may have provided). In other words, your peggo must always run with the addresses you provided for registration.
Step 5: (Optional) Protect Cosmos Keyring from unauthorized access
This is an advanced DevOps topic, consult with your sysadmin.
Learn more about Cosmos Keyring setup here. Once you’ve launched your node, the default keyring will have the validator operator key stored on disk in the encrypted form. Usually the keyring is located within node’s homedir, i.e. ~/.injectived/keyring-file.Some sections of the Injective Staking documentation will guide you through using this key for governance purposes, i.e. submitting transactions and setting up an Ethereum bridge. In order to protect the keys from unauthorized access, even when the keyring passphrase is leaked via configs, you can set OS permissions to allow disk access to injectived / peggo processes only.In Linux systems like Debian, Ubuntu and RHEL, this can be achieved using POSIX Access Control Lists (ACLs). Before beginning to work with ACLs, the file system must be mounted with ACLs turned on. There are some official guides for each distro: