Documentation
¶
Overview ¶
Package state provides a structure for celestia-node's ability to access state-relevant information from as well as submit transactions/messages to the celestia network.
This package contains one main interface, `Accessor`, that defines the methods available for both accessing and updating state on the celestia network.
`Accessor` will contain three different implementations:
- Implementation over a gRPC connection with a celestia-core node called `CoreAccess`.
- Implementation over a libp2p stream with a state-providing node.
- Implementation over a local running instance of the celestia-application (this feature will be implemented in *Full* nodes).
Index ¶
- Variables
- type AccAddress
- type Address
- type Balance
- type ConfigOption
- type CoreAccessor
- func (ca *CoreAccessor) AccountAddress(context.Context) (Address, error)
- func (ca *CoreAccessor) Balance(ctx context.Context) (*Balance, error)
- func (ca *CoreAccessor) BalanceForAddress(ctx context.Context, addr Address) (*Balance, error)
- func (ca *CoreAccessor) BeginRedelegate(ctx context.Context, srcValAddr, dstValAddr ValAddress, amount Int, ...) (*TxResponse, error)
- func (ca *CoreAccessor) CancelUnbondingDelegation(ctx context.Context, valAddr ValAddress, amount, height Int, cfg *TxConfig) (*TxResponse, error)
- func (ca *CoreAccessor) Delegate(ctx context.Context, delAddr ValAddress, amount Int, cfg *TxConfig) (*TxResponse, error)
- func (ca *CoreAccessor) GrantFee(ctx context.Context, grantee AccAddress, amount Int, cfg *TxConfig) (*TxResponse, error)
- func (ca *CoreAccessor) LastPayForBlob() int64
- func (ca *CoreAccessor) PayForBlobCount() int64
- func (ca *CoreAccessor) QueryDelegation(ctx context.Context, valAddr ValAddress) (*stakingtypes.QueryDelegationResponse, error)
- func (ca *CoreAccessor) QueryDelegationRewards(ctx context.Context, valAddr ValAddress) (*distributiontypes.QueryDelegationRewardsResponse, error)
- func (ca *CoreAccessor) QueryRedelegations(ctx context.Context, srcValAddr, dstValAddr ValAddress) (*stakingtypes.QueryRedelegationsResponse, error)
- func (ca *CoreAccessor) QueryUnbonding(ctx context.Context, valAddr ValAddress) (*stakingtypes.QueryUnbondingDelegationResponse, error)
- func (ca *CoreAccessor) RevokeGrantFee(ctx context.Context, grantee AccAddress, cfg *TxConfig) (*TxResponse, error)
- func (ca *CoreAccessor) Start(ctx context.Context) error
- func (ca *CoreAccessor) Stop(_ context.Context) error
- func (ca *CoreAccessor) SubmitPayForBlob(ctx context.Context, libBlobs []*libshare.Blob, cfg *TxConfig) (_ *TxResponse, err error)
- func (ca *CoreAccessor) Transfer(ctx context.Context, addr AccAddress, amount Int, cfg *TxConfig) (*TxResponse, error)
- func (ca *CoreAccessor) Undelegate(ctx context.Context, delAddr ValAddress, amount Int, cfg *TxConfig) (*TxResponse, error)
- func (ca *CoreAccessor) WithdrawDelegatorReward(ctx context.Context, valAddr ValAddress, cfg *TxConfig) (*TxResponse, error)
- type Int
- type Option
- type Tx
- type TxClient
- type TxConfig
- type TxPriority
- type TxResponse
- type ValAddress
Constants ¶
This section is empty.
Variables ¶
var ( ErrInvalidAmount = errors.New("state: amount must be greater than zero") ErrInvalidHeight = errors.New("state: height must be positive and fit in int64") )
var ( NewTxConfig = txclient.NewTxConfig WithGas = txclient.WithGas WithGasPrice = txclient.WithGasPrice WithKeyName = txclient.WithKeyName WithSignerAddress = txclient.WithSignerAddress WithFeeGranterAddress = txclient.WithFeeGranterAddress WithMaxGasPrice = txclient.WithMaxGasPrice WithTxPriority = txclient.WithTxPriority DefaultGasPrice = txclient.DefaultGasPrice DefaultMaxGasPrice = txclient.DefaultMaxGasPrice TxPriorityLow = txclient.TxPriorityLow TxPriorityMedium = txclient.TxPriorityMedium TxPriorityHigh = txclient.TxPriorityHigh ErrGasPriceExceedsLimit = txclient.ErrGasPriceExceedsLimit WithEstimatorService = txclient.WithEstimatorService WithEstimatorServiceTLS = txclient.WithEstimatorServiceTLS WithAdditionalCoreEndpoints = txclient.WithAdditionalCoreEndpoints WithTxWorkerAccounts = txclient.WithTxWorkerAccounts )
Functions ¶
This section is empty.
Types ¶
type AccAddress ¶
type AccAddress = sdk.AccAddress
AccAddress is an alias to the AccAddress type from Cosmos-SDK.
type Address ¶
Address is an alias to the Address type from Cosmos-SDK. It is embedded into a struct to provide a non-interface type for JSON serialization.
func (Address) MarshalJSON ¶ added in v0.11.0
func (*Address) UnmarshalJSON ¶ added in v0.11.0
type ConfigOption ¶ added in v0.15.0
type ConfigOption = txclient.ConfigOption
Backward-compatible aliases for txClient types and functions.
type CoreAccessor ¶
type CoreAccessor struct {
// contains filtered or unexported fields
}
CoreAccessor implements service over a gRPC connection with a celestia-core node.
func NewCoreAccessor ¶
func NewCoreAccessor( client TxClient, keyring keyring.Keyring, keyname string, getter libhead.Head[*header.ExtendedHeader], conn *grpc.ClientConn, network string, ) (*CoreAccessor, error)
NewCoreAccessor dials the given celestia-core endpoint and constructs and returns a new CoreAccessor (state service) with the active connection.
func (*CoreAccessor) AccountAddress ¶
func (ca *CoreAccessor) AccountAddress(context.Context) (Address, error)
func (*CoreAccessor) Balance ¶
func (ca *CoreAccessor) Balance(ctx context.Context) (*Balance, error)
func (*CoreAccessor) BalanceForAddress ¶
func (*CoreAccessor) BeginRedelegate ¶
func (ca *CoreAccessor) BeginRedelegate( ctx context.Context, srcValAddr, dstValAddr ValAddress, amount Int, cfg *TxConfig, ) (*TxResponse, error)
func (*CoreAccessor) CancelUnbondingDelegation ¶
func (ca *CoreAccessor) CancelUnbondingDelegation( ctx context.Context, valAddr ValAddress, amount, height Int, cfg *TxConfig, ) (*TxResponse, error)
func (*CoreAccessor) Delegate ¶
func (ca *CoreAccessor) Delegate( ctx context.Context, delAddr ValAddress, amount Int, cfg *TxConfig, ) (*TxResponse, error)
func (*CoreAccessor) GrantFee ¶ added in v0.14.0
func (ca *CoreAccessor) GrantFee( ctx context.Context, grantee AccAddress, amount Int, cfg *TxConfig, ) (*TxResponse, error)
func (*CoreAccessor) LastPayForBlob ¶ added in v0.11.0
func (ca *CoreAccessor) LastPayForBlob() int64
func (*CoreAccessor) PayForBlobCount ¶ added in v0.11.0
func (ca *CoreAccessor) PayForBlobCount() int64
func (*CoreAccessor) QueryDelegation ¶
func (ca *CoreAccessor) QueryDelegation( ctx context.Context, valAddr ValAddress, ) (*stakingtypes.QueryDelegationResponse, error)
func (*CoreAccessor) QueryDelegationRewards ¶ added in v0.30.2
func (ca *CoreAccessor) QueryDelegationRewards( ctx context.Context, valAddr ValAddress, ) (*distributiontypes.QueryDelegationRewardsResponse, error)
func (*CoreAccessor) QueryRedelegations ¶
func (ca *CoreAccessor) QueryRedelegations( ctx context.Context, srcValAddr, dstValAddr ValAddress, ) (*stakingtypes.QueryRedelegationsResponse, error)
func (*CoreAccessor) QueryUnbonding ¶
func (ca *CoreAccessor) QueryUnbonding( ctx context.Context, valAddr ValAddress, ) (*stakingtypes.QueryUnbondingDelegationResponse, error)
func (*CoreAccessor) RevokeGrantFee ¶ added in v0.14.0
func (ca *CoreAccessor) RevokeGrantFee( ctx context.Context, grantee AccAddress, cfg *TxConfig, ) (*TxResponse, error)
func (*CoreAccessor) SubmitPayForBlob ¶ added in v0.7.0
func (ca *CoreAccessor) SubmitPayForBlob( ctx context.Context, libBlobs []*libshare.Blob, cfg *TxConfig, ) (_ *TxResponse, err error)
SubmitPayForBlob builds, signs, and synchronously submits a MsgPayForBlob with additional options defined in `TxConfig`. It blocks until the transaction is committed and returns the TxResponse. The user can specify additional options that can bee applied to the Tx.
func (*CoreAccessor) Transfer ¶
func (ca *CoreAccessor) Transfer( ctx context.Context, addr AccAddress, amount Int, cfg *TxConfig, ) (*TxResponse, error)
func (*CoreAccessor) Undelegate ¶
func (ca *CoreAccessor) Undelegate( ctx context.Context, delAddr ValAddress, amount Int, cfg *TxConfig, ) (*TxResponse, error)
func (*CoreAccessor) WithdrawDelegatorReward ¶ added in v0.30.2
func (ca *CoreAccessor) WithdrawDelegatorReward( ctx context.Context, valAddr ValAddress, cfg *TxConfig, ) (*TxResponse, error)
type TxPriority ¶ added in v0.22.1
type TxPriority = txclient.TxPriority
type TxResponse ¶
type TxResponse = sdk.TxResponse
TxResponse is an alias to the TxResponse type from Cosmos-SDK.
type ValAddress ¶
type ValAddress = sdk.ValAddress
ValAddress is an alias to the ValAddress type from Cosmos-SDK.