localstatequery

package
v0.21.0 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PROTOCOL_NAME        = "local-state-query"
	PROTOCOL_ID   uint16 = 7
)
View Source
const (
	MESSAGE_TYPE_ACQUIRE            = 0
	MESSAGE_TYPE_ACQUIRED           = 1
	MESSAGE_TYPE_FAILURE            = 2
	MESSAGE_TYPE_QUERY              = 3
	MESSAGE_TYPE_RESULT             = 4
	MESSAGE_TYPE_RELEASE            = 5
	MESSAGE_TYPE_REACQUIRE          = 6
	MESSAGE_TYPE_DONE               = 7
	MESSAGE_TYPE_ACQUIRE_NO_POINT   = 8
	MESSAGE_TYPE_REACQUIRE_NO_POINT = 9

	ACQUIRE_FAILURE_POINT_TOO_OLD      = 0
	ACQUIRE_FAILURE_POINT_NOT_ON_CHAIN = 1
)
View Source
const (
	QUERY_TYPE_BLOCK          = 0
	QUERY_TYPE_SYSTEM_START   = 1
	QUERY_TYPE_CHAIN_BLOCK_NO = 2
	QUERY_TYPE_CHAIN_POINT    = 3

	// Block query sub-types
	QUERY_TYPE_SHELLEY   = 0
	QUERY_TYPE_HARD_FORK = 2

	// Hard fork query sub-types
	QUERY_TYPE_HARD_FORK_ERA_HISTORY = 0
	QUERY_TYPE_HARD_FORK_CURRENT_ERA = 1

	// Shelley query sub-types
	QUERY_TYPE_SHELLEY_LEDGER_TIP                              = 0
	QUERY_TYPE_SHELLEY_EPOCH_NO                                = 1
	QUERY_TYPE_SHELLEY_NON_MYOPIC_MEMBER_REWARDS               = 2
	QUERY_TYPE_SHELLEY_CURRENT_PROTOCOL_PARAMS                 = 3
	QUERY_TYPE_SHELLEY_PROPOSED_PROTOCOL_PARAMS_UPDATES        = 4
	QUERY_TYPE_SHELLEY_STAKE_DISTRIBUTION                      = 5
	QUERY_TYPE_SHELLEY_UTXO_BY_ADDRESS                         = 6
	QUERY_TYPE_SHELLEY_UTXO_WHOLE                              = 7
	QUERY_TYPE_SHELLEY_DEBUG_EPOCH_STATE                       = 8
	QUERY_TYPE_SHELLEY_CBOR                                    = 9
	QUERY_TYPE_SHELLEY_FILTERED_DELEGATION_AND_REWARD_ACCOUNTS = 10
	QUERY_TYPE_SHELLEY_GENESIS_CONFIG                          = 11
	QUERY_TYPE_SHELLEY_DEBUG_NEW_EPOCH_STATE                   = 12
	QUERY_TYPE_SHELLEY_DEBUG_CHAIN_DEP_STATE                   = 13
	QUERY_TYPE_SHELLEY_REWARD_PROVENANCE                       = 14
	QUERY_TYPE_SHELLEY_UTXO_BY_TXIN                            = 15
	QUERY_TYPE_SHELLEY_STAKE_POOLS                             = 16
	QUERY_TYPE_SHELLEY_STAKE_POOL_PARAMS                       = 17
	QUERY_TYPE_SHELLEY_REWARD_INFO_POOLS                       = 18
	QUERY_TYPE_SHELLEY_POOL_STATE                              = 19
	QUERY_TYPE_SHELLEY_STAKE_SNAPSHOTS                         = 20
	QUERY_TYPE_SHELLEY_POOL_DISTR                              = 21
)

Variables

View Source
var (
	STATE_IDLE      = protocol.NewState(1, "Idle")
	STATE_ACQUIRING = protocol.NewState(2, "Acquiring")
	STATE_ACQUIRED  = protocol.NewState(3, "Acquired")
	STATE_QUERYING  = protocol.NewState(4, "Querying")
	STATE_DONE      = protocol.NewState(5, "Done")
)

