As part of open sourcing the software product, we should consider that loyalty points are not the best language. Switching to "credits" makes sense from a lot of points of view. At the same time, this change allows an achitectural change towards slots. Slots allow daemon resources to get booked based on the HW ratio configured in the daemon config.
94 lines
2.0 KiB
Protocol Buffer
94 lines
2.0 KiB
Protocol Buffer
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
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_credits = 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);
|
|
}
|