Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 24 additions & 13 deletions documentation.swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
{
Expand Down Expand Up @@ -817,9 +817,6 @@
"modelClaimNodeRegistrationTransactionBody": {
"type": "object",
"properties": {
"AccountAddress": {
"type": "string"
},
"NodePublicKey": {
"type": "string",
"format": "byte"
Expand Down Expand Up @@ -1241,13 +1238,13 @@
"type": "string",
"format": "byte"
},
"Queued": {
"type": "boolean",
"format": "boolean"
},
"RegistrationHeight": {
"type": "integer",
"format": "int64"
},
"RegistrationStatus": {
"type": "integer",
"format": "int64"
}
}
},
Expand Down Expand Up @@ -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": {
Expand Down Expand Up @@ -1621,5 +1618,19 @@
}
}
}
},
"x-stream-definitions": {
"modelGetNodeHardwareResponse": {
"properties": {
"error": {
"$ref": "#/definitions/runtimeStreamError"
},
"result": {
"$ref": "#/definitions/modelGetNodeHardwareResponse"
}
},
"title": "Stream result of modelGetNodeHardwareResponse",
"type": "object"
}
}
}
18 changes: 14 additions & 4 deletions model/nodeRegistration.proto
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,18 @@ 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;
}

// 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
Expand All @@ -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;
}
68 changes: 30 additions & 38 deletions model/transaction.proto
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
syntax="proto3";
syntax = "proto3";

package model;
option go_package = "github.com/zoobc/zoobc-core/common/model";
Expand All @@ -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;
Expand Down Expand Up @@ -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;
Expand All @@ -59,87 +58,84 @@ 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
//------------

// 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;
}
Expand All @@ -149,16 +145,12 @@ 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 {
bytes TransactionBytes = 1;
int32 ChainType = 2;
bytes SenderPublicKey = 3;
}
message SendTransactionResponse {
BatchReceipt BatchReceipt = 1;
}
message SendTransactionResponse { BatchReceipt BatchReceipt = 1; }