From 82b5e8fcbd564f9d87bdec0d5e72a5d2f037f259 Mon Sep 17 00:00:00 2001 From: sukrawidhyawan Date: Fri, 9 Aug 2019 10:28:09 +0800 Subject: [PATCH 1/7] add SetupDatasetTransactionBody --- model/transaction.proto | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/model/transaction.proto b/model/transaction.proto index 504779f..f44b8ee 100644 --- a/model/transaction.proto +++ b/model/transaction.proto @@ -26,8 +26,9 @@ message Transaction { SendMoneyTransactionBody sendMoneyTransactionBody = 16; NodeRegistrationTransactionBody nodeRegistrationTransactionBody = 17; UpdateNodeRegistrationTransactionBody updateNodeRegistrationTransactionBody = 18; + SetupDatasetTransactionBody setupDatasetTransactionBody = 19; } - bytes Signature = 19; + bytes Signature = 20; } message EmptyTransactionBody {} @@ -55,6 +56,16 @@ message UpdateNodeRegistrationTransactionBody { ProofOfOwnership Poown = 5; } +message SetupDatasetTransactionBody { + string AccountSetter = 1; + string AccountReceiver = 2; + string Property = 3; + string Value = 4; + uint64 TimestampStarts = 5; + uint64 TimestampExpires = 6; + uint32 Height = 7; +} + //TODO: shall we move this to a different file? message ProofOfOwnership { bytes MessageBytes = 1; From d1f41d0ef730d84749bf5f8d3f767490263d1b54 Mon Sep 17 00:00:00 2001 From: sukrawidhyawan Date: Mon, 12 Aug 2019 14:42:40 +0800 Subject: [PATCH 2/7] add dataset message represent drom database --- model/datasets.proto | 18 ++++++++++++++++++ model/transaction.proto | 3 +-- 2 files changed, 19 insertions(+), 2 deletions(-) create mode 100644 model/datasets.proto diff --git a/model/datasets.proto b/model/datasets.proto new file mode 100644 index 0000000..715dd1a --- /dev/null +++ b/model/datasets.proto @@ -0,0 +1,18 @@ +syntax="proto3"; + +package model; + +option go_package = "github.com/zoobc/zoobc-core/common/model"; + + +// Dataset represent the dataset data structure stored in the database +message Dataset { + string AccountSetter = 1; + string AccountRecipient = 2; + string Property = 3; + string Value = 4; + uint64 TimestampStarts = 5; + uint64 TimestampExpires = 6; + uint32 Height = 7; + bool Latest = 8; +} diff --git a/model/transaction.proto b/model/transaction.proto index 778852f..7d7e8b4 100644 --- a/model/transaction.proto +++ b/model/transaction.proto @@ -58,12 +58,11 @@ message UpdateNodeRegistrationTransactionBody { message SetupDatasetTransactionBody { string AccountSetter = 1; - string AccountReceiver = 2; + string AccountRecipient = 2; string Property = 3; string Value = 4; uint64 TimestampStarts = 5; uint64 TimestampExpires = 6; - uint32 Height = 7; } //TODO: shall we move this to a different file? From 23b7a471b79f30e32cef2c10941cedbd00642ebd Mon Sep 17 00:00:00 2001 From: sukrawidhyawan Date: Mon, 12 Aug 2019 18:34:10 +0800 Subject: [PATCH 3/7] change field of SetupDatasetTransactionBody --- model/transaction.proto | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/model/transaction.proto b/model/transaction.proto index 7d7e8b4..a958d62 100644 --- a/model/transaction.proto +++ b/model/transaction.proto @@ -57,12 +57,16 @@ message UpdateNodeRegistrationTransactionBody { } message SetupDatasetTransactionBody { + // Account Address that set Dataset string AccountSetter = 1; + // Account Address that got property of Dataset string AccountRecipient = 2; + // Property name string Property = 3; + // Value of property string Value = 4; - uint64 TimestampStarts = 5; - uint64 TimestampExpires = 6; + // How long Dataset will active + uint64 MuchTime = 5; } //TODO: shall we move this to a different file? From 9d6732b35f453df7a22e680ebbe4b75f44cd2723 Mon Sep 17 00:00:00 2001 From: sukrawidhyawan Date: Mon, 19 Aug 2019 13:38:44 +0800 Subject: [PATCH 4/7] update swagger --- documentation.swagger.json | 123 +++++++++++++++++++++++++++++++++++-- 1 file changed, 117 insertions(+), 6 deletions(-) diff --git a/documentation.swagger.json b/documentation.swagger.json index 11b163a..42929b6 100644 --- a/documentation.swagger.json +++ b/documentation.swagger.json @@ -194,7 +194,7 @@ "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/modelHost" + "$ref": "#/definitions/modelHostInfo" } } } @@ -396,6 +396,36 @@ } } }, + "/v1/nodeadmin/getProofOfOwnership": { + "get": { + "tags": [ + "NodeAdminService" + ], + "operationId": "GetProofOfOwnership", + "parameters": [ + { + "type": "string", + "description": "Account Address.", + "name": "AccountAddress", + "in": "query" + }, + { + "type": "string", + "format": "byte", + "name": "Signature", + "in": "query" + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/modelProofOfOwnership" + } + } + } + } + }, "/v1/transaction/GetTransaction": { "get": { "tags": [ @@ -573,6 +603,46 @@ } } }, + "modelBlockIdsResponse": { + "type": "object", + "properties": { + "BlockIds": { + "type": "array", + "items": { + "type": "string", + "format": "int64" + } + } + } + }, + "modelBlocksData": { + "type": "object", + "properties": { + "NextBlocks": { + "type": "array", + "items": { + "$ref": "#/definitions/modelBlock" + } + } + } + }, + "modelChainStatus": { + "type": "object", + "properties": { + "ChainType": { + "type": "integer", + "format": "int32", + "title": "Integer indicating chaintype" + }, + "Height": { + "type": "integer", + "format": "int64" + }, + "LastBlock": { + "$ref": "#/definitions/modelBlock" + } + } + }, "modelEmpty": { "type": "object", "title": "Empty structure to represent empty parameter in proto" @@ -608,6 +678,13 @@ "modelGetBlocksResponse": { "type": "object", "properties": { + "Blocks": { + "type": "array", + "title": "Blocks returned", + "items": { + "$ref": "#/definitions/modelBlock" + } + }, "ChainType": { "type": "integer", "format": "int32", @@ -622,13 +699,34 @@ "type": "integer", "format": "int64", "title": "Blocks height returned from" - }, - "blocks": { + } + } + }, + "modelGetCommonMilestoneBlockIdsResponse": { + "type": "object", + "properties": { + "BlockIds": { "type": "array", - "title": "Blocks returned", "items": { - "$ref": "#/definitions/modelBlock" + "type": "string", + "format": "int64" } + }, + "Last": { + "type": "boolean", + "format": "boolean" + } + } + }, + "modelGetCumulativeDifficultyResponse": { + "type": "object", + "properties": { + "CumulativeDifficulty": { + "type": "string" + }, + "Height": { + "type": "integer", + "format": "int64" } } }, @@ -759,6 +857,20 @@ } } }, + "modelHostInfo": { + "type": "object", + "properties": { + "ChainStatuses": { + "type": "array", + "items": { + "$ref": "#/definitions/modelChainStatus" + } + }, + "Host": { + "$ref": "#/definitions/modelHost" + } + } + }, "modelMempoolTransaction": { "type": "object", "title": "Mempool represent the mempool data structure stored in the database", @@ -901,7 +1013,6 @@ }, "modelProofOfOwnership": { "type": "object", - "title": "TODO: shall we move this to a different file?", "properties": { "MessageBytes": { "type": "string", From 97103eaf0f5df229b3298ad283c0d3f385e9f7a3 Mon Sep 17 00:00:00 2001 From: sukrawidhyawan Date: Mon, 19 Aug 2019 15:59:10 +0800 Subject: [PATCH 5/7] change Dataset field name --- documentation.swagger.json | 16 ++++++++-------- model/datasets.proto | 4 ++-- model/transaction.proto | 4 ++-- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/documentation.swagger.json b/documentation.swagger.json index 42929b6..17a9707 100644 --- a/documentation.swagger.json +++ b/documentation.swagger.json @@ -1036,14 +1036,6 @@ "modelSetupDatasetTransactionBody": { "type": "object", "properties": { - "AccountRecipient": { - "type": "string", - "title": "Account Address that got property of Dataset" - }, - "AccountSetter": { - "type": "string", - "title": "Account Address that set Dataset" - }, "MuchTime": { "type": "string", "format": "uint64", @@ -1053,6 +1045,14 @@ "type": "string", "title": "Property name" }, + "RecipientAccountAddress": { + "type": "string", + "title": "Account Address that got property of Dataset" + }, + "SetterAccountAddress": { + "type": "string", + "title": "Account Address that set Dataset" + }, "Value": { "type": "string", "title": "Value of property" diff --git a/model/datasets.proto b/model/datasets.proto index 715dd1a..7a50b35 100644 --- a/model/datasets.proto +++ b/model/datasets.proto @@ -7,8 +7,8 @@ option go_package = "github.com/zoobc/zoobc-core/common/model"; // Dataset represent the dataset data structure stored in the database message Dataset { - string AccountSetter = 1; - string AccountRecipient = 2; + string SetterAccountAddress = 1; + string RecipientAccountAddress = 2; string Property = 3; string Value = 4; uint64 TimestampStarts = 5; diff --git a/model/transaction.proto b/model/transaction.proto index 3ab6854..da12e97 100644 --- a/model/transaction.proto +++ b/model/transaction.proto @@ -54,9 +54,9 @@ message UpdateNodeRegistrationTransactionBody { message SetupDatasetTransactionBody { // Account Address that set Dataset - string AccountSetter = 1; + string SetterAccountAddress = 1; // Account Address that got property of Dataset - string AccountRecipient = 2; + string RecipientAccountAddress = 2; // Property name string Property = 3; // Value of property From b11f20a68a3171820c339fc935eec943a315d4e9 Mon Sep 17 00:00:00 2001 From: sukrawidhyawan Date: Mon, 19 Aug 2019 16:19:36 +0800 Subject: [PATCH 6/7] change name one of TransactionBody --- documentation.swagger.json | 6 +++--- model/transaction.proto | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/documentation.swagger.json b/documentation.swagger.json index 17a9707..178130b 100644 --- a/documentation.swagger.json +++ b/documentation.swagger.json @@ -1033,7 +1033,7 @@ } } }, - "modelSetupDatasetTransactionBody": { + "modelSetupAccountDatasetTransactionBody": { "type": "object", "properties": { "MuchTime": { @@ -1122,8 +1122,8 @@ "sendMoneyTransactionBody": { "$ref": "#/definitions/modelSendMoneyTransactionBody" }, - "setupDatasetTransactionBody": { - "$ref": "#/definitions/modelSetupDatasetTransactionBody" + "setupAccountDatasetTransactionBody": { + "$ref": "#/definitions/modelSetupAccountDatasetTransactionBody" }, "updateNodeRegistrationTransactionBody": { "$ref": "#/definitions/modelUpdateNodeRegistrationTransactionBody" diff --git a/model/transaction.proto b/model/transaction.proto index da12e97..b7f37b2 100644 --- a/model/transaction.proto +++ b/model/transaction.proto @@ -26,7 +26,7 @@ message Transaction { SendMoneyTransactionBody sendMoneyTransactionBody = 14; NodeRegistrationTransactionBody nodeRegistrationTransactionBody = 15; UpdateNodeRegistrationTransactionBody updateNodeRegistrationTransactionBody = 16; - SetupDatasetTransactionBody setupDatasetTransactionBody = 17; + SetupAccountDatasetTransactionBody setupAccountDatasetTransactionBody = 17; } bytes Signature = 18; } @@ -52,7 +52,7 @@ message UpdateNodeRegistrationTransactionBody { ProofOfOwnership Poown = 4; } -message SetupDatasetTransactionBody { +message SetupAccountDatasetTransactionBody { // Account Address that set Dataset string SetterAccountAddress = 1; // Account Address that got property of Dataset From 582e9a0f27ace410ec3f5a59ae5624e08e8b953e Mon Sep 17 00:00:00 2001 From: sukrawidhyawan Date: Mon, 19 Aug 2019 17:32:33 +0800 Subject: [PATCH 7/7] change dataset to accountDataset --- model/{datasets.proto => accountDatasets.proto} | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename model/{datasets.proto => accountDatasets.proto} (75%) diff --git a/model/datasets.proto b/model/accountDatasets.proto similarity index 75% rename from model/datasets.proto rename to model/accountDatasets.proto index 7a50b35..32fbed5 100644 --- a/model/datasets.proto +++ b/model/accountDatasets.proto @@ -5,8 +5,8 @@ package model; option go_package = "github.com/zoobc/zoobc-core/common/model"; -// Dataset represent the dataset data structure stored in the database -message Dataset { +// AccountDataset represent the account dataset structure stored in the database +message AccountDataset { string SetterAccountAddress = 1; string RecipientAccountAddress = 2; string Property = 3;