api

package
v1.3.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2023 License: MIT Imports: 21 Imported by: 4

README

API v3

The API has been broken up both along lines of call type and transport mechanism. The specification defines services which implement methods, and transport mechanisms for exchanging remote method calls.

Motivation

  • Take lessons learned and make a cleaner, more polished API
  • Nodes hard-code the IP/domain of other nodes
  • We currently require Tendermint RPC and Accumulate API
  • Splitting functionality across multiple servers
Packages
Other

Services

Each service defines a single method. Having one method per service was not entirely intentional, but it is convenient and allows for flexibility of implementation:

  • Services can be implemented independently.
  • A service provider is not obligated to implement all services.
  • Implementing middleware is straight forward.
Node and network services

The node service's node status method returns the status of the node. The request includes a node ID so that routing middleware may route the request to the specified node.

The network service's network status method returns the currently active network global variables. This may be expanded to include the status of nodes in the network and other related information.

The metrics service's metrics method returns the transactions per second of the last N blocks of the receiving partition. The request includes a partition ID so that routing middleware may route the request to the specified partition. The current terminal implementation actually returns chain entries per second, not transactions per second, since that is less intensive to calculate.

Submit services

The submit service's submit method submits an envelope to the network.

The validate service's validate method calls CheckTx. In the future once signatures and CheckTx are reworked, validate will partially or fully validate the envelope. Partial validation will check if the signature is valid and the signer can pay, i.e. whether the envelope would pass CheckTx. Full validation will attempt to determine whether the envelope would succeed when executed. This will be provided partially as a debugging aid once CheckTx is updated to no longer execute that check.

The faucet service's faucet method constructs and submits a transaction that deposits ACME into a lite token account.

Query services

The query service's query method retrieves data. The query method accepts a scope (URL) and a structured query. The query parameter is a union, including types such as chain query, data query, public key search, etc. Depending on the type of query and the parameters of the query, the query method can return a range of different record types. Query types are defined here and record types are defined here.

The event service's subscribe method subscribes to event notifications. The implementation is incomplete and subject to change.

Transports

Transport mechanisms are responsible for transporting the input and output parameters of a remote method call between the caller (client) and service provider (server).

The implementation of a transport mechanisms must be defined such that they are completely transparent from an outside perspective. The service provider component of a transporter must forward requests to a service implementation, and the caller component must present itself as a service implementation, such that from the caller's perspective there is little difference between a remote call and a local call. For example, the constructors should have something like the following signature:

func NewServer(api.Querier, ServerOptions) QuerierServer

func NewClient(ClientOptions) api.Querier
JSON-RPC

The JSON-RPC transport transports remote method calls as JSON-RPC method calls. The server provides a set of service implementations, which are wrapped and exposed as JSON-RPC methods via an HTTP listener. The client provides a server URL and implements all the API services via JSON-RPC calls.

Websocket

The websocket transport transports remote method calls and events over a websocket. The implementation is incomplete and subject to change.

P2P

The P2P transport transports remote method calls over a libp2p network. The P2P nodes gossip about which nodes are validators and what partition they belong to, and which are not, maintaining a table of other nodes and their role in the network.

Each P2P node can be both a service provider and a caller. The node can provide services by configuring a remote method call message handler, wrapping its service implementation. The node provides a client that wraps calls as a message and sends it to the appropriate node. Messages can be sent directly to a specific node, or the caller can determine which partition the message should be routed to and use its peer table to select an appropriate node.

Architecture & The Future

The idea is for validators to expose only Tendermint P2P and Accumulate P2P, and for API nodes to expose traditional APIs and proxy between those APIs and the P2P network.

The P2P transport should be expanded to recognize which nodes are validators and which are data servers, so that queries can be routed to data servers.

The P2P node internals should be updated to impose rate limits and balance load across validator and data server nodes. The API nodes could use a distributed hash table such that load is balanced overall across service provider nodes, instead of just balanced per API node.

The executor's internal API calls should be migrated from v2 to v3.

The P2P internals should be updated to route node queries to specific nodes, so that the API v2 compatibility layer can be decoupled from validator nodes and moved to the API nodes.

The P2P network should be split into red and black (private and public) sides, with the API nodes providing a gateway between the two. The private network can be gated via an on-chain whitelist such that incoming connections from untrusted peers are rejected. This will protect validator and data server nodes from malicious or misbehaved peers, and allow the API to (relatively) easily impose rate limits.

Documentation

Index

Constants

View Source
const N_ACC = "acc"

N_ACC is the multicodec name for the acc protocol.

View Source
const N_ACC_SVC = "acc-svc"

N_ACC_SVC is the multicodec name for the acc-svc protocol.

View Source
const P_ACC = 0x300000

P_ACC is the multicodec code for the acc protocol.

View Source
const P_ACC_SVC = 0x300001

P_ACC_SVC is the multicodec code for the acc-svc protocol.

Variables

This section is empty.

Functions

func EqualEvent

func EqualEvent(a, b Event) bool

EqualEvent is used to compare the values of the union

func EqualQuery

func EqualQuery(a, b Query) bool

EqualQuery is used to compare the values of the union

func EqualRecord

func EqualRecord(a, b Record) bool

EqualRecord is used to compare the values of the union

Types

type AccountRecord

type AccountRecord struct {
	Account       protocol.Account          `json:"account,omitempty" form:"account" query:"account" validate:"required"`
	Directory     *RecordRange[*UrlRecord]  `json:"directory,omitempty" form:"directory" query:"directory" validate:"required"`
	Pending       *RecordRange[*TxIDRecord] `json:"pending,omitempty" form:"pending" query:"pending" validate:"required"`
	Receipt       *Receipt                  `json:"receipt,omitempty" form:"receipt" query:"receipt" validate:"required"`
	LastBlockTime *time.Time                `json:"lastBlockTime,omitempty" form:"lastBlockTime" query:"lastBlockTime" validate:"required"`
	// contains filtered or unexported fields
}

func (*AccountRecord) Copy

func (v *AccountRecord) Copy() *AccountRecord

func (*AccountRecord) CopyAsInterface

func (v *AccountRecord) CopyAsInterface() interface{}

func (*AccountRecord) Equal

func (v *AccountRecord) Equal(u *AccountRecord) bool

func (*AccountRecord) IsValid

func (v *AccountRecord) IsValid() error

func (*AccountRecord) MarshalBinary

func (v *AccountRecord) MarshalBinary() ([]byte, error)

func (*AccountRecord) MarshalJSON

func (v *AccountRecord) MarshalJSON() ([]byte, error)

func (*AccountRecord) RecordType

func (*AccountRecord) RecordType() RecordType

func (*AccountRecord) UnmarshalBinary

func (v *AccountRecord) UnmarshalBinary(data []byte) error

func (*AccountRecord) UnmarshalBinaryFrom

func (v *AccountRecord) UnmarshalBinaryFrom(rd io.Reader) error

func (*AccountRecord) UnmarshalFieldsFrom

func (v *AccountRecord) UnmarshalFieldsFrom(reader *encoding.Reader) error

func (*AccountRecord) UnmarshalJSON

func (v *AccountRecord) UnmarshalJSON(data []byte) error

type AnchorSearchQuery

type AnchorSearchQuery struct {
	Anchor         []byte `json:"anchor,omitempty" form:"anchor" query:"anchor" validate:"required"`
	IncludeReceipt bool   `json:"includeReceipt,omitempty" form:"includeReceipt" query:"includeReceipt"`
	// contains filtered or unexported fields
}

AnchorSearchQuery queries {account}#anchor/{hash}.

func (*AnchorSearchQuery) Copy

func (*AnchorSearchQuery) CopyAsInterface

func (v *AnchorSearchQuery) CopyAsInterface() interface{}

func (*AnchorSearchQuery) Equal

func (*AnchorSearchQuery) IsValid

func (v *AnchorSearchQuery) IsValid() error

func (*AnchorSearchQuery) MarshalBinary

func (v *AnchorSearchQuery) MarshalBinary() ([]byte, error)

func (*AnchorSearchQuery) MarshalJSON

func (v *AnchorSearchQuery) MarshalJSON() ([]byte, error)

func (*AnchorSearchQuery) QueryType

func (*AnchorSearchQuery) QueryType() QueryType

func (*AnchorSearchQuery) UnmarshalBinary

func (v *AnchorSearchQuery) UnmarshalBinary(data []byte) error

func (*AnchorSearchQuery) UnmarshalBinaryFrom

func (v *AnchorSearchQuery) UnmarshalBinaryFrom(rd io.Reader) error

func (*AnchorSearchQuery) UnmarshalFieldsFrom

func (v *AnchorSearchQuery) UnmarshalFieldsFrom(reader *encoding.Reader) error

func (*AnchorSearchQuery) UnmarshalJSON

func (v *AnchorSearchQuery) UnmarshalJSON(data []byte) error

type BatchData

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

func ContextWithBatchData

func ContextWithBatchData(ctx context.Context) (context.Context, context.CancelFunc, *BatchData)

ContextWithBatchData will return a context with batch data. If the incoming context already has batch data, ContextWithBatch returns the incoming context and a noop cancel function. If the incoming context does not have batch data, ContextWithBatch will create a new cancellable context with batch data.

func GetBatchData

func GetBatchData(ctx context.Context) *BatchData

func (*BatchData) Context added in v1.2.10

func (d *BatchData) Context() context.Context

func (*BatchData) Get

func (d *BatchData) Get(k any) any

func (*BatchData) Put

func (d *BatchData) Put(k, v any)

type BlockEvent

type BlockEvent struct {
	Partition string                      `json:"partition,omitempty" form:"partition" query:"partition" validate:"required"`
	Index     uint64                      `json:"index,omitempty" form:"index" query:"index" validate:"required"`
	Time      time.Time                   `json:"time,omitempty" form:"time" query:"time" validate:"required"`
	Major     uint64                      `json:"major,omitempty" form:"major" query:"major" validate:"required"`
	Entries   []*ChainEntryRecord[Record] `json:"entries,omitempty" form:"entries" query:"entries" validate:"required"`
	// contains filtered or unexported fields
}

func (*BlockEvent) Copy

func (v *BlockEvent) Copy() *BlockEvent

func (*BlockEvent) CopyAsInterface

func (v *BlockEvent) CopyAsInterface() interface{}

func (*BlockEvent) Equal

func (v *BlockEvent) Equal(u *BlockEvent) bool

func (*BlockEvent) EventType

func (*BlockEvent) EventType() EventType

func (*BlockEvent) IsValid

func (v *BlockEvent) IsValid() error

func (*BlockEvent) MarshalBinary

func (v *BlockEvent) MarshalBinary() ([]byte, error)

func (*BlockEvent) MarshalJSON

func (v *BlockEvent) MarshalJSON() ([]byte, error)

func (*BlockEvent) UnmarshalBinary

func (v *BlockEvent) UnmarshalBinary(data []byte) error

func (*BlockEvent) UnmarshalBinaryFrom

func (v *BlockEvent) UnmarshalBinaryFrom(rd io.Reader) error

func (*BlockEvent) UnmarshalFieldsFrom

func (v *BlockEvent) UnmarshalFieldsFrom(reader *encoding.Reader) error

func (*BlockEvent) UnmarshalJSON

func (v *BlockEvent) UnmarshalJSON(data []byte) error

type BlockQuery

type BlockQuery struct {
	Minor      *uint64       `json:"minor,omitempty" form:"minor" query:"minor"`
	Major      *uint64       `json:"major,omitempty" form:"major" query:"major"`
	MinorRange *RangeOptions `json:"minorRange,omitempty" form:"minorRange" query:"minorRange"`
	MajorRange *RangeOptions `json:"majorRange,omitempty" form:"majorRange" query:"majorRange"`
	EntryRange *RangeOptions `json:"entryRange,omitempty" form:"entryRange" query:"entryRange"`
	// OmitEmpty omits empty (unrecorded) blocks from the response.
	OmitEmpty bool `json:"omitEmpty,omitempty" form:"omitEmpty" query:"omitEmpty"`
	// contains filtered or unexported fields
}

func (*BlockQuery) Copy

func (v *BlockQuery) Copy() *BlockQuery

func (*BlockQuery) CopyAsInterface

func (v *BlockQuery) CopyAsInterface() interface{}

func (*BlockQuery) Equal

func (v *BlockQuery) Equal(u *BlockQuery) bool

func (*BlockQuery) IsValid

func (q *BlockQuery) IsValid() error

func (*BlockQuery) MarshalBinary

func (v *BlockQuery) MarshalBinary() ([]byte, error)

func (*BlockQuery) MarshalJSON

func (v *BlockQuery) MarshalJSON() ([]byte, error)

func (*BlockQuery) QueryType

func (*BlockQuery) QueryType() QueryType

func (*BlockQuery) UnmarshalBinary

