diff --git a/documentation.swagger.json b/documentation.swagger.json index 6a814bc..bcdf208 100644 --- a/documentation.swagger.json +++ b/documentation.swagger.json @@ -360,10 +360,10 @@ "operationId": "GetNodeRegistrations", "parameters": [ { - "type": "boolean", - "format": "boolean", - "description": "Fetch Node Registries based on queue status \ntrue : will retrieve node registries that still pending\nfalse: will retrieve node registries that already registered.", - "name": "Queued", + "type": "integer", + "format": "int64", + "description": "Fetch Node Registries based on queue status \n2 : will retrieve node registries that have been deleted\n1 : will retrieve node registries that still pending\n0: will retrieve node registries that already registered.", + "name": "RegistrationStatus", "in": "query" }, { @@ -817,9 +817,6 @@ "modelClaimNodeRegistrationTransactionBody": { "type": "object", "properties": { - "AccountAddress": { - "type": "string" - }, "NodePublicKey": { "type": "string", "format": "byte" @@ -1241,13 +1238,13 @@ "type": "string", "format": "byte" }, - "Queued": { - "type": "boolean", - "format": "boolean" - }, "RegistrationHeight": { "type": "integer", "format": "int64" + }, + "RegistrationStatus": { + "type": "integer", + "format": "int64" } } }, @@ -1568,10 +1565,10 @@ "properties": { "LockedBalance": { "type": "string", - "format": "int64" + "format": "int64", + "title": "Funds to be locked to register the node" }, "NodeAddress": { - "title": "Funds to be locked to register the node", "$ref": "#/definitions/modelNodeAddress" }, "NodePublicKey": { @@ -1621,5 +1618,19 @@ } } } + }, + "x-stream-definitions": { + "modelGetNodeHardwareResponse": { + "properties": { + "error": { + "$ref": "#/definitions/runtimeStreamError" + }, + "result": { + "$ref": "#/definitions/modelGetNodeHardwareResponse" + } + }, + "title": "Stream result of modelGetNodeHardwareResponse", + "type": "object" + } } } diff --git a/model/nodeRegistration.proto b/model/nodeRegistration.proto index be48a26..801374f 100644 --- a/model/nodeRegistration.proto +++ b/model/nodeRegistration.proto @@ -16,7 +16,7 @@ message NodeRegistration { uint32 RegistrationHeight = 4; NodeAddress NodeAddress = 5; int64 LockedBalance = 6 [jstype = JS_STRING]; - bool Queued = 7; + uint32 RegistrationStatus = 7; bool Latest = 8; uint32 Height = 9; } @@ -24,9 +24,10 @@ message NodeRegistration { // GetNodeRegisterRequest create request to get a list of node registry message GetNodeRegistrationsRequest { /* Fetch Node Registries based on queue status - true : will retrieve node registries that still pending - false: will retrieve node registries that already registered*/ - bool Queued = 1; + 2 : will retrieve node registries that have been deleted + 1 : will retrieve node registries that still pending + 0: will retrieve node registries that already registered*/ + uint32 RegistrationStatus = 1; // Fetch Node Registries when registration height is greater than or equal to uint32 MinRegistrationHeight = 2; // Fetch Node Registries when registration height is less than or equal to @@ -53,3 +54,12 @@ message GetNodeRegistrationRequest { message GetNodeRegistrationResponse { NodeRegistration NodeRegistration = 1; } + +enum NodeRegistrationState { + // NodeRegistered 'registred' node status (= 0): a node in node registry with this status is registered + NodeRegistered = 0; + // NodeQueued 'queued' node status (= 1): a node in node registry with this status is queued, or 'pending registered' + NodeQueued = 1; + // NodeDeleted 'deleted' node status (= 2): a node in node registry with this status is marked as deleted + NodeDeleted = 2; +} \ No newline at end of file diff --git a/model/transaction.proto b/model/transaction.proto index 6d7e3f6..68ebc2b 100644 --- a/model/transaction.proto +++ b/model/transaction.proto @@ -1,4 +1,4 @@ -syntax="proto3"; +syntax = "proto3"; package model; option go_package = "github.com/zoobc/zoobc-core/common/model"; @@ -8,18 +8,17 @@ import "model/pagination.proto"; import "model/batchReceipt.proto"; import "model/nodeRegistration.proto"; - // Transaction represent the transaction data structure stored in the database message Transaction { uint32 Version = 1; - int64 ID = 2 [jstype = JS_STRING]; - int64 BlockID = 3 [jstype = JS_STRING]; + int64 ID = 2 [ jstype = JS_STRING ]; + int64 BlockID = 3 [ jstype = JS_STRING ]; uint32 Height = 4; string SenderAccountAddress = 5; string RecipientAccountAddress = 6; uint32 TransactionType = 7; - int64 Fee = 8 [jstype = JS_STRING]; - int64 Timestamp = 9 [jstype = JS_STRING]; + int64 Fee = 8 [ jstype = JS_STRING ]; + int64 Timestamp = 9 [ jstype = JS_STRING ]; bytes TransactionHash = 10; uint32 TransactionBodyLength = 11; bytes TransactionBodyBytes = 12; @@ -47,7 +46,7 @@ enum TransactionType { NodeRegistrationTransaction = 2; // in bytes: []byte{2,1,0,0} UpdateNodeRegistrationTransaction = 258; - // in bytes: []byte{2,2,0,0} + // in bytes: []byte{2,2,0,0} RemoveNodeRegistrationTransaction = 514; // in bytes: []byte{2,3,0,0} ClaimNodeRegistrationTransaction = 770; @@ -59,64 +58,61 @@ enum TransactionType { message EmptyTransactionBody {} -message SendMoneyTransactionBody { - int64 Amount = 1 [jstype = JS_STRING]; +message SendMoneyTransactionBody { + int64 Amount = 1 [ jstype = JS_STRING ]; } message NodeRegistrationTransactionBody { - bytes NodePublicKey = 1; + bytes NodePublicKey = 1; string AccountAddress = 2; // Funds to be locked to register the node NodeAddress NodeAddress = 3; - int64 LockedBalance = 4 [jstype = JS_STRING]; + int64 LockedBalance = 4 [ jstype = JS_STRING ]; // Proof of ownership (message + signature) ProofOfOwnership Poown = 5; } message UpdateNodeRegistrationTransactionBody { - bytes NodePublicKey = 1; - // Funds to be locked to register the node + bytes NodePublicKey = 1; NodeAddress NodeAddress = 2; - int64 LockedBalance = 3 [jstype = JS_STRING]; + // Funds to be locked to register the node + int64 LockedBalance = 3 [ jstype = JS_STRING ]; // Proof of ownership (message + signature) ProofOfOwnership Poown = 4; } -message RemoveNodeRegistrationTransactionBody { - bytes NodePublicKey = 1; +message RemoveNodeRegistrationTransactionBody { bytes NodePublicKey = 1; } + +message ClaimNodeRegistrationTransactionBody { + bytes NodePublicKey = 1; + // Proof of ownership (message + signature) + ProofOfOwnership Poown = 2; } message SetupAccountDatasetTransactionBody { - // Account Address that set Dataset + // Account Address that set Dataset string SetterAccountAddress = 1; // Account Address that got property of Dataset string RecipientAccountAddress = 2; // Property name string Property = 3; - // Value of property + // Value of property string Value = 4; // How long Dataset will active in second - uint64 MuchTime = 5 [jstype = JS_STRING]; + uint64 MuchTime = 5 [ jstype = JS_STRING ]; } message RemoveAccountDatasetTransactionBody { - // Account Address that set Dataset + // Account Address that set Dataset string SetterAccountAddress = 1; // Account Address that got property of Dataset string RecipientAccountAddress = 2; // Property name string Property = 3; - // Value of property + // Value of property string Value = 4; } -message ClaimNodeRegistrationTransactionBody { - bytes NodePublicKey = 1; - string AccountAddress = 2; - // Proof of ownership (message + signature) - ProofOfOwnership Poown = 3; -} - //------------ // P2P Content //------------ @@ -124,22 +120,22 @@ message ClaimNodeRegistrationTransactionBody { // GetTransactionRequest return model.Transaction message GetTransactionRequest { // Fetch Transaction by its ID - int64 ID = 1 [jstype = JS_STRING]; + int64 ID = 1 [ jstype = JS_STRING ]; } // GetTransactions return GetTransactionsResponse message GetTransactionsRequest { string AccountAddress = 1; uint32 Height = 2; - int64 TimestampStart = 3 [jstype = JS_STRING]; - int64 TimestampEnd = 4 [jstype = JS_STRING]; + int64 TimestampStart = 3 [ jstype = JS_STRING ]; + int64 TimestampEnd = 4 [ jstype = JS_STRING ]; uint32 TransactionType = 5; Pagination Pagination = 6; } message GetTransactionsResponse { // Number of transactions in total - uint64 Total = 1 [jstype = JS_STRING]; + uint64 Total = 1 [ jstype = JS_STRING ]; // Transaction transactions returned repeated Transaction Transactions = 2; } @@ -149,9 +145,7 @@ message PostTransactionRequest { // Signed transaction bytes bytes TransactionBytes = 1; } -message PostTransactionResponse { - Transaction Transaction = 1; -} +message PostTransactionResponse { Transaction Transaction = 1; } // SendTransactionRequest request in p2pCommunication service message SendTransactionRequest { @@ -159,6 +153,4 @@ message SendTransactionRequest { int32 ChainType = 2; bytes SenderPublicKey = 3; } -message SendTransactionResponse { - BatchReceipt BatchReceipt = 1; -} +message SendTransactionResponse { BatchReceipt BatchReceipt = 1; }