GRPC Documentation - ValidatorAPI
The validator_api.proto defines the gRPC service interface for the Bitcoin SV transaction validation service. It specifies the methods and message types for transaction validation, health checking, and block information retrieval.
Table of Contents
validator_api.proto
EmptyMessage
Represents an empty request message. Used for endpoints that don't require input parameters. swagger:model EmptyMessage
GetBlockHeightResponse
Provides the current block height. swagger:model GetBlockHeightResponse
Field | Type | Label | Description |
---|---|---|---|
height | uint32 | Current block height |
GetMedianBlockTimeResponse
Provides the median time of recent blocks. Used for time-based validation rules. swagger:model GetMedianBlockTimeResponse
Field | Type | Label | Description |
---|---|---|---|
median_time | uint32 | Median time of recent blocks |
HealthResponse
Provides health check information for the validation service. swagger:model HealthResponse
Field | Type | Label | Description |
---|---|---|---|
ok | bool | Overall health status | |
details | string | Detailed health information | |
timestamp | google.protobuf.Timestamp | Timestamp of health check |
ValidateTransactionBatchRequest
Contains multiple transactions for batch validation. swagger:model ValidateTransactionBatchRequest
Field | Type | Label | Description |
---|---|---|---|
transactions | ValidateTransactionRequest | repeated | Array of transactions to validate |
ValidateTransactionBatchResponse
Provides batch validation results for multiple transactions. swagger:model ValidateTransactionBatchResponse
Field | Type | Label | Description |
---|---|---|---|
valid | bool | Overall batch validation status | |
errors | errors.TError | repeated | Array of error messages, one per transaction |
metadata | bytes | repeated | Array of metadata for each transaction |
ValidateTransactionRequest
Contains data for transaction validation. swagger:model ValidateTransactionRequest
Field | Type | Label | Description |
---|---|---|---|
transaction_data | bytes | Raw transaction data to validate | |
block_height | uint32 | Block height for validation context | |
skip_utxo_creation | bool | optional | Skip UTXO creation for validation |
add_tx_to_block_assembly | bool | optional | Add transaction to block assembly |
skip_policy_checks | bool | optional | Skip policy checks |
create_conflicting | bool | optional | Create conflicting transaction |
ValidateTransactionResponse
Provides transaction validation results. swagger:model ValidateTransactionResponse
Field | Type | Label | Description |
---|---|---|---|
valid | bool | Validation result (true if valid) | |
txid | bytes | Transaction ID of the validated transaction | |
reason | string | Reason for rejection if invalid | |
metadata | bytes | Additional metadata for the transaction |
ValidatorAPI
Service provides methods for transaction validation and related operations.
Method Name | Request Type | Response Type | Description |
---|---|---|---|
HealthGRPC | EmptyMessage | HealthResponse | Checks the health status of the validation service. Returns detailed health information including service status and timestamp. |
ValidateTransaction | ValidateTransactionRequest | ValidateTransactionResponse | Validates a single transaction. Performs comprehensive validation including script verification and UTXO checks. |
ValidateTransactionBatch | ValidateTransactionBatchRequest | ValidateTransactionBatchResponse | Validates multiple transactions in a single request. Provides efficient batch processing of transactions. |
GetBlockHeight | EmptyMessage | GetBlockHeightResponse | Retrieves the current block height. Used for validation context and protocol upgrade determination. |
GetMedianBlockTime | EmptyMessage | GetMedianBlockTimeResponse | Retrieves the median time of recent blocks. Used for time-based validation rules. |