Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

format .proto file #45

Merged
merged 1 commit into from
Sep 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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) {}
}
Loading