fields

package
v0.2.7 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package fields provides blockchain-specific logging field helpers.

These helpers create structured fields with consistent naming for blockchain-related data like transactions, blocks, shards, and timing.

Usage:

import "github.com/JupiterMetaLabs/ion/fields"

logger.Info("transaction routed",
    fields.TxHash("abc123"),
    fields.ShardID(5),
    fields.LatencyMs(12.5),
)

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Address

func Address(addr string) ion.Field

Address creates a generic address field (wallet/contract).

func Amount added in v0.2.4

func Amount(amt string) ion.Field

Amount creates a generic amount field.

func BlockHash

func BlockHash(h string) ion.Field

BlockHash creates a block hash field.

func BlockHeight

func BlockHeight(h uint64) ion.Field

BlockHeight creates a block height field.

func ChainID

func ChainID(id string) ion.Field

ChainID creates a chain ID field.

func ClientID added in v0.2.4

func ClientID(id string) ion.Field

ClientID creates a client ID field (e.g. user-agent).

func Component

func Component(name string) ion.Field

Component creates a component name field.

func Contract added in v0.2.4

func Contract(addr string) ion.Field

Contract creates a contract address field.

func Count

func Count(n int) ion.Field

Count creates a generic count field.

func DurationMs

func DurationMs(ms float64) ion.Field

DurationMs creates a duration field in milliseconds.

func Enabled

func Enabled(on bool) ion.Field

Enabled creates an enabled boolean field.

func Epoch

func Epoch(e uint64) ion.Field

Epoch creates a consensus epoch field.

func ErrorMsg added in v0.1.4

func ErrorMsg(err error) ion.Field

ErrorMsg creates a detailed error message field.

func FromAddress added in v0.1.4

func FromAddress(addr string) ion.Field

FromAddress creates a sender address field.

func GasLimit added in v0.1.4

func GasLimit(limit uint64) ion.Field

GasLimit creates a gas limit field.

func GasPrice added in v0.1.4

func GasPrice(price uint64) ion.Field

GasPrice creates a gas price field.

func GasUsed added in v0.1.4

func GasUsed(used uint64) ion.Field

GasUsed creates a gas used field.

func Host

func Host(h string) ion.Field

Host creates a host field.

func LatencyMs

func LatencyMs(ms float64) ion.Field

LatencyMs creates a latency field in milliseconds.

func Method

func Method(m string) ion.Field

Method creates a method name field.

func Network

func Network(net string) ion.Field

Network creates a network name field (mainnet, testnet).

func NodeID

func NodeID(id string) ion.Field

NodeID creates a node ID field.

func Nonce added in v0.1.4

func Nonce(n uint64) ion.Field

Nonce creates a transaction nonce field.

func Operation

func Operation(op string) ion.Field

Operation creates an operation name field.

func PeerID added in v0.2.4

func PeerID(id string) ion.Field

PeerID creates a peer ID field.

func Pending

func Pending(n int) ion.Field

Pending creates a pending count field.

func Port

func Port(p int) ion.Field

Port creates a port field.

func Proposer added in v0.2.4

func Proposer(id string) ion.Field

Proposer creates a block proposer ID field.

func Protocol added in v0.2.4

func Protocol(p string) ion.Field

Protocol creates a protocol version/name field.

func Reason

func Reason(r string) ion.Field

Reason creates a reason field.

func RemoteAddr

func RemoteAddr(addr string) ion.Field

RemoteAddr creates a remote address field.

func Round added in v0.2.4

func Round(r uint64) ion.Field

Round creates a consensus round field.

func Score

func Score(s float64) ion.Field

Score creates a score field.

func ShardID

func ShardID(id int) ion.Field

ShardID creates a shard ID field.

func Size

func Size(bytes int64) ion.Field

Size creates a size field in bytes.

func Slot

func Slot(s uint64) ion.Field

Slot creates a consensus slot number field.

func Success

func Success(ok bool) ion.Field

Success creates a success boolean field.

func ToAddress added in v0.1.4

func ToAddress(addr string) ion.Field

ToAddress creates a recipient address field.

func Token added in v0.2.4

func Token(t string) ion.Field

Token creates a token symbol/address field.

func Total

func Total(n int) ion.Field

Total creates a total count field.

func TxHash

func TxHash(hash string) ion.Field

TxHash creates a transaction hash field.

func TxSignature

func TxSignature(sig string) ion.Field

TxSignature creates a transaction signature field.

func TxStatus

func TxStatus(status string) ion.Field

TxStatus creates a transaction status field.

func TxType

func TxType(typ string) ion.Field

TxType creates a transaction type field.

func Validator added in v0.2.4

func Validator(id string) ion.Field

Validator creates a validator ID field.

func Value added in v0.1.4

func Value(val string) ion.Field

Value creates a transaction value field.

func View added in v0.2.4

func View(v uint64) ion.Field

View creates a consensus view field.

func Weight

func Weight(w float64) ion.Field

Weight creates a weight field.

Types

This section is empty.

Jump to

Keyboard shortcuts

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