model

package
v0.4.0-alpha.8 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2023 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const WaitRequestProcessedDefaultTimeout = 30 * time.Second

Variables

This section is empty.

Functions

func IsHTTPNotFound

func IsHTTPNotFound(e error) bool

IsHTTPNotFound returns true if the error is an HTTPError with status code http.StatusNotFound

Types

type Address

type Address string

Address is the string representation of iotago.Address

func NewAddress

func NewAddress(address iotago.Address) Address

func (Address) Address

func (a Address) Address() iotago.Address

func (Address) MarshalJSON

func (a Address) MarshalJSON() ([]byte, error)

func (*Address) UnmarshalJSON

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

type BlobData

type BlobData struct {
	Data Bytes `swagger:"desc(Blob content (base64))"`
}

func NewBlobData

func NewBlobData(data []byte) *BlobData

type BlobInfo

type BlobInfo struct {
	Exists bool      `json:"exists" swagger:"desc(Whether or not the blob exists in the registry)"`
	Hash   HashValue `json:"hash" swagger:"desc(Hash of the blob)"`
}

func NewBlobInfo

func NewBlobInfo(exists bool, hash hashing.HashValue) *BlobInfo

type Bytes

type Bytes string

Bytes is the base64 representation of a byte slice. It is intended to be a replacement for any []byte attribute in JSON models. Normally it shouldn't be necessary since the standard json package already handles []byte data, but this makes sure that the swagger documentation shows examples correctly (instead of as if a []byte was json-encoded as an array of ints).

func NewBytes

func NewBytes(data []byte) Bytes

func (Bytes) Bytes

func (b Bytes) Bytes() []byte

func (Bytes) MarshalJSON

func (b Bytes) MarshalJSON() ([]byte, error)

func (*Bytes) UnmarshalJSON

func (b *Bytes) UnmarshalJSON(data []byte) error

type ChainIDBech32

type ChainIDBech32 string

ChainIDBech32 is the string representation of isc.ChainIDBech32 (bech32)

func NewChainIDBech32

func NewChainIDBech32(chainID isc.ChainID) ChainIDBech32

func (ChainIDBech32) ChainID

func (ch ChainIDBech32) ChainID() isc.ChainID

func (ChainIDBech32) MarshalJSON

func (ch ChainIDBech32) MarshalJSON() ([]byte, error)

func (*ChainIDBech32) UnmarshalJSON

func (ch *ChainIDBech32) UnmarshalJSON(b []byte) error

type ChainInfo

type ChainInfo struct {
	ChainID        ChainIDBech32      `json:"chainId" swagger:"desc(ChainID bech32)"`
	Active         bool               `json:"active" swagger:"desc(Whether or not the chain is active)"`
	StateAddress   *Address           `json:"stateAddress" swagger:"desc(State address, if we are part of it.)"`
	CommitteeNodes []*ChainNodeStatus `json:"committeeNodes" swagger:"desc(Committee nodes and their peering info.)"`
	AccessNodes    []*ChainNodeStatus `json:"accessNodes" swagger:"desc(Access nodes and their peering info.)"`
	CandidateNodes []*ChainNodeStatus `json:"candidateNodes" swagger:"desc(Candidate nodes and their peering info.)"`
}

type ChainNodeStatus

type ChainNodeStatus struct {
	Node         PeeringNodeStatus
	ForCommittee bool
	ForAccess    bool
	AccessAPI    string
}

type ChainRecord

type ChainRecord struct {
	ChainID     ChainIDBech32 `json:"chainId" swagger:"desc(ChainID (bech32))"`
	Active      bool          `json:"active" swagger:"desc(Whether or not the chain is active)"`
	AccessNodes []string      `json:"accessNodes" swagger:"desc(list of access nodes public keys, hex encoded)"`
}

func NewChainRecord

func NewChainRecord(rec *registry.ChainRecord) *ChainRecord

func (*ChainRecord) Record

func (bd *ChainRecord) Record() (*registry.ChainRecord, error)

type ConsensusPipeMetrics

type ConsensusPipeMetrics struct {
	EventStateTransitionMsgPipeSize int
	EventPeerLogIndexMsgPipeSize    int
	EventACSMsgPipeSize             int
	EventVMResultMsgPipeSize        int
	EventTimerMsgPipeSize           int
}

type ConsensusWorkflowStatus

