Documentation ¶
Index ¶
- func DeserializeSlice[T encoding.BinaryUnmarshaler](bts []byte, newFn func() T) ([]T, error)
- func SerializeSlice[T encoding.BinaryMarshaler](slice []T) ([]byte, error)
- type Account
- type AccountStatus
- type ChainInfo
- type DatasetIdentifier
- type HexBytes
- type JoinRequest
- type NodeInfo
- type UUID
- type UUIDArray
- type Validator
- type ValidatorRemoveProposal
- type VotableEvent
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeserializeSlice ¶
func DeserializeSlice[T encoding.BinaryUnmarshaler](bts []byte, newFn func() T) ([]T, error)
DeserializeSlice deserializes a slice of binary marshalable items. It expects bytes, as well as a function to create a new item of the slice type.
func SerializeSlice ¶
func SerializeSlice[T encoding.BinaryMarshaler](slice []T) ([]byte, error)
SerializeSlice serializes a slice of binary marshalable items. It prepends the length of each item to the serialized data.
Types ¶
type AccountStatus ¶
type AccountStatus uint32
const ( AccountStatusLatest AccountStatus = iota AccountStatusPending )
type ChainInfo ¶
type ChainInfo struct { ChainID string `json:"chain_id"` BlockHeight uint64 `json:"block_height"` BlockHash string `json:"block_hash"` }
ChainInfo describes the current status of a Kwil blockchain.
type DatasetIdentifier ¶
type DatasetIdentifier struct { Name string `json:"name"` Owner []byte `json:"owner"` DBID string `json:"dbid"` }
DatasetIdentifier contains the information required to identify a dataset.
type HexBytes ¶
type HexBytes []byte
HexBytes is used to decode hexadecimal text into a byte slice.
func (HexBytes) MarshalJSON ¶
MarshalJSON satisfies the json.Marshaler interface.
func (*HexBytes) UnmarshalJSON ¶
UnmarshalText satisfies the json.Unmarshaler interface.
type JoinRequest ¶
type JoinRequest struct { Candidate []byte `json:"candidate"` // pubkey of the candidate validator Power int64 `json:"power"` // the requested power ExpiresAt int64 `json:"expires_at"` // the block height at which the join request expires Board [][]byte `json:"board"` // slice of pubkeys of all the eligible voting validators Approved []bool `json:"approved"` // slice of bools indicating if the corresponding validator approved }
type NodeInfo ¶
type NodeInfo struct { NodeID string `json:"node_id"` PublicKey HexBytes `json:"pubkey"` P2PListenAddress string `json:"p2p_listen_address"` }
NodeInfo contains public information about a node. It can be used by clients to join as a peer.
type UUID ¶
type UUID [16]byte
UUID is a rfc4122 compliant uuidv5
func NewUUIDV5 ¶
NewUUIDV5 generates a uuidv5 from a byte slice. This is used to deterministically generate uuids.
type ValidatorRemoveProposal ¶
type ValidatorRemoveProposal struct { Target []byte `json:"target"` // pubkey of the validator to remove Remover []byte `json:"remover"` // pubkey of the validator proposing the removal }
ValidatorRemoveProposal is a proposal from an existing validator (remover) to remove a validator (the target) from the validator set.
type VotableEvent ¶
VotableEvent is an event that can be voted. It contains an event type and a body. An ID can be generated from the event type and body.
func (*VotableEvent) ID ¶
func (e *VotableEvent) ID() UUID
Directories ¶
Path | Synopsis |
---|---|
_numbers
|
|
Package types contains the type used by the administrative RPC client and servers.
|
Package types contains the type used by the administrative RPC client and servers. |
Package client contains the shared client types, including the options used to construct a Client instance, and the records iterator used to represent the results of an action call.
|
Package client contains the shared client types, including the options used to construct a Client instance, and the records iterator used to represent the results of an action call. |
Package transactions contains all the logic for creating and validating transactions and call messages.
|
Package transactions contains all the logic for creating and validating transactions and call messages. |