Skip to content

Commit

Permalink
format .proto file (#45)
Browse files Browse the repository at this point in the history
  • Loading branch information
hairtail authored Sep 26, 2023
1 parent 0acc10a commit 2e20d61
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 44 deletions.
8 changes: 2 additions & 6 deletions protos/health.proto
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,9 @@ syntax = "proto3";

package grpc.health.v1;

service Health {
rpc Check(HealthCheckRequest) returns (HealthCheckResponse);
}
service Health { rpc Check(HealthCheckRequest) returns (HealthCheckResponse); }

message HealthCheckRequest {
string service = 1;
}
message HealthCheckRequest { string service = 1; }

message HealthCheckResponse {
enum ServingStatus {
Expand Down
73 changes: 35 additions & 38 deletions protos/lightstreamer.proto
Original file line number Diff line number Diff line change
Expand Up @@ -4,70 +4,67 @@ package lightstreamer;
message Empty {}

message BlockID {
optional uint64 sequence = 1;
optional bytes hash = 2;
optional uint64 sequence = 1;
optional bytes hash = 2;
}

// BlockRange specifies a series of blocks from start to end inclusive.
// Both BlockIDs must be sequences; specification by hash is not yet supported.
message BlockRange {
BlockID start = 1;
BlockID end = 2;
BlockID start = 1;
BlockID end = 2;
}

message LightBlock {
uint32 protoVersion = 1; // the version of this wire format, for storage
uint64 sequence = 2; // the height of this block
bytes hash = 3; // the ID (hash) of this block, same as explorer
bytes previousBlockHash = 4; // the ID (hash) of this block's predecessor
uint32 timestamp = 5; // Unix epoch time when the block was mined
repeated LightTransaction transactions = 6; // zero or more compact transactions from this block
uint64 noteSize = 7; // the size of the notes tree after adding transactions from this block.

uint32 protoVersion = 1; // the version of this wire format, for storage
uint64 sequence = 2; // the height of this block
bytes hash = 3; // the ID (hash) of this block, same as explorer
bytes previousBlockHash = 4; // the ID (hash) of this block's predecessor
uint32 timestamp = 5; // Unix epoch time when the block was mined
repeated LightTransaction transactions =
6; // zero or more compact transactions from this block
uint64 noteSize = 7; // the size of the notes tree after adding transactions
// from this block.
}

message LightTransaction {
uint64 index = 1; // do we need this field?
bytes hash = 2;
uint64 index = 1; // do we need this field?
bytes hash = 2;

repeated LightSpend spends = 4;
repeated LightOutput outputs = 5;
repeated LightSpend spends = 4;
repeated LightOutput outputs = 5;
}


message LightSpend {
bytes nf = 2;
}
message LightSpend { bytes nf = 2; }

message LightOutput {
bytes note = 1; // NoteEncrypted, serialized
bytes note = 1; // NoteEncrypted, serialized
}


message Transaction {
// built, encrypted transaction
bytes data = 1;
// built, encrypted transaction
bytes data = 1;
}

message SendResponse {
bytes hash = 1;
bool accepted = 2;
bytes hash = 1;
bool accepted = 2;
}

message ServerInfo {
string version = 1;
string vendor = 2;
string networkId = 3;
string nodeVersion = 4;
string nodeStatus = 5;
uint64 blockHeight = 6;
string blockHash = 7;
string version = 1;
string vendor = 2;
string networkId = 3;
string nodeVersion = 4;
string nodeStatus = 5;
uint64 blockHeight = 6;
string blockHash = 7;
}

service LightStreamer {
rpc GetServerInfo(Empty) returns (ServerInfo) {}
rpc GetLatestBlock(Empty) returns (BlockID) {}
rpc GetBlock(BlockID) returns (LightBlock) {}
rpc GetBlockRange(BlockRange) returns (stream LightBlock) {}
rpc SendTransaction(Transaction) returns (SendResponse) {}
rpc GetServerInfo(Empty) returns (ServerInfo) {}
rpc GetLatestBlock(Empty) returns (BlockID) {}
rpc GetBlock(BlockID) returns (LightBlock) {}
rpc GetBlockRange(BlockRange) returns (stream LightBlock) {}
rpc SendTransaction(Transaction) returns (SendResponse) {}
}

0 comments on commit 2e20d61

Please sign in to comment.