func (v *BlockQuery) UnmarshalBinary(data []byte) error

func (*BlockQuery) UnmarshalBinaryFrom

func (v *BlockQuery) UnmarshalBinaryFrom(rd io.Reader) error

func (*BlockQuery) UnmarshalFieldsFrom

func (v *BlockQuery) UnmarshalFieldsFrom(reader *encoding.Reader) error

func (*BlockQuery) UnmarshalJSON

func (v *BlockQuery) UnmarshalJSON(data []byte) error

type ChainEntryRecord

type ChainEntryRecord[T Record] struct {

	// Account is the account (omitted if unambiguous).
	Account       *url.URL         `json:"account,omitempty" form:"account" query:"account" validate:"required"`
	Name          string           `json:"name,omitempty" form:"name" query:"name" validate:"required"`
	Type          merkle.ChainType `json:"type,omitempty" form:"type" query:"type" validate:"required"`
	Index         uint64           `json:"index" form:"index" query:"index" validate:"required"`
	Entry         [32]byte         `json:"entry,omitempty" form:"entry" query:"entry" validate:"required"`
	Value         T                `json:"value,omitempty" form:"value" query:"value" validate:"required"`
	Receipt       *Receipt         `json:"receipt,omitempty" form:"receipt" query:"receipt" validate:"required"`
	State         [][]byte         `json:"state,omitempty" form:"state" query:"state" validate:"required"`
	LastBlockTime *time.Time       `json:"lastBlockTime,omitempty" form:"lastBlockTime" query:"lastBlockTime" validate:"required"`
	// contains filtered or unexported fields
}

func ChainEntryRecordAs

func ChainEntryRecordAs[T2 Record, T1 Record](v *ChainEntryRecord[T1]) (*ChainEntryRecord[T2], error)

func (*ChainEntryRecord[T]) Copy

func (v *ChainEntryRecord[T]) Copy() *ChainEntryRecord[T]

func (*ChainEntryRecord[T]) CopyAsInterface

func (v *ChainEntryRecord[T]) CopyAsInterface() interface{}

func (*ChainEntryRecord[T]) Equal

func (v *ChainEntryRecord[T]) Equal(u *ChainEntryRecord[T]) bool

func (*ChainEntryRecord[T]) IsValid

func (v *ChainEntryRecord[T]) IsValid() error

func (*ChainEntryRecord[T]) MarshalBinary

func (v *ChainEntryRecord[T]) MarshalBinary() ([]byte, error)

func (*ChainEntryRecord[T]) MarshalJSON

func (v *ChainEntryRecord[T]) MarshalJSON() ([]byte, error)

func (*ChainEntryRecord[T]) RecordType

func (*ChainEntryRecord[T]) RecordType() RecordType

func (*ChainEntryRecord[T]) UnmarshalBinary

func (v *ChainEntryRecord[T]) UnmarshalBinary(data []byte) error

func (*ChainEntryRecord[T]) UnmarshalBinaryFrom

func (v *ChainEntryRecord[T]) UnmarshalBinaryFrom(rd io.Reader) error

func (*ChainEntryRecord[T]) UnmarshalFieldsFrom

func (v *ChainEntryRecord[T]) UnmarshalFieldsFrom(reader *encoding.Reader) error

func (*ChainEntryRecord[T]) UnmarshalJSON

func (v *ChainEntryRecord[T]) UnmarshalJSON(data []byte) error

type ChainQuery

type ChainQuery struct {
	Name           string        `json:"name,omitempty" form:"name" query:"name"`
	Index          *uint64       `json:"index,omitempty" form:"index" query:"index"`
	Entry          []byte        `json:"entry,omitempty" form:"entry" query:"entry"`
	Range          *RangeOptions `json:"range,omitempty" form:"range" query:"range"`
	IncludeReceipt bool          `json:"includeReceipt,omitempty" form:"includeReceipt" query:"includeReceipt"`
	// contains filtered or unexported fields
}

func (*ChainQuery) Copy

func (v *ChainQuery) Copy() *ChainQuery

func (*ChainQuery) CopyAsInterface

func (v *ChainQuery) CopyAsInterface() interface{}

func (*ChainQuery) Equal

func (v *ChainQuery) Equal(u *ChainQuery) bool

func (*ChainQuery) IsValid

func (q *ChainQuery) IsValid() error

func (*ChainQuery) MarshalBinary

func (v *ChainQuery) MarshalBinary() ([]byte, error)

func (*ChainQuery) MarshalJSON

func (v *ChainQuery) MarshalJSON() ([]byte, error)

func (*ChainQuery) QueryType

func (*ChainQuery) QueryType() QueryType

func (*ChainQuery) UnmarshalBinary

func (v *ChainQuery) UnmarshalBinary(data []byte) error

func (*ChainQuery) UnmarshalBinaryFrom

func (v *ChainQuery) UnmarshalBinaryFrom(rd io.Reader) error

func (*ChainQuery) UnmarshalFieldsFrom

func (v *ChainQuery) UnmarshalFieldsFrom(reader *encoding.Reader) error

func (*ChainQuery) UnmarshalJSON

func (v *ChainQuery) UnmarshalJSON(data []byte) error

type ChainRecord

type ChainRecord struct {
	Name          string           `json:"name,omitempty" form:"name" query:"name" validate:"required"`
	Type          merkle.ChainType `json:"type,omitempty" form:"type" query:"type" validate:"required"`
	Count         uint64           `json:"count,omitempty" form:"count" query:"count" validate:"required"`
	State         [][]byte         `json:"state,omitempty" form:"state" query:"state" validate:"required"`
	LastBlockTime *time.Time       `json:"lastBlockTime,omitempty" form:"lastBlockTime" query:"lastBlockTime" validate:"required"`
	// contains filtered or unexported fields
}

func (*ChainRecord) Copy

func (v *ChainRecord) Copy() *ChainRecord

func (*ChainRecord) CopyAsInterface

func (v *ChainRecord) CopyAsInterface() interface{}

func (*ChainRecord) Equal

func (v *ChainRecord) Equal(u *ChainRecord) bool

func (*ChainRecord) IsValid

func (v *ChainRecord) IsValid() error

func (*ChainRecord) MarshalBinary

func (v *ChainRecord) MarshalBinary() ([]byte, error)

func (*ChainRecord) MarshalJSON

func (v *ChainRecord) MarshalJSON() ([]byte, error)

func (*ChainRecord) RecordType

func (*ChainRecord) RecordType() RecordType

func (*ChainRecord) UnmarshalBinary

func (v *ChainRecord) UnmarshalBinary(data []byte) error

func (*ChainRecord) UnmarshalBinaryFrom

func (v *ChainRecord) UnmarshalBinaryFrom(rd io.Reader) error

func (*ChainRecord) UnmarshalFieldsFrom

func (v *ChainRecord) UnmarshalFieldsFrom(reader *encoding.Reader) error

func (*ChainRecord) UnmarshalJSON

func (v *ChainRecord) UnmarshalJSON(data []byte) error

type Collator

type Collator struct {
	Querier Querier
	Network NetworkService
}

Collator is a Querier implementation that can collate query responses from multiple networks.

func (*Collator) Query

func (c *Collator) Query(ctx context.Context, scope *url.URL, query Query) (Record, error)

type ConsensusPeerInfo

type ConsensusPeerInfo struct {
	NodeID string `json:"nodeID,omitempty" form:"nodeID" query:"nodeID" validate:"required"`
	Host   string `json:"host,omitempty" form:"host" query:"host" validate:"required"`
	Port   uint64 `json:"port,omitempty" form:"port" query:"port" validate:"required"`
	// contains filtered or unexported fields
}

func (*ConsensusPeerInfo) Copy

func (*ConsensusPeerInfo) CopyAsInterface

func (v *ConsensusPeerInfo) CopyAsInterface() interface{}

func (*ConsensusPeerInfo) Equal

func (*ConsensusPeerInfo) IsValid

func (v *ConsensusPeerInfo) IsValid() error

func (*ConsensusPeerInfo) MarshalBinary

func (v *ConsensusPeerInfo) MarshalBinary() ([]byte, error)

func (*ConsensusPeerInfo) UnmarshalBinary

func (v *ConsensusPeerInfo) UnmarshalBinary(data []byte) error

func (*ConsensusPeerInfo) UnmarshalBinaryFrom

func (v *ConsensusPeerInfo) UnmarshalBinaryFrom(rd io.Reader) error

type ConsensusService

type ConsensusService interface {
	// ConsensusStatus returns the status of the consensus node.
	ConsensusStatus(ctx context.Context, opts ConsensusStatusOptions) (*ConsensusStatus, error)
}

type ConsensusStatus

type ConsensusStatus struct {
	Ok               bool                   `json:"ok,omitempty" form:"ok" query:"ok" validate:"required"`
	LastBlock        *LastBlock             `json:"lastBlock,omitempty" form:"lastBlock" query:"lastBlock" validate:"required"`
	Version          string                 `json:"version,omitempty" form:"version" query:"version" validate:"required"`
	Commit           string                 `json:"commit,omitempty" form:"commit" query:"commit" validate:"required"`
	NodeKeyHash      [32]byte               `json:"nodeKeyHash,omitempty" form:"nodeKeyHash" query:"nodeKeyHash" validate:"required"`
	ValidatorKeyHash [32]byte               `json:"validatorKeyHash,omitempty" form:"validatorKeyHash" query:"validatorKeyHash" validate:"required"`
	PartitionID      string                 `json:"partitionID,omitempty" form:"partitionID" query:"partitionID" validate:"required"`
	PartitionType    protocol.PartitionType `json:"partitionType,omitempty" form:"partitionType" query:"partitionType" validate:"required"`
	Peers            []*ConsensusPeerInfo   `json:"peers,omitempty" form:"peers" query:"peers" validate:"required"`
	// contains filtered or unexported fields
}

func (*ConsensusStatus) Copy

func (v *ConsensusStatus) Copy() *ConsensusStatus

func (*ConsensusStatus) CopyAsInterface

func (v *ConsensusStatus) CopyAsInterface() interface{}

func (*ConsensusStatus) Equal

func (v *ConsensusStatus) Equal(u *ConsensusStatus) bool

func (*ConsensusStatus) IsValid

func (v *ConsensusStatus) IsValid() error

func (*ConsensusStatus) MarshalBinary

func (v *ConsensusStatus) MarshalBinary() ([]byte, error)

func (*ConsensusStatus) MarshalJSON

func (v *ConsensusStatus) MarshalJSON() ([]byte, error)

func (*ConsensusStatus) UnmarshalBinary

func (v *ConsensusStatus) UnmarshalBinary(data []byte) error

func (*ConsensusStatus) UnmarshalBinaryFrom

func (v *ConsensusStatus) UnmarshalBinaryFrom(rd io.Reader) error

func (*ConsensusStatus) UnmarshalJSON

func (v *ConsensusStatus) UnmarshalJSON(data []byte) error

type ConsensusStatusOptions

type ConsensusStatusOptions struct {
	NodeID            string `json:"nodeID,omitempty" form:"nodeID" query:"nodeID" validate:"required"`
	Partition         string `json:"partition,omitempty" form:"partition" query:"partition" validate:"required"`
	IncludePeers      *bool  `json:"includePeers,omitempty" form:"includePeers" query:"includePeers"`
	IncludeAccumulate *bool  `json:"includeAccumulate,omitempty" form:"includeAccumulate" query:"includeAccumulate"`
	// contains filtered or unexported fields
}

func (*ConsensusStatusOptions) Copy

func (*ConsensusStatusOptions) CopyAsInterface

func (v *ConsensusStatusOptions) CopyAsInterface() interface{}

func (*ConsensusStatusOptions) Equal

func (*ConsensusStatusOptions) IsValid

func (v *ConsensusStatusOptions) IsValid() error

func (*ConsensusStatusOptions) MarshalBinary

func (v *ConsensusStatusOptions) MarshalBinary() ([]byte, error)

func (*ConsensusStatusOptions) UnmarshalBinary

func (v *ConsensusStatusOptions) UnmarshalBinary(data []byte) error

func (*ConsensusStatusOptions) UnmarshalBinaryFrom

func (v *ConsensusStatusOptions) UnmarshalBinaryFrom(rd io.Reader) error

type DataQuery

type DataQuery struct {
	Index *uint64       `json:"index,omitempty" form:"index" query:"index"`
	Entry []byte        `json:"entry,omitempty" form:"entry" query:"entry"`
	Range *RangeOptions `json:"range,omitempty" form:"range" query:"range"`
	// contains filtered or unexported fields
}

func (*DataQuery) Copy

func (v *DataQuery) Copy() *DataQuery

func (*DataQuery) CopyAsInterface

func (v *DataQuery) CopyAsInterface() interface{}

func (*DataQuery) Equal

func (v *DataQuery) Equal(u *DataQuery) bool

