blockchain

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMsgApproveAction

func NewMsgApproveAction(
	creator string,
	actionID string,
) *actiontypes.MsgApproveAction

NewMsgApproveAction constructs a MsgApproveAction with the provided creator and actionID.

func NewMsgDeregisterSupernode

func NewMsgDeregisterSupernode(
	creator, validatorAddress string,
) *supernodetypes.MsgDeregisterSupernode

NewMsgDeregisterSupernode constructs a MsgDeregisterSupernode.

func NewMsgFinalizeAction

func NewMsgFinalizeAction(
	creator string,
	actionID string,
	actionType actiontypes.ActionType,
	metadata string,
) *actiontypes.MsgFinalizeAction

NewMsgFinalizeAction constructs a MsgFinalizeAction with the provided parameters.

func NewMsgRegisterSupernode

func NewMsgRegisterSupernode(
	creator, validatorAddress, ipAddress, supernodeAccount, p2pPort string,
) *supernodetypes.MsgRegisterSupernode

NewMsgRegisterSupernode constructs a MsgRegisterSupernode.

func NewMsgRequestAction

func NewMsgRequestAction(
	creator string,
	actionType actiontypes.ActionType,
	metadata string,
	price string,
	expiration string,
	fileSizeKbs int64,
) *actiontypes.MsgRequestAction

NewMsgRequestAction constructs a MsgRequestAction with the provided parameters. Converts typed inputs to the string format required by the protobuf message.

func NewMsgStartSupernode

func NewMsgStartSupernode(
	creator, validatorAddress string,
) *supernodetypes.MsgStartSupernode

NewMsgStartSupernode constructs a MsgStartSupernode.

func NewMsgStopSupernode

func NewMsgStopSupernode(
	creator, validatorAddress, reason string,
) *supernodetypes.MsgStopSupernode

NewMsgStopSupernode constructs a MsgStopSupernode.

func NewMsgUpdateParams

func NewMsgUpdateParams(
	authority string,
	params actiontypes.Params,
) *actiontypes.MsgUpdateParams

NewMsgUpdateParams constructs a MsgUpdateParams with the provided authority and params.

func NewMsgUpdateSupernode

func NewMsgUpdateSupernode(
	creator, validatorAddress, ipAddress, note, supernodeAccount, p2pPort string,
) *supernodetypes.MsgUpdateSupernode

NewMsgUpdateSupernode constructs a MsgUpdateSupernode.

func NewSuperNodeMsgUpdateParams

func NewSuperNodeMsgUpdateParams(
	authority string,
	params supernodetypes.Params,
) *supernodetypes.MsgUpdateParams

NewSuperNodeMsgUpdateParams constructs a SuperNode MsgUpdateParams with the provided authority and params.

Types

type ActionClient

type ActionClient struct {
	// contains filtered or unexported fields
}

ActionClient provides action module operations

func (*ActionClient) GetAction

func (a *ActionClient) GetAction(ctx context.Context, actionID string) (*types.Action, error)

GetAction retrieves an action by ID

func (*ActionClient) GetActionFee

func (a *ActionClient) GetActionFee(ctx context.Context, dataSize int64) (string, error)

GetActionFee calculates the fee for an action based on data size

func (*ActionClient) ListActions

func (a *ActionClient) ListActions(ctx context.Context, opts ...QueryOption) ([]*types.Action, error)

ListActions lists actions with optional filters

func (*ActionClient) ListActionsByBlockHeight

func (a *ActionClient) ListActionsByBlockHeight(ctx context.Context, blockHeight int64, limit, offset uint64) ([]*types.Action, error)

ListActionsByBlockHeight lists actions created at a specific block height with pagination.

func (*ActionClient) ListActionsBySuperNode

func (a *ActionClient) ListActionsBySuperNode(ctx context.Context, superNodeAddress string, limit, offset uint64) ([]*types.Action, error)

ListActionsBySuperNode lists actions for a specific supernode address with pagination.

