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

feat: platform status endpoint #2088

Merged
merged 18 commits into from
Aug 30, 2024
Merged
Changes from 1 commit
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
90 changes: 90 additions & 0 deletions packages/dapi-grpc/protos/platform/v0/platform.proto
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ service Platform {
rpc getPrefundedSpecializedBalance(GetPrefundedSpecializedBalanceRequest) returns (GetPrefundedSpecializedBalanceResponse);
rpc getTotalCreditsInPlatform(GetTotalCreditsInPlatformRequest) returns (GetTotalCreditsInPlatformResponse);
rpc getPathElements(GetPathElementsRequest) returns (GetPathElementsResponse);
rpc getStatus(GetStatusRequest) returns (GetStatusResponse);
}

// Proof message includes cryptographic proofs for validating responses
Expand Down Expand Up @@ -1001,3 +1002,92 @@ message GetPathElementsResponse {
GetPathElementsResponseV0 v0 = 1;
}
}

message GetStatusRequest {
message GetStatusRequestV0 {
}

oneof version { GetStatusRequestV0 v0 = 1; }
}


message GetStatusResponse {
message GetStatusResponseV0 {
message Version {
message Software {
string dapi = 1;
string drive = 2;
string tenderdash = 3;
}

message Protocol {
message Tenderdash {
int32 p2p = 1;
int32 block = 2;
}

message Drive {
int32 max = 3;
int32 current = 4;
}

Tenderdash tenderdash = 1;
Drive drive = 2;
}

Software software = 1;
Protocol protocol = 2;
}

message Time {
uint64 local = 1;
uint64 block = 2;
uint32 epoch = 3;
}

message Node {
string id = 1;
bytes pro_tx_hash = 2;
}

message Chain {
bool catching_up = 1;
bytes latest_block_hash = 2;
bytes latest_app_hash = 3;
uint64 latest_block_height = 4;
string latest_block_time = 5;
bytes earliest_block_hash = 6;
bytes earliest_app_hash = 7;
uint64 earliest_block_height = 8;
string earliest_block_time = 9;
uint64 max_peer_block_height = 10;
// Latest known core height in consensus
uint32 core_chain_locked_height = 11;
}

message Network {
string chain_id = 1;
uint32 peers_count = 2;
bool listening = 3;
}

message StateSync {
uint64 total_synced_time = 1;
uint64 remaining_time = 2;
uint32 total_snapshots = 3;
uint64 chunk_process_avg_time = 4;
uint64 snapshot_height = 5;
uint64 snapshot_chunks_count = 6;
uint64 backfilled_blocks = 7;
uint64 backfill_blocks_total = 8;
}

Version version = 1;
Node node = 2;
Chain chain = 3;
StateSync state_sync = 4;
Time time = 5;
}

oneof version { GetStatusResponseV0 v0 = 1; }
}