mirror of
https://github.com/0glabs/0g-chain.git
synced 2025-04-04 15:55:23 +00:00
Configure the gas price which used by DA helper through parameters.
This commit is contained in:
parent
d6ecf1313e
commit
7a36255cd5
@ -29,6 +29,7 @@ var (
|
||||
account = flag.String("account", "", "account to run evmosd cli")
|
||||
keyring = flag.String("keyring", "", "keyring to run evmosd cli")
|
||||
homePath = flag.String("home", "", "home path of evmosd node")
|
||||
gasPrice = flag.String("gas-price", "", "gas price to run evmosd cli")
|
||||
)
|
||||
|
||||
func newUpgrader() *websocket.Upgrader {
|
||||
@ -40,6 +41,7 @@ func newUpgrader() *websocket.Upgrader {
|
||||
ctx = context.WithValue(ctx, types.NODE_CLI_EXEC_ACCOUNT, *account)
|
||||
ctx = context.WithValue(ctx, types.NODE_CLI_EXEC_KEYRING, *keyring)
|
||||
ctx = context.WithValue(ctx, types.NODE_HOME_PATH, *homePath)
|
||||
ctx = context.WithValue(ctx, types.NODE_GAS_PRICE, *gasPrice)
|
||||
go func() { service.OnMessage(ctx, c, messageType, data) }()
|
||||
})
|
||||
|
||||
|
@ -165,7 +165,6 @@ func runEvmosdCliReportDasResult(ctx context.Context, requestId uint64, result b
|
||||
strconv.FormatUint(requestId, 10),
|
||||
strconv.FormatBool(result),
|
||||
"--from", account.(string),
|
||||
"--gas-prices", "7678500neuron", // TODO: use args to set gas prices
|
||||
}
|
||||
|
||||
homePath := ctx.Value(types.NODE_HOME_PATH)
|
||||
@ -178,6 +177,11 @@ func runEvmosdCliReportDasResult(ctx context.Context, requestId uint64, result b
|
||||
args = append(args, "--keyring-backend", keyring.(string))
|
||||
}
|
||||
|
||||
gasPrice := ctx.Value(types.NODE_GAS_PRICE)
|
||||
if len(gasPrice.(string)) > 0 {
|
||||
args = append(args, "--gas-prices", gasPrice.(string))
|
||||
}
|
||||
|
||||
cmdStr := relativePath.(string) + "0gchaind"
|
||||
cmd := exec.Command(cmdStr, append(args, "-y")...)
|
||||
cmd.Stdout = os.Stdout
|
||||
|
@ -7,4 +7,5 @@ const (
|
||||
NODE_CLI_EXEC_ACCOUNT = "node_exec_account"
|
||||
NODE_CLI_EXEC_KEYRING = "node_exec_keyring"
|
||||
NODE_HOME_PATH = "home_path"
|
||||
NODE_GAS_PRICE = "gas_price"
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user