Merge pull request #281 from harmony-one/change_default_gas_price

change default gas price
pull/285/head
Haodi 3 years ago committed by GitHub
commit 86206d80ae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      cmd/subcommands/ethtransfer.go
  2. 2
      cmd/subcommands/root.go
  3. 10
      cmd/subcommands/staking.go
  4. 4
      cmd/subcommands/transfer.go

@ -171,7 +171,7 @@ func ethHandlerForBulkTransactions(txLog *transactionLog, index int) error {
if txnFlags.GasPrice != nil {
gasPrice = *txnFlags.GasPrice
} else {
gasPrice = "1" // Reset to default for subsequent transactions
gasPrice = "30000" // Reset to default for subsequent transactions
}
if txnFlags.GasLimit != nil {
gasLimit = *txnFlags.GasLimit
@ -271,7 +271,7 @@ Create an Ethereum compatible transaction, sign it, and send off to the Harmony
cmdEthTransfer.Flags().BoolVar(&dryRun, "dry-run", false, "do not send signed transaction")
cmdEthTransfer.Flags().BoolVar(&trueNonce, "true-nonce", false, "send transaction with on-chain nonce")
cmdEthTransfer.Flags().StringVar(&amount, "amount", "0", "amount to send (ONE)")
cmdEthTransfer.Flags().StringVar(&gasPrice, "gas-price", "1", "gas price to pay (NANO)")
cmdEthTransfer.Flags().StringVar(&gasPrice, "gas-price", "30000", "gas price to pay (NANO)")
cmdEthTransfer.Flags().StringVar(&gasLimit, "gas-limit", "", "gas limit")
cmdEthTransfer.Flags().StringVar(&inputNonce, "nonce", "", "set nonce for tx")
cmdEthTransfer.Flags().StringVar(&targetChain, "chain-id", "", "what chain ID to target")

@ -95,6 +95,8 @@ var (
}
} else if endpoint.Match([]byte(node)) {
chainName = endpointToChainID(node)
} else if strings.Contains(node, "api.harmony.one") {
chainName = chainIDWrapper{chainID: &common.Chain.MainNet}
} else {
chainName = chainIDWrapper{chainID: &common.Chain.TestNet}
}

@ -455,7 +455,7 @@ Create a new validator"
)
subCmdNewValidator.Flags().StringVar(&blsPubKeyDir, "bls-pubkeys-dir", "", "directory to bls pubkeys storing pub.key, pub.pass files")
subCmdNewValidator.Flags().StringVar(&stakingAmount, "amount", "0.0", "staking amount")
subCmdNewValidator.Flags().StringVar(&gasPrice, "gas-price", "1", "gas price to pay")
subCmdNewValidator.Flags().StringVar(&gasPrice, "gas-price", "30000", "gas price to pay")
subCmdNewValidator.Flags().StringVar(&gasLimit, "gas-limit", "", "gas limit")
subCmdNewValidator.Flags().StringVar(&inputNonce, "nonce", "", "set nonce for transaction")
subCmdNewValidator.Flags().StringVar(&targetChain, "chain-id", "", "what chain ID to target")
@ -633,7 +633,7 @@ Create a new validator"
subCmdEditValidator.Flags().StringVar(&slotKeyToRemove, "remove-bls-key", "", "remove BLS pubkey from slot")
subCmdEditValidator.Flags().StringVar(&active, "active", "", "validator active true/false")
subCmdEditValidator.Flags().StringVar(&gasPrice, "gas-price", "1", "gas price to pay")
subCmdEditValidator.Flags().StringVar(&gasPrice, "gas-price", "30000", "gas price to pay")
subCmdEditValidator.Flags().StringVar(&gasLimit, "gas-limit", "", "gas limit")
subCmdEditValidator.Flags().StringVar(&inputNonce, "nonce", "", "set nonce for transaction")
subCmdEditValidator.Flags().StringVar(&targetChain, "chain-id", "", "what chain ID to target")
@ -698,7 +698,7 @@ Delegating to a validator
subCmdDelegate.Flags().Var(&delegatorAddress, "delegator-addr", "delegator's address")
subCmdDelegate.Flags().Var(&validatorAddress, "validator-addr", "validator's address")
subCmdDelegate.Flags().StringVar(&stakingAmount, "amount", "0", "staking amount")
subCmdDelegate.Flags().StringVar(&gasPrice, "gas-price", "1", "gas price to pay")
subCmdDelegate.Flags().StringVar(&gasPrice, "gas-price", "30000", "gas price to pay")
subCmdDelegate.Flags().StringVar(&gasLimit, "gas-limit", "", "gas limit")
subCmdDelegate.Flags().StringVar(&inputNonce, "nonce", "", "set nonce for transaction")
subCmdDelegate.Flags().StringVar(&targetChain, "chain-id", "", "what chain ID to target")
@ -765,7 +765,7 @@ Delegating to a validator
subCmdUnDelegate.Flags().Var(&delegatorAddress, "delegator-addr", "delegator's address")
subCmdUnDelegate.Flags().Var(&validatorAddress, "validator-addr", "source validator's address")
subCmdUnDelegate.Flags().StringVar(&stakingAmount, "amount", "0", "staking amount")
subCmdUnDelegate.Flags().StringVar(&gasPrice, "gas-price", "1", "gas price to pay")
subCmdUnDelegate.Flags().StringVar(&gasPrice, "gas-price", "30000", "gas price to pay")
subCmdUnDelegate.Flags().StringVar(&gasLimit, "gas-limit", "", "gas limit")
subCmdUnDelegate.Flags().StringVar(&inputNonce, "nonce", "", "set nonce for transaction")
subCmdUnDelegate.Flags().StringVar(&targetChain, "chain-id", "", "what chain ID to target")
@ -820,7 +820,7 @@ Collect token rewards
subCmdCollectRewards.Flags().BoolVar(&trueNonce, "true-nonce", false, "send transaction with on-chain nonce")
subCmdCollectRewards.Flags().Var(&delegatorAddress, "delegator-addr", "delegator's address")
subCmdCollectRewards.Flags().StringVar(&gasPrice, "gas-price", "1", "gas price to pay")
subCmdCollectRewards.Flags().StringVar(&gasPrice, "gas-price", "30000", "gas price to pay")
subCmdCollectRewards.Flags().StringVar(&gasLimit, "gas-limit", "", "gas limit")
subCmdCollectRewards.Flags().StringVar(&inputNonce, "nonce", "", "set nonce for tx")
subCmdCollectRewards.Flags().StringVar(&targetChain, "chain-id", "", "what chain ID to target")

