Prathamesh Musale
86259b35a6
Part of [Create a public laconicd testnet](https://www.notion.so/Create-a-public-laconicd-testnet-896a11bdd8094eff8f1b49c0be0ca3b8) Requires cerc-io/registry-sdk#22 Behaviour in different configuration scenarios: - Gas set, fees set to `Xalnt`: ```bash # Example gas: 500000 fees: 500000alnt gasPrice: ``` - `gasPrice` config ignored - tx rejected if given `fees` < `gas` * `min-gas-price` set by the node - tx fails mid-execution if it runs out of given `gas` - Fees not set, gas price set to `Xalnt`: ```bash # Example gas: fees: gasPrice: 1alnt ``` - `gas` config ignored - uses `auto` fee calculation using gas estimation with [default multiplier](https://git.vdb.to/cerc-io/registry-sdk/src/branch/main/src/constants.ts) (`2`) value from `registry-sdk` - tx rejected if given `gasPrice` < `min-gas-price` set by the node - tx fails mid-execution if it runs out of calculated gas - Fees set to a `X` (without `alnt` suffix), gas price set to `Yalnt`: ```bash # Example gas: fees: 1.8 gasPrice: 1alnt ``` - `gas` config ignored - uses `auto` fee calculation using gas estimation with `fees` as the multiplier - tx rejected if given `gasPrice` < `min-gas-price` set by the node - tx fails mid-execution if it runs out of calculated gas, can be retried with a higher gas estimation multiplier (`fees`) - Fees and gas price both not set: ```bash # Example gas: fees: gasPrice: ``` - `gas` config ignored - uses `auto` fee calculation using gas estimation - throws error: ```bash Gas price must be set in the client options when auto gas is used. ``` The provided config can be overridden with CLI args if required. Co-authored-by: IshaVenikar <ishavenikar7@gmail.com> Reviewed-on: #81 Co-authored-by: Prathamesh Musale <prathamesh.musale0@gmail.com> Co-committed-by: Prathamesh Musale <prathamesh.musale0@gmail.com>
31 lines
644 B
TypeScript
31 lines
644 B
TypeScript
import yargs from 'yargs/yargs';
|
|
import { hideBin } from 'yargs/helpers';
|
|
|
|
// eslint-disable-next-line no-unused-expressions
|
|
yargs(hideBin(process.argv))
|
|
.options({
|
|
verbose: {
|
|
description: 'Verbose output',
|
|
demand: false,
|
|
default: false,
|
|
type: 'boolean',
|
|
alias: 'v'
|
|
},
|
|
config: {
|
|
alias: 'c',
|
|
default: 'config.yml',
|
|
describe: 'Config file path.',
|
|
type: 'string'
|
|
},
|
|
output: {
|
|
alias: 'o',
|
|
describe: 'Gives output in json format when specified.',
|
|
type: 'string'
|
|
}
|
|
})
|
|
.commandDir('cmds')
|
|
.demandCommand()
|
|
.help()
|
|
.alias('h', 'help')
|
|
.argv;
|