-
Notifications
You must be signed in to change notification settings - Fork 58
Expand file tree
/
Copy pathadmin.proto
More file actions
149 lines (123 loc) · 4.42 KB
/
Copy pathadmin.proto
File metadata and controls
149 lines (123 loc) · 4.42 KB
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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
syntax = "proto3";
package mostro.admin.v1;
// Admin service for direct communication with Mostro daemon
service AdminService {
// Cancel an order as admin
rpc CancelOrder(CancelOrderRequest) returns (CancelOrderResponse);
// Settle a disputed order as admin
rpc SettleOrder(SettleOrderRequest) returns (SettleOrderResponse);
// Add a new dispute solver
rpc AddSolver(AddSolverRequest) returns (AddSolverResponse);
// Take a dispute for resolution
rpc TakeDispute(TakeDisputeRequest) returns (TakeDisputeResponse);
// Backward compatibility only: password is ignored; SQLite is not encrypted
rpc ValidateDbPassword(ValidateDbPasswordRequest) returns (ValidateDbPasswordResponse);
// Get Mostro version
rpc GetVersion(GetVersionRequest) returns (GetVersionResponse);
// Enable/disable maintenance (drain) mode. Loopback peers only.
// While enabled the daemon rejects new-order/take-buy/take-sell with
// CantDo(maintenance_mode); everything on existing orders keeps working.
rpc SetMaintenanceMode(SetMaintenanceModeRequest) returns (SetMaintenanceModeResponse);
// Maintenance flag plus the counters of what is still bound to the
// connected Lightning node (docs/MAINTENANCE_MODE_LN_MIGRATION.md §1.3).
rpc GetMaintenanceStatus(GetMaintenanceStatusRequest) returns (GetMaintenanceStatusResponse);
}
// Request to cancel an order
message CancelOrderRequest {
string order_id = 1;
optional string request_id = 2;
// When true the daemon refuses any order that is not still pre-trade
// (pending / waiting-taker-bond) instead of falling through to the
// dispute-resolution cancel. Operator tooling that means "cancel this
// pending order" must set it so a mistyped id can never close a dispute.
optional bool pretrade_only = 3;
}
// Response for order cancellation
message CancelOrderResponse {
bool success = 1;
optional string error_message = 2;
}
// Request to settle a disputed order
message SettleOrderRequest {
string order_id = 1;
optional string request_id = 2;
}
// Response for order settlement
message SettleOrderResponse {
bool success = 1;
optional string error_message = 2;
}
// Request to add a new solver
message AddSolverRequest {
string solver_pubkey = 1;
optional string request_id = 2;
}
// Response for adding a solver
message AddSolverResponse {
bool success = 1;
optional string error_message = 2;
}
// Request to take a dispute
message TakeDisputeRequest {
string dispute_id = 1;
optional string request_id = 2;
}
// Response for taking a dispute
message TakeDisputeResponse {
bool success = 1;
optional string error_message = 2;
}
// Backward compatibility: `password` is ignored (no DB encryption)
message ValidateDbPasswordRequest {
string password = 1;
}
message ValidateDbPasswordResponse {
bool success = 1;
optional string error_message = 2;
}
// Get Mostro version
message GetVersionRequest {}
message GetVersionResponse {
string version = 1;
}
message SetMaintenanceModeRequest {
bool enabled = 1;
optional string reason = 2;
optional string request_id = 3;
}
message SetMaintenanceModeResponse {
bool success = 1;
optional string error_message = 2;
}
message GetMaintenanceStatusRequest {
optional string request_id = 1;
}
// What is still bound to the connected Lightning node.
message DrainCounters {
// A: orders with a hold invoice in a non-terminal status
uint32 escrowed_orders = 1;
// B: buyer payouts in flight (settled-hold-invoice + payout hash)
uint32 inflight_payouts = 2;
// C: dev-fee payouts claimed or in flight (marker set, not yet paid);
// a merely unpaid dev fee is not node-bound and is not counted
uint32 inflight_dev_fees = 3;
// D: bond hold invoices still open (requested / locked)
uint32 open_bonds = 4;
// E: slashed-bond payouts in flight (pending-payout + payout hash)
uint32 pending_bond_payouts = 5;
// Informational: pending orders hold no escrow and do not block a switch
uint32 pending_orders = 6;
}
message GetMaintenanceStatusResponse {
bool enabled = 1;
optional string reason = 2;
// unix seconds of the last enable; absent while disabled
optional int64 since = 3;
DrainCounters counters = 4;
// true when counters A..E are all zero
bool drained = 5;
// identity pubkey of the connected Lightning node (empty if unknown)
string ln_node_pubkey = 6;
// pubkey persisted by the boot guard (Phase 4); absent until first written
optional string stored_ln_node_pubkey = 7;
}