func (*ActionClient) ListActionsByType

func (a *ActionClient) ListActionsByType(ctx context.Context, actionType string, limit, offset uint64) ([]*types.Action, error)

ListActionsByType provides a convenience wrapper accepting actionType as a string with pagination.

func (*ActionClient) ListExpiredActions

func (a *ActionClient) ListExpiredActions(ctx context.Context, limit, offset uint64) ([]*types.Action, error)

ListExpiredActions lists expired actions with pagination.

func (*ActionClient) Params

func (a *ActionClient) Params(ctx context.Context) (*actiontypes.Params, error)

Params retrieves the Action module parameters.

func (*ActionClient) QueryActionByMetadata

func (a *ActionClient) QueryActionByMetadata(ctx context.Context, actionTypeStr, metadataQuery string, limit, offset uint64) ([]*types.Action, error)

QueryActionByMetadata queries actions by metadata and string ActionType with pagination.

func (*ActionClient) QueryActionByMetadataEnum

func (a *ActionClient) QueryActionByMetadataEnum(ctx context.Context, actionType actiontypes.ActionType, metadataQuery string, limit, offset uint64) ([]*types.Action, error)

QueryActionByMetadataEnum queries actions by metadata and typed ActionType with pagination.

func (*ActionClient) WaitForState added in v1.0.5

func (a *ActionClient) WaitForState(ctx context.Context, actionID string, state types.ActionState, pollInterval time.Duration) (*types.Action, error)

WaitForState polls action state until it matches the target or the context is done. A pollInterval <= 0 uses a 1s default.

type AuditClient

type AuditClient struct {
}

AuditClient provides audit module operations

type ClaimClient

type ClaimClient struct {
	// contains filtered or unexported fields
}

ClaimClient provides claim module operations

type Client

type Client struct {
	*base.Client

	// Module-specific clients
	Action    *ActionClient
	SuperNode *SuperNodeClient
	Claim     *ClaimClient
	Audit     *AuditClient
}

Client provides access to Lumera-specific blockchain operations.

func New

func New(ctx context.Context, cfg Config, kr keyring.Keyring, keyName string) (*Client, error)

New creates a new Lumera blockchain client.

func (*Client) ApproveActionTx

func (c *Client) ApproveActionTx(ctx context.Context, creator, actionID, memo string) (*types.ActionResult, error)

ApproveActionTx builds, signs, broadcasts and confirms a MsgApproveAction.

func (*Client) DeregisterSupernodeTx

func (c *Client) DeregisterSupernodeTx(ctx context.Context, creator, validatorAddress, memo string) (*types.ActionResult, error)

DeregisterSupernodeTx de-registers an existing supernode.

func (*Client) FinalizeActionTx

func (c *Client) FinalizeActionTx(ctx context.Context, creator, actionID string, actionType actiontypes.ActionType, metadata, memo string) (*types.ActionResult, error)

FinalizeActionTx builds, signs, broadcasts and confirms a MsgFinalizeAction.

func (*Client) RegisterSupernodeTx

func (c *Client) RegisterSupernodeTx(ctx context.Context, creator, validatorAddress, ipAddress, supernodeAccount, p2pPort, memo string) (*types.ActionResult, error)

RegisterSupernodeTx registers a new supernode.

func (*Client) RequestActionTx

func (c *Client) RequestActionTx(ctx context.Context, creator string, actionType actiontypes.ActionType, metadata, price, expiration string, fileSizeKbs int64, memo string) (*types.ActionResult, error)

RequestActionTx builds, signs, broadcasts and confirms a MsgRequestAction.

func (*Client) StartSupernodeTx

func (c *Client) StartSupernodeTx(ctx context.Context, creator, validatorAddress, memo string) (*types.ActionResult, error)

StartSupernodeTx starts a supernode.

func (*Client) StopSupernodeTx

func (c *Client) StopSupernodeTx(ctx context.Context, creator, validatorAddress, reason, memo string) (*types.ActionResult, error)