func (*DataQuery) IsValid

func (q *DataQuery) IsValid() error

func (*DataQuery) MarshalBinary

func (v *DataQuery) MarshalBinary() ([]byte, error)

func (*DataQuery) MarshalJSON

func (v *DataQuery) MarshalJSON() ([]byte, error)

func (*DataQuery) QueryType

func (*DataQuery) QueryType() QueryType

func (*DataQuery) UnmarshalBinary

func (v *DataQuery) UnmarshalBinary(data []byte) error

func (*DataQuery) UnmarshalBinaryFrom

func (v *DataQuery) UnmarshalBinaryFrom(rd io.Reader) error

func (*DataQuery) UnmarshalFieldsFrom

func (v *DataQuery) UnmarshalFieldsFrom(reader *encoding.Reader) error

func (*DataQuery) UnmarshalJSON

func (v *DataQuery) UnmarshalJSON(data []byte) error

type DefaultQuery

type DefaultQuery struct {
	IncludeReceipt bool `json:"includeReceipt,omitempty" form:"includeReceipt" query:"includeReceipt"`
	// contains filtered or unexported fields
}

func (*DefaultQuery) Copy

func (v *DefaultQuery) Copy() *DefaultQuery

func (*DefaultQuery) CopyAsInterface

func (v *DefaultQuery) CopyAsInterface() interface{}

func (*DefaultQuery) Equal

func (v *DefaultQuery) Equal(u *DefaultQuery) bool

func (*DefaultQuery) IsValid

func (v *DefaultQuery) IsValid() error

func (*DefaultQuery) MarshalBinary

func (v *DefaultQuery) MarshalBinary() ([]byte, error)

func (*DefaultQuery) MarshalJSON

func (v *DefaultQuery) MarshalJSON() ([]byte, error)

func (*DefaultQuery) QueryType

func (*DefaultQuery) QueryType() QueryType

func (*DefaultQuery) UnmarshalBinary

func (v *DefaultQuery) UnmarshalBinary(data []byte) error

func (*DefaultQuery) UnmarshalBinaryFrom

func (v *DefaultQuery) UnmarshalBinaryFrom(rd io.Reader) error

func (*DefaultQuery) UnmarshalFieldsFrom

func (v *DefaultQuery) UnmarshalFieldsFrom(reader *encoding.Reader) error

func (*DefaultQuery) UnmarshalJSON

func (v *DefaultQuery) UnmarshalJSON(data []byte) error

type DelegateSearchQuery

type DelegateSearchQuery struct {
	Delegate *url.URL `json:"delegate,omitempty" form:"delegate" query:"delegate" validate:"required"`
	// contains filtered or unexported fields
}

func (*DelegateSearchQuery) Copy

func (*DelegateSearchQuery) CopyAsInterface

func (v *DelegateSearchQuery) CopyAsInterface() interface{}

func (*DelegateSearchQuery) Equal

func (*DelegateSearchQuery) IsValid

func (v *DelegateSearchQuery) IsValid() error

func (*DelegateSearchQuery) MarshalBinary

func (v *DelegateSearchQuery) MarshalBinary() ([]byte, error)

func (*DelegateSearchQuery) MarshalJSON

func (v *DelegateSearchQuery) MarshalJSON() ([]byte, error)

func (*DelegateSearchQuery) QueryType

func (*DelegateSearchQuery) QueryType() QueryType

func (*DelegateSearchQuery) UnmarshalBinary

func (v *DelegateSearchQuery) UnmarshalBinary(data []byte) error

func (*DelegateSearchQuery) UnmarshalBinaryFrom

func (v *DelegateSearchQuery) UnmarshalBinaryFrom(rd io.Reader) error

func (*DelegateSearchQuery) UnmarshalFieldsFrom

func (v *DelegateSearchQuery) UnmarshalFieldsFrom(reader *encoding.Reader) error

func (*DelegateSearchQuery) UnmarshalJSON

func (v *DelegateSearchQuery) UnmarshalJSON(data []byte) error

type DirectoryQuery

type DirectoryQuery struct {
	Range *RangeOptions `json:"range,omitempty" form:"range" query:"range" validate:"required"`
	// contains filtered or unexported fields
}

func (*DirectoryQuery) Copy

func (v *DirectoryQuery) Copy() *DirectoryQuery

func (*DirectoryQuery) CopyAsInterface

func (v *DirectoryQuery) CopyAsInterface() interface{}

func (*DirectoryQuery) Equal

func (v *DirectoryQuery) Equal(u *DirectoryQuery) bool

func (*DirectoryQuery) IsValid

func (v *DirectoryQuery) IsValid() error

func (*DirectoryQuery) MarshalBinary

func (v *DirectoryQuery) MarshalBinary() ([]byte, error)

func (*DirectoryQuery) MarshalJSON

func (v *DirectoryQuery) MarshalJSON() ([]byte, error)

func (*DirectoryQuery) QueryType

func (*DirectoryQuery) QueryType() QueryType

func (*DirectoryQuery) UnmarshalBinary

func (v *DirectoryQuery) UnmarshalBinary(data []byte) error

func (*DirectoryQuery) UnmarshalBinaryFrom

func (v *DirectoryQuery) UnmarshalBinaryFrom(rd io.Reader) error

func (*DirectoryQuery) UnmarshalFieldsFrom

func (v *DirectoryQuery) UnmarshalFieldsFrom(reader *encoding.Reader) error

func (*DirectoryQuery) UnmarshalJSON

func (v *DirectoryQuery) UnmarshalJSON(data []byte) error

type ErrorEvent

type ErrorEvent struct {
	Err *errors2.Error `json:"err,omitempty" form:"err" query:"err" validate:"required"`
	// contains filtered or unexported fields
}

func (*ErrorEvent) Copy

func (v *ErrorEvent) Copy() *ErrorEvent

func (*ErrorEvent) CopyAsInterface

func (v *ErrorEvent) CopyAsInterface() interface{}

func (*ErrorEvent) Equal

func (v *ErrorEvent) Equal(u *ErrorEvent) bool

func (*ErrorEvent) EventType

func (*ErrorEvent) EventType() EventType

func (*ErrorEvent) IsValid

func (v *ErrorEvent) IsValid() error

func (*ErrorEvent) MarshalBinary

func (v *ErrorEvent) MarshalBinary() ([]byte, error)

func (*ErrorEvent) MarshalJSON

func (v *ErrorEvent) MarshalJSON() ([]byte, error)

func (*ErrorEvent) UnmarshalBinary

func (v *ErrorEvent) UnmarshalBinary(data []byte) error

func (*ErrorEvent) UnmarshalBinaryFrom

func (v *ErrorEvent) UnmarshalBinaryFrom(rd io.Reader) error

func (*ErrorEvent) UnmarshalFieldsFrom

func (v *ErrorEvent) UnmarshalFieldsFrom(reader *encoding.Reader) error

func (*ErrorEvent) UnmarshalJSON

func (v *ErrorEvent) UnmarshalJSON(data []byte) error

type ErrorRecord added in v1.2.9

type ErrorRecord struct {
	Value *errors2.Error `json:"value,omitempty" form:"value" query:"value" validate:"required"`
	// contains filtered or unexported fields
}

func (*ErrorRecord) Copy added in v1.2.9

func (v *ErrorRecord) Copy() *ErrorRecord

func (*ErrorRecord) CopyAsInterface added in v1.2.9

func (v *ErrorRecord) CopyAsInterface() interface{}

func (*ErrorRecord) Equal added in v1.2.9

func (v *ErrorRecord) Equal(u *ErrorRecord) bool

func (*ErrorRecord) Error added in v1.2.9

func (r *ErrorRecord) Error() string

func (*ErrorRecord) IsValid added in v1.2.9

func (v *ErrorRecord) IsValid() error

func (*ErrorRecord) MarshalBinary added in v1.2.9

func (v *ErrorRecord) MarshalBinary() ([]byte, error)

func (*ErrorRecord) MarshalJSON added in v1.2.9

func (v *ErrorRecord) MarshalJSON() ([]byte, error)

func (*ErrorRecord) RecordType added in v1.2.9

func (*ErrorRecord) RecordType() RecordType

func (*ErrorRecord) UnmarshalBinary added in v1.2.9

func (v *ErrorRecord) UnmarshalBinary(data []byte) error

func (*ErrorRecord) UnmarshalBinaryFrom added in v1.2.9

func (v *ErrorRecord) UnmarshalBinaryFrom(rd io.Reader) error

func (*ErrorRecord) UnmarshalFieldsFrom added in v1.2.9

func (v *ErrorRecord) UnmarshalFieldsFrom(reader *encoding.Reader) error

func (*ErrorRecord) UnmarshalJSON added in v1.2.9

func (v *ErrorRecord) UnmarshalJSON(data []byte) error

type Event

type Event interface {
	encoding.UnionValue
	EventType() EventType
}

Event is an event returned by EventService.

func CopyEvent

func CopyEvent(v Event) Event

CopyEvent copies a Event.

func NewEvent

func NewEvent(typ EventType) (Event, error)

NewEvent creates a new Event for the specified EventType.

func UnmarshalEvent

func UnmarshalEvent(data []byte) (Event, error)

UnmarshalEvent unmarshals a Event.

func UnmarshalEventFrom

func UnmarshalEventFrom(rd io.Reader) (Event, error)

UnmarshalEventFrom unmarshals a Event.

func UnmarshalEventJSON

func UnmarshalEventJSON(data []byte) (Event, error)

UnmarshalEventJson unmarshals a Event.

type EventService

type EventService interface {
	// Subscribe subscribes to event notifications. The channel will be closed
	// once the context is canceled. Subscribe will leak goroutines if the
	// context is not canceled.
	Subscribe(ctx context.Context, opts SubscribeOptions) (<-chan Event, error)
}

type EventType

type EventType uint64

EventType is the type of an Event.

const EventTypeBlock EventType = 2

EventTypeBlock .

const EventTypeError EventType = 1

EventTypeError .

const EventTypeGlobals EventType = 3

EventTypeGlobals .

func EventTypeByName

func EventTypeByName(name string) (EventType, bool)

EventTypeByName returns the named Event Type.

func (EventType) GetEnumValue

func (v EventType) GetEnumValue() uint64

GetEnumValue returns the value of the Event Type

func (EventType) MarshalJSON

func (v EventType) MarshalJSON() ([]byte, error)

MarshalJSON marshals the Event Type to JSON as a string.

func (*EventType) SetEnumValue

func (v *EventType) SetEnumValue(id uint64) bool

SetEnumValue sets the value. SetEnumValue returns false if the value is invalid.

func (EventType) String

func (v EventType) String() string

String returns the name of the Event Type.

func (*EventType) UnmarshalJSON

func (v *EventType) UnmarshalJSON(data []byte) error

UnmarshalJSON unmarshals the Event Type from JSON as a string.

type Faucet

type Faucet interface {
	Faucet(ctx context.Context, account *url.URL, opts FaucetOptions) (*Submission, error)
}

type FaucetOptions

type FaucetOptions struct {
	Token *url.URL `json:"token,omitempty" form:"token" query:"token"`
	// contains filtered or unexported fields
}

func (*FaucetOptions) Copy

func (v *FaucetOptions) Copy() *FaucetOptions

func (*FaucetOptions) CopyAsInterface

func (v *FaucetOptions) CopyAsInterface() interface{}

func (*FaucetOptions) Equal

func (v *FaucetOptions) Equal(u *FaucetOptions) bool

func (*FaucetOptions) IsValid

func (v *FaucetOptions) IsValid() error

func (*FaucetOptions) MarshalBinary

func (v *FaucetOptions) MarshalBinary() ([]byte, error)

func (*FaucetOptions) UnmarshalBinary

func (v *FaucetOptions) UnmarshalBinary(data []byte) error

func (*FaucetOptions) UnmarshalBinaryFrom

func (v *FaucetOptions) UnmarshalBinaryFrom(rd io.Reader) error

type FindServiceOptions

type FindServiceOptions struct {
	Network string          `json:"network,omitempty" form:"network" query:"network" validate:"required"`
	Service *ServiceAddress `json:"service,omitempty" form:"service" query:"service" validate:"required"`
	// Known restricts the results to known peers.
	Known bool `json:"known,omitempty" form:"known" query:"known"`
	// Timeout is the time to wait before stopping, when querying the DHT.
	Timeout time.Duration `json:"timeout,omitempty" form:"timeout" query:"timeout"`
	// contains filtered or unexported fields
}

func (*FindServiceOptions) Copy

func (*FindServiceOptions) CopyAsInterface

func (v *FindServiceOptions) CopyAsInterface() interface{}

func (*FindServiceOptions) Equal

func (*FindServiceOptions) IsValid

func (v *FindServiceOptions) IsValid() error

func (*FindServiceOptions) MarshalBinary