type ConsensusWorkflowStatus struct {
	FlagStateReceived        bool `json:"flagStateReceived" swagger:"desc(Shows if state output is received in current consensus iteration)"`
	FlagBatchProposalSent    bool `json:"flagBatchProposalSent" swagger:"desc(Shows if batch proposal is sent out in current consensus iteration)"`
	FlagConsensusBatchKnown  bool `` /* 126-byte string literal not displayed */
	FlagVMStarted            bool `json:"flagVMStarted" swagger:"desc(Shows if virtual machine is started in current consensus iteration)"`
	FlagVMResultSigned       bool `json:"flagVMResultSigned" swagger:"desc(Shows if virtual machine has returned its results in current consensus iteration)"`
	FlagTransactionFinalized bool `json:"flagTransactionFinalized" swagger:"desc(Shows if consensus on transaction is reached in current consensus iteration)"`
	FlagTransactionPosted    bool `json:"flagTransactionPosted" swagger:"desc(Shows if transaction is posted to L1 in current consensus iteration)"`
	FlagTransactionSeen      bool `` /* 127-byte string literal not displayed */
	FlagInProgress           bool `json:"flagInProgress" swagger:"desc(Shows if consensus algorithm is still not completed in current consensus iteration)"`

	TimeBatchProposalSent    time.Time `json:"timeBatchProposalSent" swagger:"desc(Shows when batch proposal was last sent out in current consensus iteration)"`
	TimeConsensusBatchKnown  time.Time `` /* 140-byte string literal not displayed */
	TimeVMStarted            time.Time `json:"timeVMStarted" swagger:"desc(Shows when virtual machine was last started in current consensus iteration)"`
	TimeVMResultSigned       time.Time `` /* 137-byte string literal not displayed */
	TimeTransactionFinalized time.Time `` /* 175-byte string literal not displayed */
	TimeTransactionPosted    time.Time `json:"timeTransactionPosted" swagger:"desc(Shows when transaction was last posted to L1 in current consensus iteration)"`
	TimeTransactionSeen      time.Time `` /* 143-byte string literal not displayed */
	TimeCompleted            time.Time `json:"timeCompleted" swagger:"desc(Shows when algorithm was last completed in current consensus iteration)"`

	CurrentStateIndex uint32 `json:"currentStateIndex" swagger:"desc(Shows current state index of the consensus)"`
}

type DKSharesInfo

type DKSharesInfo struct {
	Address      string   `json:"address" swagger:"desc(New generated shared address.)"`
	SharedPubKey string   `json:"sharedPubKey" swagger:"desc(Shared public key (base64-encoded).)"`
	PubKeyShares []string `json:"pubKeyShares" swagger:"desc(Public key shares for all the peers (base64-encoded).)"`
	PeerPubKeys  []string `json:"peerPubKeys" swagger:"desc(Public keys of the nodes sharing the key (base64-encoded).)"`
	Threshold    uint16   `json:"threshold"`
	PeerIndex    *uint16  `json:"peerIndex" swagger:"desc(Index of the node returning the share, if it is a member of the sharing group.)"`
}

DKSharesInfo stands for the DKShare representation, returned by the GET and POST methods.

type DKSharesPostRequest

type DKSharesPostRequest struct {
	PeerPubKeys []string `json:"peerPubKeys" swagger:"desc(Optional, base64 encoded public keys of the peers generating the DKS.)"`
	Threshold   uint16   `json:"threshold" swagger:"desc(Should be =< len(PeerPubKeys))"`
	TimeoutMS   uint32   `json:"timeoutMS" swagger:"desc(Timeout in milliseconds.)"`
}

DKSharesPostRequest is a POST request for creating new DKShare.

type HTTPError

type HTTPError struct {
	// StatusCode is the associated HTTP status code (default: htttp.StatusInternalServerError)
	StatusCode int

	// Message is the error message
	Message string
}

HTTPError is the standard error response for all webapi endpoints, and also implements the Go error interface.

func NewHTTPError

func NewHTTPError(statusCode int, message string) *HTTPError

NewHTTPError creates a new HTTPError

func (*HTTPError) Error

func (e *HTTPError) Error() string

Error implements the Go error interface

type HashValue

type HashValue string

HashValue is the hex representation of a hashing.HashValue

func NewHashValue

func NewHashValue(h hashing.HashValue) HashValue

func (HashValue) HashValue

func (h HashValue) HashValue() hashing.HashValue

func (HashValue) MarshalJSON

func (h HashValue) MarshalJSON() ([]byte, error)

func (*HashValue) UnmarshalJSON

func (h *HashValue) UnmarshalJSON(b []byte) error

type InfoResponse

type InfoResponse struct {
	Version       string `json:"version" swagger:"desc(Wasp version)"`
	NetworkID     string `json:"networkId" swagger:"desc('hostname:port'; uniquely identifies the node)"`
	PublisherPort int    `json:"publisherPort" swagger:"desc(Nanomsg port that exposes publisher messages)"`
}

type NodeConnectionMessageMetrics

