model

package
v0.3.4 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2022 License: Apache-2.0, BSD-2-Clause Imports: 14 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      `swagger:"desc(Whether or not the blob exists in the registry)"`
	Hash   HashValue `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 ChainID

type ChainID string

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

func NewChainID

func NewChainID(chainID *isc.ChainID) ChainID

func (ChainID) ChainID

func (ch ChainID) ChainID() *isc.ChainID

func (ChainID) MarshalJSON

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

func (*ChainID) UnmarshalJSON

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

type ChainInfo added in v0.2.4

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

type ChainNodeStatus added in v0.2.4

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

type ChainRecord

type ChainRecord struct {
	ChainID ChainID `swagger:"desc(ChainID (bech32))"`
	Active  bool    `swagger:"desc(Whether or not the chain is active)"`
}

func NewChainRecord

func NewChainRecord(rec *registry.ChainRecord) *ChainRecord

func (*ChainRecord) Record added in v0.2.0

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

type ConsensusPipeMetrics added in v0.2.5

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

func NewConsensusPipeMetrics added in v0.2.5

func NewConsensusPipeMetrics(pipeMetrics chain.ConsensusPipeMetrics) *ConsensusPipeMetrics

type ConsensusWorkflowStatus added in v0.2.4

type ConsensusWorkflowStatus struct {
	FlagStateReceived        bool `swagger:"desc(Shows if state output is received in current consensus iteration)"`
	FlagBatchProposalSent    bool `swagger:"desc(Shows if batch proposal is sent out in current consensus iteration)"`
	FlagConsensusBatchKnown  bool `swagger:"desc(Shows if consensus on batch is reached and known in current consensus iteration)"`
	FlagVMStarted            bool `swagger:"desc(Shows if virtual machine is started in current consensus iteration)"`
	FlagVMResultSigned       bool `swagger:"desc(Shows if virtual machine has returned its results in current consensus iteration)"`
	FlagTransactionFinalized bool `swagger:"desc(Shows if consensus on transaction is reached in current consensus iteration)"`
	FlagTransactionPosted    bool `swagger:"desc(Shows if transaction is posted to L1 in current consensus iteration)"`
	FlagTransactionSeen      bool `swagger:"desc(Shows if L1 reported that it has seen the transaction of current consensus iteration)"`
	FlagInProgress           bool `swagger:"desc(Shows if consensus algorithm is still not completed in current consensus iteration)"`

	TimeBatchProposalSent    time.Time `swagger:"desc(Shows when batch proposal was last sent out in current consensus iteration)"`
	TimeConsensusBatchKnown  time.Time `swagger:"desc(Shows when ACS results of consensus on batch was last received in current consensus iteration)"`
	TimeVMStarted            time.Time `swagger:"desc(Shows when virtual machine was last started in current consensus iteration)"`
	TimeVMResultSigned       time.Time `swagger:"desc(Shows when virtual machine results were last received and signed in current consensus iteration)"`
	TimeTransactionFinalized time.Time `` /* 143-byte string literal not displayed */
	TimeTransactionPosted    time.Time `swagger:"desc(Shows when transaction was last posted to L1 in current consensus iteration)"`
	TimeTransactionSeen      time.Time `swagger:"desc(Shows when algorithm last noted that transaction hadd been seen by L1 in current consensus iteration)"`
	TimeCompleted            time.Time `swagger:"desc(Shows when algorithm was last completed in current consensus iteration)"`

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

func NewConsensusWorkflowStatus added in v0.2.4

func NewConsensusWorkflowStatus(status chain.ConsensusWorkflowStatus) *ConsensusWorkflowStatus

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 base58 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 `swagger:"desc(Wasp version)"`
	VersionHash   string `swagger:"desc(Wasp version hash)"`
	NetworkID     string `swagger:"desc('hostname:port'; uniquely identifies the node)"`
	PublisherPort int    `swagger:"desc(Nanomsg port that exposes publisher messages)"`
}

type NodeConnectionMessageMetrics added in v0.2.3

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

func NewNodeConnectionMessageMetrics added in v0.2.3

func NewNodeConnectionMessageMetrics(metrics nodeconnmetrics.NodeConnectionMessageMetrics) *NodeConnectionMessageMetrics

type NodeConnectionMessagesMetrics added in v0.2.3

type NodeConnectionMessagesMetrics struct {
	OutPublishStateTransaction      *NodeConnectionMessageMetrics `swagger:"desc(Stats of sent out PublishStateTransaction messages)"`
	OutPublishGovernanceTransaction *NodeConnectionMessageMetrics `swagger:"desc(Stats of sent out PublishGovernanceTransaction messages)"`
	OutPullLatestOutput             *NodeConnectionMessageMetrics `swagger:"desc(Stats of sent out PullLatestOutput messages)"`
	OutPullTxInclusionState         *NodeConnectionMessageMetrics `swagger:"desc(Stats of sent out PullTxInclusionState messages)"`
	OutPullOutputByID               *NodeConnectionMessageMetrics `swagger:"desc(Stats of sent out PullOutputByID messages)"`

	InStateOutput      *NodeConnectionMessageMetrics `swagger:"desc(Stats of received State output messages)"`
	InAliasOutput      *NodeConnectionMessageMetrics `swagger:"desc(Stats of received AliasOutput messages)"`
	InOutput           *NodeConnectionMessageMetrics `swagger:"desc(Stats of received Output messages)"`
	InOnLedgerRequest  *NodeConnectionMessageMetrics `swagger:"desc(Stats of received OnLedgerRequest messages)"`
	InTxInclusionState *NodeConnectionMessageMetrics `swagger:"desc(Stats of received TxInclusionState messages)"`
}

func NewNodeConnectionMessagesMetrics added in v0.2.3

func NewNodeConnectionMessagesMetrics(metrics nodeconnmetrics.NodeConnectionMessagesMetrics) *NodeConnectionMessagesMetrics

type NodeConnectionMetrics added in v0.2.3

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

func NewNodeConnectionMetrics added in v0.2.3

func NewNodeConnectionMetrics(metrics nodeconnmetrics.NodeConnectionMetrics) *NodeConnectionMetrics

type NodeOwnerCertificateRequest added in v0.2.4

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

type NodeOwnerCertificateResponse added in v0.2.4

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

type OffLedgerRequestBody added in v0.2.0

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

type PeeringNodeStatus added in v0.2.0

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

type PeeringTrustedNode added in v0.2.0

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 added in v0.2.0

func NewPeeringTrustedNode(tp *peering.TrustedPeer) *PeeringTrustedNode

type RequestID added in v0.3.0

type RequestID string

RequestID is the string representation of isc.RequestID

func NewRequestID added in v0.3.0

func NewRequestID(reqID isc.RequestID) RequestID

func (RequestID) MarshalJSON added in v0.3.0

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

func (RequestID) RequestID added in v0.3.0

func (r RequestID) RequestID() isc.RequestID

func (*RequestID) UnmarshalJSON added in v0.3.0

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

type RequestReceiptResponse added in v0.3.0

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

type ValueTxID

type ValueTxID string

ValueTxID is the base58 representation of a transaction ID

func NewValueTxID

func NewValueTxID(id *iotago.TransactionID) ValueTxID

func (ValueTxID) ID

func (id ValueTxID) ID() iotago.TransactionID

func (ValueTxID) MarshalJSON

func (id ValueTxID) MarshalJSON() ([]byte, error)

func (*ValueTxID) UnmarshalJSON

func (id *ValueTxID) UnmarshalJSON(b []byte) error

type WaitRequestProcessedParams

type WaitRequestProcessedParams struct {
	Timeout time.Duration `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