func (v *FindServiceOptions) MarshalBinary() ([]byte, error)

func (*FindServiceOptions) MarshalJSON added in v1.2.10

func (v *FindServiceOptions) MarshalJSON() ([]byte, error)

func (*FindServiceOptions) UnmarshalBinary

func (v *FindServiceOptions) UnmarshalBinary(data []byte) error

func (*FindServiceOptions) UnmarshalBinaryFrom

func (v *FindServiceOptions) UnmarshalBinaryFrom(rd io.Reader) error

func (*FindServiceOptions) UnmarshalJSON added in v1.2.10

func (v *FindServiceOptions) UnmarshalJSON(data []byte) error

type FindServiceResult

type FindServiceResult struct {
	PeerID    p2p.PeerID      `json:"peerID,omitempty" form:"peerID" query:"peerID" validate:"required"`
	Status    KnownPeerStatus `json:"status,omitempty" form:"status" query:"status" validate:"required"`
	Addresses []p2p.Multiaddr `json:"addresses,omitempty" form:"addresses" query:"addresses" validate:"required"`
	// contains filtered or unexported fields
}

func (*FindServiceResult) Copy

func (*FindServiceResult) CopyAsInterface

func (v *FindServiceResult) CopyAsInterface() interface{}

func (*FindServiceResult) Equal

func (*FindServiceResult) IsValid

func (v *FindServiceResult) IsValid() error

func (*FindServiceResult) MarshalBinary

func (v *FindServiceResult) MarshalBinary() ([]byte, error)

func (*FindServiceResult) MarshalJSON

func (v *FindServiceResult) MarshalJSON() ([]byte, error)

func (*FindServiceResult) UnmarshalBinary

func (v *FindServiceResult) UnmarshalBinary(data []byte) error

func (*FindServiceResult) UnmarshalBinaryFrom

func (v *FindServiceResult) UnmarshalBinaryFrom(rd io.Reader) error

func (*FindServiceResult) UnmarshalJSON

func (v *FindServiceResult) UnmarshalJSON(data []byte) error

type GlobalsEvent

type GlobalsEvent struct {
	Old *core.GlobalValues `json:"old,omitempty" form:"old" query:"old" validate:"required"`
	New *core.GlobalValues `json:"new,omitempty" form:"new" query:"new" validate:"required"`
	// contains filtered or unexported fields
}

func (*GlobalsEvent) Copy

func (v *GlobalsEvent) Copy() *GlobalsEvent

func (*GlobalsEvent) CopyAsInterface

func (v *GlobalsEvent) CopyAsInterface() interface{}

func (*GlobalsEvent) Equal

func (v *GlobalsEvent) Equal(u *GlobalsEvent) bool

func (*GlobalsEvent) EventType

func (*GlobalsEvent) EventType() EventType

func (*GlobalsEvent) IsValid

func (v *GlobalsEvent) IsValid() error

func (*GlobalsEvent) MarshalBinary

func (v *GlobalsEvent) MarshalBinary() ([]byte, error)

func (*GlobalsEvent) MarshalJSON

func (v *GlobalsEvent) MarshalJSON() ([]byte, error)

func (*GlobalsEvent) UnmarshalBinary

func (v *GlobalsEvent) UnmarshalBinary(data []byte) error

func (*GlobalsEvent) UnmarshalBinaryFrom

func (v *GlobalsEvent) UnmarshalBinaryFrom(rd io.Reader) error

func (*GlobalsEvent) UnmarshalFieldsFrom

func (v *GlobalsEvent) UnmarshalFieldsFrom(reader *encoding.Reader) error

func (*GlobalsEvent) UnmarshalJSON

func (v *GlobalsEvent) UnmarshalJSON(data []byte) error

type IndexEntryRecord

type IndexEntryRecord struct {
	Value *protocol.IndexEntry `json:"value,omitempty" form:"value" query:"value" validate:"required"`
	// contains filtered or unexported fields
}

func (*IndexEntryRecord) Copy

func (*IndexEntryRecord) CopyAsInterface

func (v *IndexEntryRecord) CopyAsInterface() interface{}

func (*IndexEntryRecord) Equal

func (v *IndexEntryRecord) Equal(u *IndexEntryRecord) bool

func (*IndexEntryRecord) IsValid

func (v *IndexEntryRecord) IsValid() error

func (*IndexEntryRecord) MarshalBinary

func (v *IndexEntryRecord) MarshalBinary() ([]byte, error)

func (*IndexEntryRecord) MarshalJSON

func (v *IndexEntryRecord) MarshalJSON() ([]byte, error)

func (*IndexEntryRecord) RecordType

func (*IndexEntryRecord) RecordType() RecordType

func (*IndexEntryRecord) UnmarshalBinary

func (v *IndexEntryRecord) UnmarshalBinary(data []byte) error

func (*IndexEntryRecord) UnmarshalBinaryFrom

func (v *IndexEntryRecord) UnmarshalBinaryFrom(rd io.Reader) error

func (*IndexEntryRecord) UnmarshalFieldsFrom

func (v *IndexEntryRecord) UnmarshalFieldsFrom(reader *encoding.Reader) error

func (*IndexEntryRecord) UnmarshalJSON

func (v *IndexEntryRecord) UnmarshalJSON(data []byte) error

type KeyRecord

type KeyRecord struct {
	Authority *url.URL          `json:"authority,omitempty" form:"authority" query:"authority" validate:"required"`
	Signer    *url.URL          `json:"signer,omitempty" form:"signer" query:"signer" validate:"required"`
	Version   uint64            `json:"version,omitempty" form:"version" query:"version" validate:"required"`
	Index     uint64            `json:"index,omitempty" form:"index" query:"index" validate:"required"`
	Entry     *protocol.KeySpec `json:"entry,omitempty" form:"entry" query:"entry" validate:"required"`
	// contains filtered or unexported fields
}

func (*KeyRecord) Copy

func (v *KeyRecord) Copy() *KeyRecord

func (*KeyRecord) CopyAsInterface

func (v *KeyRecord) CopyAsInterface() interface{}

func (*KeyRecord) Equal

func (v *KeyRecord) Equal(u *KeyRecord) bool

func (*KeyRecord) IsValid

func (v *KeyRecord) IsValid() error

func (*KeyRecord) MarshalBinary

func (v *KeyRecord) MarshalBinary() ([]byte, error)

func (*KeyRecord) MarshalJSON

func (v *KeyRecord) MarshalJSON() ([]byte, error)

func (*KeyRecord) RecordType

func (*KeyRecord) RecordType() RecordType

func (*KeyRecord) UnmarshalBinary

func (v *KeyRecord) UnmarshalBinary(data []byte) error

func (*KeyRecord) UnmarshalBinaryFrom

func (v *KeyRecord) UnmarshalBinaryFrom(rd io.Reader) error

func (*KeyRecord) UnmarshalFieldsFrom

func (v *KeyRecord) UnmarshalFieldsFrom(reader *encoding.Reader) error

func (*KeyRecord) UnmarshalJSON

func (v *KeyRecord) UnmarshalJSON(data []byte) error

type KnownPeerStatus added in v1.2.10

type KnownPeerStatus int64

KnownPeerStatus is the status of a known peer.

const PeerStatusIsKnownBad KnownPeerStatus = 2

PeerStatusIsKnownBad .

const PeerStatusIsKnownGood KnownPeerStatus = 1

PeerStatusIsKnownGood .

const PeerStatusIsUnknown KnownPeerStatus = 0

PeerStatusIsUnknown .

func KnownPeerStatusByName added in v1.2.10

func KnownPeerStatusByName(name string) (KnownPeerStatus, bool)

KnownPeerStatusByName returns the named Known Peer Status.

func (KnownPeerStatus) GetEnumValue added in v1.2.10

func (v KnownPeerStatus) GetEnumValue() uint64

GetEnumValue returns the value of the Known Peer Status

func (KnownPeerStatus) MarshalJSON added in v1.2.10

func (v KnownPeerStatus) MarshalJSON() ([]byte, error)

MarshalJSON marshals the Known Peer Status to JSON as a string.

func (*KnownPeerStatus) SetEnumValue added in v1.2.10

func (v *KnownPeerStatus) SetEnumValue(id uint64) bool

SetEnumValue sets the value. SetEnumValue returns false if the value is invalid.

func (KnownPeerStatus) String added in v1.2.10

func (v KnownPeerStatus) String() string

String returns the name of the Known Peer Status.

func (*KnownPeerStatus) UnmarshalJSON added in v1.2.10

func (v *KnownPeerStatus) UnmarshalJSON(data []byte) error

UnmarshalJSON unmarshals the Known Peer Status from JSON as a string.

type LastBlock

type LastBlock struct {
	Height                int64     `json:"height,omitempty" form:"height" query:"height" validate:"required"`
	Time                  time.Time `json:"time,omitempty" form:"time" query:"time" validate:"required"`
	ChainRoot             [32]byte  `json:"chainRoot,omitempty" form:"chainRoot" query:"chainRoot" validate:"required"`
	StateRoot             [32]byte  `json:"stateRoot,omitempty" form:"stateRoot" query:"stateRoot" validate:"required"`
	DirectoryAnchorHeight uint64    `json:"directoryAnchorHeight,omitempty" form:"directoryAnchorHeight" query:"directoryAnchorHeight" validate:"required"`
	// contains filtered or unexported fields
}

func (*LastBlock) Copy

func (v *LastBlock) Copy() *LastBlock

func (*LastBlock) CopyAsInterface

func (v *LastBlock) CopyAsInterface() interface{}

func (*LastBlock) Equal

func (v *LastBlock) Equal(u *LastBlock) bool

func (*LastBlock) IsValid

func (v *LastBlock) IsValid() error

func (*LastBlock) MarshalBinary

func (v *LastBlock) MarshalBinary() ([]byte, error)

func (*LastBlock) MarshalJSON

func (v *LastBlock) MarshalJSON() ([]byte, error)

func (*LastBlock) UnmarshalBinary

func (v *LastBlock) UnmarshalBinary(data []byte) error

func (*LastBlock) UnmarshalBinaryFrom

func (v *LastBlock) UnmarshalBinaryFrom(rd io.Reader) error

func (*LastBlock) UnmarshalJSON

func (v *LastBlock) UnmarshalJSON(data []byte) error

type MajorBlockRecord

type MajorBlockRecord struct {
	Index         uint64                          `json:"index,omitempty" form:"index" query:"index" validate:"required"`
	Time          time.Time                       `json:"time,omitempty" form:"time" query:"time" validate:"required"`
	MinorBlocks   *RecordRange[*MinorBlockRecord] `json:"minorBlocks,omitempty" form:"minorBlocks" query:"minorBlocks" validate:"required"`
	LastBlockTime *time.Time                      `json:"lastBlockTime,omitempty" form:"lastBlockTime" query:"lastBlockTime" validate:"required"`
	// contains filtered or unexported fields
}

func (*MajorBlockRecord) Copy

func (*MajorBlockRecord) CopyAsInterface

func (v *MajorBlockRecord) CopyAsInterface() interface{}

func (*MajorBlockRecord) Equal

func (v *MajorBlockRecord) Equal(u *MajorBlockRecord) bool

func (*MajorBlockRecord) IsValid

func (v *MajorBlockRecord) IsValid() error

func (*MajorBlockRecord) MarshalBinary

func (v *MajorBlockRecord) MarshalBinary() ([]byte, error)

func (*MajorBlockRecord) MarshalJSON

func (v *MajorBlockRecord) MarshalJSON() ([]byte, error)

func (*MajorBlockRecord) RecordType

func (*MajorBlockRecord) RecordType() RecordType

func (*MajorBlockRecord) UnmarshalBinary

func (v *MajorBlockRecord) UnmarshalBinary(data []byte) error

func (*MajorBlockRecord) UnmarshalBinaryFrom

func (v *MajorBlockRecord) UnmarshalBinaryFrom(rd io.Reader) error

func (*MajorBlockRecord) UnmarshalFieldsFrom

func (v *MajorBlockRecord) UnmarshalFieldsFrom(reader *encoding.Reader) error

func (*MajorBlockRecord) UnmarshalJSON

func (v *MajorBlockRecord) UnmarshalJSON(data []byte) error

type MessageHashSearchQuery

type MessageHashSearchQuery struct {
	Hash [32]byte `json:"hash,omitempty" form:"hash" query:"hash" validate:"required"`
	// contains filtered or unexported fields
}

func (*MessageHashSearchQuery) Copy

func (*MessageHashSearchQuery) CopyAsInterface

func (v *MessageHashSearchQuery) CopyAsInterface() interface{}

func (*MessageHashSearchQuery) Equal

func (*MessageHashSearchQuery) IsValid

func (v *MessageHashSearchQuery) IsValid() error

func (*MessageHashSearchQuery) MarshalBinary

