ethkit

package module
v1.30.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 19, 2024 License: LGPL-3.0, MIT Imports: 2 Imported by: 2

README

=========================================================================================
________________________________/\\\_____________________________________________________
________________________________\/\\\___________/\\\_____________________________________
______________________/\\\_______\/\\\__________\/\\\___________/\\\______/\\\___________
________/\\\\\\\\___/\\\\\\\\\\\__\/\\\__________\/\\\___ /\\___\///____/\\\\\\\\\\\_____
_______/\\\         \////\\\////___\/\\\\\\\\\\___\/\\\_ /\\\___________\////\\\////_____
_______/\\\\\\\\\\\_____\/\\\_______\/\\\/////\\\__\/\\\\\\_______\/\\\_____\/\\\________
_______\//\\\            \/\\\_______\/\\\___\/\\\__\/\\\__\/\\\___\/\\\_____\/\\\_______
________\//\\\\\\\\\\_____\//\\\\\____\/\\\___\/\\\__\/\\\__\/\\\___\/\\\_____\//\\\\\___
_________\///////////______\//////_____\///____\///___\///___\///____\///______\/////____

==================================== we <3 Ethereum =====================================

Ethkit is an Ethereum CLI and Go development kit designed to make it easier to use and develop for Ethereum.

Ethkit CLI

GoDoc Widget Go Report Card example branch parameter

Ethkit comes equipped with the ethkit CLI providing:

  • Wallet - manage Ethereum wallets & accounts. restore wallets from a secret mnemonic. with scrypt wallet encryption support.
  • Abigen - generate Go code from an ABI artifact file to interact with or deploy a smart contract.
  • Artifacts - parse details from a Truffle artifact file from command line such as contract bytecode or the json abi
  • Balance - retrieve the balance of an account at any block height for any supported network via RPC
  • Block - retrieve the block information based on block height (or tag) and filtered by optional input parameters

Install

go install github.com/0xsequence/ethkit/cmd/ethkit@latest

Run

ethkit [command]

Commands

wallet

wallet handles encrypted Ethereum wallet creation and management in user-supplied keyfiles. 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.

Usage:
  ethkit wallet [flags]

Flags:
  -h, --help              help for wallet
      --import-mnemonic   import a secret mnemonic to a new keyfile
      --keyfile string    wallet key file path
      --new               create a new wallet and save it to the keyfile
      --print-account     print wallet account address from keyfile (default) (default true)
      --print-mnemonic    print wallet secret mnemonic from keyfile (danger!)
abigen

abigen generates Go contract client code from a JSON truffle artifacts file.

Usage:
  ethkit abigen [flags]

Flags:
      --abiFile string         path to abi json file
      --artifactsFile string   path to truffle contract artifacts file
  -h, --help                   help for abigen
      --lang string            target language, supported: [go], default=go
      --outFile string         outFile (optional), default=stdout
      --pkg string             pkg (optional)
      --type string            type (optional)
artifacts

artifacts prints the contract ABI or bytecode from a user-supplied truffle artifacts file.

Usage:
  ethkit artifacts [flags]

Flags:
      --abi           abi
      --bytecode      bytecode
      --file string   path to truffle contract artifacts file (required)
  -h, --help          help for artifacts
balance

balance retrieves the balance of an account via RPC by a provided address at a predefined block height.

Usage:
  ethkit balance [account] [flags]

Flags:
  -B, --block string     The block height to query at (default "latest")
  -e, --ether            Format the balance in ether
  -h, --help             help for balance
  -r, --rpc-url string   The RPC endpoint to the blockchain node to interact with
block

block retrieves a block by a provided block height or tag via RPC

Usage:
  ethkit block [number|tag] [flags]

Aliases:
  block, bl

Flags:
  -f, --field string     Get the specific field of a block
      --full             Get the full block information
  -h, --help             help for block
  -j, --json             Print the block as JSON

Ethkit Go Development Library

Ethkit is a very capable Ethereum development library for writing systems in Go that interface with an Ethereum-compatible network (mainnet/testnet or another EVM sidechain). We use it in the Sequence stack for many micro-services in our infrastructure, we hope you enjoy it too.

