publicrpc.proto 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. syntax = "proto3";
  2. package publicrpc.v1;
  3. option go_package = "github.com/certusone/wormhole/node/pkg/proto/publicrpc/v1;publicrpcv1";
  4. import "gossip/v1/gossip.proto";
  5. import "google/api/annotations.proto";
  6. enum ChainID {
  7. CHAIN_ID_UNSPECIFIED = 0;
  8. CHAIN_ID_SOLANA = 1;
  9. CHAIN_ID_ETHEREUM = 2;
  10. CHAIN_ID_TERRA = 3;
  11. CHAIN_ID_BSC = 4;
  12. }
  13. // MessageID is a VAA's globally unique identifier (see data availability design document).
  14. message MessageID {
  15. // Emitter chain ID.
  16. ChainID emitter_chain = 1;
  17. // Hex-encoded (without leading 0x) emitter address.
  18. string emitter_address = 2;
  19. // Sequence number for (emitter_chain, emitter_address).
  20. int64 sequence = 3;
  21. }
  22. // PublicRPCService service exposes endpoints to be consumed externally; GUIs, historical record keeping, etc.
  23. service PublicRPCService {
  24. // GetLastHeartbeats returns the last heartbeat received for each guardian node in the
  25. // node's active guardian set. Heartbeats received by nodes not in the guardian set are ignored.
  26. // The heartbeat value is null if no heartbeat has yet been received.
  27. rpc GetLastHeartbeats (GetLastHeartbeatsRequest) returns (GetLastHeartbeatsResponse) {
  28. option (google.api.http) = {
  29. get: "/v1/heartbeats"
  30. };
  31. }
  32. rpc GetSignedVAA (GetSignedVAARequest) returns (GetSignedVAAResponse) {
  33. option (google.api.http) = {
  34. get: "/v1/signed_vaa/{message_id.emitter_chain}/{message_id.emitter_address}/{message_id.sequence}"
  35. };
  36. }
  37. rpc GetCurrentGuardianSet (GetCurrentGuardianSetRequest) returns (GetCurrentGuardianSetResponse) {
  38. option (google.api.http) = {
  39. get: "/v1/guardianset/current"
  40. };
  41. }
  42. }
  43. message GetSignedVAARequest {
  44. MessageID message_id = 1;
  45. }
  46. message GetSignedVAAResponse {
  47. bytes vaa_bytes = 1;
  48. }
  49. message GetLastHeartbeatsRequest {
  50. }
  51. message GetLastHeartbeatsResponse {
  52. message Entry {
  53. // Verified, hex-encoded (with leading 0x) guardian address. This is the guardian address
  54. // which signed this heartbeat. The GuardianAddr field inside the heartbeat
  55. // is NOT verified - remote nodes can put arbitrary data in it.
  56. string verified_guardian_addr = 1;
  57. // Base58-encoded libp2p node address that sent this heartbeat, used to
  58. // distinguish between multiple nodes running for the same guardian.
  59. string p2p_node_addr = 2;
  60. // Raw heartbeat received from the network. Data is only as trusted
  61. // as the guardian node that sent it - none of the fields are verified.
  62. gossip.v1.Heartbeat raw_heartbeat = 3;
  63. }
  64. repeated Entry entries = 1;
  65. }
  66. message GetCurrentGuardianSetRequest {
  67. }
  68. message GetCurrentGuardianSetResponse {
  69. GuardianSet guardian_set = 1;
  70. }
  71. message GuardianSet {
  72. // Guardian set index
  73. uint32 index = 1;
  74. // List of guardian addresses as human-readable hex-encoded (leading 0x) addresses.
  75. repeated string addresses = 2;
  76. }