-
Notifications
You must be signed in to change notification settings - Fork 0
/
message.proto
109 lines (89 loc) · 2.51 KB
/
message.proto
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
syntax = "proto3";
package prb;
import "utils.proto";
import "error.proto";
import "db.proto";
import "data-provider.proto";
import "lifecycle.proto";
import "worker.proto";
enum WalkieRoles {
WR_CLIENT = 0;
WR_DATA_PROVIDER_INT = 1;
WR_DATA_PROVIDER_EXT = 2;
WR_LIFECYCLE_MANAGER = 3;
WR_TRADER = 4;
}
message WalkieSystemInfo {
string hostname = 1;
string peer_id = 2;
WalkieRoles role = 3;
string chain_identity = 4;
string bridge_identity = 5;
AuthStatus auth = 6;
}
message WalkieRpcRequestWrapper {
uint64 created_at = 1;
string nonce = 2;
bytes data = 3;
string method = 4;
}
message WalkieRpcResponseWrapper {
uint64 created_at = 1;
string request_nonce = 2;
string nonce = 3;
bytes data = 4;
bool has_error = 5;
error.ResponseError error = 6;
}
message WalkieBroadcastWrapper {
uint64 created_at = 1;
string nonce = 2;
bytes data = 3;
string method = 4;
}
enum AuthStatus {
AS_NONE = 0;
AS_NEED_AUTH = 1;
AS_GRANTED = 2;
AS_REJECTED = 3;
AS_BLOCKED = 4;
}
enum AuthType {
AT_NONE = 0;
AT_PSK = 1;
AT_WHITE_LIST = 2;
}
message AuthRequest {
AuthType type = 1;
string auth_string = 2;
}
message AuthResponse {
AuthStatus status = 1;
AuthType type = 2;
string peer_id = 3;
}
service WalkieRpc {
// shared
rpc Hello(WalkieSystemInfo) returns (WalkieSystemInfo);
rpc Auth(AuthRequest) returns (AuthResponse);
// data_provider
rpc GetDataProviderInfo(Empty) returns (data_provider.Info);
// data_provider: internal
rpc GetBlobByKey(data_provider.GetBlobByKey) returns (data_provider.RawBlob);
// data_provider: external
rpc WantBlob(data_provider.WantBlob) returns (data_provider.BlobMeta);
rpc GetBlobWithToken(data_provider.GetBlob) returns (data_provider.Blob);
// lifecycle_manager
rpc ListPool(Empty) returns (lifecycle.PoolList);
rpc CreatePool(lifecycle.CreatePool) returns (lifecycle.PoolList);
rpc UpdatePool(lifecycle.UpdatePool) returns (lifecycle.PoolList);
rpc ListWorker(Empty) returns (lifecycle.WorkerList);
rpc CreateWorker(lifecycle.CreateWorker) returns (lifecycle.WorkerList);
rpc UpdateWorker(lifecycle.UpdateWorker) returns (lifecycle.WorkerList);
rpc RestartWorker(lifecycle.UuidQueryRequest) returns (WorkerStateUpdate);
rpc RefreshRaAndRestartWorker(lifecycle.UuidQueryRequest) returns (WorkerStateUpdate);
rpc KickWorker(lifecycle.UuidQueryRequest) returns (WorkerStateUpdate);
rpc GetWorkerStatus(lifecycle.UuidQueryRequest) returns (WorkerStateUpdate);
// trader
}
service WalkieBroadcast {}