func (v *MessageHashSearchQuery) MarshalBinary() ([]byte, error)

func (*MessageHashSearchQuery) MarshalJSON

func (v *MessageHashSearchQuery) MarshalJSON() ([]byte, error)

func (*MessageHashSearchQuery) QueryType

func (*MessageHashSearchQuery) QueryType() QueryType

func (*MessageHashSearchQuery) UnmarshalBinary

func (v *MessageHashSearchQuery) UnmarshalBinary(data []byte) error

func (*MessageHashSearchQuery) UnmarshalBinaryFrom

func (v *MessageHashSearchQuery) UnmarshalBinaryFrom(rd io.Reader) error

func (*MessageHashSearchQuery) UnmarshalFieldsFrom

func (v *MessageHashSearchQuery) UnmarshalFieldsFrom(reader *encoding.Reader) error

func (*MessageHashSearchQuery) UnmarshalJSON

func (v *MessageHashSearchQuery) UnmarshalJSON(data []byte) error

type MessageRecord

type MessageRecord[T messaging.Message] struct {
	ID      *url.TxID                  `json:"id,omitempty" form:"id" query:"id" validate:"required"`
	Message T                          `json:"message,omitempty" form:"message" query:"message" validate:"required"`
	Status  errors2.Status             `json:"status,omitempty" form:"status" query:"status" validate:"required"`
	Error   *errors2.Error             `json:"error,omitempty" form:"error" query:"error" validate:"required"`
	Result  protocol.TransactionResult `json:"result,omitempty" form:"result" query:"result" validate:"required"`
	// Received is the block when the transaction was first received.
	Received      uint64                            `json:"received,omitempty" form:"received" query:"received" validate:"required"`
	Produced      *RecordRange[*TxIDRecord]         `json:"produced,omitempty" form:"produced" query:"produced" validate:"required"`
	Cause         *RecordRange[*TxIDRecord]         `json:"cause,omitempty" form:"cause" query:"cause" validate:"required"`
	Signatures    *RecordRange[*SignatureSetRecord] `json:"signatures,omitempty" form:"signatures" query:"signatures" validate:"required"`
	Historical    bool                              `json:"historical,omitempty" form:"historical" query:"historical" validate:"required"`
	Sequence      *messaging.SequencedMessage       `json:"sequence,omitempty" form:"sequence" query:"sequence"`
	SourceReceipt *merkle.Receipt                   `json:"sourceReceipt,omitempty" form:"sourceReceipt" query:"sourceReceipt" validate:"required"`
	LastBlockTime *time.Time                        `json:"lastBlockTime,omitempty" form:"lastBlockTime" query:"lastBlockTime" validate:"required"`
	// contains filtered or unexported fields
}

func MessageRecordAs

func MessageRecordAs[T2 messaging.Message, T1 messaging.Message](v *MessageRecord[T1]) (*MessageRecord[T2], error)

func (*MessageRecord[T]) AsError

func (r *MessageRecord[T]) AsError() error

func (*MessageRecord[T]) Copy

func (v *MessageRecord[T]) Copy() *MessageRecord[T]

func (*MessageRecord[T]) CopyAsInterface

func (v *MessageRecord[T]) CopyAsInterface() interface{}

func (*MessageRecord[T]) Equal

func (v *MessageRecord[T]) Equal(u *MessageRecord[T]) bool

func (*MessageRecord[T]) IsValid

func (v *MessageRecord[T]) IsValid() error

func (*MessageRecord[T]) MarshalBinary

func (v *MessageRecord[T]) MarshalBinary() ([]byte, error)

func (*MessageRecord[T]) MarshalJSON

func (v *MessageRecord[T]) MarshalJSON() ([]byte, error)

func (*MessageRecord[T]) RecordType

func (*MessageRecord[T]) RecordType() RecordType

func (*MessageRecord[T]) StatusNo

func (r *MessageRecord[T]) StatusNo() uint64

func (*MessageRecord[T]) UnmarshalBinary

func (v *MessageRecord[T]) UnmarshalBinary(data []byte) error

func (*MessageRecord[T]) UnmarshalBinaryFrom

func (v *MessageRecord[T]) UnmarshalBinaryFrom(rd io.Reader) error

func (*MessageRecord[T]) UnmarshalFieldsFrom

func (v *MessageRecord[T]) UnmarshalFieldsFrom(reader *encoding.Reader) error

func (*MessageRecord[T]) UnmarshalJSON

func (v *MessageRecord[T]) UnmarshalJSON(data []byte) error

type MessageRecordError

type MessageRecordError[T messaging.Message] struct {
	*MessageRecord[T]
}

func (MessageRecordError[T]) Error

func (r MessageRecordError[T]) Error() string

type Metrics

type Metrics struct {
	TPS float64 `json:"tps" form:"tps" query:"tps" validate:"required"`
	// contains filtered or unexported fields
}

func (*Metrics) Copy

func (v *Metrics) Copy() *Metrics

func (*Metrics) CopyAsInterface

func (v *Metrics) CopyAsInterface() interface{}

func (*Metrics) Equal

func (v *Metrics) Equal(u *Metrics) bool

func (*Metrics) IsValid

func (v *Metrics) IsValid() error

func (*Metrics) MarshalBinary

func (v *Metrics) MarshalBinary() ([]byte, error)

func (*Metrics) UnmarshalBinary

func (v *Metrics) UnmarshalBinary(data []byte) error

func (*Metrics) UnmarshalBinaryFrom

func (v *Metrics) UnmarshalBinaryFrom(rd io.Reader) error

type MetricsOptions

type MetricsOptions struct {
	Partition string `json:"partition,omitempty" form:"partition" query:"partition" validate:"required"`
	// Span sets the width of the window in blocks.
	Span uint64 `json:"span,omitempty" form:"span" query:"span"`
	// contains filtered or unexported fields
}

func (*MetricsOptions) Copy

func (v *MetricsOptions) Copy() *MetricsOptions

func (*MetricsOptions) CopyAsInterface

func (v *MetricsOptions) CopyAsInterface() interface{}

func (*MetricsOptions) Equal

func (v *MetricsOptions) Equal(u *MetricsOptions) bool

func (*MetricsOptions) IsValid

func (v *MetricsOptions) IsValid() error

func (*MetricsOptions) MarshalBinary

func (v *MetricsOptions) MarshalBinary() ([]byte, error)

func (*MetricsOptions) UnmarshalBinary

func (v *MetricsOptions) UnmarshalBinary(data []byte) error

func (*MetricsOptions) UnmarshalBinaryFrom

func (v *MetricsOptions) UnmarshalBinaryFrom(rd io.Reader) error

type MetricsService

type MetricsService interface {
	// Metrics returns network metrics such as transactions per second.
	Metrics(ctx context.Context, opts MetricsOptions) (*Metrics, error)
}

type MinorBlockRecord

type MinorBlockRecord struct {
	Index         uint64                                  `json:"index,omitempty" form:"index" query:"index" validate:"required"`
	Time          *time.Time                              `json:"time,omitempty" form:"time" query:"time" validate:"required"`
	Source        *url.URL                                `json:"source,omitempty" form:"source" query:"source" validate:"required"`
	Entries       *RecordRange[*ChainEntryRecord[Record]] `json:"entries,omitempty" form:"entries" query:"entries" validate:"required"`
	Anchored      *RecordRange[*MinorBlockRecord]         `json:"anchored,omitempty" form:"anchored" query:"anchored" validate:"required"`
	LastBlockTime *time.Time                              `json:"lastBlockTime,omitempty" form:"lastBlockTime" query:"lastBlockTime" validate:"required"`
	// contains filtered or unexported fields
}

func (*MinorBlockRecord) Copy

func (*MinorBlockRecord) CopyAsInterface

func (v *MinorBlockRecord) CopyAsInterface() interface{}

func (*MinorBlockRecord) Equal

func (v *MinorBlockRecord) Equal(u *MinorBlockRecord) bool

func (*MinorBlockRecord) IsValid

func (v *MinorBlockRecord) IsValid() error

func (*MinorBlockRecord) MarshalBinary

func (v *MinorBlockRecord) MarshalBinary() ([]byte, error)

func (*MinorBlockRecord) MarshalJSON

func (v *MinorBlockRecord) MarshalJSON() ([]byte, error)

func (*MinorBlockRecord) RecordType

func (*MinorBlockRecord) RecordType() RecordType

func (*MinorBlockRecord) UnmarshalBinary

func (v *MinorBlockRecord) UnmarshalBinary(data []byte) error

func (*MinorBlockRecord) UnmarshalBinaryFrom

func (v *MinorBlockRecord) UnmarshalBinaryFrom(rd io.Reader) error

func (*MinorBlockRecord) UnmarshalFieldsFrom

func (v *MinorBlockRecord) UnmarshalFieldsFrom(reader *encoding.Reader) error

func (*MinorBlockRecord) UnmarshalJSON

func (v *MinorBlockRecord) UnmarshalJSON(data []byte) error

type NetworkService

type NetworkService interface {
	// NetworkService returns the status of the network.
	NetworkStatus(ctx context.Context, opts NetworkStatusOptions) (*NetworkStatus, error)
}

type NetworkStatus

type NetworkStatus struct {
	Oracle  *protocol.AcmeOracle        `json:"oracle,omitempty" form:"oracle" query:"oracle" validate:"required"`
	Globals *protocol.NetworkGlobals    `json:"globals,omitempty" form:"globals" query:"globals" validate:"required"`
	Network *protocol.NetworkDefinition `json:"network,omitempty" form:"network" query:"network" validate:"required"`
	Routing *protocol.RoutingTable      `json:"routing,omitempty" form:"routing" query:"routing" validate:"required"`
	// ExecutorVersion is the active executor version.
	ExecutorVersion protocol.ExecutorVersion `json:"executorVersion,omitempty" form:"executorVersion" query:"executorVersion"`
	// DirectoryHeight is the height of the directory network.
	DirectoryHeight  uint64 `json:"directoryHeight,omitempty" form:"directoryHeight" query:"directoryHeight" validate:"required"`
	MajorBlockHeight uint64 `json:"majorBlockHeight,omitempty" form:"majorBlockHeight" query:"majorBlockHeight" validate:"required"`
	// contains filtered or unexported fields
}

func (*NetworkStatus) Copy

func (v *NetworkStatus) Copy() *NetworkStatus

func (*NetworkStatus) CopyAsInterface

func (v *NetworkStatus) CopyAsInterface() interface{}

func (*NetworkStatus) Equal

func (v *NetworkStatus) Equal(u *NetworkStatus) bool

func (*NetworkStatus) IsValid

func (v *NetworkStatus) IsValid() error

func (*NetworkStatus) MarshalBinary

func (v *NetworkStatus) MarshalBinary() ([]byte, error)

func (*NetworkStatus) UnmarshalBinary

func (v *NetworkStatus) UnmarshalBinary(data []byte) error

func (*NetworkStatus) UnmarshalBinaryFrom

func (v *NetworkStatus) UnmarshalBinaryFrom(rd io.Reader) error

type NetworkStatusOptions

type NetworkStatusOptions struct {
	Partition string `json:"partition,omitempty" form:"partition" query:"partition" validate:"required"`
	// contains filtered or unexported fields
}

func (*NetworkStatusOptions) Copy

func (*NetworkStatusOptions) CopyAsInterface

func (v *NetworkStatusOptions) CopyAsInterface() interface{}

func (*NetworkStatusOptions) Equal

func (*NetworkStatusOptions) IsValid

func (v *NetworkStatusOptions) IsValid() error

func (*NetworkStatusOptions) MarshalBinary

func (v *NetworkStatusOptions) MarshalBinary() ([]byte, error)

func (*NetworkStatusOptions) UnmarshalBinary

func (v *NetworkStatusOptions) UnmarshalBinary(data []byte) error

func (*NetworkStatusOptions) UnmarshalBinaryFrom

func (v *NetworkStatusOptions) UnmarshalBinaryFrom(rd io.Reader) error

type NodeInfo

type NodeInfo struct {
	PeerID   p2p.PeerID        `json:"peerID,omitempty" form:"peerID" query:"peerID" validate:"required"`
	Network  string            `json:"network,omitempty" form:"network" query:"network" validate:"required"`
	Services []*ServiceAddress `json:"services,omitempty" form:"services" query:"services" validate:"required"`
	// contains filtered or unexported fields
}

func (*NodeInfo) Copy

func (v *NodeInfo) Copy() *NodeInfo

func (*NodeInfo) CopyAsInterface

func (v *NodeInfo) CopyAsInterface() interface{}

func (*NodeInfo) Equal

func (v *NodeInfo) Equal(u *NodeInfo) bool

func (*NodeInfo) IsValid

func (v *NodeInfo) IsValid() error

func (*NodeInfo) MarshalBinary