StopSupernodeTx stops a supernode with a reason.

func (*Client) UpdateActionParamsTx

func (c *Client) UpdateActionParamsTx(ctx context.Context, authority string, params actiontypes.Params, memo string) (*types.ActionResult, error)

UpdateActionParamsTx builds, signs, broadcasts and confirms a MsgUpdateParams for the Action module.

func (*Client) UpdateSuperNodeParamsTx

func (c *Client) UpdateSuperNodeParamsTx(ctx context.Context, authority string, params supernodetypes.Params, memo string) (*types.ActionResult, error)

UpdateSuperNodeParamsTx builds, signs, broadcasts and confirms a SuperNode MsgUpdateParams.

func (*Client) UpdateSupernodeTx

func (c *Client) UpdateSupernodeTx(ctx context.Context, creator, validatorAddress, ipAddress, note, supernodeAccount, p2pPort, memo string) (*types.ActionResult, error)

UpdateSupernodeTx updates a supernode's info.

type Config

type Config = base.Config

Config mirrors the base blockchain config for Lumera-specific usage.

type QueryOption

type QueryOption interface {
	ApplyToActionQuery(*actiontypes.QueryListActionsRequest)
}

QueryOption is a functional option for queries

func WithActionState

func WithActionState(state actiontypes.ActionState) QueryOption

WithActionState filters by action state enum

func WithActionStateEnum

func WithActionStateEnum(st actiontypes.ActionState) QueryOption

WithActionStateEnum is an alias for WithActionState for clarity

func WithActionStateStr

func WithActionStateStr(s string) QueryOption

WithActionStateStr parses a string into an enum (case-insensitive), falling back to zero value if unknown

func WithActionType

func WithActionType(actionType actiontypes.ActionType) QueryOption

WithActionType filters by action type enum

func WithActionTypeEnum

func WithActionTypeEnum(t actiontypes.ActionType) QueryOption

WithActionTypeEnum is an alias for WithActionType for clarity

func WithActionTypeStr

func WithActionTypeStr(s string) QueryOption

WithActionTypeStr parses a string into an enum (case-insensitive), falling back to zero value if unknown

func WithPagination

func WithPagination(limit, offset uint64) QueryOption

WithPagination sets pagination parameters

type SuperNodeClient

type SuperNodeClient struct {
	// contains filtered or unexported fields
}

SuperNodeClient provides supernode module operations

func (*SuperNodeClient) GetSuperNode

func (s *SuperNodeClient) GetSuperNode(ctx context.Context, validatorAddr string) (*types.SuperNode, error)

GetSuperNode retrieves a supernode by validator address

func (*SuperNodeClient) GetSuperNodeBySuperNodeAddress

func (s *SuperNodeClient) GetSuperNodeBySuperNodeAddress(ctx context.Context, supernodeAddress string) (*types.SuperNode, error)

GetSuperNodeBySuperNodeAddress retrieves a supernode by its supernode account address.

func (*SuperNodeClient) GetTopSuperNodesForBlock

func (s *SuperNodeClient) GetTopSuperNodesForBlock(ctx context.Context, blockHeight int32) ([]*supernodetypes.SuperNode, error)

GetTopSuperNodesForBlock retrieves top supernodes for a specific block

func (*SuperNodeClient) GetTopSuperNodesForBlockWithOptions

func (s *SuperNodeClient) GetTopSuperNodesForBlockWithOptions(ctx context.Context, blockHeight int32, limit int32, state string) ([]*types.SuperNode, error)

GetTopSuperNodesForBlockWithOptions retrieves top supernodes for a block with optional limit and state filter.

func (*SuperNodeClient) ListSuperNodes

func (s *SuperNodeClient) ListSuperNodes(ctx context.Context, limit, offset uint64) ([]*types.SuperNode, error)

ListSuperNodes returns a paginated list of supernodes (converted to SDK types).

func (*SuperNodeClient) Params

Params retrieves the SuperNode module parameters.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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