Functions

func NewMsgFromCbor

func NewMsgFromCbor(msgType uint, data []byte) (protocol.Message, error)

Types

type AcquireFailurePointNotOnChainError added in v0.21.0

type AcquireFailurePointNotOnChainError struct {
}

func (AcquireFailurePointNotOnChainError) Error added in v0.21.0

type AcquireFailurePointTooOldError added in v0.21.0

type AcquireFailurePointTooOldError struct {
}

func (AcquireFailurePointTooOldError) Error added in v0.21.0

type AcquireFunc

type AcquireFunc func(interface{}) error

Callback function types TODO: update callbacks

type Client added in v0.19.0

type Client struct {
	*protocol.Protocol
	// contains filtered or unexported fields
}

func NewClient added in v0.19.0

func NewClient(protoOptions protocol.ProtocolOptions, cfg *Config) *Client

func (*Client) Acquire added in v0.21.0

func (c *Client) Acquire(point *common.Point) error

func (*Client) DebugChainDepState added in v0.21.0

func (c *Client) DebugChainDepState() (*DebugChainDepStateResult, error)

TODO

func (*Client) DebugEpochState added in v0.21.0

func (c *Client) DebugEpochState() (*DebugEpochStateResult, error)

TODO

func (*Client) DebugNewEpochState added in v0.21.0

func (c *Client) DebugNewEpochState() (*DebugNewEpochStateResult, error)

TODO

func (*Client) GetChainBlockNo added in v0.21.0

func (c *Client) GetChainBlockNo() (int64, error)

func (*Client) GetChainPoint added in v0.21.0

func (c *Client) GetChainPoint() (*common.Point, error)

func (*Client) GetCurrentEra added in v0.21.0

func (c *Client) GetCurrentEra() (int, error)

func (*Client) GetCurrentProtocolParams added in v0.21.0

func (c *Client) GetCurrentProtocolParams() (*CurrentProtocolParamsResult, error)

func (*Client) GetEpochNo added in v0.21.0

func (c *Client) GetEpochNo() (int, error)

func (*Client) GetEraHistory added in v0.21.0

func (c *Client) GetEraHistory() ([]EraHistoryResult, error)

func (*Client) GetFilteredDelegationsAndRewardAccounts added in v0.21.0

func (c *Client) GetFilteredDelegationsAndRewardAccounts(creds []interface{}) (*FilteredDelegationsAndRewardAccountsResult, error)

TODO

func (*Client) GetGenesisConfig added in v0.21.0

func (c *Client) GetGenesisConfig() (*GenesisConfigResult, error)

TODO

func (*Client) GetNonMyopicMemberRewards added in v0.21.0

func (c *Client) GetNonMyopicMemberRewards() (*NonMyopicMemberRewardsResult, error)

TODO

func (*Client) GetPoolDistr added in v0.21.0

func (c *Client) GetPoolDistr(poolIds []interface{}) (*PoolDistrResult, error)

TODO

func (*Client) GetPoolState added in v0.21.0

func (c *Client) GetPoolState(poolIds []interface{}) (*PoolStateResult, error)

TODO

func (*Client) GetProposedProtocolParamsUpdates added in v0.21.0

func (c *Client) GetProposedProtocolParamsUpdates() (*ProposedProtocolParamsUpdatesResult, error)

TODO

func (*Client) GetRewardInfoPools added in v0.21.0

func (c *Client) GetRewardInfoPools() (*RewardInfoPoolsResult, error)

TODO

func (*Client) GetRewardProvenance added in v0.21.0

func (c *Client) GetRewardProvenance() (*RewardProvenanceResult, error)

TODO

func (*Client) GetStakeDistribution added in v0.21.0

func (c *Client) GetStakeDistribution() (*StakeDistributionResult, error)

func (*Client) GetStakePoolParams added in v0.21.0

func (c *Client) GetStakePoolParams(poolIds []interface{}) (*StakePoolParamsResult, error)

TODO

func (*Client) GetStakePools added in v0.21.0

func (c *Client) GetStakePools() (*StakePoolsResult, error)

