Skip to content

128 proof of ownership schema #35

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Aug 16, 2019
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
31 changes: 30 additions & 1 deletion documentation.swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
Expand Down Expand Up @@ -901,7 +931,6 @@
},
"modelProofOfOwnership": {
"type": "object",
"title": "TODO: shall we move this to a different file?",
"properties": {
"MessageBytes": {
"type": "string",
Expand Down
22 changes: 22 additions & 0 deletions model/proofOfOwnership.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
syntax="proto3";

package model;

option go_package = "github.com/zoobc/zoobc-core/common/model";

message ProofOfOwnership {
bytes MessageBytes = 1;
bytes Signature = 2;
}

message ProofOfOwnershipMessage {
string AccountAddress = 1;
bytes BlockHash = 2;
uint32 BlockHeight = 3;
}

message GetProofOfOwnershipRequest {
// Account Address
string AccountAddress = 1;
bytes Signature = 2;
}
16 changes: 2 additions & 14 deletions model/transaction.proto
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ syntax="proto3";
package model;

option go_package = "github.com/zoobc/zoobc-core/common/model";
import "model/proofOfOwnership.proto";


// Transaction represent the transaction data structure stored in the database
message Transaction {
Expand Down Expand Up @@ -49,20 +51,6 @@ message UpdateNodeRegistrationTransactionBody {
ProofOfOwnership Poown = 4;
}

//TODO: shall we move this to a different file?
message ProofOfOwnership {
bytes MessageBytes = 1;
bytes Signature = 2;
}

//TODO: shall we move this to a different file?
message ProofOfOwnershipMessage {
uint32 AccountType = 1;
string AccountAddress = 2;
bytes BlockHash = 3;
uint32 BlockHeight = 4;
}


//------------
// P2P Content
Expand Down
17 changes: 17 additions & 0 deletions service/proofOfOwnership.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
syntax="proto3";

package service;

option go_package = "github.com/zoobc/zoobc-core/common/service";

import "model/proofOfOwnership.proto";
import "google/api/annotations.proto";

// Generate ProofOfOwnership
service NodeAdminService {
rpc GetProofOfOwnership(model.GetProofOfOwnershipRequest) returns (model.ProofOfOwnership) {
option (google.api.http) = {
get: "/v1/nodeadmin/getProofOfOwnership"
};
}
}