Commit d3a5bdd9 authored by vicotor's avatar vicotor

update nodemanager

parent e34f3159
...@@ -9,40 +9,31 @@ import "base/gogo.proto"; ...@@ -9,40 +9,31 @@ import "base/gogo.proto";
option (gogoproto.messagename_all) = true; option (gogoproto.messagename_all) = true;
message MetaTxBase { enum TaskType {
// tx_type used to type tx. SystemTask = 0;
uint32 tx_type = 1; ComputeTask = 1;
CustomTask = 2;
BigInt chain_id = 2[(gogoproto.customtype) = "github.com/CaduceusMetaverseProtocol/MetaTypes/types.BigInt"];
uint64 nonce = 3;
BigInt gas_price = 4[(gogoproto.customtype) = "github.com/CaduceusMetaverseProtocol/MetaTypes/types.BigInt"];
uint64 gas = 5;
Address to = 6[(gogoproto.customtype) = "github.com/CaduceusMetaverseProtocol/MetaTypes/types.Address"];
BigInt value = 7[(gogoproto.customtype) = "github.com/CaduceusMetaverseProtocol/MetaTypes/types.BigInt"];
bytes data = 8;
AccessList access_list = 9;
BigInt v = 10[(gogoproto.customtype) = "github.com/CaduceusMetaverseProtocol/MetaTypes/types.BigInt"];
BigInt r = 11[(gogoproto.customtype) = "github.com/CaduceusMetaverseProtocol/MetaTypes/types.BigInt"];
BigInt s = 12[(gogoproto.customtype) = "github.com/CaduceusMetaverseProtocol/MetaTypes/types.BigInt"];
Address from = 13[(gogoproto.customtype) = "github.com/CaduceusMetaverseProtocol/MetaTypes/types.Address"];
//google.protobuf.Timestamp receive_time = 14; `protobuf:"bytes,1,opt,name=Name,proto3"`
// expire block used to ignore execute tx when it is packaged in expired_block.
BigInt expired_block = 15[(gogoproto.customtype) = "github.com/CaduceusMetaverseProtocol/MetaTypes/types.BigInt"];
Hash tx_hash = 16[(gogoproto.customtype) = "github.com/CaduceusMetaverseProtocol/MetaTypes/types.Hash"];
} }
enum BillingMethod {
BillingFree = 1;
message MetaBigInt { BillingByTime = 2;
BigInt value = 1[(gogoproto.customtype) = "github.com/CaduceusMetaverseProtocol/MetaTypes/types.BigInt"]; BillingByDuration = 3;
} }
message MetaHash{ message TaskContent {
Hash hash = 1 [(gogoproto.customtype) = "github.com/CaduceusMetaverseProtocol/MetaTypes/types.Hash"]; string task_id = 1;
TaskType task_type = 2;
bytes task_param = 3;
uint64 max_execute_duration = 4;
ModelContent model = 5;
} }
message MetaAddress { message ModelContent {
Address address = 1[(gogoproto.customtype) = "github.com/CaduceusMetaverseProtocol/MetaTypes/types.Address"]; string model_name = 1;
string model_type = 2; // 文生文/文生图等等
string model_instance = 3;
string require_power = 4;
BillingMethod billing = 5;
uint64 cost = 6;
} }
...@@ -2,16 +2,61 @@ syntax = "proto3"; ...@@ -2,16 +2,61 @@ syntax = "proto3";
package nodemanager.v1; package nodemanager.v1;
import "base/v1/meta.proto"; import "base/v1/odysseus.proto";
// The standard BatchGet request definition.
message BatchCheckTxRequest { message WorkerMessage {
repeated base.v1.MetaTxBase txs = 1; oneof message {
HeartbeatResponse heartbeat_response = 1;
SubmitTaskResult submit_task_result = 2;
StatusResp status_resp = 3;
}
}
message ManagerMessage {
oneof message {
HeartbeatRequest heartbeat_request = 1;
PushTaskMessage push_task_message = 2;
ProofTaskResult proof_task_result = 3;
}
}
message HeartbeatRequest {
}
message HeartbeatResponse {
}
message StatusResp {
uint64 remain_power = 1;
uint remain_device = 2; // 剩余
} }
message PushTaskMessage {
}
message SubmitTaskResult {
}
// The standard BatchGet response definition. message ProofTaskResult {
message BatchCheckTxResponse {
// The retrieved shelves.
repeated base.v1.MetaProofTx checked_txs = 1;
} }
message DispatchTaskRequest {
string task_type = 1;
bytes task_data = 2;
string worker = 3;
}
message DeviceInfo {
// device info for gpu
string device_name = 1;
string device_type = 2;
uint64 device_power = 3;
}
message WorkerContent {
string worker_id = 1;
string worker_pubkey = 2;
repeated DeviceInfo devices = 3;
}
\ No newline at end of file
...@@ -4,7 +4,7 @@ package nodemanager.v1; ...@@ -4,7 +4,7 @@ package nodemanager.v1;
import "nodemanager/v1/request_response.proto"; import "nodemanager/v1/request_response.proto";
service NodeManagerService { service NodeManagerService {
rpc RegisterWorker(stream WorkerMessage) returns (stream ManagerMessage) {}
rpc BatchCheckTx(BatchCheckTxRequest) returns (BatchCheckTxResponse) {} rpc DispatchTask(DispatchTaskRequest) returns () {}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment