nockchain-grpc/proto/nockapp.proto

76 lines
1.7 KiB
Protocol Buffer
Raw Permalink Normal View History

// nockchain/private/v1/nockapp.proto
syntax = "proto3";
package nockchain.private.v1;
option go_package = "./;nockchain";
service NockAppService {
rpc Peek(PeekRequest) returns (PeekResponse);
rpc Poke(PokeRequest) returns (PokeResponse);
}
message PeekRequest {
int32 pid = 1; // process ID for tracking
bytes path = 2; // JAM-encoded nock peek path
}
message PeekResponse {
oneof result {
bytes data = 1; // JAM-encoded nock data (success case)
AppErrorStatus error = 2;
}
}
message PokeRequest {
int32 pid = 1; // process ID for tracking
Wire wire = 2; // wire routing information
bytes payload = 3; // JAM-encoded nock data
}
message PokeResponse {
oneof result {
bool acknowledged = 1; // true if successful
AppErrorStatus error = 2;
}
}
message AppErrorStatus {
AppErrorCode code = 1;
string message = 2;
optional string details = 3; // additional error context
}
enum AppErrorCode {
ERROR_CODE_UNSPECIFIED = 0;
ERROR_CODE_INVALID_REQUEST = 1;
ERROR_CODE_PEEK_FAILED = 2;
ERROR_CODE_PEEK_RETURNED_NO_DATA = 3;
ERROR_CODE_POKE_FAILED = 4;
ERROR_CODE_NACKAPP_ERROR = 5;
ERROR_CODE_TIMEOUT = 6;
ERROR_CODE_INTERNAL_ERROR = 7;
ERROR_CODE_NOT_FOUND = 8;
ERROR_CODE_PERMISSION_DENIED = 9;
ERROR_CODE_INVALID_WIRE = 10;
ERROR_CODE_KERNEL_ERROR = 11;
}
// ===================================================================
// Wire types for NockApp pokes
// ===================================================================
message Wire {
string source = 1; // e.g., "http", "file", "wallet", "grpc"
uint64 version = 2; // wire format version
repeated WireTag tags = 3; // operation-specific tags
}
message WireTag {
oneof value {
string text = 1;
uint64 number = 2;
}
}