type NodeConnectionMessageMetrics struct {
	Total       uint32    `json:"total" swagger:"desc(Total number of messages sent/received)"`
	LastEvent   time.Time `json:"lastEvent" swagger:"desc(Last time the message was sent/received)"`
	LastMessage string    `json:"lastMessage" swagger:"desc(The print out of the last message)"`
}

type NodeConnectionMessagesMetrics

type NodeConnectionMessagesMetrics struct {
	OutPublishStateTransaction      *NodeConnectionMessageMetrics `json:"outPublishStateTransaction" swagger:"desc(Stats of sent out PublishStateTransaction messages)"`
	OutPublishGovernanceTransaction *NodeConnectionMessageMetrics `json:"outPublishGovernanceTransaction" swagger:"desc(Stats of sent out PublishGovernanceTransaction messages)"`
	OutPullLatestOutput             *NodeConnectionMessageMetrics `json:"outPullLatestOutput" swagger:"desc(Stats of sent out PullLatestOutput messages)"`
	OutPullTxInclusionState         *NodeConnectionMessageMetrics `json:"outPullTxInclusionState" swagger:"desc(Stats of sent out PullTxInclusionState messages)"`
	OutPullOutputByID               *NodeConnectionMessageMetrics `json:"outPullOutputByID" swagger:"desc(Stats of sent out PullOutputByID messages)"`
	InStateOutput                   *NodeConnectionMessageMetrics `json:"inStateOutput" swagger:"desc(Stats of received State output messages)"`
	InAliasOutput                   *NodeConnectionMessageMetrics `json:"inAliasOutput" swagger:"desc(Stats of received AliasOutput messages)"`
	InOutput                        *NodeConnectionMessageMetrics `json:"inOutput" swagger:"desc(Stats of received Output messages)"`
	InOnLedgerRequest               *NodeConnectionMessageMetrics `json:"inOnLedgerRequest" swagger:"desc(Stats of received OnLedgerRequest messages)"`
	InTxInclusionState              *NodeConnectionMessageMetrics `json:"inTxInclusionState" swagger:"desc(Stats of received TxInclusionState messages)"`
}

type NodeConnectionMetrics

type NodeConnectionMetrics struct {
	NodeConnectionMessagesMetrics `json:"nodeConnectionMessagesMetrics"`
	InMilestone                   *NodeConnectionMessageMetrics `json:"inMilestone" swagger:"desc(Stats of received Milestone messages)"`
	Registered                    []ChainIDBech32               `json:"registered" swagger:"desc(Chain IDs of the chains registered to receiving L1 events)"`
}

type NodeOwnerCertificateRequest

type NodeOwnerCertificateRequest struct {
	NodePubKey   Bytes   `json:"nodePubKey" swagger:"desc(Node pub key. (base64))"`
	OwnerAddress Address `json:"ownerAddress" swagger:"desc(Node owner address. (bech32))"`
}

type NodeOwnerCertificateResponse

type NodeOwnerCertificateResponse struct {
	Certificate Bytes `json:"certificate" swagger:"desc(Certificate stating the ownership. (base64))"`
}

type OffLedgerRequestBody

type OffLedgerRequestBody struct {
	Request Bytes `json:"request" swagger:"desc(Offledger Request (base64))"`
}

type PeeringNodeStatus

type PeeringNodeStatus struct {
	PubKey   string
	NetID    string
	IsAlive  bool
	NumUsers int
}

type PeeringTrustedNode

type PeeringTrustedNode struct {
	PubKey string `json:"pubKey" swagger:"desc(Public key of the NetID.)"`
	NetID  string `json:"netId" swagger:"desc(NetID of a peer to trust.)"`
}

PeeringTrustedNode describes single node in the list of trusted peering nodes.

func NewPeeringTrustedNode

func NewPeeringTrustedNode(tp *peering.TrustedPeer) *PeeringTrustedNode

type RequestID

type RequestID string

RequestID is the string representation of isc.RequestID

func NewRequestID

func NewRequestID(reqID isc.RequestID) RequestID

func (RequestID) MarshalJSON

func (r RequestID) MarshalJSON() ([]byte, error)

func (RequestID) RequestID

func (r RequestID) RequestID() isc.RequestID

func (*RequestID) UnmarshalJSON

func (r *RequestID) UnmarshalJSON(b []byte) error

type RequestReceiptResponse

type RequestReceiptResponse struct {
	Receipt string `json:"receipt" swagger:"desc(Request receipt, empty if request was not processed)"`
}

type WaitRequestProcessedParams

type WaitRequestProcessedParams struct {
	Timeout time.Duration `json:"timeout" swagger:"desc(Timeout in nanoseconds),default(30 seconds)"`
}

Jump to

Keyboard shortcuts

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