feat: add Block.creator_signature and Block.witness_signatures

This commit is contained in:
Nex Zhu
2022-11-14 01:22:04 +08:00
parent 94743e9a17
commit ae35d605b1
7 changed files with 232 additions and 143 deletions

View File

@@ -10,19 +10,19 @@ See [API documentation](..\docs\apis.md)
##### Installling tools
Download the [Protocol Buffers compiler](https://github.com/protocolbuffers/protobuf/releases) (protoc-3.17.3-*)+ for
Download the [Protocol Buffers compiler](https://github.com/protocolbuffers/protobuf/releases) (protoc-3.21.9-*)+ for
your platform and add `protoc` to `PATH` environment variable
For generating Go code, install `protoc-gen-go` (v1.27.1+):
For generating Go code, install `protoc-gen-go` (v1.28.1+):
```shell
GIT_TAG="v1.27.1"
GIT_TAG="v1.28.1"
go get -d -u google.golang.org/protobuf/cmd/protoc-gen-go
git -C "$(go env GOPATH)"/src/google.golang.org/protobuf checkout $GIT_TAG
go install google.golang.org/protobuf/cmd/protoc-gen-go
```
Also install `protoc-gen-go-grpc` v1.1.0+:
Also install `protoc-gen-go-grpc` v1.2.0+:
```shell
go get -u google.golang.org/grpc/cmd/protoc-gen-go-grpc
@@ -36,7 +36,7 @@ gobin google.golang.org/grpc/cmd/protoc-gen-go-grpc
```
For generating HTTP JSON APIs with [grpc-gateway](https://grpc-ecosystem.github.io/grpc-gateway/), follow
the [documentation](https://github.com/grpc-ecosystem/grpc-gateway/tree/v2#installation).
the [documentation](https://github.com/grpc-ecosystem/grpc-gateway#installation).
For generating validators
install [go-proto-validators](https://github.com/mwitkow/go-proto-validators/tree/master/protoc-gen-govalidators):

View File

@@ -42,6 +42,8 @@ message Block {
bytes transactions_root = 9; // 区块的事务默克尔树根
repeated Transaction transactions = 10; // 事务对象的数组,或为空
repeated bytes transaction_hashes = 11; // 20字节的事务哈希的数组或为空
bytes creator_signature = 12; // 产块者签名
bytes witness_signatures = 13; // 见证者签名
}
message Contract {