TODO

func (*Client) GetStakeSnapshots added in v0.21.0

func (c *Client) GetStakeSnapshots(poolId interface{}) (*StakeSnapshotsResult, error)

TODO

func (*Client) GetSystemStart added in v0.21.0

func (c *Client) GetSystemStart() (*SystemStartResult, error)

func (*Client) GetUTxOByAddress added in v0.21.0

func (c *Client) GetUTxOByAddress(addrs []interface{}) (*UTxOByAddressResult, error)

TODO

func (*Client) GetUTxOByTxIn added in v0.21.0

func (c *Client) GetUTxOByTxIn(txins []interface{}) (*UTxOByTxInResult, error)

TODO

func (*Client) GetUTxOWhole added in v0.21.0

func (c *Client) GetUTxOWhole() (*UTxOWholeResult, error)

TODO

func (*Client) Release added in v0.21.0

func (c *Client) Release() error

type Config added in v0.18.0

type Config struct {
	AcquireFunc   AcquireFunc
	QueryFunc     QueryFunc
	ReleaseFunc   ReleaseFunc
	ReAcquireFunc ReAcquireFunc
	DoneFunc      DoneFunc
}

type CurrentProtocolParamsResult added in v0.21.0

type CurrentProtocolParamsResult struct {
	MinFeeA            int
	MinFeeB            int
	MaxBlockBodySize   int
	MaxTxSize          int
	MaxBlockHeaderSize int
	KeyDeposit         int
	PoolDeposit        int
	EMax               int
	NOpt               int
	A0                 []int
	Rho                []int
	Tau                []int
	// This field no longer exists in Babbage, but we're keeping this here for reference
	// unless we need to support querying a node still on an older era
	//DecentralizationParam  []int
	ProtocolVersionMajor   int
	ProtocolVersionMinor   int
	MinPoolCost            int
	Unknown                interface{}
	CostModels             interface{}
	ExecutionUnitPrices    interface{} // [priceMemory priceSteps]	both elements are fractions
	MaxTxExecutionUnits    []uint
	MaxBlockExecutionUnits []uint
	MaxValueSize           int
	CollateralPercentage   int
	// contains filtered or unexported fields
}

type DebugChainDepStateResult added in v0.21.0

type DebugChainDepStateResult interface{}

type DebugEpochStateResult added in v0.21.0

type DebugEpochStateResult interface{}

type DebugNewEpochStateResult added in v0.21.0

type DebugNewEpochStateResult interface{}

TODO

type DoneFunc

type DoneFunc func() error

type EraHistoryResult added in v0.21.0

type EraHistoryResult struct {
	Begin  eraHistoryResultBeginEnd
	End    eraHistoryResultBeginEnd
	Params eraHistoryResultParams
	// contains filtered or unexported fields
}

type FilteredDelegationsAndRewardAccountsResult added in v0.21.0

type FilteredDelegationsAndRewardAccountsResult interface{}

type GenesisConfigResult added in v0.21.0

type GenesisConfigResult struct {
	Start             SystemStartResult
	NetworkMagic      int
	NetworkId         uint8
	ActiveSlotsCoeff  []interface{}
	SecurityParam     int
	EpochLength       int
	SlotsPerKESPeriod int
	MaxKESEvolutions  int
	SlotLength        int
	UpdateQuorum      int
	MaxLovelaceSupply int64
	ProtocolParams    struct {
		MinFeeA               int
		MinFeeB               int
		MaxBlockBodySize      int
		MaxTxSize             int
		MaxBlockHeaderSize    int
		KeyDeposit            int
		PoolDeposit           int
		EMax                  int
		NOpt                  int
		A0                    []int
		Rho                   []int
		Tau                   []int
		DecentralizationParam []int
		ExtraEntropy          interface{}
		ProtocolVersionMajor  int
		ProtocolVersionMinor  int
		MinUTxOValue          int
		MinPoolCost           int
		// contains filtered or unexported fields
	}
	// This value contains maps with bytestring keys, which we can't parse yet
	GenDelegs cbor.RawMessage
	Unknown1  interface{}
	Unknown2  interface{}
	// contains filtered or unexported fields
}

