laconic-registry-cli/package.json
Prathamesh Musale 86259b35a6
All checks were successful
Lint / lint (18.x) (push) Successful in 1m12s
Publish npm package to gitea / npm_publish (18.x) (release) Successful in 1m24s
Tests / cli_tests (18.x) (push) Successful in 9m15s
Add a config option and arg to set gas price for auto fees calculation (#81)
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>
2024-09-06 09:44:47 +00:00

51 lines
1.4 KiB
JSON

{
"name": "@cerc-io/laconic-registry-cli",
"version": "0.2.8",
"main": "index.js",
"repository": "git@github.com:cerc-io/laconic-registry-cli.git",
"author": "",
"license": "UNLICENSED",
"devDependencies": {
"@types/fs-extra": "^9.0.13",
"@types/jest": "^27.4.1",
"@types/js-yaml": "^4.0.5",
"@types/lodash": "^4.14.182",
"@types/node": "^17.0.25",
"@types/yargs": "^17.0.10",
"@typescript-eslint/eslint-plugin": "^5.47.1",
"@typescript-eslint/parser": "^5.47.1",
"dotenv": "^16.3.2",
"eslint": "^8.35.0",
"eslint-config-semistandard": "^15.0.1",
"eslint-config-standard": "^16.0.3",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^5.1.0",
"eslint-plugin-standard": "^5.0.0",
"husky": "^9.0.2",
"jest": "29.0.0",
"ts-jest": "^29.0.2",
"ts-node": "^10.2.1",
"typescript": "^4.6.3"
},
"dependencies": {
"@cerc-io/registry-sdk": "^0.2.9",
"@cosmjs/stargate": "^0.32.2",
"fs-extra": "^10.1.0",
"js-yaml": "^3.14.1",
"lodash": "^4.17.21",
"lodash-clean": "^2.2.3",
"yargs": "^17.4.1"
},
"scripts": {
"test": "jest --runInBand --verbose test/cli.test.ts",
"lint": "eslint .",
"clean": "rm -rf ./dist",
"build": "tsc",
"prepare": "husky"
},
"bin": {
"laconic": "bin/laconic"
}
}