-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
75 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
fn main() -> Result<(), Box<dyn std::error::Error>> { | ||
tonic_build::configure() | ||
.build_server(false) | ||
.compile(&["proto/status.proto"], &["proto"])?; | ||
Ok(()) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// Apibara Sink status server | ||
syntax = "proto3"; | ||
|
||
package apibara.sink.v1; | ||
|
||
service Status { | ||
// Get Sink status. | ||
rpc GetStatus(GetStatusRequest) returns (GetStatusResponse); | ||
} | ||
|
||
// Request for the `GetStatus` method. | ||
message GetStatusRequest {} | ||
|
||
// Response for the `GetStatus` method. | ||
message GetStatusResponse { | ||
// The status of the sink. | ||
SinkStatus status = 1; | ||
// The starting block. | ||
optional uint64 starting_block = 2; | ||
// The current block. | ||
optional uint64 current_block = 3; | ||
// The current head of the chain. | ||
optional uint64 head_block = 4; | ||
// The reason why the sink is not running. | ||
optional string reason = 5; | ||
} | ||
|
||
enum SinkStatus { | ||
SINK_STATUS_UNKNOWN = 0; | ||
// The sink is running. | ||
SINK_STATUS_RUNNING = 1; | ||
// The sink has errored. | ||
SINK_STATUS_ERRORED = 2; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters