Skip to content

Commit

Permalink
post-review fixes: change config params with default values to optional
Browse files Browse the repository at this point in the history
  • Loading branch information
NeverHappened committed Nov 5, 2022
1 parent 8c08068 commit 21ef003
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,26 +86,26 @@ Relayer:
| `RELAYER_NEUTRON_CHAIN_REST_ADDR` | `string` | rest address of neutron chain | required |
| `RELAYER_NEUTRON_CHAIN_HOME_DIR ` | `string` | path to keys directory | required |
| `RELAYER_NEUTRON_CHAIN_SIGN_KEY_NAME` | `string` | key name | required |
| `RELAYER_NEUTRON_CHAIN_TIMEOUT ` | `time` | timeout of neutron chain provider | required |
| `RELAYER_NEUTRON_CHAIN_TIMEOUT ` | `time` | timeout of neutron chain provider | optional |
| `RELAYER_NEUTRON_CHAIN_GAS_PRICES` | `string` | specifies how much the user is willing to pay per unit of gas, which can be one or multiple denominations of token | required |
| `RELAYER_NEUTRON_CHAIN_GAS_LIMIT` | `string` | the maximum price a relayer user is willing to pay for relayer's paid blockchain actions | required |
| `RELAYER_NEUTRON_CHAIN_GAS_ADJUSTMENT` | `float` | used to scale gas up in order to avoid underestimating. For example, users can specify their gas adjustment as 1.5 to use 1.5 times the estimated gas | required |
| `RELAYER_NEUTRON_CHAIN_CONNECTION_ID` | `string` | neutron chain connection ID | required |
| `RELAYER_NEUTRON_CHAIN_DEBUG ` | `bool` | flag to run neutron chain provider in debug mode | required |
| `RELAYER_NEUTRON_CHAIN_DEBUG ` | `bool` | flag to run neutron chain provider in debug mode | optional |
| `RELAYER_NEUTRON_CHAIN_KEYRING_BACKEND` | `string` | [see](https://docs.cosmos.network/master/run-node/keyring.html#the-kwallet-backend) | required |
| `RELAYER_NEUTRON_CHAIN_OUTPUT_FORMAT` | `json` OR `yaml` | neutron chain provider output format | required |
| `RELAYER_NEUTRON_CHAIN_SIGN_MODE_STR ` | `string` | [see](https://docs.cosmos.network/master/core/transactions.html#signing-transactions) also consider use short variation, e.g. `direct` | required |
| `RELAYER_NEUTRON_CHAIN_SIGN_MODE_STR ` | `string` | [see](https://docs.cosmos.network/master/core/transactions.html#signing-transactions) also consider use short variation, e.g. `direct` | optional |
| `RELAYER_TARGET_CHAIN_RPC_ADDR` | `string` | rpc address of target chain | required |
| `RELAYER_TARGET_CHAIN_ACCOUNT_PREFIX ` | `string` | target chain account prefix | required |
| `RELAYER_TARGET_CHAIN_VALIDATOR_ACCOUNT_PREFIX ` | `string` | target chain validator account prefix | required |
| `RELAYER_TARGET_CHAIN_TIMEOUT ` | `time` | timeout of target chain provider | required |
| `RELAYER_TARGET_CHAIN_DEBUG ` | `bool` | flag to run target chain provider in debug mode | required |
| `RELAYER_TARGET_CHAIN_OUTPUT_FORMAT` | `json` or `yaml` | target chain provider output format | required |
| `RELAYER_TARGET_CHAIN_TIMEOUT ` | `time` | timeout of target chain provider | optional |
| `RELAYER_TARGET_CHAIN_DEBUG ` | `bool` | flag to run target chain provider in debug mode | optional |
| `RELAYER_TARGET_CHAIN_OUTPUT_FORMAT` | `json` or `yaml` | target chain provider output format | optional |
| `RELAYER_REGISTRY_ADDRESSES` | `string` | a list of comma-separated smart-contract addresses for which the relayer processes interchain queries | required |
| `RELAYER_ALLOW_TX_QUERIES` | `bool` | if true relayer will process tx queries (if `false`, relayer will drop them) | required |
| `RELAYER_ALLOW_KV_CALLBACKS` | `bool` | if `true`, will pass proofs as sudo callbacks to contracts | required |
| `RELAYER_MIN_KV_UPDATE_PERIOD` | `uint` | minimal period of queries execution and submission (not less than `n` blocks) | optional |
| `RELAYER_STORAGE_PATH` | `string` | path to leveldb storage, will be created on given path if doesn't exists <br/> (required if `RELAYER_ALLOW_TX_QUERIES` is `true`) | optional |
| `RELAYER_STORAGE_PATH` | `string` | path to leveldb storage, will be created on given path if doesn't exists <br/> (required if `RELAYER_ALLOW_TX_QUERIES` is `true`) | optional |
| `RELAYER_CHECK_SUBMITTED_TX_STATUS_DELAY` | `uint` | delay in seconds to wait before transaction is checked for commit status | optional |
| `RELAYER_QUERIES_TASK_QUEUE_CAPACITY` | `int` | 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 subscriptions). | optional |
| `RELAYER_PROMETHEUS_PORT` | `uint` | listen port for Prometheus | optional |
Expand Down
14 changes: 7 additions & 7 deletions internal/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,24 +31,24 @@ type NeutronChainConfig struct {
RESTAddr string `required:"true" split_words:"true"`
HomeDir string `required:"true" split_words:"true"`
SignKeyName string `required:"true" split_words:"true"`
Timeout time.Duration `required:"true" split_words:"true" default:"10s"`
Timeout time.Duration `split_words:"true" default:"10s"`
GasPrices string `required:"true" split_words:"true"`
GasLimit uint64 `split_words:"true" default:"0"`
GasAdjustment float64 `required:"true" split_words:"true"`
ConnectionID string `required:"true" split_words:"true"`
Debug bool `required:"true" split_words:"true" default:"false"`
Debug bool `split_words:"true" default:"false"`
KeyringBackend string `required:"true" split_words:"true"`
OutputFormat string `required:"true" split_words:"true" default:"json"`
SignModeStr string `required:"true" split_words:"true" default:"direct"`
OutputFormat string `split_words:"true" default:"json"`
SignModeStr string `split_words:"true" default:"direct"`
}

type TargetChainConfig struct {
RPCAddr string `required:"true" split_words:"true"`
AccountPrefix string `required:"true" split_words:"true"`
ValidatorAccountPrefix string `required:"true" split_words:"true"`
Timeout time.Duration `required:"true" split_words:"true" default:"10s"`
Debug bool `required:"true" split_words:"true" default:"false"`
OutputFormat string `required:"true" split_words:"true" default:"json"`
Timeout time.Duration `split_words:"true" default:"10s"`
Debug bool `split_words:"true" default:"false"`
OutputFormat string `split_words:"true" default:"json"`
}

func NewNeutronQueryRelayerConfig() (NeutronQueryRelayerConfig, error) {
Expand Down

0 comments on commit 21ef003

Please sign in to comment.