Skip to content

Commit

Permalink
Update dependency project-origin/registry to v1 (#19)
Browse files Browse the repository at this point in the history
* Update dependency project-origin/registry to v1

* Add changes to .proto

---------

Co-authored-by: projectorigin-renovate[bot] <150237208+projectorigin-renovate[bot]@users.noreply.github.com>
Co-authored-by: Martin Schmidt <[email protected]>
  • Loading branch information
1 parent 14c1dbe commit 118b9df
Show file tree
Hide file tree
Showing 2 changed files with 83 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,13 @@

<ItemGroup>
<Protobuf Include="../Protos/common.proto" Link="Protos\common.proto">
<SourceUrl>https://raw.githubusercontent.com/project-origin/registry/v0.4.2/src/Protos/common.proto</SourceUrl>
<SourceUrl>https://raw.githubusercontent.com/project-origin/registry/v1.3.0/src/Protos/common.proto</SourceUrl>
</Protobuf>
<Protobuf Include="../Protos/registry.proto" Link="Protos\registry.proto">
<SourceUrl>https://raw.githubusercontent.com/project-origin/registry/v0.4.2/src/Protos/registry.proto</SourceUrl>
<SourceUrl>https://raw.githubusercontent.com/project-origin/registry/v1.3.0/src/Protos/registry.proto</SourceUrl>
</Protobuf>
<Protobuf Include="../Protos/electricity.proto" Link="Protos\electricity.proto">
<SourceUrl>https://raw.githubusercontent.com/project-origin/registry/v0.4.2/src/Protos/electricity.proto</SourceUrl>
<SourceUrl>https://raw.githubusercontent.com/project-origin/registry/v1.3.0/src/Protos/electricity.proto</SourceUrl>
</Protobuf>
</ItemGroup>

Expand Down
80 changes: 80 additions & 0 deletions src/Protos/registry.proto
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
syntax = "proto3";

import "google/protobuf/timestamp.proto";
import "common.proto";

package project_origin.registry.v1;
Expand All @@ -9,6 +10,33 @@ service RegistryService {
rpc GetStreamTransactions (GetStreamTransactionsRequest) returns (GetStreamTransactionsResponse);
rpc GetTransactionStatus(GetTransactionStatusRequest) returns (GetTransactionStatusResponse);
rpc GetTransactionProof (GetTransactionProofRequest) returns (GetTransactionProofResponse);
rpc GetBlocks(GetBlocksRequest) returns (GetBlocksResponse);
}

message GetBlocksRequest {
// Number of blocks to skip.
int32 skip = 1;

// The maximum number of blocks to return.
int32 limit = 2;

// If true, the result will include the transactions in the blocks.
bool include_transactions = 3;
}

message GetBlocksResponse {
// The blocks.
repeated Block blocks = 1;
}

message GetBlockTransactionsRequest {
// The block number to get transactions from, 0 based.
int32 block_number = 1;
}

message GetBlockTransactionsResponse {
// The transactions in the block.
repeated Transaction transactions = 1;
}

message SendTransactionsRequest {
Expand Down Expand Up @@ -92,3 +120,55 @@ message MerkleProof {
repeated bytes hashes = 3;
bytes block_id = 4;
}

message BlockHeader {
// SHA-256 hash of the previous block header.
bytes previous_header_hash = 1;

// SHA-256 hash of the previous publication.
bytes previous_publication_hash = 2;

// SHA-256 hash of the merkle root of the transactions in the block.
bytes merkle_root_hash = 3;

// Timestamp of when the block was created.
google.protobuf.Timestamp created_at = 4;
}

// A block in the immutable log.
message Block {
// Height of the block in the chain.
int32 height = 1;

// The header of the block.
BlockHeader header = 2;

// The publication of the block.
BlockPublication publication = 3;

// The transactions in the block.
repeated Transaction transactions = 4;
}

// A publication of a block.
message BlockPublication {
// Contains the type of the publication.
oneof immutable_log_type {
// Should only be used for testing.
LogEntry log_entry = 1;
Concordium concordium = 2;
}

message LogEntry {
// SHA-256 hash of the block header.
bytes block_header_hash = 1;
}

message Concordium {
// The hash of the transaction on the Concordium blockchain.
bytes transaction_hash = 1;

// The hash of the block on the Concordium blockchain.
bytes block_hash = 2;
}
}

0 comments on commit 118b9df

Please sign in to comment.