Documentation
¶
Index ¶
- Constants
- Variables
- func NewMsgFromCbor(msgType uint, data []byte) (protocol.Message, error)
- type AcquireFailurePointNotOnChainError
- type AcquireFailurePointTooOldError
- type AcquireFunc
- type Client
- func (c *Client) Acquire(point *common.Point) error
- func (c *Client) DebugChainDepState() (*DebugChainDepStateResult, error)
- func (c *Client) DebugEpochState() (*DebugEpochStateResult, error)
- func (c *Client) DebugNewEpochState() (*DebugNewEpochStateResult, error)
- func (c *Client) GetChainBlockNo() (int64, error)
- func (c *Client) GetChainPoint() (*common.Point, error)
- func (c *Client) GetCurrentEra() (int, error)
- func (c *Client) GetCurrentProtocolParams() (*CurrentProtocolParamsResult, error)
- func (c *Client) GetEpochNo() (int, error)
- func (c *Client) GetEraHistory() ([]EraHistoryResult, error)
- func (c *Client) GetFilteredDelegationsAndRewardAccounts(creds []interface{}) (*FilteredDelegationsAndRewardAccountsResult, error)
- func (c *Client) GetGenesisConfig() (*GenesisConfigResult, error)
- func (c *Client) GetNonMyopicMemberRewards() (*NonMyopicMemberRewardsResult, error)
- func (c *Client) GetPoolDistr(poolIds []interface{}) (*PoolDistrResult, error)
- func (c *Client) GetPoolState(poolIds []interface{}) (*PoolStateResult, error)
- func (c *Client) GetProposedProtocolParamsUpdates() (*ProposedProtocolParamsUpdatesResult, error)
- func (c *Client) GetRewardInfoPools() (*RewardInfoPoolsResult, error)
- func (c *Client) GetRewardProvenance() (*RewardProvenanceResult, error)
- func (c *Client) GetStakeDistribution() (*StakeDistributionResult, error)
- func (c *Client) GetStakePoolParams(poolIds []interface{}) (*StakePoolParamsResult, error)
- func (c *Client) GetStakePools() (*StakePoolsResult, error)
- func (c *Client) GetStakeSnapshots(poolId interface{}) (*StakeSnapshotsResult, error)
- func (c *Client) GetSystemStart() (*SystemStartResult, error)
- func (c *Client) GetUTxOByAddress(addrs []interface{}) (*UTxOByAddressResult, error)
- func (c *Client) GetUTxOByTxIn(txins []interface{}) (*UTxOByTxInResult, error)
- func (c *Client) GetUTxOWhole() (*UTxOWholeResult, error)
- func (c *Client) Release() error
- type Config
- type CurrentProtocolParamsResult
- type DebugChainDepStateResult
- type DebugEpochStateResult
- type DebugNewEpochStateResult
- type DoneFunc
- type EraHistoryResult
- type FilteredDelegationsAndRewardAccountsResult
- type GenesisConfigResult
- type LocalStateQuery
- type MsgAcquire
- type MsgAcquireNoPoint
- type MsgAcquired
- type MsgDone
- type MsgFailure
- type MsgQuery
- type MsgReAcquire
- type MsgReAcquireNoPoint
- type MsgRelease
- type MsgResult
- type NonMyopicMemberRewardsResult
- type PoolDistrResult
- type PoolStateResult
- type ProposedProtocolParamsUpdatesResult
- type QueryFunc
- type ReAcquireFunc
- type ReleaseFunc
- type RewardInfoPoolsResult
- type RewardProvenanceResult
- type Server
- type StakeDistributionResult
- type StakePoolParamsResult
- type StakePoolsResult
- type StakeSnapshotsResult
- type SystemStartResult
- type UTxOByAddressResult
- type UTxOByTxInResult
- type UTxOWholeResult
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") )
View Source
var StateMap = protocol.StateMap{ STATE_IDLE: protocol.StateMapEntry{ Agency: protocol.AGENCY_CLIENT, Transitions: []protocol.StateTransition{ { MsgType: MESSAGE_TYPE_ACQUIRE, NewState: STATE_ACQUIRING, }, { MsgType: MESSAGE_TYPE_ACQUIRE_NO_POINT, NewState: STATE_ACQUIRING, }, { MsgType: MESSAGE_TYPE_DONE, NewState: STATE_DONE, }, }, }, STATE_ACQUIRING: protocol.StateMapEntry{ Agency: protocol.AGENCY_SERVER, Transitions: []protocol.StateTransition{ { MsgType: MESSAGE_TYPE_FAILURE, NewState: STATE_IDLE, }, { MsgType: MESSAGE_TYPE_ACQUIRED, NewState: STATE_ACQUIRED, }, }, }, STATE_ACQUIRED: protocol.StateMapEntry{ Agency: protocol.AGENCY_CLIENT, Transitions: []protocol.StateTransition{ { MsgType: MESSAGE_TYPE_QUERY, NewState: STATE_QUERYING, }, { MsgType: MESSAGE_TYPE_REACQUIRE, NewState: STATE_ACQUIRING, }, { MsgType: MESSAGE_TYPE_REACQUIRE_NO_POINT, NewState: STATE_ACQUIRING, }, { MsgType: MESSAGE_TYPE_RELEASE, NewState: STATE_IDLE, }, }, }, STATE_QUERYING: protocol.StateMapEntry{ Agency: protocol.AGENCY_SERVER, Transitions: []protocol.StateTransition{ { MsgType: MESSAGE_TYPE_RESULT, NewState: STATE_ACQUIRED, }, }, }, STATE_DONE: protocol.StateMapEntry{ Agency: protocol.AGENCY_NONE, }, }
Functions ¶
Types ¶
type AcquireFailurePointNotOnChainError ¶ added in v0.21.0
type AcquireFailurePointNotOnChainError struct { }
func (AcquireFailurePointNotOnChainError) Error ¶ added in v0.21.0
func (e AcquireFailurePointNotOnChainError) Error() string
type AcquireFailurePointTooOldError ¶ added in v0.21.0
type AcquireFailurePointTooOldError struct { }
func (AcquireFailurePointTooOldError) Error ¶ added in v0.21.0
func (e AcquireFailurePointTooOldError) Error() string
type AcquireFunc ¶
type AcquireFunc func(interface{}) error
Callback function types TODO: update callbacks
type Client ¶ added in v0.19.0
func NewClient ¶ added in v0.19.0
func NewClient(protoOptions protocol.ProtocolOptions, cfg *Config) *Client
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 (*Client) GetChainPoint ¶ added in v0.21.0
func (*Client) GetCurrentEra ¶ added in v0.21.0
func (*Client) GetCurrentProtocolParams ¶ added in v0.21.0
func (c *Client) GetCurrentProtocolParams() (*CurrentProtocolParamsResult, error)
func (*Client) GetEpochNo ¶ added in v0.21.0
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
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 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 ¶
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 ¶
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 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 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 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{}
Click to show internal directories.
Click to hide internal directories.