Peggo
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:
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.
Step 1: Configuring .env
Ethereum config
First, 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.
Managing Ethereum keys for peggo
peggo
Peggo supports two options to provide signing key credentials - using the Geth keystore (recommended) or by providing a plaintext Ethereum private key.
Option 1. Geth Keystore
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.
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:
Then ensure that your Ethereum address has enough ETH.
Option 2. Ethereum Private Key (Unsafe)
Simply update the PEGGO_ETH_PK
with a new Ethereum Private Key from a new account.
Then ensure that your Ethereum address has enough ETH.
Injective config
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
, andSendToCosmos
transactions) orSimply 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
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
You can transfer INJ from your validator account to orchestrator address using this command
Example
You can then verify that your orchestrator account has INJ balances by running
Managing Cosmos account keys for peggo
peggo
Peggo supports two options to provide Cosmos signing key credentials - using the Cosmos keyring (recommended) or by providing a plaintext private key.
Option 1. Cosmos Keyring
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.
Option 2. Cosmos Private Key (Unsafe)
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
To obtain your validator's Cosmos private key (if applicable), run
Again, this method is less secure and is not recommended.
Step 2: Register Your Orchestrator and Ethereum Address
You can register orchestrator and ethereum address only once. It CANNOT be updated later. So Check twice before running below command.
To obtain your validator's inj address, run,
injectived keys list $VALIDATOR_KEY_NAME
To obtain your orchestrators's inj address,
injectived keys list $ORCHESTRATOR_KEY_NAME
Example:
You can verify successful registration by checking for your Validator's mapped Ethereum address on https://lcd.injective.network/peggy/v1/valset/current.
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 3: Start the Relayer
This starts the Peggo bridge (relayer / orchestrator).
Step 4: Create a Peggo systemd service
Add peggo.service
file with below content under /etc/systemd/system/peggo.service
Then use the following commands to configure Environment variables, start and stop the peggo relayer.
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:
Contribute
If you'd like to inspect the Peggo orchestrator source code and contribute, you can do so at https://github.com/InjectiveLabs/peggo.
Last updated