func (v *NodeInfo) MarshalBinary() ([]byte, error)

func (*NodeInfo) MarshalJSON

func (v *NodeInfo) MarshalJSON() ([]byte, error)

func (*NodeInfo) UnmarshalBinary

func (v *NodeInfo) UnmarshalBinary(data []byte) error

func (*NodeInfo) UnmarshalBinaryFrom

func (v *NodeInfo) UnmarshalBinaryFrom(rd io.Reader) error

func (*NodeInfo) UnmarshalJSON

func (v *NodeInfo) UnmarshalJSON(data []byte) error

type NodeInfoOptions

type NodeInfoOptions struct {
	PeerID p2p.PeerID `json:"peerID,omitempty" form:"peerID" query:"peerID" validate:"required"`
	// contains filtered or unexported fields
}

func (*NodeInfoOptions) Copy

func (v *NodeInfoOptions) Copy() *NodeInfoOptions

func (*NodeInfoOptions) CopyAsInterface

func (v *NodeInfoOptions) CopyAsInterface() interface{}

func (*NodeInfoOptions) Equal

func (v *NodeInfoOptions) Equal(u *NodeInfoOptions) bool

func (*NodeInfoOptions) IsValid

func (v *NodeInfoOptions) IsValid() error

func (*NodeInfoOptions) MarshalBinary

func (v *NodeInfoOptions) MarshalBinary() ([]byte, error)

func (*NodeInfoOptions) MarshalJSON

func (v *NodeInfoOptions) MarshalJSON() ([]byte, error)

func (*NodeInfoOptions) UnmarshalBinary

func (v *NodeInfoOptions) UnmarshalBinary(data []byte) error

func (*NodeInfoOptions) UnmarshalBinaryFrom

func (v *NodeInfoOptions) UnmarshalBinaryFrom(rd io.Reader) error

func (*NodeInfoOptions) UnmarshalJSON

func (v *NodeInfoOptions) UnmarshalJSON(data []byte) error

type NodeService

type NodeService interface {
	// NodeInfo returns information about the network node.
	NodeInfo(ctx context.Context, opts NodeInfoOptions) (*NodeInfo, error)

	// FindService searches for nodes that provide the given service.
	FindService(ctx context.Context, opts FindServiceOptions) ([]*FindServiceResult, error)
}

type PendingQuery

type PendingQuery struct {
	Range *RangeOptions `json:"range,omitempty" form:"range" query:"range" validate:"required"`
	// contains filtered or unexported fields
}

func (*PendingQuery) Copy

func (v *PendingQuery) Copy() *PendingQuery

func (*PendingQuery) CopyAsInterface

func (v *PendingQuery) CopyAsInterface() interface{}

func (*PendingQuery) Equal

func (v *PendingQuery) Equal(u *PendingQuery) bool

func (*PendingQuery) IsValid

func (v *PendingQuery) IsValid() error

func (*PendingQuery) MarshalBinary

func (v *PendingQuery) MarshalBinary() ([]byte, error)

func (*PendingQuery) MarshalJSON

func (v *PendingQuery) MarshalJSON() ([]byte, error)

func (*PendingQuery) QueryType

func (*PendingQuery) QueryType() QueryType

func (*PendingQuery) UnmarshalBinary

func (v *PendingQuery) UnmarshalBinary(data []byte) error

func (*PendingQuery) UnmarshalBinaryFrom

func (v *PendingQuery) UnmarshalBinaryFrom(rd io.Reader) error

func (*PendingQuery) UnmarshalFieldsFrom

func (v *PendingQuery) UnmarshalFieldsFrom(reader *encoding.Reader) error

func (*PendingQuery) UnmarshalJSON

func (v *PendingQuery) UnmarshalJSON(data []byte) error

type PublicKeyHashSearchQuery

type PublicKeyHashSearchQuery struct {
	PublicKeyHash []byte `json:"publicKeyHash,omitempty" form:"publicKeyHash" query:"publicKeyHash" validate:"required"`
	// contains filtered or unexported fields
}

func (*PublicKeyHashSearchQuery) Copy

func (*PublicKeyHashSearchQuery) CopyAsInterface

func (v *PublicKeyHashSearchQuery) CopyAsInterface() interface{}

func (*PublicKeyHashSearchQuery) Equal

func (*PublicKeyHashSearchQuery) IsValid

func (v *PublicKeyHashSearchQuery) IsValid() error

func (*PublicKeyHashSearchQuery) MarshalBinary

func (v *PublicKeyHashSearchQuery) MarshalBinary() ([]byte, error)

func (*PublicKeyHashSearchQuery) MarshalJSON

func (v *PublicKeyHashSearchQuery) MarshalJSON() ([]byte, error)

func (*PublicKeyHashSearchQuery) QueryType

func (*PublicKeyHashSearchQuery) QueryType() QueryType

func (*PublicKeyHashSearchQuery) UnmarshalBinary

func (v *PublicKeyHashSearchQuery) UnmarshalBinary(data []byte) error

func (*PublicKeyHashSearchQuery) UnmarshalBinaryFrom

func (v *PublicKeyHashSearchQuery) UnmarshalBinaryFrom(rd io.Reader) error

func (*PublicKeyHashSearchQuery) UnmarshalFieldsFrom

func (v *PublicKeyHashSearchQuery) UnmarshalFieldsFrom(reader *encoding.Reader) error

func (*PublicKeyHashSearchQuery) UnmarshalJSON

func (v *PublicKeyHashSearchQuery) UnmarshalJSON(data []byte) error

type PublicKeySearchQuery

type PublicKeySearchQuery struct {
	PublicKey []byte                 `json:"publicKey,omitempty" form:"publicKey" query:"publicKey" validate:"required"`
	Type      protocol.SignatureType `json:"type,omitempty" form:"type" query:"type" validate:"required"`
	// contains filtered or unexported fields
}

func (*PublicKeySearchQuery) Copy

func (*PublicKeySearchQuery) CopyAsInterface

func (v *PublicKeySearchQuery) CopyAsInterface() interface{}

func (*PublicKeySearchQuery) Equal

func (*PublicKeySearchQuery) IsValid

func (v *PublicKeySearchQuery) IsValid() error

func (*PublicKeySearchQuery) MarshalBinary

func (v *PublicKeySearchQuery) MarshalBinary() ([]byte, error)

func (*PublicKeySearchQuery) MarshalJSON

func (v *PublicKeySearchQuery) MarshalJSON() ([]byte, error)

func (*PublicKeySearchQuery) QueryType

func (*PublicKeySearchQuery) QueryType() QueryType

func (*PublicKeySearchQuery) UnmarshalBinary

func (v *PublicKeySearchQuery) UnmarshalBinary(data []byte) error

func (*PublicKeySearchQuery) UnmarshalBinaryFrom

func (v *PublicKeySearchQuery) UnmarshalBinaryFrom(rd io.Reader) error

func (*PublicKeySearchQuery) UnmarshalFieldsFrom

func (v *PublicKeySearchQuery) UnmarshalFieldsFrom(reader *encoding.Reader) error

func (*PublicKeySearchQuery) UnmarshalJSON

func (v *PublicKeySearchQuery) UnmarshalJSON(data []byte) error

type Querier

type Querier interface {
	// Query queries the state of an account or transaction.
	Query(ctx context.Context, scope *url.URL, query Query) (Record, error)
}

type Querier2

type Querier2 struct {
	Querier
}

func (Querier2) QueryAccount

func (q Querier2) QueryAccount(ctx context.Context, account *url.URL, query *DefaultQuery) (*AccountRecord, error)

func (Querier2) QueryAccountAs

func (q Querier2) QueryAccountAs(ctx context.Context, account *url.URL, query *DefaultQuery, target any) (*AccountRecord, error)

func (Querier2) QueryAccountChains

func (q Querier2) QueryAccountChains(ctx context.Context, scope *url.URL, query *ChainQuery) (*RecordRange[*ChainRecord], error)

func (Querier2) QueryChain

func (q Querier2) QueryChain(ctx context.Context, scope *url.URL, query *ChainQuery) (*ChainRecord, error)

func (Querier2) QueryChainEntries

func (q Querier2) QueryChainEntries(ctx context.Context, scope *url.URL, query *ChainQuery) (*RecordRange[*ChainEntryRecord[Record]], error)

func (Querier2) QueryChainEntry

func (q Querier2) QueryChainEntry(ctx context.Context, scope *url.URL, query *ChainQuery) (*ChainEntryRecord[Record], error)

func (Querier2) QueryDataEntries

func (Querier2) QueryDataEntry

func (Querier2) QueryDirectory

func (q Querier2) QueryDirectory(ctx context.Context, scope *url.URL, query *DirectoryQuery) (*RecordRange[*AccountRecord], error)

func (Querier2) QueryDirectoryUrls

func (q Querier2) QueryDirectoryUrls(ctx context.Context, scope *url.URL, query *DirectoryQuery) (*RecordRange[*UrlRecord], error)

func (Querier2) QueryIndexChainEntries

func (q Querier2) QueryIndexChainEntries(ctx context.Context, scope *url.URL, query *ChainQuery) (*RecordRange[*ChainEntryRecord[*IndexEntryRecord]], error)

func (Querier2) QueryIndexChainEntry

func (q Querier2) QueryIndexChainEntry(ctx context.Context, scope *url.URL, query *ChainQuery) (*ChainEntryRecord[*IndexEntryRecord], error)

func (Querier2) QueryMainChainEntries

func (q Querier2) QueryMainChainEntries(ctx context.Context, scope *url.URL, query *ChainQuery) (*RecordRange[*ChainEntryRecord[*MessageRecord[*messaging.TransactionMessage]]], error)

func (Querier2) QueryMainChainEntry

func (q Querier2) QueryMainChainEntry(ctx context.Context, scope *url.URL, query *ChainQuery) (*ChainEntryRecord[*MessageRecord[*messaging.TransactionMessage]], error)

func (Querier2) QueryMajorBlock

func (q Querier2) QueryMajorBlock(ctx context.Context, scope *url.URL, query *BlockQuery) (*MajorBlockRecord, error)

func (Querier2) QueryMajorBlocks

func (q Querier2) QueryMajorBlocks(ctx context.Context, scope *url.URL, query *BlockQuery) (*RecordRange[*MajorBlockRecord], error)

func (Querier2) QueryMessage

func (q Querier2) QueryMessage(ctx context.Context, txid *url.TxID, query *DefaultQuery) (*MessageRecord[messaging.Message], error)

func (Querier2) QueryMinorBlock

func (q Querier2) QueryMinorBlock(ctx context.Context, scope *url.URL, query *BlockQuery) (*MinorBlockRecord, error)

func (Querier2) QueryMinorBlocks

func (q Querier2) QueryMinorBlocks(ctx context.Context, scope *url.URL, query *BlockQuery) (*RecordRange[*MinorBlockRecord], error)

func (Querier2) QueryPending

func (Querier2) QueryPendingIds

func (q Querier2) QueryPendingIds(ctx context.Context, scope *url.URL, query *PendingQuery) (*RecordRange[*TxIDRecord], error)

func (Querier2) QuerySignature

func (q Querier2) QuerySignature(ctx context.Context, txid *url.TxID, query *DefaultQuery) (*MessageRecord[*messaging.SignatureMessage], error)

func (Querier2) QuerySignatureChainEntries

func (q Querier2) QuerySignatureChainEntries(ctx context.Context, scope *url.URL, query *ChainQuery) (*RecordRange[*ChainEntryRecord[*MessageRecord[messaging.Message]]], error)

func (Querier2) QuerySignatureChainEntry

func (q Querier2) QuerySignatureChainEntry(ctx context.Context, scope *url.URL, query *ChainQuery) (*ChainEntryRecord[*MessageRecord[messaging.Message]], error)

func (Querier2) QueryTransaction

func (q Querier2) QueryTransaction(ctx context.Context, txid *url.TxID, query *DefaultQuery) (*MessageRecord[*messaging.TransactionMessage], error)

func (Querier2) QueryTransactionChains

func (q Querier2) QueryTransactionChains(ctx context.Context, scope *url.TxID, query *ChainQuery) (*RecordRange[*ChainEntryRecord[Record]], error)

func (Querier2) SearchForAnchor

func (q Querier2) SearchForAnchor(ctx context.Context, scope *url.URL, search *AnchorSearchQuery) (*RecordRange[*ChainEntryRecord[Record]], error)

func (Querier2) SearchForDelegate

func (q Querier2) SearchForDelegate(ctx context.Context, scope *url.URL, search *DelegateSearchQuery) (*RecordRange[*KeyRecord], error)

func (Querier2) SearchForMessage

func (q Querier2) SearchForMessage(ctx context.Context, hash [32]byte) (*RecordRange[*TxIDRecord], error)

func (Querier2) SearchForPublicKey

