From d3f95ab0940b28db132ec3755894126b52fff2f3 Mon Sep 17 00:00:00 2001 From: JSHan94 Date: Thu, 17 Apr 2025 13:47:33 +0900 Subject: [PATCH 1/3] Reorganizes VM tutorials and updates gas price guides Removes outdated fee token update tutorial for EVM rollups. Adds new gas price update guides for EVM, MoveVM, and WasmVM rollups. Updates documentation index to reflect these changes. --- .../evm/update-fee-token.mdx | 164 --------------- .../evm/update-gas-price.mdx | 194 ++++++++++++++++++ .../movevm/update-gas-price.mdx | 156 ++++++++++++++ .../wasmvm/update-gas-price.mdx | 156 ++++++++++++++ docs.json | 10 +- 5 files changed, 512 insertions(+), 168 deletions(-) delete mode 100644 developers/developer-guides/vm-specific-tutorials/evm/update-fee-token.mdx create mode 100644 developers/developer-guides/vm-specific-tutorials/evm/update-gas-price.mdx create mode 100644 developers/developer-guides/vm-specific-tutorials/movevm/update-gas-price.mdx create mode 100644 developers/developer-guides/vm-specific-tutorials/wasmvm/update-gas-price.mdx diff --git a/developers/developer-guides/vm-specific-tutorials/evm/update-fee-token.mdx b/developers/developer-guides/vm-specific-tutorials/evm/update-fee-token.mdx deleted file mode 100644 index 4d1f16b0..00000000 --- a/developers/developer-guides/vm-specific-tutorials/evm/update-fee-token.mdx +++ /dev/null @@ -1,164 +0,0 @@ ---- -title: Update Fee with ERC20 Token ---- - -## Prerequisites - -- [NodeJS](https://nodejs.org) - -## Update Fee Token with ERC20 Token - -You may want to use an ERC20 token as the Fee Token instead of the tokens issued by the Cosmos Bank module. - -To achieve this, you can update the chain parameter of the EVM module to set the Fee Token as an ERC20 token. - -Use validator (admin) account to update the chain parameter. - - -The deployed ERC20 token must inherit the `InitiaERC20` contract. - - -```ts -import { - EvmParams, - RESTClient, - MnemonicKey, - MsgUpdateEvmParams, - Wallet, - MsgExecuteMessages, -} from "@initia/initia.js"; - -/** - * main() demonstrates how to update EVM-related chain parameters (such as fee denom, allowed publishers, etc.). - * Note: This requires the mnemonic for the chain’s operator(a.k.a validator), which you must obtain from the chain administrator. - */ -async function main() { - /** - * 1) Instantiate a RESTClient using the chain’s RPC endpoint. - * - The first argument is the base URL or RPC endpoint of your chain. - * - The second argument is an object providing client options like gas prices. - * - * For example: - * "https://maze-rpc-sequencer-fd70c395-4cfc-4624-ab8a-8e025af6a140.ane1-prod-nocsm.newmetric.xyz/" - * is a special endpoint in this context (provided by NewMetric). - */ - const client = new RESTClient( - "https://maze-rpc-sequencer-fd70c395-4cfc-4624-ab8a-8e025af6a140.ane1-prod-nocsm.newmetric.xyz/", - { - /** - * gasPrices: '0GAS' - * - This can be set to '0GAS' if the chain you’re using allows 0 gas prices or free transactions - * for certain operations (testnet or specific config). - * - In production or other networks, you usually set this to something like "0.025" or - * whatever fee denom and minimum gas price the network expects. - */ - gasPrices: '0GAS', - } - ); - - /** - * 2) Create a Wallet instance using the client and a MnemonicKey. - * - The MnemonicKey is derived from the chain operator's mnemonic (private key). - * - This wallet has permission to execute the EVM parameter update because it’s - * presumably the authorized validator or has the necessary roles on the chain. - */ - const wallet = new Wallet( - client, - new MnemonicKey({ - /** - * Replace with the actual mnemonic of the chain operator or the account with - * the authority to update EVM params. - * Make sure you keep this mnemonic secret. - */ - mnemonic: "" // enter validator mnemonic - }) - ); - - /** - * 3) Construct the MsgUpdateEvmParams message. - * - This message tells the chain which parameters to update in the EVM module. - * - The first argument is the "opchild module address" or "authority address" (in bech32 format). - * This is the authority that is allowed to update the EVM params on chain. - * This is obtained from `/cosmos/auth/v1beta1/module_accounts/opchild` endpoint. - * - * - Then we instantiate a new EvmParams object: - * @param extra_eip (array): Optional EIPs to enable - * @param allowed_publisher (array): Entities allowed to publish certain EVM data - * @param allow_custom_erc20 (boolean): Toggle for custom ERC20 tokens - * @param allowed_custom_erc20s (array): A list of allowed custom ERC20 addresses - * (could be 0x or bech32, depending on chain config) - * @param fee_denom (string): The fee denomination on-chain (e.g. 'umin'). - * It typically should match the chain’s native fee token. - */ - const msgs = [ - new MsgUpdateEvmParams( - "init1gz9n8jnu9fgqw7vem9ud67gqjk5q4m2w0aejne", // Authority/Opchild module address - new EvmParams( - [], // extra_eip - e.g. ["EIP1559"] if needed - [], // allowed_publisher - e.g. ['0x123...'] if you want certain publishers - /** - * allow_custom_erc20 (boolean) - * - Determines whether custom ERC20 tokens are allowed beyond the default token factory. - * - * - If true and allowed_custom_erc20s = []: - * => All custom ERC20 tokens are allowed. - * - * - If true and allowed_custom_erc20s = [addr1, addr2]: - * => Only the tokens specified in the list [addr1, addr2] are allowed. - * - * - If false and allowed_custom_erc20s = []: - * => Only tokens created by the chain's token factory are allowed; no arbitrary custom tokens. - */ - true, - /** - * allowed_custom_erc20s (string[]) - * - A list of custom ERC20 addresses (0x or bech32, depending on your chain) that are permitted. - * - This array must be considered in conjunction with allow_custom_erc20 (above). - * - If allow_custom_erc20 = true but this is empty => all custom ERC20 tokens are allowed. - * - If allow_custom_erc20 = true and you specify addresses => only those addresses are allowed. - */ - [], - /** - * fee_denom (string) - * - Must be the chain's fee token; often in the format `evm/` - * on an EVM-compatible chain. - * - Example: "evm/9D9c32921575Fd98e67E27C0189ED4b750Cb17C5" - */ - "evm/9D9c32921575Fd98e67E27C0189ED4b750Cb17C5" - ) - ) - ]; - - /** - * 4) Create a MsgExecuteMessages message to execute the EVM parameter update. - * - This message will include the MsgUpdateEvmParams message(s) we created above. - * - The first argument is the wallet’s (validator’s) account address. - * - The second argument is an array of messages to execute. - */ - const executeMsg = new MsgExecuteMessages( - wallet.key.accAddress, // must be admin address - msgs - ) - - /** - * 5) Create and sign the transaction with the Wallet. - * - This will create a transaction that includes the EVM param update message - * and then sign it using the wallet’s (validator’s) private key. - */ - const signedTx = await wallet.createAndSignTx({ - msgs: [executeMsg], - }); - - /** - * 6) Broadcast the transaction to the chain’s REST endpoint. - * - This sends the signed transaction to be processed on-chain, - * where it will update the EVM parameters if everything is valid. - */ - await client.tx.broadcast(signedTx); -} - -/** - * Finally, run the main() function. - */ -main(); -``` \ No newline at end of file diff --git a/developers/developer-guides/vm-specific-tutorials/evm/update-gas-price.mdx b/developers/developer-guides/vm-specific-tutorials/evm/update-gas-price.mdx new file mode 100644 index 00000000..990221dc --- /dev/null +++ b/developers/developer-guides/vm-specific-tutorials/evm/update-gas-price.mdx @@ -0,0 +1,194 @@ +--- +title: Update Gas Price on EVM Rollup +--- + +## Overview + +You may want to use an ERC20 token as the Fee Token instead of the tokens issued by the Cosmos Bank module. + +To achieve this, you can update the chain parameter of the EVM module to set the Fee Token as an ERC20 token. + +Use validator (admin) account to update the chain parameter. + + +The deployed ERC20 token must inherit the `InitiaERC20` contract. + + +## Prerequisites + +- [NodeJS](https://nodejs.org) + +## Update Chain Parameters + +#### 1. Set Up Operator Key + +Add your `operator` key to the local keyring. This key will be used to sign transactions. + +```bash +minitiad keys add operator --recover --key-type secp256k1 --coin-type 118 +``` + +- `--recover`: Recovers a key from a mnemonic phrase. +- `--key-type secp256k1`: Common key type used in Cosmos SDK-based chains. +- `--coin-type 118`: Standard coin type for Cosmos-based chains. + +#### 2. Create Update Messages + +You need to create messages for both: + +- `opchild.v1.MsgUpdateParams` +- `evm.v1.MsgUpdateParams` + +You can get the current `opchild` and `evm` parameters by querying: + +```bash +curl ${REST_ENDPOINT}/opinit/opchild/v1/params + +# 📌 Example: https://rest-yominet-1.anvil.asia-southeast.initia.xyz/opinit/opchild/v1/params +# { +# "params": { +# "max_validators": 100, +# "historical_entries": 10000, +# "min_gas_prices": [ +# { +# "denom": "GAS", +# "amount": "30000000.000000000000000000" +# } +# ], +# "bridge_executors": [ +# "init1jaz6hxkn8cx9dxjwrjwy4v2qs2u09pf25ztcam" +# ], +# "admin": "init1ppzptg22xx259zzpgpejphzcvjmc7r2ff984c3", +# "fee_whitelist": [ +# "init1ppzptg22xx259zzpgpejphzcvjmc7r2ff984c3", +# "init1ppzptg22xx259zzpgpejphzcvjmc7r2ff984c3", +# "init1jaz6hxkn8cx9dxjwrjwy4v2qs2u09pf25ztcam", +# "init1fvhhqk3tvv08vd5gmsp45x8tkzhcwv3ly8kn78" +# ], +# "hook_max_gas": "3000000" +# } +# } + +curl ${REST_ENDPOINT}/minievm/evm/v1/params + +# 📌 Example: https://rest-yominet-1.anvil.asia-southeast.initia.xyz/minievm/evm/v1/params +# { +# "params": { +# "extra_eips": [], +# "allowed_publishers": [], +# "allow_custom_erc20": true, +# "allowed_custom_erc20s": [], +# "fee_denom": "GAS", +# "gas_refund_ratio": "0.500000000000000000", +# "num_retain_block_hashes": "0" +# } +# } +``` + +Create a JSON file named `messages.json` with the following content: + +```json +// messages.json +{ + "messages": [ + { + "@type": "/opinit.opchild.v1.MsgUpdateParams", + "authority": "init1gz9n8jnu9fgqw7vem9ud67gqjk5q4m2w0aejne", + "params": { + "max_validators": 100, // Max number of active validators + "historical_entries": 10000, // Number of historical blocks to retain + "min_gas_prices": [ + { + "denom": "umin", // Native token denomination + "amount": "1000000000" // Minimum gas price in smallest unit + } + ], + "bridge_executors": [ + "init1jaz6hxkn8cx9dxjwrjwy4v2qs2u09pf25ztcam" // Allowed bridge executor address + ], + "admin": "init10g75rf30pwpkgu68yr8uh4gm824xajg09233xr", // Admin address with authority to update params + "fee_whitelist": [ + // Addresses exempted from fees + "init1ppzptg22xx259zzpgpejphzcvjmc7r2ff984c3", + "init1ppzptg22xx259zzpgpejphzcvjmc7r2ff984c3", + "init1jaz6hxkn8cx9dxjwrjwy4v2qs2u09pf25ztcam", + "init1fvhhqk3tvv08vd5gmsp45x8tkzhcwv3ly8kn78" + ], + "hook_max_gas": "3000000" // Maximum gas for execution hooks + } + }, + { + "@type": "/minievm.evm.v1.MsgUpdateParams", + "authority": "init1gz9n8jnu9fgqw7vem9ud67gqjk5q4m2w0aejne", + "params": { + "extra_eips": [], // Additional Ethereum Improvement Proposals to enable + "allowed_publishers": [], // List of allowed smart contract publishers + "allow_custom_erc20": true, // Whether to allow custom ERC-20 tokens + "allowed_custom_erc20s": [], // Whitelisted custom ERC-20 contracts + "fee_denom": "umin", // Fee denomination used by EVM + "gas_refund_ratio": "0.500000000000000000", // Refund ratio on unused gas + "num_retain_block_hashes": "256" // Number of recent block hashes to retain + } + } + ] +} +``` + + +`authority` address will be a opchild module account regardless of the field you want to update. +To get the authority address, you can use the following command: + +```bash +curl ${REST_ENDPOINT}/cosmos/auth/v1beta1/module_accounts/opchild + +# 📌 Example: https://rest-yominet-1.anvil.asia-southeast.initia.xyz/cosmos/auth/v1beta1/module_accounts/opchild +# { +# "account": { +# "@type": "/cosmos.auth.v1beta1.ModuleAccount", +# "base_account": { +# "address": "init1gz9n8jnu9fgqw7vem9ud67gqjk5q4m2w0aejne", +# "pub_key": null, +# "account_number": "2771", +# "sequence": "0" +# }, +# "name": "opchild", +# "permissions": [ +# "minter", +# "burner" +# ] +# } +# } +``` + + + +If you set empty values on the field, it will be set to the empty value, which may cause issues. +Be careful to set any fields you do not wish to change with their existing values. +Update your values carefully — especially the `admin` address. + + +Save the content above as `messages.json`. + +#### 3. Execute the Update Transaction + +Submit the parameter update messages using the CLI: + +```bash +minitiad tx opchild execute-messages ./messages.json \ + --from operator --chain-id yominet-1 \ + --node https://rpc-yominet-1.anvil.asia-southeast.initia.xyz +``` + +#### 4. Verify the Updated Parameters + +Once the transaction is successful, verify the updated parameters: + +```bash +minitiad q opchild params \ + --node https://rpc-yominet-1.anvil.asia-southeast.initia.xyz + +minitiad q evm params \ + --node https://rpc-yominet-1.anvil.asia-southeast.initia.xyz +``` + +These queries will return the live parameter state for both modules. \ No newline at end of file diff --git a/developers/developer-guides/vm-specific-tutorials/movevm/update-gas-price.mdx b/developers/developer-guides/vm-specific-tutorials/movevm/update-gas-price.mdx new file mode 100644 index 00000000..59ff0092 --- /dev/null +++ b/developers/developer-guides/vm-specific-tutorials/movevm/update-gas-price.mdx @@ -0,0 +1,156 @@ +--- +title: Update Gas Price on Move Rollup +--- + +## Overview + +This guide explains how to update the gas price on the Move rollup. + +Use validator (admin) account to update the chain parameter. + +## Prerequisites + +- [NodeJS](https://nodejs.org) + +## Update Chain Parameters + +#### 1. Set Up Operator Key + +Add your `operator` key to the local keyring. This key will be used to sign transactions. + +```bash +minitiad keys add operator --recover --key-type secp256k1 --coin-type 118 +``` + +- `--recover`: Recovers a key from a mnemonic phrase. +- `--key-type secp256k1`: Common key type used in Cosmos SDK-based chains. +- `--coin-type 118`: Standard coin type for Cosmos-based chains. + +#### 2. Create Update Messages + +You need to create messages: + +- `opchild.v1.MsgUpdateParams` + +You can get the current `opchild` parameters by querying: + +```bash +curl ${REST_ENDPOINT}/opinit/opchild/v1/params + +# 📌 Example: https://rest-yominet-1.anvil.asia-southeast.initia.xyz/opinit/opchild/v1/params +# { +# "params": { +# "max_validators": 100, +# "historical_entries": 10000, +# "min_gas_prices": [ +# { +# "denom": "GAS", +# "amount": "30000000.000000000000000000" +# } +# ], +# "bridge_executors": [ +# "init1jaz6hxkn8cx9dxjwrjwy4v2qs2u09pf25ztcam" +# ], +# "admin": "init1ppzptg22xx259zzpgpejphzcvjmc7r2ff984c3", +# "fee_whitelist": [ +# "init1ppzptg22xx259zzpgpejphzcvjmc7r2ff984c3", +# "init1ppzptg22xx259zzpgpejphzcvjmc7r2ff984c3", +# "init1jaz6hxkn8cx9dxjwrjwy4v2qs2u09pf25ztcam", +# "init1fvhhqk3tvv08vd5gmsp45x8tkzhcwv3ly8kn78" +# ], +# "hook_max_gas": "3000000" +# } +# } +``` + +Create a JSON file named `messages.json` with the following content: + +```json +// messages.json +{ + "messages": [ + { + "@type": "/opinit.opchild.v1.MsgUpdateParams", + "authority": "init1gz9n8jnu9fgqw7vem9ud67gqjk5q4m2w0aejne", + "params": { + "max_validators": 100, // Max number of active validators + "historical_entries": 10000, // Number of historical blocks to retain + "min_gas_prices": [ + { + "denom": "umin", // Native token denomination + "amount": "1000000000" // Minimum gas price in smallest unit + } + ], + "bridge_executors": [ + "init1jaz6hxkn8cx9dxjwrjwy4v2qs2u09pf25ztcam" // Allowed bridge executor address + ], + "admin": "init10g75rf30pwpkgu68yr8uh4gm824xajg09233xr", // Admin address with authority to update params + "fee_whitelist": [ + // Addresses exempted from fees + "init1ppzptg22xx259zzpgpejphzcvjmc7r2ff984c3", + "init1ppzptg22xx259zzpgpejphzcvjmc7r2ff984c3", + "init1jaz6hxkn8cx9dxjwrjwy4v2qs2u09pf25ztcam", + "init1fvhhqk3tvv08vd5gmsp45x8tkzhcwv3ly8kn78" + ], + "hook_max_gas": "3000000" // Maximum gas for execution hooks + } + } + ] +} +``` + + +`authority` address will be a opchild module account regardless of the field you want to update. +To get the authority address, you can use the following command: + +```bash +curl ${REST_ENDPOINT}/cosmos/auth/v1beta1/module_accounts/opchild + +# 📌 Example: https://rest-yominet-1.anvil.asia-southeast.initia.xyz/cosmos/auth/v1beta1/module_accounts/opchild +# { +# "account": { +# "@type": "/cosmos.auth.v1beta1.ModuleAccount", +# "base_account": { +# "address": "init1gz9n8jnu9fgqw7vem9ud67gqjk5q4m2w0aejne", +# "pub_key": null, +# "account_number": "2771", +# "sequence": "0" +# }, +# "name": "opchild", +# "permissions": [ +# "minter", +# "burner" +# ] +# } +# } +``` + + + +If you set empty values on the field, it will be set to the empty value, which may cause issues. +Be careful to set any fields you do not wish to change with their existing values. +Update your values carefully — especially the `admin` address. + + +Save the content above as `messages.json`. + +#### 3. Execute the Update Transaction + +Submit the parameter update messages using the CLI: + +```bash +minitiad tx opchild execute-messages ./messages.json \ + --from operator --chain-id yominet-1 \ + --node https://rpc-yominet-1.anvil.asia-southeast.initia.xyz +``` + +#### 4. Verify the Updated Parameters + +Once the transaction is successful, verify the updated parameters: + +```bash +minitiad q opchild params \ + --node https://rpc-yominet-1.anvil.asia-southeast.initia.xyz +``` + +These queries will return the live parameter state for both modules. \ No newline at end of file diff --git a/developers/developer-guides/vm-specific-tutorials/wasmvm/update-gas-price.mdx b/developers/developer-guides/vm-specific-tutorials/wasmvm/update-gas-price.mdx new file mode 100644 index 00000000..7a59e4f4 --- /dev/null +++ b/developers/developer-guides/vm-specific-tutorials/wasmvm/update-gas-price.mdx @@ -0,0 +1,156 @@ +--- +title: Update Gas Price on Wasm Rollup +--- + +## Overview + +This guide explains how to update the gas price on the Wasm rollup. + +Use validator (admin) account to update the chain parameter. + +## Prerequisites + +- [NodeJS](https://nodejs.org) + +## Update Chain Parameters + +#### 1. Set Up Operator Key + +Add your `operator` key to the local keyring. This key will be used to sign transactions. + +```bash +minitiad keys add operator --recover --key-type secp256k1 --coin-type 118 +``` + +- `--recover`: Recovers a key from a mnemonic phrase. +- `--key-type secp256k1`: Common key type used in Cosmos SDK-based chains. +- `--coin-type 118`: Standard coin type for Cosmos-based chains. + +#### 2. Create Update Messages + +You need to create messages: + +- `opchild.v1.MsgUpdateParams` + +You can get the current `opchild` parameters by querying: + +```bash +curl ${REST_ENDPOINT}/opinit/opchild/v1/params + +# 📌 Example: https://rest-yominet-1.anvil.asia-southeast.initia.xyz/opinit/opchild/v1/params +# { +# "params": { +# "max_validators": 100, +# "historical_entries": 10000, +# "min_gas_prices": [ +# { +# "denom": "GAS", +# "amount": "30000000.000000000000000000" +# } +# ], +# "bridge_executors": [ +# "init1jaz6hxkn8cx9dxjwrjwy4v2qs2u09pf25ztcam" +# ], +# "admin": "init1ppzptg22xx259zzpgpejphzcvjmc7r2ff984c3", +# "fee_whitelist": [ +# "init1ppzptg22xx259zzpgpejphzcvjmc7r2ff984c3", +# "init1ppzptg22xx259zzpgpejphzcvjmc7r2ff984c3", +# "init1jaz6hxkn8cx9dxjwrjwy4v2qs2u09pf25ztcam", +# "init1fvhhqk3tvv08vd5gmsp45x8tkzhcwv3ly8kn78" +# ], +# "hook_max_gas": "3000000" +# } +# } +``` + +Create a JSON file named `messages.json` with the following content: + +```json +// messages.json +{ + "messages": [ + { + "@type": "/opinit.opchild.v1.MsgUpdateParams", + "authority": "init1gz9n8jnu9fgqw7vem9ud67gqjk5q4m2w0aejne", + "params": { + "max_validators": 100, // Max number of active validators + "historical_entries": 10000, // Number of historical blocks to retain + "min_gas_prices": [ + { + "denom": "umin", // Native token denomination + "amount": "1000000000" // Minimum gas price in smallest unit + } + ], + "bridge_executors": [ + "init1jaz6hxkn8cx9dxjwrjwy4v2qs2u09pf25ztcam" // Allowed bridge executor address + ], + "admin": "init10g75rf30pwpkgu68yr8uh4gm824xajg09233xr", // Admin address with authority to update params + "fee_whitelist": [ + // Addresses exempted from fees + "init1ppzptg22xx259zzpgpejphzcvjmc7r2ff984c3", + "init1ppzptg22xx259zzpgpejphzcvjmc7r2ff984c3", + "init1jaz6hxkn8cx9dxjwrjwy4v2qs2u09pf25ztcam", + "init1fvhhqk3tvv08vd5gmsp45x8tkzhcwv3ly8kn78" + ], + "hook_max_gas": "3000000" // Maximum gas for execution hooks + } + } + ] +} +``` + + +`authority` address will be a opchild module account regardless of the field you want to update. +To get the authority address, you can use the following command: + +```bash +curl ${REST_ENDPOINT}/cosmos/auth/v1beta1/module_accounts/opchild + +# 📌 Example: https://rest-yominet-1.anvil.asia-southeast.initia.xyz/cosmos/auth/v1beta1/module_accounts/opchild +# { +# "account": { +# "@type": "/cosmos.auth.v1beta1.ModuleAccount", +# "base_account": { +# "address": "init1gz9n8jnu9fgqw7vem9ud67gqjk5q4m2w0aejne", +# "pub_key": null, +# "account_number": "2771", +# "sequence": "0" +# }, +# "name": "opchild", +# "permissions": [ +# "minter", +# "burner" +# ] +# } +# } +``` + + + +If you set empty values on the field, it will be set to the empty value, which may cause issues. +Be careful to set any fields you do not wish to change with their existing values. +Update your values carefully — especially the `admin` address. + + +Save the content above as `messages.json`. + +#### 3. Execute the Update Transaction + +Submit the parameter update messages using the CLI: + +```bash +minitiad tx opchild execute-messages ./messages.json \ + --from operator --chain-id yominet-1 \ + --node https://rpc-yominet-1.anvil.asia-southeast.initia.xyz +``` + +#### 4. Verify the Updated Parameters + +Once the transaction is successful, verify the updated parameters: + +```bash +minitiad q opchild params \ + --node https://rpc-yominet-1.anvil.asia-southeast.initia.xyz +``` + +These queries will return the live parameter state for both modules. \ No newline at end of file diff --git a/docs.json b/docs.json index ac0a8624..65c7ea1e 100644 --- a/docs.json +++ b/docs.json @@ -174,9 +174,9 @@ "developers/developer-guides/vm-specific-tutorials/evm/creating-erc20s/creating-custom-erc20s" ] }, - "developers/developer-guides/vm-specific-tutorials/evm/update-fee-token", "developers/developer-guides/vm-specific-tutorials/evm/connect-oracles", - "developers/developer-guides/vm-specific-tutorials/evm/ibc-hooks" + "developers/developer-guides/vm-specific-tutorials/evm/ibc-hooks", + "developers/developer-guides/vm-specific-tutorials/evm/update-gas-price" ] }, { @@ -186,7 +186,8 @@ "developers/developer-guides/vm-specific-tutorials/movevm/creating-move-coin", "developers/developer-guides/vm-specific-tutorials/movevm/connect-oracles", "developers/developer-guides/vm-specific-tutorials/movevm/multisig", - "developers/developer-guides/vm-specific-tutorials/movevm/ibc-hooks" + "developers/developer-guides/vm-specific-tutorials/movevm/ibc-hooks", + "developers/developer-guides/vm-specific-tutorials/movevm/update-gas-price" ] }, { @@ -194,7 +195,8 @@ "icon": "rust", "pages": [ "developers/developer-guides/vm-specific-tutorials/wasmvm/connect-oracles", - "developers/developer-guides/vm-specific-tutorials/wasmvm/ibc-hooks" + "developers/developer-guides/vm-specific-tutorials/wasmvm/ibc-hooks", + "developers/developer-guides/vm-specific-tutorials/wasmvm/update-gas-price" ] } ] From ce5552a121487aa4854c0e2ae33312c5c2eb5f55 Mon Sep 17 00:00:00 2001 From: JSHan94 Date: Thu, 17 Apr 2025 13:51:09 +0900 Subject: [PATCH 2/3] change chain id --- .../vm-specific-tutorials/movevm/update-gas-price.mdx | 10 +++++----- .../vm-specific-tutorials/wasmvm/update-gas-price.mdx | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/developers/developer-guides/vm-specific-tutorials/movevm/update-gas-price.mdx b/developers/developer-guides/vm-specific-tutorials/movevm/update-gas-price.mdx index 59ff0092..3d21a945 100644 --- a/developers/developer-guides/vm-specific-tutorials/movevm/update-gas-price.mdx +++ b/developers/developer-guides/vm-specific-tutorials/movevm/update-gas-price.mdx @@ -37,7 +37,7 @@ You can get the current `opchild` parameters by querying: ```bash curl ${REST_ENDPOINT}/opinit/opchild/v1/params -# 📌 Example: https://rest-yominet-1.anvil.asia-southeast.initia.xyz/opinit/opchild/v1/params +# 📌 Example: https://rest-echelon-1.anvil.asia-southeast.initia.xyz/opinit/opchild/v1/params # { # "params": { # "max_validators": 100, @@ -106,7 +106,7 @@ To get the authority address, you can use the following command: ```bash curl ${REST_ENDPOINT}/cosmos/auth/v1beta1/module_accounts/opchild -# 📌 Example: https://rest-yominet-1.anvil.asia-southeast.initia.xyz/cosmos/auth/v1beta1/module_accounts/opchild +# 📌 Example: https://rest-echelon-1.anvil.asia-southeast.initia.xyz/cosmos/auth/v1beta1/module_accounts/opchild # { # "account": { # "@type": "/cosmos.auth.v1beta1.ModuleAccount", @@ -140,8 +140,8 @@ Submit the parameter update messages using the CLI: ```bash minitiad tx opchild execute-messages ./messages.json \ - --from operator --chain-id yominet-1 \ - --node https://rpc-yominet-1.anvil.asia-southeast.initia.xyz + --from operator --chain-id echelon-1 \ + --node https://rpc-echelon-1.anvil.asia-southeast.initia.xyz ``` #### 4. Verify the Updated Parameters @@ -150,7 +150,7 @@ Once the transaction is successful, verify the updated parameters: ```bash minitiad q opchild params \ - --node https://rpc-yominet-1.anvil.asia-southeast.initia.xyz + --node https://rpc-echelon-1.anvil.asia-southeast.initia.xyz ``` These queries will return the live parameter state for both modules. \ No newline at end of file diff --git a/developers/developer-guides/vm-specific-tutorials/wasmvm/update-gas-price.mdx b/developers/developer-guides/vm-specific-tutorials/wasmvm/update-gas-price.mdx index 7a59e4f4..589eae95 100644 --- a/developers/developer-guides/vm-specific-tutorials/wasmvm/update-gas-price.mdx +++ b/developers/developer-guides/vm-specific-tutorials/wasmvm/update-gas-price.mdx @@ -37,7 +37,7 @@ You can get the current `opchild` parameters by querying: ```bash curl ${REST_ENDPOINT}/opinit/opchild/v1/params -# 📌 Example: https://rest-yominet-1.anvil.asia-southeast.initia.xyz/opinit/opchild/v1/params +# 📌 Example: https://rest-inertia-1.anvil.asia-southeast.initia.xyz/opinit/opchild/v1/params # { # "params": { # "max_validators": 100, @@ -106,7 +106,7 @@ To get the authority address, you can use the following command: ```bash curl ${REST_ENDPOINT}/cosmos/auth/v1beta1/module_accounts/opchild -# 📌 Example: https://rest-yominet-1.anvil.asia-southeast.initia.xyz/cosmos/auth/v1beta1/module_accounts/opchild +# 📌 Example: https://rest-inertia-1.anvil.asia-southeast.initia.xyz/cosmos/auth/v1beta1/module_accounts/opchild # { # "account": { # "@type": "/cosmos.auth.v1beta1.ModuleAccount", @@ -140,8 +140,8 @@ Submit the parameter update messages using the CLI: ```bash minitiad tx opchild execute-messages ./messages.json \ - --from operator --chain-id yominet-1 \ - --node https://rpc-yominet-1.anvil.asia-southeast.initia.xyz + --from operator --chain-id inertia-1 \ + --node https://rpc-inertia-1.anvil.asia-southeast.initia.xyz ``` #### 4. Verify the Updated Parameters @@ -150,7 +150,7 @@ Once the transaction is successful, verify the updated parameters: ```bash minitiad q opchild params \ - --node https://rpc-yominet-1.anvil.asia-southeast.initia.xyz + --node https://rpc-inertia-1.anvil.asia-southeast.initia.xyz ``` These queries will return the live parameter state for both modules. \ No newline at end of file From 7a2d084a6ea72cdae23b884dadbdf56b0fcbbd5a Mon Sep 17 00:00:00 2001 From: JSHan94 Date: Fri, 9 May 2025 17:16:19 +0900 Subject: [PATCH 3/3] apply comments --- .../tools/clis/minitiad-cli/introduction.mdx | 31 ++++++++- .../evm/update-gas-price.mdx | 63 ++++++++++++------- 2 files changed, 72 insertions(+), 22 deletions(-) diff --git a/developers/developer-guides/tools/clis/minitiad-cli/introduction.mdx b/developers/developer-guides/tools/clis/minitiad-cli/introduction.mdx index dd0e0529..22d2126b 100644 --- a/developers/developer-guides/tools/clis/minitiad-cli/introduction.mdx +++ b/developers/developer-guides/tools/clis/minitiad-cli/introduction.mdx @@ -1,3 +1,32 @@ --- title: Introduction ---- \ No newline at end of file +--- + +For rollup development, use the **minitiad** CLI, which expose rollup-specific functionality. + +## Getting Started + +Choose the variant that matches your rollup's VM: + +| Rollup VM | CLI | Repository | +|-----------|-----|------------| +| EVM | **minitiad** | https://github.com/initia-labs/minievm | +| Wasm | **minitiad** | https://github.com/initia-labs/miniwasm | +| Move | **minitiad** | https://github.com/initia-labs/minimove | + +Then install the *minitiad* CLI. + +```bash +export VERSION=v1.0.0 +git clone https://github.com/initia-labs/minievm.git +cd minievm +git checkout $VERSION +make install +``` + +If the installation is successful, you should be able to run the following command: + +```bash +minitiad version +# v1.0.0 +``` \ No newline at end of file diff --git a/developers/developer-guides/vm-specific-tutorials/evm/update-gas-price.mdx b/developers/developer-guides/vm-specific-tutorials/evm/update-gas-price.mdx index 990221dc..7a7f489e 100644 --- a/developers/developer-guides/vm-specific-tutorials/evm/update-gas-price.mdx +++ b/developers/developer-guides/vm-specific-tutorials/evm/update-gas-price.mdx @@ -4,11 +4,7 @@ title: Update Gas Price on EVM Rollup ## Overview -You may want to use an ERC20 token as the Fee Token instead of the tokens issued by the Cosmos Bank module. - -To achieve this, you can update the chain parameter of the EVM module to set the Fee Token as an ERC20 token. - -Use validator (admin) account to update the chain parameter. +You may want to use an ERC-20 token as the fee token instead of the tokens issued by the Cosmos Bank module. To do this, you need to update the chain parameters of the EVM module and set the fee token to the desired ERC-20 token. This change must be made using a admin account with the authority to modify chain parameters. The deployed ERC20 token must inherit the `InitiaERC20` contract. @@ -17,6 +13,7 @@ The deployed ERC20 token must inherit the `InitiaERC20` contract. ## Prerequisites - [NodeJS](https://nodejs.org) +- Install [minitiad](/developers/developer-guides/tools/clis/minitiad-cli/introduction.mdx) ## Update Chain Parameters @@ -95,45 +92,69 @@ Create a JSON file named `messages.json` with the following content: "@type": "/opinit.opchild.v1.MsgUpdateParams", "authority": "init1gz9n8jnu9fgqw7vem9ud67gqjk5q4m2w0aejne", "params": { - "max_validators": 100, // Max number of active validators - "historical_entries": 10000, // Number of historical blocks to retain + "max_validators": 100, + "historical_entries": 10000, "min_gas_prices": [ { - "denom": "umin", // Native token denomination - "amount": "1000000000" // Minimum gas price in smallest unit + "denom": "umin", + "amount": "1000000000" } ], "bridge_executors": [ - "init1jaz6hxkn8cx9dxjwrjwy4v2qs2u09pf25ztcam" // Allowed bridge executor address + "init1jaz6hxkn8cx9dxjwrjwy4v2qs2u09pf25ztcam" ], - "admin": "init10g75rf30pwpkgu68yr8uh4gm824xajg09233xr", // Admin address with authority to update params + "admin": "init10g75rf30pwpkgu68yr8uh4gm824xajg09233xr", "fee_whitelist": [ - // Addresses exempted from fees - "init1ppzptg22xx259zzpgpejphzcvjmc7r2ff984c3", "init1ppzptg22xx259zzpgpejphzcvjmc7r2ff984c3", "init1jaz6hxkn8cx9dxjwrjwy4v2qs2u09pf25ztcam", "init1fvhhqk3tvv08vd5gmsp45x8tkzhcwv3ly8kn78" ], - "hook_max_gas": "3000000" // Maximum gas for execution hooks + "hook_max_gas": "3000000" } }, { "@type": "/minievm.evm.v1.MsgUpdateParams", "authority": "init1gz9n8jnu9fgqw7vem9ud67gqjk5q4m2w0aejne", "params": { - "extra_eips": [], // Additional Ethereum Improvement Proposals to enable - "allowed_publishers": [], // List of allowed smart contract publishers - "allow_custom_erc20": true, // Whether to allow custom ERC-20 tokens - "allowed_custom_erc20s": [], // Whitelisted custom ERC-20 contracts - "fee_denom": "umin", // Fee denomination used by EVM - "gas_refund_ratio": "0.500000000000000000", // Refund ratio on unused gas - "num_retain_block_hashes": "256" // Number of recent block hashes to retain + "extra_eips": [], + "allowed_publishers": [], + "allow_custom_erc20": true, + "allowed_custom_erc20s": [], + "fee_denom": "umin", + "gas_refund_ratio": "0.500000000000000000", + "num_retain_block_hashes": "256" } } ] } ``` +- Message 1: `/opchild.v1.MsgUpdateParams` + +| Field | Explanation | +|------------------------------|------------------------------------------------------------------| +| max_validators | Max number of active validators | +| historical_entries | Number of historical blocks to retain | +| min_gas_prices.denom | Native token denomination | +| min_gas_prices.amount | Minimum gas price in smallest unit | +| bridge_executors | Allowed bridge executor address | +| admin | Admin address with authority to update params | +| fee_whitelist | Addresses exempted from fees | +| hook_max_gas | Maximum gas for execution hooks | + + +- Message 2: `/evm.v1.MsgUpdateParams` + +| Field | Explanation | +|------------------------------|------------------------------------------------------------------| +| extra_eips | Additional Ethereum Improvement Proposals to enable | +| allowed_publishers | List of allowed smart contract publishers | +| allow_custom_erc20 | Whether to allow custom ERC-20 tokens | +| allowed_custom_erc20s | Whitelisted custom ERC-20 contracts | +| fee_denom | Fee denomination used by EVM | +| gas_refund_ratio | Refund ratio on unused gas | +| num_retain_block_hashes | Number of recent block hashes to retain | + `authority` address will be a opchild module account regardless of the field you want to update. To get the authority address, you can use the following command: