syntax = "proto3"; package remote_sc; // SmartContractService defines the bi-directional streaming service for remote // smart contract execution. External workers connect to this service to receive // execution tasks and send back results. service SmartContractService { // Run establishes a bi-directional stream. The server sends SmartContractRequest // messages to the client for execution, and the client sends back // SmartContractResponse messages with results. rpc Run(stream SmartContractResponse) returns (stream SmartContractRequest); } // SmartContractRequest is sent from the server to the connected worker // to request execution of a smart contract. message SmartContractRequest { // Unique identifier for this execution request, used to correlate responses string transaction_id = 1; // Full transaction JSON to be processed by the smart contract string transaction_json = 2; // Environment variables to set for the smart contract execution map env_vars = 3; // Secrets to be made available to the smart contract map secrets = 4; } // SmartContractResponse is sent from the worker back to the server // with the results of smart contract execution. message SmartContractResponse { // The transaction_id from the original request, for correlation string transaction_id = 1; // The result data from the smart contract execution as JSON string result_json = 2; // Logs captured during smart contract execution string logs = 3; // Whether to persist the output to the chain bool output_to_chain = 4; // Error message if execution failed string error = 5; }