github.com/0xsequence/ethkit@v1.25.0/README.md (about)

     1  ```
     2  =========================================================================================
     3  ________________________________/\\\_____________________________________________________
     4  ________________________________\/\\\___________/\\\_____________________________________
     5  ______________________/\\\_______\/\\\__________\/\\\___________/\\\______/\\\___________
     6  ________/\\\\\\\\___/\\\\\\\\\\\__\/\\\__________\/\\\___ /\\___\///____/\\\\\\\\\\\_____
     7  _______/\\\         \////\\\////___\/\\\\\\\\\\___\/\\\_ /\\\___________\////\\\////_____
     8  _______/\\\\\\\\\\\_____\/\\\_______\/\\\/////\\\__\/\\\\\\_______\/\\\_____\/\\\________
     9  _______\//\\\            \/\\\_______\/\\\___\/\\\__\/\\\__\/\\\___\/\\\_____\/\\\_______
    10  ________\//\\\\\\\\\\_____\//\\\\\____\/\\\___\/\\\__\/\\\__\/\\\___\/\\\_____\//\\\\\___
    11  _________\///////////______\//////_____\///____\///___\///___\///____\///______\/////____
    12  
    13  ==================================== we <3 Ethereum =====================================
    14  ```
    15  
    16  Ethkit is an Ethereum [CLI](#ethkit-cli) and [Go development kit](#ethkit-go-development-library)
    17  designed to make it easier to use and develop for Ethereum.
    18  
    19  # Ethkit CLI
    20  
    21  [![GoDoc Widget](https://godoc.org/github.com/0xsequence/ethkit?status.svg)](https://pkg.go.dev/github.com/0xsequence/ethkit) [![Go Report Card](https://goreportcard.com/badge/github.com/0xsequence/ethkit)](https://goreportcard.com/report/github.com/0xsequence/ethkit) ![example branch parameter](https://github.com/0xsequence/ethkit/actions/workflows/ci.yml/badge.svg?branch=master)
    22  
    23  Ethkit comes equipped with the `ethkit` CLI providing:
    24  
    25  - **Wallet** - manage Ethereum wallets & accounts. restore wallets from a secret mnemonic.
    26    with scrypt wallet encryption support.
    27  - **Abigen** - generate Go code from an ABI artifact file to interact with or deploy a smart
    28    contract.
    29  - **Artifacts** - parse details from a Truffle artifact file from command line such as contract
    30    bytecode or the json abi
    31  - **Balance** - retrieve the balance of an account at any block height for any supported network via RPC
    32  - **Block** - retrieve the block information based on block height (or tag) and filtered by optional input parameters
    33  
    34  ## Install
    35  
    36  `go install github.com/0xsequence/ethkit/cmd/ethkit@latest`
    37  
    38  ## Run
    39  
    40  `ethkit [command]`
    41  
    42  ## Commands
    43  
    44  ### wallet
    45  
    46  `wallet` handles encrypted Ethereum wallet creation and management in user-supplied keyfiles.
    47  It allows users to create a new Ethereum wallet, import an existing Ethereum wallet from a secret mnemonic, or print an existing wallet's secret mnemonic.
    48  
    49  ```bash
    50  Usage:
    51    ethkit wallet [flags]
    52  
    53  Flags:
    54    -h, --help              help for wallet
    55        --import-mnemonic   import a secret mnemonic to a new keyfile
    56        --keyfile string    wallet key file path
    57        --new               create a new wallet and save it to the keyfile
    58        --print-account     print wallet account address from keyfile (default) (default true)
    59        --print-mnemonic    print wallet secret mnemonic from keyfile (danger!)
    60  ```
    61  
    62  ### abigen
    63  
    64  `abigen` generates Go contract client code from a JSON [truffle](https://www.trufflesuite.com/)
    65  artifacts file.
    66  
    67  ```bash
    68  Usage:
    69    ethkit abigen [flags]
    70  
    71  Flags:
    72        --abiFile string         path to abi json file
    73        --artifactsFile string   path to truffle contract artifacts file
    74    -h, --help                   help for abigen
    75        --lang string            target language, supported: [go], default=go
    76        --outFile string         outFile (optional), default=stdout
    77        --pkg string             pkg (optional)
    78        --type string            type (optional)
    79  ```
    80  
    81  ### artifacts
    82  
    83  `artifacts` prints the contract ABI or bytecode from a user-supplied truffle artifacts file.
    84  
    85  ```bash
    86  Usage:
    87    ethkit artifacts [flags]
    88  
    89  Flags:
    90        --abi           abi
    91        --bytecode      bytecode
    92        --file string   path to truffle contract artifacts file (required)
    93    -h, --help          help for artifacts
    94  ```
    95  
    96  ### balance
    97  
    98  `balance` retrieves the balance of an account via RPC by a provided address at a predefined block height.
    99  
   100  ```bash
   101  Usage:
   102    ethkit balance [account] [flags]
   103  
   104  Flags:
   105    -B, --block string     The block height to query at (default "latest")
   106    -e, --ether            Format the balance in ether
   107    -h, --help             help for balance
   108    -r, --rpc-url string   The RPC endpoint to the blockchain node to interact with
   109  ```
   110  
   111  ### block
   112  
   113  `block` retrieves a block by a provided block height or tag via RPC
   114  
   115  ```bash
   116  Usage:
   117    ethkit block [number|tag] [flags]
   118  
   119  Aliases:
   120    block, bl
   121  
   122  Flags:
   123    -f, --field string     Get the specific field of a block
   124        --full             Get the full block information
   125    -h, --help             help for block
   126    -j, --json             Print the block as JSON
   127  ```
   128  
   129  ## Ethkit Go Development Library
   130  
   131  Ethkit is a very capable Ethereum development library for writing systems in Go that
   132  interface with an Ethereum-compatible network (mainnet/testnet or another EVM sidechain).
   133  We use it in the Sequence stack for many micro-services in our infrastructure,
   134  we hope you enjoy it too.
   135  
   136  Packages:
   137  
   138  - `ethartifacts`: simple pkg to parse Truffle artifact file
   139  - `ethcoder`: encoding/decoding libraries for smart contracts and transactions
   140  - `ethdeploy`: simple method to deploy contract bytecode to a network
   141  - `ethgas`: fetch the latest gas price of a network or track over a period of time
   142  - `ethmonitor`: easily monitor block production, transactions and logs of a chain; with re-org support
   143  - `ethrpc`: http client for Ethereum json-rpc
   144  - `ethwallet`: wallet for Ethereum with support for wallet mnemonics (BIP-39)
   145  
   146  ## License
   147  
   148  Please see [LICENSE](./LICENSE) for full details.
   149  
   150  TL;DR
   151  
   152  - All ethkit source is licensed under the MIT license, copyright (c) 2018-present [Horizon Blockchain Games Inc.](https://horizon.io)
   153  - All vendored+modified [go-ethereum](./go-ethereum) source is licensed under the original LGPLv3 license
   154  - All vendored source from go.mod dependencies is licensed under their respective licenses in [./vendor](./vendor)