func (q Querier2) SearchForPublicKey(ctx context.Context, scope *url.URL, search *PublicKeySearchQuery) (*RecordRange[*KeyRecord], error)

func (Querier2) SearchForPublicKeyHash

func (q Querier2) SearchForPublicKeyHash(ctx context.Context, scope *url.URL, search *PublicKeyHashSearchQuery) (*RecordRange[*KeyRecord], error)

type Query

type Query interface {
	encoding.UnionValue
	QueryType() QueryType

	// IsValid validates the query.
	IsValid() error
}

Query is an API query.

func CopyQuery

func CopyQuery(v Query) Query

CopyQuery copies a Query.

func NewQuery

func NewQuery(typ QueryType) (Query, error)

NewQuery creates a new Query for the specified QueryType.

func UnmarshalQuery

func UnmarshalQuery(data []byte) (Query, error)

UnmarshalQuery unmarshals a Query.

func UnmarshalQueryFrom

func UnmarshalQueryFrom(rd io.Reader) (Query, error)

UnmarshalQueryFrom unmarshals a Query.

func UnmarshalQueryJSON

func UnmarshalQueryJSON(data []byte) (Query, error)

UnmarshalQueryJson unmarshals a Query.

type QueryType

type QueryType uint64

QueryType is the type of a Query.

const QueryTypeAnchorSearch QueryType = 16

QueryTypeAnchorSearch .

const QueryTypeBlock QueryType = 5

QueryTypeBlock .

const QueryTypeChain QueryType = 1

QueryTypeChain .

const QueryTypeData QueryType = 2

QueryTypeData .

const QueryTypeDefault QueryType = 0

QueryTypeDefault .

const QueryTypeDelegateSearch QueryType = 19

QueryTypeDelegateSearch .

const QueryTypeDirectory QueryType = 3

QueryTypeDirectory .

const QueryTypeMessageHashSearch QueryType = 20

QueryTypeMessageHashSearch .

const QueryTypePending QueryType = 4

QueryTypePending .

const QueryTypePublicKeyHashSearch QueryType = 18

QueryTypePublicKeyHashSearch .

const QueryTypePublicKeySearch QueryType = 17

QueryTypePublicKeySearch .

func QueryTypeByName

func QueryTypeByName(name string) (QueryType, bool)

QueryTypeByName returns the named Query Type.

func (QueryType) GetEnumValue

func (v QueryType) GetEnumValue() uint64

GetEnumValue returns the value of the Query Type

func (QueryType) MarshalJSON

func (v QueryType) MarshalJSON() ([]byte, error)

MarshalJSON marshals the Query Type to JSON as a string.

func (*QueryType) SetEnumValue

func (v *QueryType) SetEnumValue(id uint64) bool

SetEnumValue sets the value. SetEnumValue returns false if the value is invalid.

func (QueryType) String

func (v QueryType) String() string

String returns the name of the Query Type.

func (*QueryType) UnmarshalJSON

func (v *QueryType) UnmarshalJSON(data []byte) error

UnmarshalJSON unmarshals the Query Type from JSON as a string.

type RangeOptions

type RangeOptions struct {

	// Start is the starting index.
	Start uint64 `json:"start,omitempty" form:"start" query:"start"`
	// Count is the number of requested results.
	Count *uint64 `json:"count,omitempty" form:"count" query:"count"`
	// Expand requests expanded results.
	Expand  *bool `json:"expand,omitempty" form:"expand" query:"expand"`
	FromEnd bool  `json:"fromEnd,omitempty" form:"fromEnd" query:"fromEnd"`
	// contains filtered or unexported fields
}

func (*RangeOptions) Copy

func (v *RangeOptions) Copy() *RangeOptions

func (*RangeOptions) CopyAsInterface

func (v *RangeOptions) CopyAsInterface() interface{}

func (*RangeOptions) Equal

func (v *RangeOptions) Equal(u *RangeOptions) bool

func (*RangeOptions) IsValid

func (v *RangeOptions) IsValid() error

func (*RangeOptions) MarshalBinary

func (v *RangeOptions) MarshalBinary() ([]byte, error)

func (*RangeOptions) UnmarshalBinary

func (v *RangeOptions) UnmarshalBinary(data []byte) error

func (*RangeOptions) UnmarshalBinaryFrom

func (v *RangeOptions) UnmarshalBinaryFrom(rd io.Reader) error

type Receipt

type Receipt struct {
	merkle.Receipt
	LocalBlock     uint64    `json:"localBlock,omitempty" form:"localBlock" query:"localBlock" validate:"required"`
	LocalBlockTime time.Time `json:"localBlockTime,omitempty" form:"localBlockTime" query:"localBlockTime" validate:"required"`
	MajorBlock     uint64    `json:"majorBlock,omitempty" form:"majorBlock" query:"majorBlock" validate:"required"`
	// contains filtered or unexported fields
}

func (*Receipt) Copy

func (v *Receipt) Copy() *Receipt

func (*Receipt) CopyAsInterface

func (v *Receipt) CopyAsInterface() interface{}

func (*Receipt) Equal

func (v *Receipt) Equal(u *Receipt) bool

func (*Receipt) IsValid

func (v *Receipt) IsValid() error

func (*Receipt) MarshalBinary

func (v *Receipt) MarshalBinary() ([]byte, error)

func (*Receipt) MarshalJSON

func (v *Receipt) MarshalJSON() ([]byte, error)

func (*Receipt) UnmarshalBinary

func (v *Receipt) UnmarshalBinary(data []byte) error

func (*Receipt) UnmarshalBinaryFrom

func (v *Receipt) UnmarshalBinaryFrom(rd io.Reader) error

func (*Receipt) UnmarshalJSON

func (v *Receipt) UnmarshalJSON(data []byte) error

type Record

type Record interface {
	encoding.UnionValue
	RecordType() RecordType
}

Record is a record returned by a Query.

func CopyRecord

func CopyRecord(v Record) Record

CopyRecord copies a Record.

func NewRecord

func NewRecord(typ RecordType) (Record, error)

NewRecord creates a new Record for the specified RecordType.

func UnmarshalRecord

func UnmarshalRecord(data []byte) (Record, error)

UnmarshalRecord unmarshals a Record.

func UnmarshalRecordFrom

func UnmarshalRecordFrom(rd io.Reader) (Record, error)

UnmarshalRecordFrom unmarshals a Record.

func UnmarshalRecordJSON

func UnmarshalRecordJSON(data []byte) (Record, error)

UnmarshalRecordJson unmarshals a Record.

type RecordRange

type RecordRange[T Record] struct {
	Records       []T        `json:"records,omitempty" form:"records" query:"records" validate:"required"`
	Start         uint64     `json:"start" form:"start" query:"start" validate:"required"`
	Total         uint64     `json:"total" form:"total" query:"total" validate:"required"`
	LastBlockTime *time.Time `json:"lastBlockTime,omitempty" form:"lastBlockTime" query:"lastBlockTime" validate:"required"`
	// contains filtered or unexported fields
}

func MakeRange

func MakeRange[V any, U Record](values []V, start, count uint64, fn func(V) (U, error)) (*RecordRange[U], error)

MakeRange creates a record range with at most max elements of v (unless max is zero), transformed by fn. MakeRange only returns an error if fn returns an error.

MakeRange will not return an error as long as fn does not.

func MapRange

func MapRange[U, V Record](r *RecordRange[V], fn func(V) (U, error)) (*RecordRange[U], error)

func RecordRangeAs

func RecordRangeAs[T2 Record, T1 Record](v *RecordRange[T1]) (*RecordRange[T2], error)

func (*RecordRange[T]) Append added in v1.2.0

func (r *RecordRange[T]) Append(s *RecordRange[T])

func (*RecordRange[T]) Copy

func (v *RecordRange[T]) Copy() *RecordRange[T]

func (*RecordRange[T]) CopyAsInterface

func (v *RecordRange[T]) CopyAsInterface() interface{}

func (*RecordRange[T]) Equal

func (v *RecordRange[T]) Equal(u *RecordRange[T]) bool

func (*RecordRange[T]) IsValid

func (v *RecordRange[T]) IsValid() error

func (*RecordRange[T]) MarshalBinary

func (v *RecordRange[T]) MarshalBinary() ([]byte, error)

func (*RecordRange[T]) MarshalJSON

func (v *RecordRange[T]) MarshalJSON() ([]byte, error)

func (*RecordRange[T]) RecordType

func (*RecordRange[T]) RecordType() RecordType

func (*RecordRange[T]) UnmarshalBinary

func (v *RecordRange[T]) UnmarshalBinary(data []byte) error

func (*RecordRange[T]) UnmarshalBinaryFrom

func (v *RecordRange[T]) UnmarshalBinaryFrom(rd io.Reader) error

func (*RecordRange[T]) UnmarshalFieldsFrom

func (v *RecordRange[T]) UnmarshalFieldsFrom(reader *encoding.Reader) error

func (*RecordRange[T]) UnmarshalJSON

func (v *RecordRange[T]) UnmarshalJSON(data []byte) error

type RecordType

type RecordType uint64

RecordType is the type of a Record.

const RecordTypeAccount RecordType = 1

RecordTypeAccount .

const RecordTypeChain RecordType = 2

RecordTypeChain .

const RecordTypeChainEntry RecordType = 3

RecordTypeChainEntry .

const RecordTypeError RecordType = 143

RecordTypeError .

const RecordTypeIndexEntry RecordType = 131

RecordTypeIndexEntry .

const RecordTypeKey RecordType = 4

RecordTypeKey .

const RecordTypeMajorBlock RecordType = 33

RecordTypeMajorBlock .

const RecordTypeMessage RecordType = 16

RecordTypeMessage .

const RecordTypeMinorBlock RecordType = 32

RecordTypeMinorBlock .

const RecordTypeRange RecordType = 128

RecordTypeRange .

const RecordTypeSignatureSet RecordType = 17

RecordTypeSignatureSet .

const RecordTypeTxID RecordType = 130

RecordTypeTxID .

const RecordTypeUrl RecordType = 129

RecordTypeUrl .

func RecordTypeByName

func RecordTypeByName(name string) (RecordType, bool)

RecordTypeByName returns the named Record Type.

func (RecordType) GetEnumValue

func (v RecordType) GetEnumValue() uint64

GetEnumValue returns the value of the Record Type

func (RecordType) MarshalJSON

func (v RecordType) MarshalJSON() ([]byte, error)

MarshalJSON marshals the Record Type to JSON as a string.

func (*RecordType) SetEnumValue

func (v *RecordType) SetEnumValue(id uint64) bool

SetEnumValue sets the value. SetEnumValue returns false if the value is invalid.

func (RecordType) String

func (v RecordType) String() string

String returns the name of the Record Type.

func (*RecordType) UnmarshalJSON

func (v *RecordType) UnmarshalJSON(data []byte) error

UnmarshalJSON unmarshals the Record Type from JSON as a string.

type ServiceAddress

type ServiceAddress struct {
	Type     ServiceType `json:"type,omitempty" form:"type" query:"type" validate:"required"`
	Argument string      `json:"argument,omitempty" form:"argument" query:"argument"`
	// contains filtered or unexported fields
}

func ParseServiceAddress

func ParseServiceAddress(s string) (*ServiceAddress, error)

ParseServiceAddress parses a string as a ServiceAddress. See ServiceAddress.String.

func UnpackAddress added in v1.2.10

func UnpackAddress(addr multiaddr.Multiaddr) (string, peer.ID, *ServiceAddress, multiaddr.Multiaddr, error)

UnpackAddress unpacks a multiaddr into its components. The address must include an /acc-svc component and may include a /p2p component or an /acc component. UnpackAddress will return an error if the address includes any other components.

func (*ServiceAddress) Compare

func (s *ServiceAddress) Compare(r *ServiceAddress) int

Compare this address to another.

func (*ServiceAddress) Copy

func (s *ServiceAddress) Copy() *ServiceAddress

Copy returns a copy of the address.

func (*ServiceAddress) Equal

func (s *ServiceAddress) Equal(r *ServiceAddress) bool

Equal returns true if the addresses are the same.

func (*ServiceAddress) IsValid

func (v *ServiceAddress) IsValid() error

func (*ServiceAddress) MarshalBinary

func (v *ServiceAddress) MarshalBinary() ([]byte, error)

func (*ServiceAddress) MarshalJSON added in v1.2.0

func (a *ServiceAddress) MarshalJSON() ([]byte, error)

func (*ServiceAddress) Multiaddr

func (s *ServiceAddress) Multiaddr() multiaddr.Multiaddr

Multiaddr returns `/acc-svc/<type>[:<argument>]` as a multiaddr component.

func (*ServiceAddress) MultiaddrFor

func (s *ServiceAddress) MultiaddrFor(network string) (multiaddr.Multiaddr, error)

