syntax = "proto3"; package co.topl.node.services; import 'consensus/models/block_id.proto'; import 'consensus/models/block_header.proto'; import 'node/models/block.proto'; import 'node/models/node_config.proto'; import 'node/models/node_epochData.proto'; import 'brambl/models/identifier.proto'; import 'brambl/models/transaction/io_transaction.proto'; import "validate/validate.proto"; import 'google/protobuf/wrappers.proto'; service NodeRpc { // Submit a proven Transaction to the node rpc BroadcastTransaction (BroadcastTransactionReq) returns (BroadcastTransactionRes); // Read the contents of the node's mempool rpc CurrentMempool (CurrentMempoolReq) returns (CurrentMempoolRes); // Check the content of the node's mempool and return if a Transaction Id exists rpc CurrentMempoolContains (CurrentMempoolContainsReq) returns (CurrentMempoolContainsRes); // retrieve a Block Header by its ID rpc FetchBlockHeader (FetchBlockHeaderReq) returns (FetchBlockHeaderRes); // retrieve a Block Body by its ID rpc FetchBlockBody (FetchBlockBodyReq) returns (FetchBlockBodyRes); // retrieve a Transaction by its ID rpc FetchTransaction (FetchTransactionReq) returns (FetchTransactionRes); // retrieve the Block ID associated with a height, according to the node's canonical chain rpc FetchBlockIdAtHeight (FetchBlockIdAtHeightReq) returns (FetchBlockIdAtHeightRes); // retrieve the Block ID associated with a depth, according to the node's canonical chain rpc FetchBlockIdAtDepth (FetchBlockIdAtDepthReq) returns (FetchBlockIdAtDepthRes); // retrieve a stream of changes to the canonical head of the chain. rpc SynchronizationTraversal (SynchronizationTraversalReq) returns (stream SynchronizationTraversalRes); // retrieve a stream of node's protocol configuration rpc FetchNodeConfig (FetchNodeConfigReq) returns (stream FetchNodeConfigRes); // retrieve epoch data content rpc FetchEpochData (FetchEpochDataReq) returns (FetchEpochDataRes); } // Request type for BroadcastTransaction message BroadcastTransactionReq { // A "proven" Transaction that is meant to be included in the blockchain co.topl.brambl.models.transaction.IoTransaction transaction = 1 [(validate.rules).message.required = true]; } // Response type for BroadcastTransaction message BroadcastTransactionRes {} // Request type for CurrentMempool message CurrentMempoolReq {} // Response type for CurrentMempool message CurrentMempoolRes { // A list of Transaction IDs that are currently in the node's mempool repeated co.topl.brambl.models.TransactionId transactionIds = 1; } // Request type for CurrentMempoolContainsReq message CurrentMempoolContainsReq { co.topl.brambl.models.TransactionId transactionId = 1[(validate.rules).message.required = true]; } // Response type for CurrentMempoolContainsRes message CurrentMempoolContainsRes { // Predicate indicating if the Transaction ID is currently in the node's mempool bool inMempool = 1; } // Request type for FetchBlockHeader message FetchBlockHeaderReq { // The ID of the block to retrieve co.topl.consensus.models.BlockId blockId = 1 [(validate.rules).message.required = true]; } // Response type for FetchBlockHeader message FetchBlockHeaderRes { // The Block Header associated with the requested ID. None/null if not found. // optional co.topl.consensus.models.BlockHeader header = 1; } // Request type for FetchBlockBody message FetchBlockBodyReq { // The ID of the block to retrieve co.topl.consensus.models.BlockId blockId = 1 [(validate.rules).message.required = true]; } // Response type for FetchBlockBody message FetchBlockBodyRes { // The Block Body associated with the requested ID. None/null if not found. // optional co.topl.node.models.BlockBody body = 1; } // Request type for FetchTransaction message FetchTransactionReq { co.topl.brambl.models.TransactionId transactionId = 1 [(validate.rules).message.required = true]; } // Response type for FetchTransaction message FetchTransactionRes { // The Transaction associated with the requested ID. None/null if not found. // optional co.topl.brambl.models.transaction.IoTransaction transaction = 1; } // Request type for FetchBlockIdAtHeight message FetchBlockIdAtHeightReq { // The height of interest uint64 height = 1; } // Response type for FetchBlockIdAtHeight message FetchBlockIdAtHeightRes { // The Block ID associated with the requested height. None/null if not found. // optional co.topl.consensus.models.BlockId blockId = 1; } // Request type for FetchBlockIdAtDepth message FetchBlockIdAtDepthReq { // The depth of interest. When depth=0, the canonical head is retrieved. uint64 depth = 1; } // Response type for FetchBlockIdAtDepth message FetchBlockIdAtDepthRes { // The Block ID associated with the requested depth. None/null if not found. // optional co.topl.consensus.models.BlockId blockId = 1; } // Request type for SynchronizationTraversal message SynchronizationTraversalReq {} // Response type for SynchronizationTraversal message SynchronizationTraversalRes { oneof status { // Block ID applied co.topl.consensus.models.BlockId applied = 1; // Block ID unapplied co.topl.consensus.models.BlockId unapplied = 2; } } // Request type for FetchNodeConfigReq message FetchNodeConfigReq {} // Response type for FetchNodeConfigRes message FetchNodeConfigRes { co.topl.proto.node.NodeConfig config = 1 [(validate.rules).message.required = true]; } // Request type for FetchEpochDataReq message FetchEpochDataReq { google.protobuf.UInt64Value epoch = 1; } // Response type for FetchEpochDataRes message FetchEpochDataRes { co.topl.proto.node.EpochData epochData = 1; }