Gast is a command-line toolkit designed to streamline the management of Ethereum transactions and gas prices. It provides some sets of commands for managing transactions (including creation, signing, and tracing).
Installation
Firstly, ensure you have Go language installed. To verify, run:
go version
If not installed, you can here: https://go.dev/dl/
After installing Go, run this command to install Gast:
go install github.com/Jesserc/gast@latest
Check if Gast is installed:
gast help
Usage
To use Gast, run:
gast [command]
Available Commands
completion: Generate the autocompletion script for the specified shell.
gas-price: Fetch the current gas price from specified Ethereum networks.
help: Help about any command.
tx: Manages Ethereum transactions, including creation, signing, and tracing.
Flags
--config string: Config file (default is $HOME/.gast.yaml).
-h, --help: Help for Gast.
-t, --toggle: Help message for toggle.
For more information about a command, use:
gast [command] --help
Transaction Management
Manage Ethereum transactions with ease. The tx command supports a variety of subcommands:
gast tx [sub-command] [flags]
create-contract: Deploy Solidity contract
create-raw: Generate a raw, signed EIP-1559 transaction
send-raw: Submit a raw, signed transaction
send-blob: Create and send an EIP-4844 blob transaction
send: Send EIP-1559 transaction
trace: Retrieve and display the execution trace (path) of a given transaction hash
sign-message: Sign a given message with a private key
verify-sig: Verify the signature of a signed message (can be created with the sign-message command)
estimate-gas: Estimate the gas required to execute a given transaction
get-nonce: Get the transaction count of an account
Fetching Gas Prices
To fetch the current gas prices from specific Ethereum networks, use:
gast gas-price [flags]
Supported flags include:
--eth: Use the default Ethereum RPC URL.
--op: Use the default Optimism RPC URL.
--arb: Use the default Arbitrum RPC URL.
--base: Use the default Base RPC URL.
--linea: Use the default Linea RPC URL.
--zksync: Use the default zkSync RPC URL.
-u, --url string: Specify a custom RPC URL for fetching the gas price.
Tests
To run unit test:
go test -v ./... -short
To run integration test (connects to network):
go test -v ./... -run Integration
Contribution
Good PRs or suggestions are welcomed.