service.proto raw

   1  syntax = "proto3";
   2  package orlynits.v1;
   3  option go_package = "next.orly.dev/pkg/proto/orlynits/v1;orlynitsv1";
   4  
   5  // Empty is used for requests/responses with no data
   6  message Empty {}
   7  
   8  // ReadyResponse reports bitcoind readiness
   9  message ReadyResponse {
  10    bool ready = 1;
  11    string status = 2; // "starting", "syncing", "ready", "stopped"
  12    int32 sync_progress_percent = 3;
  13  }
  14  
  15  // BlockchainInfoResponse reports basic chain state
  16  message BlockchainInfoResponse {
  17    string chain = 1; // "main", "test", "signet", "regtest"
  18    int64 blocks = 2;
  19    int64 headers = 3;
  20    double verification_progress = 4;
  21    bool initial_block_download = 5;
  22    bool pruned = 6;
  23    int64 prune_height = 7;
  24    int64 size_on_disk = 8;
  25  }
  26  
  27  // EstimateFeeRequest specifies the confirmation target
  28  message EstimateFeeRequest {
  29    int32 conf_target = 1; // target number of blocks
  30  }
  31  
  32  // EstimateFeeResponse returns the estimated fee rate
  33  message EstimateFeeResponse {
  34    double fee_rate = 1; // BTC/kvB
  35    repeated string errors = 2;
  36  }
  37  
  38  // NitsService provides gRPC access to the Bitcoin node (nits/bitcoind)
  39  service NitsService {
  40    // === Lifecycle ===
  41  
  42    // Ready returns whether bitcoind is responsive and synced enough to use
  43    rpc Ready(Empty) returns (ReadyResponse);
  44  
  45    // === Chain State ===
  46  
  47    // GetBlockchainInfo returns basic chain state information
  48    rpc GetBlockchainInfo(Empty) returns (BlockchainInfoResponse);
  49  
  50    // EstimateFee returns fee estimation for a given confirmation target
  51    rpc EstimateFee(EstimateFeeRequest) returns (EstimateFeeResponse);
  52  }
  53