type LocalStateQuery

type LocalStateQuery struct {
	Client *Client
	Server *Server
}

func New

func New(protoOptions protocol.ProtocolOptions, cfg *Config) *LocalStateQuery

type MsgAcquire

type MsgAcquire struct {
	protocol.MessageBase
	Point common.Point
}

func NewMsgAcquire

func NewMsgAcquire(point common.Point) *MsgAcquire

type MsgAcquireNoPoint

type MsgAcquireNoPoint struct {
	protocol.MessageBase
}

func NewMsgAcquireNoPoint

func NewMsgAcquireNoPoint() *MsgAcquireNoPoint

type MsgAcquired

type MsgAcquired struct {
	protocol.MessageBase
}

func NewMsgAcquired

func NewMsgAcquired() *MsgAcquired

type MsgDone

type MsgDone struct {
	protocol.MessageBase
}

func NewMsgDone

func NewMsgDone() *MsgDone

type MsgFailure

type MsgFailure struct {
	protocol.MessageBase
	Failure uint8
}

func NewMsgFailure

func NewMsgFailure(failure uint8) *MsgFailure

type MsgQuery

type MsgQuery struct {
	protocol.MessageBase
	Query interface{}
}

func NewMsgQuery

func NewMsgQuery(query interface{}) *MsgQuery

type MsgReAcquire

type MsgReAcquire struct {
	protocol.MessageBase
	Point common.Point
}

func NewMsgReAcquire

func NewMsgReAcquire(point common.Point) *MsgReAcquire

type MsgReAcquireNoPoint

type MsgReAcquireNoPoint struct {
	protocol.MessageBase
}

func NewMsgReAcquireNoPoint

func NewMsgReAcquireNoPoint() *MsgReAcquireNoPoint

type MsgRelease

type MsgRelease struct {
	protocol.MessageBase
}

func NewMsgRelease

func NewMsgRelease() *MsgRelease

type MsgResult

type MsgResult struct {
	protocol.MessageBase
	Result cbor.RawMessage
}

func NewMsgResult

func NewMsgResult(resultCbor []byte) *MsgResult

type NonMyopicMemberRewardsResult added in v0.21.0

type NonMyopicMemberRewardsResult interface{}

TODO

type PoolDistrResult added in v0.21.0

type PoolDistrResult interface{}

type PoolStateResult added in v0.21.0

type PoolStateResult interface{}

type ProposedProtocolParamsUpdatesResult added in v0.21.0

type ProposedProtocolParamsUpdatesResult interface{}

TODO

type QueryFunc

type QueryFunc func(interface{}) error

type ReAcquireFunc

type ReAcquireFunc func(interface{}) error

type ReleaseFunc

type ReleaseFunc func() error

type RewardInfoPoolsResult added in v0.21.0

type RewardInfoPoolsResult interface{}

type RewardProvenanceResult added in v0.21.0

type RewardProvenanceResult interface{}

type Server added in v0.19.0

type Server struct {
	*protocol.Protocol
	// contains filtered or unexported fields
}

func NewServer added in v0.19.0

func NewServer(protoOptions protocol.ProtocolOptions, cfg *Config) *Server

type StakeDistributionResult added in v0.21.0

type StakeDistributionResult interface{}

type StakePoolParamsResult added in v0.21.0

type StakePoolParamsResult interface{}

type StakePoolsResult added in v0.21.0

type StakePoolsResult interface{}

type StakeSnapshotsResult added in v0.21.0

type StakeSnapshotsResult interface{}

type SystemStartResult added in v0.21.0

type SystemStartResult struct {
	Year        int
	Day         int
	Picoseconds uint64
	// contains filtered or unexported fields
}

type UTxOByAddressResult added in v0.21.0

type UTxOByAddressResult interface{}

type UTxOByTxInResult added in v0.21.0

type UTxOByTxInResult interface{}

type UTxOWholeResult added in v0.21.0

type UTxOWholeResult interface{}

Jump to

Keyboard shortcuts

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