seperated non vm related services into general protofile shared common proto for types like Empty rename proto packages top level crate export for convenient imports
91 lines
2.0 KiB
Protocol Buffer
91 lines
2.0 KiB
Protocol Buffer
syntax = "proto3";
|
|
package general_proto;
|
|
|
|
import "sgx/app.proto";
|
|
import "shared/common.proto";
|
|
import "snp/vm.proto";
|
|
|
|
message AccountBalance {
|
|
uint64 balance = 1;
|
|
uint64 tmp_locked = 2;
|
|
}
|
|
|
|
message ReportNodeReq {
|
|
string admin_pubkey = 1;
|
|
string node_pubkey = 2;
|
|
string contract = 3;
|
|
string reason = 4;
|
|
}
|
|
|
|
message ListOperatorsResp {
|
|
string pubkey = 1;
|
|
uint64 escrow = 2;
|
|
string email = 3;
|
|
uint64 app_nodes = 4;
|
|
uint64 vm_nodes = 5;
|
|
uint64 reports = 6;
|
|
}
|
|
|
|
message InspectOperatorResp {
|
|
ListOperatorsResp operator = 1;
|
|
repeated vm_proto.VmNodeListResp vm_nodes = 2;
|
|
repeated app_proto.AppNodeListResp app_nodes = 3;
|
|
}
|
|
|
|
message RegOperatorReq {
|
|
string pubkey = 1;
|
|
uint64 escrow = 2;
|
|
string email = 3;
|
|
}
|
|
|
|
message KickReq {
|
|
string operator_wallet = 1;
|
|
string contract_uuid = 2;
|
|
string reason = 3;
|
|
}
|
|
|
|
message KickResp {
|
|
uint64 nano_lp = 1;
|
|
}
|
|
|
|
message BanUserReq {
|
|
string operator_wallet = 1;
|
|
string user_wallet = 2;
|
|
}
|
|
|
|
message AirdropReq {
|
|
string pubkey = 1;
|
|
uint64 tokens = 2;
|
|
}
|
|
|
|
message SlashReq {
|
|
string pubkey = 1;
|
|
uint64 tokens = 2;
|
|
}
|
|
|
|
message Account {
|
|
string pubkey = 1;
|
|
uint64 balance = 2;
|
|
uint64 tmp_locked = 3;
|
|
}
|
|
|
|
|
|
service BrainGeneralCli {
|
|
rpc GetBalance (common_proto.Pubkey) returns (AccountBalance);
|
|
|
|
rpc ReportNode (ReportNodeReq) returns (common_proto.Empty);
|
|
rpc ListOperators (common_proto.Empty) returns (stream ListOperatorsResp);
|
|
rpc InspectOperator (common_proto.Pubkey) returns (InspectOperatorResp);
|
|
rpc RegisterOperator (RegOperatorReq) returns (common_proto.Empty);
|
|
rpc KickContract (KickReq) returns (KickResp);
|
|
rpc BanUser (BanUserReq) returns (common_proto.Empty);
|
|
|
|
// admin commands
|
|
rpc Airdrop (AirdropReq) returns (common_proto.Empty);
|
|
rpc Slash (SlashReq) returns (common_proto.Empty);
|
|
rpc ListAccounts (common_proto.Empty) returns (stream Account);
|
|
rpc ListAllVmContracts (common_proto.Empty)
|
|
returns (stream vm_proto.VmContract);
|
|
rpc ListAllAppContracts (common_proto.Empty)
|
|
returns (stream app_proto.AppContract);
|
|
} |