MultiaddrFor returns `/acc/<network>/acc-svc/<type>[:<argument>]` as a multiaddr. MultiaddrFor returns an error if the network argument is not a valid UTF-8 string.

func (*ServiceAddress) String

func (s *ServiceAddress) String() string

String returns {type}:{partition}, or {type} if the partition is empty.

func (*ServiceAddress) UnmarshalBinary

func (v *ServiceAddress) UnmarshalBinary(data []byte) error

func (*ServiceAddress) UnmarshalBinaryFrom

func (v *ServiceAddress) UnmarshalBinaryFrom(rd io.Reader) error

func (*ServiceAddress) UnmarshalJSON added in v1.2.0

func (a *ServiceAddress) UnmarshalJSON(b []byte) error

type ServiceType

type ServiceType uint64

ServiceType is used to identify services.

const ServiceTypeConsensus ServiceType = 2

ServiceTypeConsensus is the type of ConsensusService.

const ServiceTypeEvent ServiceType = 6

ServiceTypeEvent is the type of EventService.

const ServiceTypeFaucet ServiceType = 9

ServiceTypeFaucet is the type of Faucet.

const ServiceTypeMetrics ServiceType = 4

ServiceTypeMetrics is the type of MetricsService.

const ServiceTypeNetwork ServiceType = 3

ServiceTypeNetwork is the type of NetworkService.

const ServiceTypeNode ServiceType = 1

ServiceTypeNode is the type of NodeService.

const ServiceTypeQuery ServiceType = 5

ServiceTypeQuery is the type of Querier.

const ServiceTypeSubmit ServiceType = 7

ServiceTypeSubmit is the type of Submitter.

const ServiceTypeUnknown ServiceType = 0

ServiceTypeUnknown indicates an unknown service type.

const ServiceTypeValidate ServiceType = 8

ServiceTypeValidate is the type of Validator.

func ServiceTypeByName

func ServiceTypeByName(name string) (ServiceType, bool)

ServiceTypeByName returns the named Service Type.

func (ServiceType) Address

func (s ServiceType) Address() *ServiceAddress

Address constructs a ServiceAddress for the service type.

func (ServiceType) AddressFor

func (s ServiceType) AddressFor(arg string) *ServiceAddress

AddressFor constructs a ServiceAddress for the service type and given argument.

func (ServiceType) AddressForUrl

func (s ServiceType) AddressForUrl(u *url.URL) *ServiceAddress

AddressFor constructs a ServiceAddress for the service type and given URL argument. The URL is encoded to avoid looking like a path.

The URL encoding leaves (latin) alphanumerics, dash, underscore, and dot untouched. Slashes are encoded as '!_' and all other characters are encoded as hex and prefixed with '!'.

func (ServiceType) GetEnumValue

func (v ServiceType) GetEnumValue() uint64

GetEnumValue returns the value of the Service Type

func (ServiceType) MarshalJSON

func (v ServiceType) MarshalJSON() ([]byte, error)

MarshalJSON marshals the Service Type to JSON as a string.

func (*ServiceType) SetEnumValue

func (v *ServiceType) SetEnumValue(id uint64) bool

SetEnumValue sets the value. SetEnumValue returns false if the value is invalid.

func (ServiceType) String

func (v ServiceType) String() string

String returns the name of the Service Type.

func (*ServiceType) UnmarshalJSON

func (v *ServiceType) UnmarshalJSON(data []byte) error

UnmarshalJSON unmarshals the Service Type from JSON as a string.

type SignatureSetRecord

type SignatureSetRecord struct {
	Account    protocol.Account                                `json:"account,omitempty" form:"account" query:"account" validate:"required"`
	Signatures *RecordRange[*MessageRecord[messaging.Message]] `json:"signatures,omitempty" form:"signatures" query:"signatures" validate:"required"`
	// contains filtered or unexported fields
}

func (*SignatureSetRecord) Copy

func (*SignatureSetRecord) CopyAsInterface

func (v *SignatureSetRecord) CopyAsInterface() interface{}

func (*SignatureSetRecord) Equal

func (*SignatureSetRecord) IsValid

func (v *SignatureSetRecord) IsValid() error

func (*SignatureSetRecord) MarshalBinary

func (v *SignatureSetRecord) MarshalBinary() ([]byte, error)

func (*SignatureSetRecord) MarshalJSON

func (v *SignatureSetRecord) MarshalJSON() ([]byte, error)

func (*SignatureSetRecord) RecordType

func (*SignatureSetRecord) RecordType() RecordType

func (*SignatureSetRecord) UnmarshalBinary

func (v *SignatureSetRecord) UnmarshalBinary(data []byte) error

func (*SignatureSetRecord) UnmarshalBinaryFrom

func (v *SignatureSetRecord) UnmarshalBinaryFrom(rd io.Reader) error

func (*SignatureSetRecord) UnmarshalFieldsFrom

func (v *SignatureSetRecord) UnmarshalFieldsFrom(reader *encoding.Reader) error

func (*SignatureSetRecord) UnmarshalJSON

func (v *SignatureSetRecord) UnmarshalJSON(data []byte) error

type Submission

type Submission struct {
	Status *protocol.TransactionStatus `json:"status,omitempty" form:"status" query:"status" validate:"required"`
	// Success indicates whether the envelope was successfully submitted.
	Success bool `json:"success,omitempty" form:"success" query:"success" validate:"required"`
	// Message is the message returned by the consensus engine.
	Message string `json:"message,omitempty" form:"message" query:"message" validate:"required"`
	// contains filtered or unexported fields
}

func (*Submission) Copy

func (v *Submission) Copy() *Submission

func (*Submission) CopyAsInterface

func (v *Submission) CopyAsInterface() interface{}

func (*Submission) Equal

func (v *Submission) Equal(u *Submission) bool

func (*Submission) IsValid

func (v *Submission) IsValid() error

func (*Submission) MarshalBinary

func (v *Submission) MarshalBinary() ([]byte, error)

func (*Submission) UnmarshalBinary

func (v *Submission) UnmarshalBinary(data []byte) error

func (*Submission) UnmarshalBinaryFrom

func (v *Submission) UnmarshalBinaryFrom(rd io.Reader) error

type SubmitOptions

type SubmitOptions struct {

	// Verify verifies that the envelope is well formed before submitting (default yes).
	Verify *bool `json:"verify,omitempty" form:"verify" query:"verify"`
	// Wait waits until the envelope is accepted into a block or rejected (default yes).
	Wait *bool `json:"wait,omitempty" form:"wait" query:"wait"`
	// contains filtered or unexported fields
}

func (*SubmitOptions) Copy

func (v *SubmitOptions) Copy() *SubmitOptions

func (*SubmitOptions) CopyAsInterface

func (v *SubmitOptions) CopyAsInterface() interface{}

func (*SubmitOptions) Equal

func (v *SubmitOptions) Equal(u *SubmitOptions) bool

func (*SubmitOptions) IsValid

func (v *SubmitOptions) IsValid() error

func (*SubmitOptions) MarshalBinary

func (v *SubmitOptions) MarshalBinary() ([]byte, error)

func (*SubmitOptions) UnmarshalBinary

func (v *SubmitOptions) UnmarshalBinary(data []byte) error

func (*SubmitOptions) UnmarshalBinaryFrom

func (v *SubmitOptions) UnmarshalBinaryFrom(rd io.Reader) error

type Submitter

type Submitter interface {
	// Submit submits an envelope for execution.
	Submit(ctx context.Context, envelope *messaging.Envelope, opts SubmitOptions) ([]*Submission, error)
}

type SubscribeOptions

type SubscribeOptions struct {
	Partition string   `json:"partition,omitempty" form:"partition" query:"partition"`
	Account   *url.URL `json:"account,omitempty" form:"account" query:"account"`
	// contains filtered or unexported fields
}

func (*SubscribeOptions) Copy

func (*SubscribeOptions) CopyAsInterface

func (v *SubscribeOptions) CopyAsInterface() interface{}

func (*SubscribeOptions) Equal

func (v *SubscribeOptions) Equal(u *SubscribeOptions) bool

func (*SubscribeOptions) IsValid

func (v *SubscribeOptions) IsValid() error

func (*SubscribeOptions) MarshalBinary

func (v *SubscribeOptions) MarshalBinary() ([]byte, error)

func (*SubscribeOptions) UnmarshalBinary

func (v *SubscribeOptions) UnmarshalBinary(data []byte) error

func (*SubscribeOptions) UnmarshalBinaryFrom

func (v *SubscribeOptions) UnmarshalBinaryFrom(rd io.Reader) error

type TxIDRecord

type TxIDRecord struct {
	Value *url.TxID `json:"value,omitempty" form:"value" query:"value" validate:"required"`
	// contains filtered or unexported fields
}

func (*TxIDRecord) Copy

func (v *TxIDRecord) Copy() *TxIDRecord

func (*TxIDRecord) CopyAsInterface

func (v *TxIDRecord) CopyAsInterface() interface{}

func (*TxIDRecord) Equal

func (v *TxIDRecord) Equal(u *TxIDRecord) bool

func (*TxIDRecord) IsValid

func (v *TxIDRecord) IsValid() error

func (*TxIDRecord) MarshalBinary

func (v *TxIDRecord) MarshalBinary() ([]byte, error)

func (*TxIDRecord) MarshalJSON

func (v *TxIDRecord) MarshalJSON() ([]byte, error)

func (*TxIDRecord) RecordType

func (*TxIDRecord) RecordType() RecordType

func (*TxIDRecord) UnmarshalBinary

func (v *TxIDRecord) UnmarshalBinary(data []byte) error

func (*TxIDRecord) UnmarshalBinaryFrom

func (v *TxIDRecord) UnmarshalBinaryFrom(rd io.Reader) error

func (*TxIDRecord) UnmarshalFieldsFrom

func (v *TxIDRecord) UnmarshalFieldsFrom(reader *encoding.Reader) error

func (*TxIDRecord) UnmarshalJSON

func (v *TxIDRecord) UnmarshalJSON(data []byte) error

type UrlRecord

type UrlRecord struct {
	Value *url.URL `json:"value,omitempty" form:"value" query:"value" validate:"required"`
	// contains filtered or unexported fields
}

func (*UrlRecord) Copy

func (v *UrlRecord) Copy() *UrlRecord

func (*UrlRecord) CopyAsInterface

func (v *UrlRecord) CopyAsInterface() interface{}

func (*UrlRecord) Equal

func (v *UrlRecord) Equal(u *UrlRecord) bool

func (*UrlRecord) IsValid

func (v *UrlRecord) IsValid() error

func (*UrlRecord) MarshalBinary

func (v *UrlRecord) MarshalBinary() ([]byte, error)

func (*UrlRecord) MarshalJSON

func (v *UrlRecord) MarshalJSON() ([]byte, error)

func (*UrlRecord) RecordType

func (*UrlRecord) RecordType() RecordType

func (*UrlRecord) UnmarshalBinary

func (v *UrlRecord) UnmarshalBinary(data []byte) error

func (*UrlRecord) UnmarshalBinaryFrom

func (v *UrlRecord) UnmarshalBinaryFrom(rd io.Reader) error

func (*UrlRecord) UnmarshalFieldsFrom

func (v *UrlRecord) UnmarshalFieldsFrom(reader *encoding.Reader) error

func (*UrlRecord) UnmarshalJSON

func (v *UrlRecord) UnmarshalJSON(data []byte) error

type ValidateOptions

type ValidateOptions struct {

	// Full fully validates the signatures and transactions (default yes).
	Full *bool `json:"full,omitempty" form:"full" query:"full"`
	// contains filtered or unexported fields
}

func (*ValidateOptions) Copy

func (v *ValidateOptions) Copy() *ValidateOptions

func (*ValidateOptions) CopyAsInterface

func (v *ValidateOptions) CopyAsInterface() interface{}

func (*ValidateOptions) Equal

func (v *ValidateOptions) Equal(u *ValidateOptions) bool

func (*ValidateOptions) IsValid

func (v *ValidateOptions) IsValid() error

func (*ValidateOptions) MarshalBinary

func (v *ValidateOptions) MarshalBinary() ([]byte, error)

func (*ValidateOptions) UnmarshalBinary

func (v *ValidateOptions) UnmarshalBinary(data []byte) error

func (*ValidateOptions) UnmarshalBinaryFrom

func (v *ValidateOptions) UnmarshalBinaryFrom(rd io.Reader) error

type Validator

type Validator interface {
	// Validate checks if an envelope is expected to succeed.
	Validate(ctx context.Context, envelope *messaging.Envelope, opts ValidateOptions) ([]*Submission, error)
}

Directories

Path Synopsis
Package message defines message types and implements binary message transport for Accumulate API v3.
Package message defines message types and implements binary message transport for Accumulate API v3.
p2p

Jump to

Keyboard shortcuts

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