Packages:

  • ethartifacts: simple pkg to parse Truffle artifact file
  • ethcoder: encoding/decoding libraries for smart contracts and transactions
  • ethdeploy: simple method to deploy contract bytecode to a network
  • ethgas: fetch the latest gas price of a network or track over a period of time
  • ethmonitor: easily monitor block production, transactions and logs of a chain; with re-org support
  • ethrpc: http client for Ethereum json-rpc
  • ethwallet: wallet for Ethereum with support for wallet mnemonics (BIP-39)

License

Please see LICENSE for full details.

TL;DR

  • All ethkit source is licensed under the MIT license, copyright (c) 2018-present Horizon Blockchain Games Inc.
  • All vendored+modified go-ethereum source is licensed under the original LGPLv3 license
  • All vendored source from go.mod dependencies is licensed under their respective licenses in ./vendor

Documentation

Index

Constants

View Source
const HashLength = common.HashLength

Variables

This section is empty.

Functions

func ToPtr

func ToPtr[T any](v T) *T

func ToSlicePtrs

func ToSlicePtrs[T any](in []T) []*T

func ToSliceValues

func ToSliceValues[T any](in []*T) []T

Types

type Address

type Address = common.Address

type BlockNonce

type BlockNonce = types.BlockNonce

type Hash

type Hash = common.Hash

Directories

Path Synopsis
cmd
Package ethereum defines interfaces for interacting with Ethereum.
Package ethereum defines interfaces for interacting with Ethereum.
accounts
Package accounts implements high level Ethereum account management.
Package accounts implements high level Ethereum account management.
accounts/abi
Package abi implements the Ethereum ABI (Application Binary Interface).
Package abi implements the Ethereum ABI (Application Binary Interface).
accounts/abi/bind
Package bind generates Ethereum contract Go bindings.
Package bind generates Ethereum contract Go bindings.
accounts/keystore
Package keystore implements encrypted storage of secp256k1 private keys.
Package keystore implements encrypted storage of secp256k1 private keys.
common
Package common contains various helper functions.
Package common contains various helper functions.
common/hexutil
Package hexutil implements hex encoding with 0x prefix.
Package hexutil implements hex encoding with 0x prefix.
common/lru
Package lru implements generically-typed LRU caches.
Package lru implements generically-typed LRU caches.
common/math
Package math provides integer math utilities.
Package math provides integer math utilities.
common/mclock
Package mclock is a wrapper for a monotonic clock source
Package mclock is a wrapper for a monotonic clock source
core/types
Package types contains data types related to Ethereum consensus.
Package types contains data types related to Ethereum consensus.
crypto/blake2b
Package blake2b implements the BLAKE2b hash algorithm defined by RFC 7693 and the extendable output function (XOF) BLAKE2Xb.
Package blake2b implements the BLAKE2b hash algorithm defined by RFC 7693 and the extendable output function (XOF) BLAKE2Xb.
crypto/bn256
Package bn256 implements the Optimal Ate pairing over a 256-bit Barreto-Naehrig curve.
Package bn256 implements the Optimal Ate pairing over a 256-bit Barreto-Naehrig curve.
crypto/bn256/cloudflare
Package bn256 implements a particular bilinear group at the 128-bit security level.
Package bn256 implements a particular bilinear group at the 128-bit security level.
crypto/bn256/google
Package bn256 implements a particular bilinear group.
Package bn256 implements a particular bilinear group.
crypto/kzg4844
Package kzg4844 implements the KZG crypto for EIP-4844.
Package kzg4844 implements the KZG crypto for EIP-4844.
crypto/secp256k1
Package secp256k1 wraps the bitcoin secp256k1 C library.
Package secp256k1 wraps the bitcoin secp256k1 C library.
ethclient
Package ethclient provides a client for the Ethereum RPC API.
Package ethclient provides a client for the Ethereum RPC API.
ethclient/gethclient
Package gethclient provides an RPC client for geth-specific APIs.
Package gethclient provides an RPC client for geth-specific APIs.
event
Package event deals with subscriptions to real-time events.
Package event deals with subscriptions to real-time events.
log
rlp
Package rlp implements the RLP serialization format.
Package rlp implements the RLP serialization format.
rlp/internal/rlpstruct
Package rlpstruct implements struct processing for RLP encoding/decoding.
Package rlpstruct implements struct processing for RLP encoding/decoding.
rpc

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL