Documentation
¶
Index ¶
Constants ¶
View Source
const ( // RouteInfo is the route for getting the node info. // GET returns the node info. RouteInfo = "/info" // RouteTips is the route for getting tips. // GET returns the tips. RouteTips = "/tips" // RouteMessageData is the route for getting message data by its messageID. // GET returns message data (json). RouteMessageData = "/messages/:" + restapipkg.ParameterMessageID // RouteMessageMetadata is the route for getting message metadata by its messageID. // GET returns message metadata (including info about "promotion/reattachment needed"). RouteMessageMetadata = RouteMessageData + "/metadata" // RouteMessageBytes is the route for getting message raw data by it's messageID. // GET returns raw message data (bytes). RouteMessageBytes = RouteMessageData + "/raw" // RouteMessageChildren is the route for getting message IDs of the children of a message, identified by its messageID. // GET returns the message IDs of all children. RouteMessageChildren = RouteMessageData + "/children" // RouteMessages is the route for getting message IDs or creating new messages. // GET with query parameter (mandatory) returns all message IDs that fit these filter criteria (query parameters: "index"). // POST creates a single new message and returns the new message ID. RouteMessages = "/messages" // RouteTransactionsIncludedMessageData is the route for getting the message that was included in the ledger for a given transaction ID. // GET returns message data (json). RouteTransactionsIncludedMessageData = "/transactions/:" + restapipkg.ParameterTransactionID + "/included-message" // RouteTransactionsIncludedMessageMetadata is the route for getting the message metadata that was included in the ledger for a given transaction ID. // GET returns message metadata (including info about "promotion/reattachment needed"). RouteTransactionsIncludedMessageMetadata = RouteTransactionsIncludedMessageData + "/metadata" // RouteTransactionsIncludedMessageBytes is the route for getting the message raw data that was included in the ledger for a given transaction ID. // GET returns raw message data (bytes). RouteTransactionsIncludedMessageBytes = RouteTransactionsIncludedMessageData + "/raw" // RouteTransactionsIncludedMessageChildren is the route for getting the message IDs of the children of the message that was included in the ledger for a given transaction ID. // GET returns the message IDs of all children. RouteTransactionsIncludedMessageChildren = RouteTransactionsIncludedMessageData + "/children" // RouteMilestone is the route for getting a milestone by it's milestoneIndex. // GET returns the milestone. RouteMilestone = "/milestones/:" + restapipkg.ParameterMilestoneIndex // RouteMilestoneUTXOChanges is the route for getting all UTXO changes of a milestone by its milestoneIndex. // GET returns the output IDs of all UTXO changes. RouteMilestoneUTXOChanges = RouteMilestone + "/utxo-changes" // RouteOutput is the route for getting outputs by their outputID (transactionHash + outputIndex). // GET returns the output. RouteOutput = "/outputs/:" + restapipkg.ParameterOutputID // RouteAddressBech32Balance is the route for getting the total balance of all unspent outputs of an address. // The address must be encoded in bech32. // GET returns the balance of all unspent outputs of this address. RouteAddressBech32Balance = "/addresses/:" + restapipkg.ParameterAddress // RouteAddressEd25519Balance is the route for getting the total balance of all unspent outputs of an ed25519 address. // The ed25519 address must be encoded in hex. // GET returns the balance of all unspent outputs of this address. RouteAddressEd25519Balance = "/addresses/ed25519/:" + restapipkg.ParameterAddress // RouteAddressBech32Outputs is the route for getting all output IDs for an address. // The address must be encoded in bech32. // GET returns the outputIDs for all outputs of this address (optional query parameters: "include-spent"). RouteAddressBech32Outputs = "/addresses/:" + restapipkg.ParameterAddress + "/outputs" // RouteAddressEd25519Outputs is the route for getting all output IDs for an ed25519 address. // The ed25519 address must be encoded in hex. // GET returns the outputIDs for all outputs of this address (optional query parameters: "include-spent"). RouteAddressEd25519Outputs = "/addresses/ed25519/:" + restapipkg.ParameterAddress + "/outputs" // RouteAddressBech32History is the route for getting the transaction history of an address. // The address must be encoded in bech32. // GET returns the tx-history of this address. RouteAddressBech32History = "/addresses/:" + restapipkg.ParameterAddress + "/tx-history" // RouteAddressEd25519History is the route for getting the transaction history of an ed25519 address. // The ed25519 address must be encoded in hex. // GET returns the tx-history of this address. RouteAddressEd25519History = "/addresses/ed25519/:" + restapipkg.ParameterAddress + "/tx-history" // RouteTreasury is the route for getting the current treasury output. RouteTreasury = "/treasury" // RouteReceipts is the route for getting all stored receipts. RouteReceipts = "/receipts" // RouteReceiptsMigratedAtIndex is the route for getting all receipts for a given migrated at index. RouteReceiptsMigratedAtIndex = "/receipts/:" + restapipkg.ParameterMilestoneIndex // RoutePeer is the route for getting peers by their peerID. // GET returns the peer // DELETE deletes the peer. RoutePeer = "/peers/:" + restapipkg.ParameterPeerID // RoutePeers is the route for getting all peers of the node. // GET returns a list of all peers. // POST adds a new peer. RoutePeers = "/peers" // RouteControlDatabasePrune is the control route to manually prune the database. // POST prunes the database. RouteControlDatabasePrune = "/control/database/prune" // RouteControlSnapshotsCreate is the control route to manually create a snapshot files. // POST creates a snapshot (full, delta or both). RouteControlSnapshotsCreate = "/control/snapshots/create" )
Variables ¶
View Source
var ( Plugin *node.Plugin // ErrNodeNotSync is returned when the node was not synced. ErrNodeNotSync = errors.New("node not synced") )
Functions ¶
func AddFeature ¶
func AddFeature(feature string)
AddFeature adds a feature for the RouteInfo endpoint.
Types ¶
type OutputResponse ¶
type OutputResponse struct {
// The hex encoded message ID of the message.
MessageID string `json:"messageId"`
// The hex encoded transaction id from which this output originated.
TransactionID string `json:"transactionId"`
// The index of the output.
OutputIndex uint16 `json:"outputIndex"`
// Whether this output is spent.
Spent bool `json:"isSpent"`
// The milestone index at which this output was spent.
MilestoneIndexSpent milestone.Index `json:"milestoneIndexSpent,omitempty"`
// The transaction this output was spent with.
TransactionIDSpent string `json:"transactionIdSpent,omitempty"`
// The ledger index at which this output was available at.
LedgerIndex milestone.Index `json:"ledgerIndex"`
// The output in its serialized form.
RawOutput *json.RawMessage `json:"output"`
}
OutputResponse defines the response of a GET outputs REST API call.
func NewOutputResponse ¶
func NewSpentResponse ¶
type PeerResponse ¶
type PeerResponse struct {
// The libp2p identifier of the peer.
ID string `json:"id"`
// The libp2p multi addresses of the peer.
MultiAddresses []string `json:"multiAddresses"`
// The alias of the peer.
Alias *string `json:"alias,omitempty"`
// The relation (static, autopeered) of the peer.
Relation string `json:"relation"`
// Whether the peer is connected.
Connected bool `json:"connected"`
// The gossip protocol information of the peer.
Gossip *gossip.Info `json:"gossip,omitempty"`
}
PeerResponse defines the response of a GET peer REST API call.
func WrapInfoSnapshot ¶
func WrapInfoSnapshot(info *p2p.PeerInfoSnapshot) *PeerResponse
WrapInfoSnapshot wraps the given peer info snapshot with additional metadata, such as gossip protocol information.
Click to show internal directories.
Click to hide internal directories.