73 lines
2.2 KiB
Protocol Buffer
73 lines
2.2 KiB
Protocol Buffer
syntax = "proto3";
|
|
|
|
package publicrpc.v1;
|
|
|
|
option go_package = "github.com/certusone/wormhole/bridge/pkg/proto/publicrpc/v1;publicrpcv1";
|
|
|
|
import "gossip/v1/gossip.proto";
|
|
import "google/api/annotations.proto";
|
|
|
|
enum EmitterChain {
|
|
CHAIN_ID_UNKNOWN = 0;
|
|
CHAIN_ID_SOLANA = 1;
|
|
CHAIN_ID_ETHEREUM = 2;
|
|
CHAIN_ID_TERRA = 3;
|
|
CHAIN_ID_BSC = 4;
|
|
}
|
|
|
|
// MessageID is a VAA's globally unique identifier (see data availability design document).
|
|
message MessageID {
|
|
// Emitter chain ID.
|
|
EmitterChain emitter_chain = 1;
|
|
// Hex-encoded emitter address.
|
|
string emitter_address = 2;
|
|
// Sequence number for (emitter_chain, emitter_address).
|
|
int64 sequence = 3;
|
|
}
|
|
|
|
// Publicrpc service exposes endpoints to be consumed externally; GUIs, historical record keeping, etc.
|
|
service Publicrpc {
|
|
// GetRawHeartbeats rpc endpoint returns a stream of the p2p heartbeat messages received.
|
|
// The GetRawHeartbeats stream will include all messages received by the guardian,
|
|
// without any filtering or verification of message content.
|
|
rpc GetRawHeartbeats (GetRawHeartbeatsRequest) returns (stream gossip.v1.Heartbeat) {
|
|
option (google.api.http) = {
|
|
get: "/v1/heartbeats:stream_raw"
|
|
};
|
|
};
|
|
|
|
// GetLastHeartbeats returns the last heartbeat received for each guardian node in the
|
|
// node's active guardian set. Heartbeats received by nodes not in the guardian set are ignored.
|
|
// The heartbeat value is null if no heartbeat has yet been received.
|
|
rpc GetLastHeartbeats (GetLastHeartbeatRequest) returns (GetLastHeartbeatResponse) {
|
|
option (google.api.http) = {
|
|
get: "/v1/heartbeats"
|
|
};
|
|
}
|
|
|
|
rpc GetSignedVAA (GetSignedVAARequest) returns (GetSignedVAAResponse) {
|
|
option (google.api.http) = {
|
|
get: "/v1/signed_vaa/{message_id.emitter_chain}/{message_id.emitter_address}/{message_id.sequence}"
|
|
};
|
|
}
|
|
}
|
|
|
|
message GetRawHeartbeatsRequest {
|
|
}
|
|
|
|
message GetSignedVAARequest {
|
|
MessageID message_id = 1;
|
|
}
|
|
|
|
message GetSignedVAAResponse {
|
|
bytes vaa_bytes = 1;
|
|
}
|
|
|
|
message GetLastHeartbeatRequest {
|
|
}
|
|
|
|
message GetLastHeartbeatResponse {
|
|
// Mapping of hex-encoded guardian addresses to raw heartbeat messages.
|
|
map<string, gossip.v1.Heartbeat> raw_heartbeats = 1;
|
|
}
|