Documentation ¶
Overview ¶
blocksPkg implements the chifra blocks command.
The chifra blocks tool retrieves block data from your Ethereum node or, if previously cached, from the TrueBlocks cache. You may specify multiple blocks per invocation.
By default, chifra blocks queries the full transactional details of the block (including receipts). You may optionally retrieve only the transaction hashes in the block (which is significantly faster). Additionally, you may also use this tool to retrieve uncle blocks at a give height.
Another useful feature of chifra blocks is the ability to extract address appearances from a block. TrueBlocks uses a similar feature internally to build its index of appearances. This type of data is very insightful when studying end user behavior and chain-wide adoption analysis.
Index ¶
- func ResetOptions(testMode bool)
- func RunBlocks(cmd *cobra.Command, args []string) error
- func ServeBlocks(w http.ResponseWriter, r *http.Request) error
- type BlocksOptions
- func (opts *BlocksOptions) BlocksInternal(rCtx *output.RenderCtx) error
- func (opts *BlocksOptions) HandleCount(rCtx *output.RenderCtx) error
- func (opts *BlocksOptions) HandleDecache(rCtx *output.RenderCtx) error
- func (opts *BlocksOptions) HandleHashes(rCtx *output.RenderCtx) error
- func (opts *BlocksOptions) HandleLogs(rCtx *output.RenderCtx) error
- func (opts *BlocksOptions) HandleShow(rCtx *output.RenderCtx) error
- func (opts *BlocksOptions) HandleTraces(rCtx *output.RenderCtx) error
- func (opts *BlocksOptions) HandleUncles(rCtx *output.RenderCtx) error
- func (opts *BlocksOptions) HandleUniq(rCtx *output.RenderCtx) error
- func (opts *BlocksOptions) HandleWithdrawals(rCtx *output.RenderCtx) error
- func (opts *BlocksOptions) String() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ResetOptions ¶
func ResetOptions(testMode bool)
func RunBlocks ¶
RunBlocks handles the blocks command for the command line. Returns error only as per cobra.
func ServeBlocks ¶
func ServeBlocks(w http.ResponseWriter, r *http.Request) error
ServeBlocks handles the blocks command for the API. Returns an error.
Types ¶
type BlocksOptions ¶
type BlocksOptions struct { Blocks []string `json:"blocks,omitempty"` // A space-separated list of one or more block identifiers BlockIds []identifiers.Identifier `json:"blockIds,omitempty"` // Block identifiers Hashes bool `json:"hashes,omitempty"` // Display only transaction hashes, default is to display full transaction detail Uncles bool `json:"uncles,omitempty"` // Display uncle blocks (if any) instead of the requested block Traces bool `json:"traces,omitempty"` // Export the traces from the block as opposed to the block data Uniq bool `json:"uniq,omitempty"` // Display a list of uniq address appearances per transaction Flow string `json:"flow,omitempty"` // For the --uniq option only, export only from or to (including trace from or to) Logs bool `json:"logs,omitempty"` // Display only the logs found in the block(s) Emitter []string `json:"emitter,omitempty"` // For the --logs option only, filter logs to show only those logs emitted by the given address(es) Topic []string `json:"topic,omitempty"` // For the --logs option only, filter logs to show only those with this topic(s) Withdrawals bool `json:"withdrawals,omitempty"` // Export the withdrawals from the block as opposed to the block data Articulate bool `json:"articulate,omitempty"` // For the --logs option only, articulate the retrieved data if ABIs can be found Count bool `json:"count,omitempty"` // Display only the count of appearances for --addrs or --uniq CacheTxs bool `json:"cacheTxs,omitempty"` // Force a write of the block's transactions to the cache (slow) CacheTraces bool `json:"cacheTraces,omitempty"` // Force a write of the block's traces to the cache (slower) Globals globals.GlobalOptions `json:"globals,omitempty"` // The global options Conn *rpc.Connection `json:"conn,omitempty"` // The connection to the RPC server BadFlag error `json:"badFlag,omitempty"` // An error flag if needed }
BlocksOptions provides all command options for the chifra blocks command.
func BlocksFinishParseInternal ¶
func BlocksFinishParseInternal(w io.Writer, values url.Values) *BlocksOptions
func GetBlocksOptions ¶
func GetBlocksOptions(args []string, g *globals.GlobalOptions) *BlocksOptions
GetBlocksOptions returns the options for this tool so other tools may use it.
func GetOptions ¶
func GetOptions() *BlocksOptions
func (*BlocksOptions) BlocksInternal ¶
func (opts *BlocksOptions) BlocksInternal(rCtx *output.RenderCtx) error
BlocksInternal handles the internal workings of the blocks command. Returns an error.
func (*BlocksOptions) HandleCount ¶
func (opts *BlocksOptions) HandleCount(rCtx *output.RenderCtx) error
func (*BlocksOptions) HandleDecache ¶
func (opts *BlocksOptions) HandleDecache(rCtx *output.RenderCtx) error
func (*BlocksOptions) HandleHashes ¶
func (opts *BlocksOptions) HandleHashes(rCtx *output.RenderCtx) error
func (*BlocksOptions) HandleLogs ¶
func (opts *BlocksOptions) HandleLogs(rCtx *output.RenderCtx) error
func (*BlocksOptions) HandleShow ¶
func (opts *BlocksOptions) HandleShow(rCtx *output.RenderCtx) error
func (*BlocksOptions) HandleTraces ¶
func (opts *BlocksOptions) HandleTraces(rCtx *output.RenderCtx) error
func (*BlocksOptions) HandleUncles ¶
func (opts *BlocksOptions) HandleUncles(rCtx *output.RenderCtx) error
func (*BlocksOptions) HandleUniq ¶
func (opts *BlocksOptions) HandleUniq(rCtx *output.RenderCtx) error
func (*BlocksOptions) HandleWithdrawals ¶
func (opts *BlocksOptions) HandleWithdrawals(rCtx *output.RenderCtx) error
func (*BlocksOptions) String ¶
func (opts *BlocksOptions) String() string
String implements the Stringer interface