api

package
v0.1.1-alpha Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PathGetLedgerID             = "/get_ledger_id"
	PathGetAccountOutputs       = "/get_account_outputs"
	PathGetChainOutput          = "/get_chain_output"
	PathGetOutput               = "/get_output"
	PathQueryTxStatus           = "/query_tx_status"
	PathQueryInclusionScore     = "/query_inclusion_score"
	PathSubmitTransaction       = "/submit_tx"
	PathGetSyncInfo             = "/sync_info"
	PathGetNodeInfo             = "/node_info"
	PathGetPeersInfo            = "/peers_info"
	PathGetLatestReliableBranch = "/get_latest_reliable_branch"
	PathGetDashboard            = "/dashboard"
)
View Source
const ErrGetOutputNotFound = "output not found"

Variables

This section is empty.

Functions

This section is empty.

Types

type ChainOutput

type ChainOutput struct {
	Error
	// hex-encoded outputID
	OutputID string `json:"output_id,omitempty"`
	// hex-encoded output data
	OutputData string `json:"output_data,omitempty"`
	// latest reliable branch used to extract chain ID
	LRBID string `json:"lrb_id"`
}

ChainOutput is returned by 'get_chain_output'

type Error

type Error struct {
	// empty string when no error
	Error string `json:"error,omitempty"`
}

type LatestReliableBranch

type LatestReliableBranch struct {
	Error
	RootData multistate.RootRecordJSONAble `json:"root_record,omitempty"`
	BranchID ledger.TransactionID          `json:"branch_id,omitempty"`
}

LatestReliableBranch returned by get_latest_reliable_branch

type LedgerID

type LedgerID struct {
	Error
	// hex-encoded ledger id bytes
	LedgerIDBytes string `json:"ledger_id_bytes,omitempty"`
}

type OutputData

type OutputData struct {
	Error
	// hex-encoded output data
	OutputData string `json:"output_data,omitempty"`
	// latest reliable branch used to extract output
	LRBID string `json:"lrb_id"`
}

OutputData is returned by 'get_output'

type OutputList

type OutputList struct {
	Error
	// key is hex-encoded outputID bytes
	// value is hex-encoded raw output data
	Outputs map[string]string `json:"outputs,omitempty"`
	// latest reliable branch used to extract outputs
	LRBID string `json:"lrb_id"`
}

OutputList is returned by 'get_account_outputs'

type PeerInfo

type PeerInfo struct {
	// The libp2p identifier of the peer.
	ID string `json:"id"`
	// The libp2p multi addresses of the peer.
	MultiAddresses            []string `json:"multiAddresses,omitempty"`
	IsStatic                  bool     `json:"is_static"`
	RespondsToPull            bool     `json:"responds_to_pull"`
	IsAlive                   bool     `json:"is_alive"`
	WhenAdded                 int64    `json:"when_added"`
	LastHeartbeatReceived     int64    `json:"last_heartbeat_received"`
	ClockDifferencesQuartiles [3]int64 `json:"clock_differences_quartiles"`
	HBMsgDifferencesQuartiles [3]int64 `json:"hb_differences_quartiles"`
	NumIncomingHB             int      `json:"num_incoming_hb"`
	NumIncomingPull           int      `json:"num_incoming_pull"`
	NumIncomingTx             int      `json:"num_incoming_tx"`
}

type PeersInfo

type PeersInfo struct {
	Error
	HostID    string            `json:"host_id"`
	Peers     []PeerInfo        `json:"peers,omitempty"`
	Blacklist map[string]string `json:"blacklist,omitempty"` // map: peerID -> reason why it is in the blacklist
}

type QueryTxInclusionScore

type QueryTxInclusionScore struct {
	Error
	TxInclusionScore
}

type QueryTxStatus

type QueryTxStatus struct {
	Error
	TxIDStatus vertex.TxIDStatusJSONAble       `json:"txid_status"`
	Inclusion  *multistate.TxInclusionJSONAble `json:"inclusion,omitempty"`
}

type SequencerSyncInfo

type SequencerSyncInfo struct {
	Synced              bool   `json:"synced"`
	LatestHealthySlot   uint32 `json:"latest_healthy_slot"`
	LatestCommittedSlot uint32 `json:"latest_committed_slot"`
	LedgerCoverage      uint64 `json:"ledger_coverage"`
}

type SyncInfo

type SyncInfo struct {
	Error
	Synced       bool                         `json:"synced"`
	InSyncWindow bool                         `json:"in_sync_window,omitempty"`
	PerSequencer map[string]SequencerSyncInfo `json:"per_sequencer,omitempty"`
}

type TxInclusionScore

type TxInclusionScore struct {
	ThresholdNumerator   int    `json:"threshold_numerator"`
	ThresholdDenominator int    `json:"threshold_denominator"`
	LatestSlot           int    `json:"latest_slot"`
	EarliestSlot         int    `json:"earliest_slot"`
	StrongScore          int    `json:"strong_score"`
	WeakScore            int    `json:"weak_score"`
	LRBID                string `json:"lrb_id"`
	IncludedInLRB        bool   `json:"included_in_lrb"`
}

func CalcTxInclusionScore

func CalcTxInclusionScore(inclusion *multistate.TxInclusion, thresholdNumerator, thresholdDenominator int) TxInclusionScore

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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