Run interchain query relayer infrastructure for Neutron
RegisteredQueries
query is executed with the RELAYER_REGISTRY_ADDRESSES
parameter used for the Owners fieldRELAYER_REGISTRY_QUERY_IDS
will be used to filter out queries if it is not emptyquery_update
and query_removed
events and modifies the queries list and parameters correspondinglyNewBlockHeader
events that are used as a trigger for queries execution. Since each query has its own update_period
, the Relayer tracks queries execution height and executes only the queries which update time has come.
RELAYER_ALLOW_KV_CALLBACKS=false
: Simply sending it to the Neutron’s Interchain Queries module which handles it by storing the result in the blockchain stateRELAYER_ALLOW_KV_CALLBACKS=true
: Sending it to the Neutron’s Interchain Queries module which handles it by storing the result in the blockchain state and passing the result to the owner smart contractupdate_period
span and never retried forcibly (e.g. on a submission error). The TX queries are a bit more tricky: since they are not stored in the Neutron chain and simply passed to smart contracts, it’s needed that each tx is passed and handled by the smart contract only once.
The Relayer uses the BroadcastTxSync
messages broadcast type to maintain balance between performance and submission control, but this means that the submission result is not waited for.
RELAYER_IGNORE_ERRORS_REGEX
.
RELAYER_INITIAL_TX_SEARCH_OFFSET
config parameter is tightly coupled with this part of documentation.
RELAYER_NEUTRON_CHAIN_RPC_ADDR
— RPC address of a Neutron node to interact with (e.g. get events and to submit results)RELAYER_NEUTRON_CHAIN_REST_ADDR
— REST address of a Neutron node to interact with (e.g. get registered queries list)RELAYER_NEUTRON_CHAIN_HOME_DIR
— path to keys directoryRELAYER_NEUTRON_CHAIN_SIGN_KEY_NAME
— name of the key pair to be used by the RelayerRELAYER_NEUTRON_CHAIN_TIMEOUT
— timeout for Neutron RPC and REST callsRELAYER_NEUTRON_CHAIN_GAS_PRICES
— the price for a unit of gas used by the RelayerRELAYER_NEUTRON_CHAIN_GAS_LIMIT
— the maximum price to be paid for a single submissionRELAYER_NEUTRON_CHAIN_GAS_ADJUSTMENT
— gas multiplier used in order to avoid underestimatingRELAYER_NEUTRON_CHAIN_CONNECTION_ID
— Neutron chain connection ID; Relayer will only relay events for this connectionRELAYER_NEUTRON_CHAIN_DEBUG
— flag to run neutron chain provider in debug modeRELAYER_NEUTRON_CHAIN_KEYRING_BACKEND
— keyring backend typeRELAYER_NEUTRON_CHAIN_OUTPUT_FORMAT
— Neutron chain provider output formatRELAYER_NEUTRON_CHAIN_SIGN_MODE_STR
— signing mode (e.g. direct)RELAYER_TARGET_CHAIN_RPC_ADDR
— RPC address of a target chain node to interact with (e.g. send queries)RELAYER_TARGET_CHAIN_ACCOUNT_PREFIX
— target chain account prefixRELAYER_TARGET_CHAIN_VALIDATOR_ACCOUNT_PREFIX
— target chain validator account prefixRELAYER_TARGET_CHAIN_TIMEOUT
— timeout for target chain RPC callsRELAYER_TARGET_CHAIN_DEBUG
— flag to run neutron chain provider in debug modeRELAYER_TARGET_CHAIN_OUTPUT_FORMAT
— target chain provider output formatRELAYER_REGISTRY_ADDRESSES
— a list of comma-separated smart-contract addresses (registered query owners) for which the Relayer processes interchain queries. If empty, literally all registered queries are processed which is usable if you are up to deploy a public RelayerRELAYER_REGISTRY_QUERY_IDS
— a list of comma-separated query IDs which complements to RELAYER_REGISTRY_ADDRESSES
to further filter out interchain queries being processed. If empty, no queries will be filtered outRELAYER_ALLOW_TX_QUERIES
— if true, Relayer will process tx queries (if false, Relayer will ignore them). A true value here is mostly usable for a private Relayer because TX queries submission is quite expensiveRELAYER_ALLOW_KV_CALLBACKS
— if true, will pass proofs as sudo callbacks to contracts. A true value here is mostly usable for a private Relayer because KV query callbacks execution is quite expensive. If false, results will simply be submitted to Neutron and become available for smart contracts retrievalRELAYER_MIN_KV_UPDATE_PERIOD
— minimal period of queries execution and submission. This value is usable for a public Relayer as a rate limiter because it roughly overrides the queries update_period
and force queries execution not more often than N blocksRELAYER_STORAGE_PATH
— path to leveldb storage, will be created on the given path if it doesn’t exist. It is required if RELAYER_ALLOW_TX_QUERIES
is trueRELAYER_QUERIES_TASK_QUEUE_CAPACITY
— capacity of the channel that is used to send messages from subscriber to Relayer. Better set to a higher value to avoid problems with Tendermint websocket subscriptionsRELAYER_CHECK_SUBMITTED_TX_STATUS_DELAY
— delay in seconds between TX query submission and the result handling checkingRELAYER_INITIAL_TX_SEARCH_OFFSET
— Only for transaction queries. If set to non zero and no prior search height exists, it will initially set search height to (last_height - X). One example of usage of it will be if you have lots of old tx’s on first start you don’t need. Keep in mind that it will affect each newly created transaction queryRELAYER_WEBSERVER_PORT
— listener address for webserver json api you can query and prometheus metricsRELAYER_IGNORE_ERRORS_REGEX
— regular expression to match errors that should be ignored. If the error matches the regex, the Relayer will ignore it and will not retry the submission. For any other errors, the Relayer will exit with an errorRELAYER_NEUTRON_CHAIN_HOME_DIR
variable. The easiest way is to run neutrond keys
from the cloned neutron repository and get the default value from the --keyring-dir
flag:
relayer
as the RELAYER_NEUTRON_CHAIN_SIGN_KEY_NAME
test
as the RELAYER_NEUTRON_CHAIN_KEYRING_BACKEND
RELAYER_NEUTRON_CHAIN_HOME_DIR
-p 9999:9999
exposes the port that allows access to the webserver json api and Relayer’s metrics powered using Prometheus. The container’s port will be the same as the RELAYER_LISTEN_ADDR
value that is 9999 by default. Use another value if you are up to use a different portRELAYER_NEUTRON_CHAIN_HOME_DIR=/keyring
and run the app as:
RELAYER_LISTEN_ADDR
env.
Commands:
Print available queries:
SIGINT
and SIGTERM
. It usually takes a fraction of a second.