{"id":18150317,"url":"https://github.com/jesserc/gast","last_synced_at":"2025-04-27T10:27:50.248Z","repository":{"id":226616254,"uuid":"758545034","full_name":"Jesserc/gast","owner":"Jesserc","description":"gast is an open source command-line toolkit for Ethereum transactions (deploy contracts, create tx \u0026 blob tx, sign, verify, trace)","archived":false,"fork":false,"pushed_at":"2024-03-17T12:36:53.000Z","size":325,"stargazers_count":16,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-03-17T13:41:41.323Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Jesserc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2024-02-16T14:52:54.000Z","updated_at":"2024-04-14T21:44:01.546Z","dependencies_parsed_at":"2024-04-14T21:43:50.775Z","dependency_job_id":"d73fe1b4-a45d-407f-9f5f-2bf998881458","html_url":"https://github.com/Jesserc/gast","commit_stats":null,"previous_names":["jesserc/gast"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jesserc%2Fgast","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jesserc%2Fgast/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jesserc%2Fgast/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jesserc%2Fgast/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Jesserc","download_url":"https://codeload.github.com/Jesserc/gast/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246296312,"owners_count":20754621,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-02T00:08:45.364Z","updated_at":"2025-03-31T10:31:24.438Z","avatar_url":"https://github.com/Jesserc.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Gast - Ethereum  Transaction Toolkit\n\nGast is an open-source command-line transaction toolkit designed to streamline the management of Ethereum (including testnets and EVM compatible Layer 2s) transactions and gas prices. It provides some sets of commands for managing transactions (including creation, signing, and tracing).\n\n## Installation\n\nFirstly, ensure you have Go language installed. To verify, run:\n```shell\n go version\n```\nIf not installed, you can here: https://go.dev/dl/ \n\nAfter installing Go, run this command to install Gast:\n```shell\ngo install github.com/Jesserc/gast@latest\n```\nCheck if Gast is installed:\n```shell\ngast help\n```\nIf the command is not recognized, you would have to add the Go Bin directory to your path.\n```shell\nexport PATH=$PATH:$(go env GOPATH)/bin\n```\nOr manually paste it in your `.bashrc`, `.zshrc` file.\n```shell\nnano ~/.zshrc # add =\u003e export PATH=$PATH:$(go env GOPATH)/bin\n# or\nnano ~/.bashrc # add =\u003e export PATH=$PATH:$(go env GOPATH)/bin\n```\n\n## Usage\n\nTo use Gast, run:\n\n```shell\ngast [command]\n```\n\n### Available Commands\n\n- `completion`: Generate the autocompletion script for the specified shell.\n- `gas-price`: Fetch the current gas price from specified Ethereum networks.\n- `help`: Help about any command.\n- `tx`: Manages Ethereum transactions, including creation, signing, and tracing.\n\n### Flags\n\n- `-h, --help`: Help for Gast.\n\nFor more information about a command, use:\n\n```shell\ngast [command] --help\n```\n\n### Transaction Management\n\nManage Ethereum transactions with ease. The `tx` command supports a variety of subcommands:\n```shell\ngast tx [sub-command] [flags]\n```\n* `create-contract`: Deploy Solidity contract\n* `create-raw`: Generate a raw, signed EIP-1559 transaction to propagate later\n* `send-raw`: Propagate a raw, signed transaction. The nonce must not be used\n* `send-blob`: Create and send an EIP-4844 blob transaction\n* `get-blob`: Get blob transaction data\n* `send`: Send EIP-1559 transaction\n* `trace`: Retrieve and display the execution trace (path) of a given transaction hash\n* `sign-message`: Sign a given message with a private key\n* `verify-sig`: Verify the signature of a signed message (can be created with the sign-message command)\n* `estimate-gas`: Estimate the gas required to execute a given transaction\n* `get-nonce`: Get the transaction count of an account\n\n[//]: # (- `create-contract`: Deploy Solidity contract \u0026#40;solc must be installed\u0026#41;.)\n\n[//]: # (- `create-raw`: Generates a raw, unsigned EIP-1559 transaction.)\n\n[//]: # (- `send-raw`: Submits a raw, signed transaction to the Ethereum network.)\n\n[//]: # (- `send`: Submits a constructed transaction.)\n\n[//]: # (- `send-blob`: Submits a constructed EIP-4844 blob transaction.)\n\n[//]: # (- `estimate-gas`: Provides an estimate of the gas required to execute a given transaction.)\n\n[//]: # (- `get-nonce`: Get transaction count of an account.)\n\n[//]: # (- `sign-message`: Signs a given message with the private key.)\n\n[//]: # (- `trace`: Retrieves and displays the execution trace \u0026#40;path\u0026#41; of a given transaction hash using `ots_traceTransaction`.)\n\n[//]: # (- `verify-sig`: Verifies the signature of a signed message.)\n\n### Fetching Gas Prices\n\nTo fetch the current gas prices from specific Ethereum networks, use:\n\n```shell\ngast gas-price [flags]\n```\n\nSupported flags include:\n\n- `--eth`: Use the default Ethereum RPC URL.\n- `--op`: Use the default Optimism RPC URL.\n- `--arb`: Use the default Arbitrum RPC URL.\n- `--base`: Use the default Base RPC URL.\n- `--linea`: Use the default Linea RPC URL.\n- `--zksync`: Use the default zkSync RPC URL.\n- `-u, --rpc-url string`: Specify a custom RPC URL for fetching the gas price.\n\n## Generating Completions\nTo generate completions for zsh shell, run:\n```shell\ngast completion zsh # or use your shell\n```\nSave completion script to a completion file:\n```shell\nmkdir -p ~/.zsh/completion\nnano ~/.zsh/completion/_gast # paste the completion script here\n```\nOpen .zshrc to Include the Completion Directory:\n```shell\nnano ~/.zshrc\n```\nAdd the following lines to set completions:\n```shell\nfpath=(~/.zsh/completion $fpath)\nautoload -Uz compinit\ncompinit\n```\nApply changes:\n```shell\nsource ~/.zshrc\n```\n\n## Command Examples\n\nHere are some practical examples to help you get started with Gast. These commands demonstrate how to use Gast for managing Ethereum transactions and gas prices.\n\n### Fetching Gas Prices\n\n```shell\n# Fetch current gas price for Ethereum network\ngast gas-price --eth \n\n# Fetch gas price from a custom RPC URL\ngast gas-price --rpc-url https://forno.celo.org\n```\n\n### Contract Deployment\n\n```shell\n# Deploy a Solidity contract\ngast tx create-contract --rpc-url https://sepolia.drpc.org --private-key \"2843e08c0fa87258545656e44955aa2c6ca2ebb92fa65507e4e5728570d36662\" --gas-limit 1599000 -d contracts/CurrentYear.sol\n```\n\n### Creating and Sending Transactions\n\n```shell\n# Create a raw, signed EIP-1559 transaction\ngast tx create-raw --rpc-url \"https://eth-sepolia.g.alchemy.com/v2/Of6ow3pvkFafGPn8Y2uk9vz4bSveZQxa\" --to \"0x4924Fb92285Cb10BC440E6fb4A53c2B94f2930c5\" --private-key \"2843e08c0fa87258545656e44955aa2c6ca2ebb92fa65507e4e5728570d36662\" --gas-limit 21000 --wei 10000000000000\n\n# Submit a raw, signed transaction to the Ethereum network\ngast tx send-raw --raw-tx b87402f87183aa36a781d7843b9aca0084f702d4c28256ce944924fb92285cb10bc440e6fb4a53c2b94f2930c58398968080c080a081725247a454fc36e3ecd411ef6e7ddb89e668745fb2a5169ea08bfc4f5b617ba013cce55e74f620f15904e30a1c0f3e5dad22919e782468afe372d3bc6f5222b0 --rpc-url \"https://eth-sepolia.g.alchemy.com/v2/Of6ow3pvkFafGPn8Y2uk9vz4bSveZQxa\"\n\n# Estimate gas for a transaction\ngast tx estimate-gas --from 0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045 --to 0xbe0eb53f46cd790cd13851d5eff43d12404d33e8 --rpc-url https://rpc.mevblocker.io --data 'Hello Ethereum!'\n\n# Get the transaction count of an account\ngast tx get-nonce --address 0x8741Fb04b7d8f5A01e0ec1D454602Bc08BDB0c8c --rpc-url https://sepolia.drpc.org\n```\n\n### Send EIP-4844 Blob Transactions\n\n```shell\n# Create and send an EIP-4844 blob transaction\ngast tx send-blob --to 0x571B102323C3b8B8Afb30619Ac1d36d85359fb84 --rpc-url \"https://rpc2.sepolia.org\" --private-key \"2843e08c0fa87258545656e44955aa2c6ca2ebb92fa65507e4e5728570d36662\" --blob-data 'Hello Blobs!' --dir gast/blob-tx # dir to save blob tx result\n```\n\n### Retrieve EIP-4844 blob transaction data (mainnet only)\n```shell\n\n# retrieve EIP-4844 blob transaction data\ngast tx get-blob --id 8626178 --kzg-commitment 0xb28e4d255047f6e50b3d7548d37155b6e2289e82520aa6248d9fbe50e73b81d9f705cb3f2192d55caf54e26fb29c419a # `id` is the block root (32 bytes) or slot number of the blob tx and `kzg-commitment` is the kzg commitment (48 bytes) of the blob\n```\n### Message Signing and Verification\n\n```shell\n# Sign a message with a private key\ngast tx sign-message -m Jesserc -p \"2843e08c0fa87258545656e44955aa2c6ca2ebb92fa65507e4e5728570d36662\"\n\n# Verify the signature of a signed message\ngast tx verify-sig --sig 0x5e9faa36429804f79bd8ca495e21095f29f1038ec2b3f10788437a16d52f79682aca534e2b4ff0f426d6444555d807e6bc1c7c8a6b21aaaa4676d4f5e8d45b541b --address 0x571B102323C3b8B8Afb30619Ac1d36d85359fb84 --msg Jesserc\n```\n\n### Transaction Tracing (mainnet only)\n\n```shell\n# Retrieve the execution trace of a transaction\ngast tx trace --hash 0xee92800f24e23971c0ab031b30d60d6414e2255a308993d902604f4cfc1e4e7f -u https://rpc.builder0x69.io/ \n```\n\n\n## Tests\nTo run unit test:\n```shell\ngo test -v ./... -short\n```\n\nTo run integration test (connects to network):\n```shell\n go test -v ./...  -run Integration\n```\n\n## Contribution\nGood PRs or suggestions are welcomed.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjesserc%2Fgast","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjesserc%2Fgast","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjesserc%2Fgast/lists"}