@ -255,7 +255,7 @@ func handlerForBulkTransactions(txLog *transactionLog, index int) error {
if txnFlags.GasPrice != nil {
gasPrice = *txnFlags.GasPrice
} else {
gasPrice = "1" // Reset to default for subsequent transactions
gasPrice = "30000" // Reset to default for subsequent transactions
}
if txnFlags.GasLimit != nil {
gasLimit = *txnFlags.GasLimit
@ -409,7 +409,7 @@ Create a transaction, sign it, and send off to the Harmony blockchain
cmdTransfer.Flags().BoolVar(&offlineSign, "offline-sign", false, "output offline signing")
cmdTransfer.Flags().BoolVar(&trueNonce, "true-nonce", false, "send transaction with on-chain nonce")
cmdTransfer.Flags().StringVar(&amount, "amount", "0", "amount to send (ONE)")
cmdTransfer.Flags().StringVar(&gasPrice, "gas-price", "1", "gas price to pay (NANO)")
cmdTransfer.Flags().StringVar(&gasPrice, "gas-price", "30000", "gas price to pay (NANO)")
cmdTransfer.Flags().StringVar(&gasLimit, "gas-limit", "", "gas limit")
cmdTransfer.Flags().StringVar(&inputNonce, "nonce", "", "set nonce for tx")
cmdTransfer.Flags().Uint32Var(&fromShardID, "from-shard", 0, "source shard id")

Loading…
Cancel
Save