Signed-off-by: Leo Chen <leo@harmony.one>
pull/3347/head
Leo Chen 4 years ago
parent 0c04a2b574
commit 7dcdbe7d2b
  1. 1491
      api/proto/message/message.pb.go
  2. 492
      api/service/syncing/downloader/proto/downloader.pb.go
  3. 8
      consensus/debug.go
  4. 2
      rpc/debug.go

File diff suppressed because it is too large Load Diff

@ -1,33 +1,29 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.23.0
// protoc v3.6.1
// source: downloader.proto
package downloader
import (
context "context"
fmt "fmt"
math "math"
proto "github.com/golang/protobuf/proto"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// This is a compile-time assertion that a sufficiently up-to-date version
// of the legacy proto package is being used.
const _ = proto.ProtoPackageIsVersion4
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
type DownloaderRequest_RequestType int32
@ -42,55 +38,34 @@ const (
DownloaderRequest_BLOCKHEADER DownloaderRequest_RequestType = 7
)
// Enum value maps for DownloaderRequest_RequestType.
var (
DownloaderRequest_RequestType_name = map[int32]string{
0: "BLOCKHASH",
1: "BLOCK",
2: "NEWBLOCK",
3: "BLOCKHEIGHT",
4: "REGISTER",
5: "REGISTERTIMEOUT",
6: "UNKNOWN",
7: "BLOCKHEADER",
}
DownloaderRequest_RequestType_value = map[string]int32{
"BLOCKHASH": 0,
"BLOCK": 1,
"NEWBLOCK": 2,
"BLOCKHEIGHT": 3,
"REGISTER": 4,
"REGISTERTIMEOUT": 5,
"UNKNOWN": 6,
"BLOCKHEADER": 7,
}
)
func (x DownloaderRequest_RequestType) Enum() *DownloaderRequest_RequestType {
p := new(DownloaderRequest_RequestType)
*p = x
return p
}
func (x DownloaderRequest_RequestType) String() string {
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}
func (DownloaderRequest_RequestType) Descriptor() protoreflect.EnumDescriptor {
return file_downloader_proto_enumTypes[0].Descriptor()
var DownloaderRequest_RequestType_name = map[int32]string{
0: "BLOCKHASH",
1: "BLOCK",
2: "NEWBLOCK",
3: "BLOCKHEIGHT",
4: "REGISTER",
5: "REGISTERTIMEOUT",
6: "UNKNOWN",
7: "BLOCKHEADER",
}
func (DownloaderRequest_RequestType) Type() protoreflect.EnumType {
return &file_downloader_proto_enumTypes[0]
var DownloaderRequest_RequestType_value = map[string]int32{
"BLOCKHASH": 0,
"BLOCK": 1,
"NEWBLOCK": 2,
"BLOCKHEIGHT": 3,
"REGISTER": 4,
"REGISTERTIMEOUT": 5,
"UNKNOWN": 6,
"BLOCKHEADER": 7,
}
func (x DownloaderRequest_RequestType) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
func (x DownloaderRequest_RequestType) String() string {
return proto.EnumName(DownloaderRequest_RequestType_name, int32(x))
}
// Deprecated: Use DownloaderRequest_RequestType.Descriptor instead.
func (DownloaderRequest_RequestType) EnumDescriptor() ([]byte, []int) {
return file_downloader_proto_rawDescGZIP(), []int{0, 0}
return fileDescriptor_6a99ec95c7ab1ff1, []int{0, 0}
}
type DownloaderResponse_RegisterResponseType int32
@ -98,345 +73,216 @@ type DownloaderResponse_RegisterResponseType int32
const (
DownloaderResponse_SUCCESS DownloaderResponse_RegisterResponseType = 0
DownloaderResponse_FAIL DownloaderResponse_RegisterResponseType = 1
DownloaderResponse_INSYNC DownloaderResponse_RegisterResponseType = 2 // node is now in sync, remove it from the broadcast list
DownloaderResponse_INSYNC DownloaderResponse_RegisterResponseType = 2
)
// Enum value maps for DownloaderResponse_RegisterResponseType.
var (
DownloaderResponse_RegisterResponseType_name = map[int32]string{
0: "SUCCESS",
1: "FAIL",
2: "INSYNC",
}
DownloaderResponse_RegisterResponseType_value = map[string]int32{
"SUCCESS": 0,
"FAIL": 1,
"INSYNC": 2,
}
)
func (x DownloaderResponse_RegisterResponseType) Enum() *DownloaderResponse_RegisterResponseType {
p := new(DownloaderResponse_RegisterResponseType)
*p = x
return p
var DownloaderResponse_RegisterResponseType_name = map[int32]string{
0: "SUCCESS",
1: "FAIL",
2: "INSYNC",
}
func (x DownloaderResponse_RegisterResponseType) String() string {
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
var DownloaderResponse_RegisterResponseType_value = map[string]int32{
"SUCCESS": 0,
"FAIL": 1,
"INSYNC": 2,
}
func (DownloaderResponse_RegisterResponseType) Descriptor() protoreflect.EnumDescriptor {
return file_downloader_proto_enumTypes[1].Descriptor()
}
func (DownloaderResponse_RegisterResponseType) Type() protoreflect.EnumType {
return &file_downloader_proto_enumTypes[1]
}
func (x DownloaderResponse_RegisterResponseType) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
func (x DownloaderResponse_RegisterResponseType) String() string {
return proto.EnumName(DownloaderResponse_RegisterResponseType_name, int32(x))
}
// Deprecated: Use DownloaderResponse_RegisterResponseType.Descriptor instead.
func (DownloaderResponse_RegisterResponseType) EnumDescriptor() ([]byte, []int) {
return file_downloader_proto_rawDescGZIP(), []int{1, 0}
return fileDescriptor_6a99ec95c7ab1ff1, []int{1, 0}
}
// DownloaderRequest is the generic download request.
type DownloaderRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// Request type.
Type DownloaderRequest_RequestType `protobuf:"varint,1,opt,name=type,proto3,enum=downloader.DownloaderRequest_RequestType" json:"type,omitempty"`
// The hashes of the blocks we want to download.
Hashes [][]byte `protobuf:"bytes,2,rep,name=hashes,proto3" json:"hashes,omitempty"`
PeerHash []byte `protobuf:"bytes,3,opt,name=peerHash,proto3" json:"peerHash,omitempty"`
BlockHash []byte `protobuf:"bytes,4,opt,name=blockHash,proto3" json:"blockHash,omitempty"`
Ip string `protobuf:"bytes,5,opt,name=ip,proto3" json:"ip,omitempty"`
Port string `protobuf:"bytes,6,opt,name=port,proto3" json:"port,omitempty"`
Size uint32 `protobuf:"varint,7,opt,name=size,proto3" json:"size,omitempty"`
}
func (x *DownloaderRequest) Reset() {
*x = DownloaderRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_downloader_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
Hashes [][]byte `protobuf:"bytes,2,rep,name=hashes,proto3" json:"hashes,omitempty"`
PeerHash []byte `protobuf:"bytes,3,opt,name=peerHash,proto3" json:"peerHash,omitempty"`
BlockHash []byte `protobuf:"bytes,4,opt,name=blockHash,proto3" json:"blockHash,omitempty"`
Ip string `protobuf:"bytes,5,opt,name=ip,proto3" json:"ip,omitempty"`
Port string `protobuf:"bytes,6,opt,name=port,proto3" json:"port,omitempty"`
Size uint32 `protobuf:"varint,7,opt,name=size,proto3" json:"size,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *DownloaderRequest) Reset() { *m = DownloaderRequest{} }
func (m *DownloaderRequest) String() string { return proto.CompactTextString(m) }
func (*DownloaderRequest) ProtoMessage() {}
func (*DownloaderRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_6a99ec95c7ab1ff1, []int{0}
}
func (x *DownloaderRequest) String() string {
return protoimpl.X.MessageStringOf(x)
func (m *DownloaderRequest) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_DownloaderRequest.Unmarshal(m, b)
}
func (*DownloaderRequest) ProtoMessage() {}
func (x *DownloaderRequest) ProtoReflect() protoreflect.Message {
mi := &file_downloader_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
func (m *DownloaderRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_DownloaderRequest.Marshal(b, m, deterministic)
}
// Deprecated: Use DownloaderRequest.ProtoReflect.Descriptor instead.
func (*DownloaderRequest) Descriptor() ([]byte, []int) {
return file_downloader_proto_rawDescGZIP(), []int{0}
func (m *DownloaderRequest) XXX_Merge(src proto.Message) {
xxx_messageInfo_DownloaderRequest.Merge(m, src)
}
func (m *DownloaderRequest) XXX_Size() int {
return xxx_messageInfo_DownloaderRequest.Size(m)
}
func (m *DownloaderRequest) XXX_DiscardUnknown() {
xxx_messageInfo_DownloaderRequest.DiscardUnknown(m)
}
var xxx_messageInfo_DownloaderRequest proto.InternalMessageInfo
func (x *DownloaderRequest) GetType() DownloaderRequest_RequestType {
if x != nil {
return x.Type
func (m *DownloaderRequest) GetType() DownloaderRequest_RequestType {
if m != nil {
return m.Type
}
return DownloaderRequest_BLOCKHASH
}
func (x *DownloaderRequest) GetHashes() [][]byte {
if x != nil {
return x.Hashes
func (m *DownloaderRequest) GetHashes() [][]byte {
if m != nil {
return m.Hashes
}
return nil
}
func (x *DownloaderRequest) GetPeerHash() []byte {
if x != nil {
return x.PeerHash
func (m *DownloaderRequest) GetPeerHash() []byte {
if m != nil {
return m.PeerHash
}
return nil
}
func (x *DownloaderRequest) GetBlockHash() []byte {
if x != nil {
return x.BlockHash
func (m *DownloaderRequest) GetBlockHash() []byte {
if m != nil {
return m.BlockHash
}
return nil
}
func (x *DownloaderRequest) GetIp() string {
if x != nil {
return x.Ip
func (m *DownloaderRequest) GetIp() string {
if m != nil {
return m.Ip
}
return ""
}
func (x *DownloaderRequest) GetPort() string {
if x != nil {
return x.Port
func (m *DownloaderRequest) GetPort() string {
if m != nil {
return m.Port
}
return ""
}
func (x *DownloaderRequest) GetSize() uint32 {
if x != nil {
return x.Size
func (m *DownloaderRequest) GetSize() uint32 {
if m != nil {
return m.Size
}
return 0
}
// DownloaderResponse is the generic response of DownloaderRequest.
type DownloaderResponse struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// payload of Block.
Payload [][]byte `protobuf:"bytes,1,rep,name=payload,proto3" json:"payload,omitempty"`
// response of registration request
Type DownloaderResponse_RegisterResponseType `protobuf:"varint,2,opt,name=type,proto3,enum=downloader.DownloaderResponse_RegisterResponseType" json:"type,omitempty"`
BlockHeight uint64 `protobuf:"varint,3,opt,name=blockHeight,proto3" json:"blockHeight,omitempty"`
Type DownloaderResponse_RegisterResponseType `protobuf:"varint,2,opt,name=type,proto3,enum=downloader.DownloaderResponse_RegisterResponseType" json:"type,omitempty"`
BlockHeight uint64 `protobuf:"varint,3,opt,name=blockHeight,proto3" json:"blockHeight,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (x *DownloaderResponse) Reset() {
*x = DownloaderResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_downloader_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (m *DownloaderResponse) Reset() { *m = DownloaderResponse{} }
func (m *DownloaderResponse) String() string { return proto.CompactTextString(m) }
func (*DownloaderResponse) ProtoMessage() {}
func (*DownloaderResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_6a99ec95c7ab1ff1, []int{1}
}
func (x *DownloaderResponse) String() string {
return protoimpl.X.MessageStringOf(x)
func (m *DownloaderResponse) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_DownloaderResponse.Unmarshal(m, b)
}
func (*DownloaderResponse) ProtoMessage() {}
func (x *DownloaderResponse) ProtoReflect() protoreflect.Message {
mi := &file_downloader_proto_msgTypes[1]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
func (m *DownloaderResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_DownloaderResponse.Marshal(b, m, deterministic)
}
// Deprecated: Use DownloaderResponse.ProtoReflect.Descriptor instead.
func (*DownloaderResponse) Descriptor() ([]byte, []int) {
return file_downloader_proto_rawDescGZIP(), []int{1}
func (m *DownloaderResponse) XXX_Merge(src proto.Message) {
xxx_messageInfo_DownloaderResponse.Merge(m, src)
}
func (m *DownloaderResponse) XXX_Size() int {
return xxx_messageInfo_DownloaderResponse.Size(m)
}
func (m *DownloaderResponse) XXX_DiscardUnknown() {
xxx_messageInfo_DownloaderResponse.DiscardUnknown(m)
}
func (x *DownloaderResponse) GetPayload() [][]byte {
if x != nil {
return x.Payload
var xxx_messageInfo_DownloaderResponse proto.InternalMessageInfo
func (m *DownloaderResponse) GetPayload() [][]byte {
if m != nil {
return m.Payload
}
return nil
}
func (x *DownloaderResponse) GetType() DownloaderResponse_RegisterResponseType {
if x != nil {
return x.Type
func (m *DownloaderResponse) GetType() DownloaderResponse_RegisterResponseType {
if m != nil {
return m.Type
}
return DownloaderResponse_SUCCESS
}
func (x *DownloaderResponse) GetBlockHeight() uint64 {
if x != nil {
return x.BlockHeight
func (m *DownloaderResponse) GetBlockHeight() uint64 {
if m != nil {
return m.BlockHeight
}
return 0
}
var File_downloader_proto protoreflect.FileDescriptor
var file_downloader_proto_rawDesc = []byte{
0x0a, 0x10, 0x64, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f,
0x74, 0x6f, 0x12, 0x0a, 0x64, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x65, 0x72, 0x22, 0xe6,
0x02, 0x0a, 0x11, 0x44, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x65, 0x72, 0x52, 0x65, 0x71,
0x75, 0x65, 0x73, 0x74, 0x12, 0x3d, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01,
0x28, 0x0e, 0x32, 0x29, 0x2e, 0x64, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x65, 0x72, 0x2e,
0x44, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
0x74, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74,
0x79, 0x70, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x68, 0x61, 0x73, 0x68, 0x65, 0x73, 0x18, 0x02, 0x20,
0x03, 0x28, 0x0c, 0x52, 0x06, 0x68, 0x61, 0x73, 0x68, 0x65, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x70,
0x65, 0x65, 0x72, 0x48, 0x61, 0x73, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, 0x70,
0x65, 0x65, 0x72, 0x48, 0x61, 0x73, 0x68, 0x12, 0x1c, 0x0a, 0x09, 0x62, 0x6c, 0x6f, 0x63, 0x6b,
0x48, 0x61, 0x73, 0x68, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x62, 0x6c, 0x6f, 0x63,
0x6b, 0x48, 0x61, 0x73, 0x68, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x70, 0x18, 0x05, 0x20, 0x01, 0x28,
0x09, 0x52, 0x02, 0x69, 0x70, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x06, 0x20,
0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x7a,
0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x22, 0x87, 0x01,
0x0a, 0x0b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0d, 0x0a,
0x09, 0x42, 0x4c, 0x4f, 0x43, 0x4b, 0x48, 0x41, 0x53, 0x48, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05,
0x42, 0x4c, 0x4f, 0x43, 0x4b, 0x10, 0x01, 0x12, 0x0c, 0x0a, 0x08, 0x4e, 0x45, 0x57, 0x42, 0x4c,
0x4f, 0x43, 0x4b, 0x10, 0x02, 0x12, 0x0f, 0x0a, 0x0b, 0x42, 0x4c, 0x4f, 0x43, 0x4b, 0x48, 0x45,
0x49, 0x47, 0x48, 0x54, 0x10, 0x03, 0x12, 0x0c, 0x0a, 0x08, 0x52, 0x45, 0x47, 0x49, 0x53, 0x54,
0x45, 0x52, 0x10, 0x04, 0x12, 0x13, 0x0a, 0x0f, 0x52, 0x45, 0x47, 0x49, 0x53, 0x54, 0x45, 0x52,
0x54, 0x49, 0x4d, 0x45, 0x4f, 0x55, 0x54, 0x10, 0x05, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b,
0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x06, 0x12, 0x0f, 0x0a, 0x0b, 0x42, 0x4c, 0x4f, 0x43, 0x4b, 0x48,
0x45, 0x41, 0x44, 0x45, 0x52, 0x10, 0x07, 0x22, 0xd4, 0x01, 0x0a, 0x12, 0x44, 0x6f, 0x77, 0x6e,
0x6c, 0x6f, 0x61, 0x64, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18,
0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0c, 0x52,
0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x47, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65,
0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x33, 0x2e, 0x64, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61,
0x64, 0x65, 0x72, 0x2e, 0x44, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x65, 0x72, 0x52, 0x65,
0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x52,
0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70,
0x65, 0x12, 0x20, 0x0a, 0x0b, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74,
0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x65, 0x69,
0x67, 0x68, 0x74, 0x22, 0x39, 0x0a, 0x14, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x52,
0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0b, 0x0a, 0x07, 0x53,
0x55, 0x43, 0x43, 0x45, 0x53, 0x53, 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, 0x46, 0x41, 0x49, 0x4c,
0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x49, 0x4e, 0x53, 0x59, 0x4e, 0x43, 0x10, 0x02, 0x32, 0x56,
0x0a, 0x0a, 0x44, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x65, 0x72, 0x12, 0x48, 0x0a, 0x05,
0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x1d, 0x2e, 0x64, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64,
0x65, 0x72, 0x2e, 0x44, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x65, 0x72, 0x52, 0x65, 0x71,
0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x64, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x65,
0x72, 0x2e, 0x44, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70,
0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
file_downloader_proto_rawDescOnce sync.Once
file_downloader_proto_rawDescData = file_downloader_proto_rawDesc
)
func file_downloader_proto_rawDescGZIP() []byte {
file_downloader_proto_rawDescOnce.Do(func() {
file_downloader_proto_rawDescData = protoimpl.X.CompressGZIP(file_downloader_proto_rawDescData)
})
return file_downloader_proto_rawDescData
}
var file_downloader_proto_enumTypes = make([]protoimpl.EnumInfo, 2)
var file_downloader_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
var file_downloader_proto_goTypes = []interface{}{
(DownloaderRequest_RequestType)(0), // 0: downloader.DownloaderRequest.RequestType
(DownloaderResponse_RegisterResponseType)(0), // 1: downloader.DownloaderResponse.RegisterResponseType
(*DownloaderRequest)(nil), // 2: downloader.DownloaderRequest
(*DownloaderResponse)(nil), // 3: downloader.DownloaderResponse
}
var file_downloader_proto_depIdxs = []int32{
0, // 0: downloader.DownloaderRequest.type:type_name -> downloader.DownloaderRequest.RequestType
1, // 1: downloader.DownloaderResponse.type:type_name -> downloader.DownloaderResponse.RegisterResponseType
2, // 2: downloader.Downloader.Query:input_type -> downloader.DownloaderRequest
3, // 3: downloader.Downloader.Query:output_type -> downloader.DownloaderResponse
3, // [3:4] is the sub-list for method output_type
2, // [2:3] is the sub-list for method input_type
2, // [2:2] is the sub-list for extension type_name
2, // [2:2] is the sub-list for extension extendee
0, // [0:2] is the sub-list for field type_name
}
func init() { file_downloader_proto_init() }
func file_downloader_proto_init() {
if File_downloader_proto != nil {
return
}
if !protoimpl.UnsafeEnabled {
file_downloader_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*DownloaderRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_downloader_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*DownloaderResponse); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_downloader_proto_rawDesc,
NumEnums: 2,
NumMessages: 2,
NumExtensions: 0,
NumServices: 1,
},
GoTypes: file_downloader_proto_goTypes,
DependencyIndexes: file_downloader_proto_depIdxs,
EnumInfos: file_downloader_proto_enumTypes,
MessageInfos: file_downloader_proto_msgTypes,
}.Build()
File_downloader_proto = out.File
file_downloader_proto_rawDesc = nil
file_downloader_proto_goTypes = nil
file_downloader_proto_depIdxs = nil
func init() {
proto.RegisterEnum("downloader.DownloaderRequest_RequestType", DownloaderRequest_RequestType_name, DownloaderRequest_RequestType_value)
proto.RegisterEnum("downloader.DownloaderResponse_RegisterResponseType", DownloaderResponse_RegisterResponseType_name, DownloaderResponse_RegisterResponseType_value)
proto.RegisterType((*DownloaderRequest)(nil), "downloader.DownloaderRequest")
proto.RegisterType((*DownloaderResponse)(nil), "downloader.DownloaderResponse")
}
func init() {
proto.RegisterFile("downloader.proto", fileDescriptor_6a99ec95c7ab1ff1)
}
var fileDescriptor_6a99ec95c7ab1ff1 = []byte{
// 410 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x52, 0xcd, 0x6e, 0xd3, 0x40,
0x10, 0xce, 0x3a, 0x8e, 0x93, 0x4c, 0xd2, 0x76, 0x19, 0x10, 0x5a, 0x55, 0x80, 0x2c, 0x9f, 0xcc,
0xc5, 0x87, 0xf6, 0xc4, 0x81, 0x43, 0x70, 0x4d, 0x6c, 0xb5, 0x38, 0x62, 0xed, 0x50, 0x71, 0x74,
0xe9, 0xaa, 0xb6, 0xa8, 0xea, 0xc5, 0xeb, 0x0a, 0x99, 0x17, 0xe0, 0x05, 0x79, 0x06, 0x9e, 0x03,
0x79, 0x9d, 0xd6, 0x96, 0x80, 0x9c, 0x76, 0xbf, 0x6f, 0x7e, 0x34, 0xf3, 0x7d, 0x03, 0xf4, 0xba,
0xfc, 0x7e, 0x77, 0x5b, 0x66, 0xd7, 0xa2, 0xf2, 0x64, 0x55, 0xd6, 0x25, 0x42, 0xcf, 0x38, 0xbf,
0x0d, 0x78, 0x72, 0xf6, 0x08, 0xb9, 0xf8, 0x76, 0x2f, 0x54, 0x8d, 0x6f, 0xc1, 0xac, 0x1b, 0x29,
0x18, 0xb1, 0x89, 0x7b, 0x78, 0xf2, 0xda, 0x1b, 0xb4, 0xf8, 0x2b, 0xd9, 0xdb, 0xbd, 0x69, 0x23,
0x05, 0xd7, 0x65, 0xf8, 0x1c, 0xac, 0x3c, 0x53, 0xb9, 0x50, 0xcc, 0xb0, 0xc7, 0xee, 0x92, 0xef,
0x10, 0x1e, 0xc3, 0x4c, 0x0a, 0x51, 0x85, 0x99, 0xca, 0xd9, 0xd8, 0x26, 0xee, 0x92, 0x3f, 0x62,
0x7c, 0x01, 0xf3, 0xab, 0xdb, 0xf2, 0xcb, 0x57, 0x1d, 0x34, 0x75, 0xb0, 0x27, 0xf0, 0x10, 0x8c,
0x42, 0xb2, 0x89, 0x4d, 0xdc, 0x39, 0x37, 0x0a, 0x89, 0x08, 0xa6, 0x2c, 0xab, 0x9a, 0x59, 0x9a,
0xd1, 0xff, 0x96, 0x53, 0xc5, 0x0f, 0xc1, 0xa6, 0x36, 0x71, 0x0f, 0xb8, 0xfe, 0x3b, 0x3f, 0x09,
0x2c, 0x06, 0xf3, 0xe1, 0x01, 0xcc, 0xdf, 0x5d, 0x6c, 0xfc, 0xf3, 0x70, 0x95, 0x84, 0x74, 0x84,
0x73, 0x98, 0x68, 0x48, 0x09, 0x2e, 0x61, 0x16, 0x07, 0x97, 0x1d, 0x32, 0xf0, 0x08, 0x16, 0x5d,
0x5e, 0x10, 0xad, 0xc3, 0x94, 0x8e, 0xdb, 0x30, 0x0f, 0xd6, 0x51, 0x92, 0x06, 0x9c, 0x9a, 0xf8,
0x14, 0x8e, 0x1e, 0x50, 0x1a, 0x7d, 0x08, 0x36, 0xdb, 0x94, 0x4e, 0x70, 0x01, 0xd3, 0x6d, 0x7c,
0x1e, 0x6f, 0x2e, 0x63, 0x6a, 0x0d, 0x1a, 0xac, 0xce, 0x02, 0x4e, 0xa7, 0xce, 0x2f, 0x02, 0x38,
0xd4, 0x4e, 0xc9, 0xf2, 0x4e, 0x09, 0x64, 0x30, 0x95, 0x59, 0xd3, 0x92, 0x8c, 0x68, 0xad, 0x1e,
0x20, 0xae, 0x77, 0x1e, 0x18, 0xda, 0x83, 0xd3, 0xff, 0x79, 0xd0, 0xf5, 0xf1, 0xb8, 0xb8, 0x29,
0x54, 0xdd, 0x13, 0x03, 0x37, 0x6c, 0x58, 0x74, 0x42, 0x8a, 0xe2, 0x26, 0xaf, 0xb5, 0xf0, 0x26,
0x1f, 0x52, 0xce, 0x1b, 0x78, 0xf6, 0xaf, 0xfa, 0x76, 0xa3, 0x64, 0xeb, 0xfb, 0x41, 0x92, 0xd0,
0x11, 0xce, 0xc0, 0x7c, 0xbf, 0x8a, 0x2e, 0x28, 0x41, 0x00, 0x2b, 0x8a, 0x93, 0xcf, 0xb1, 0x4f,
0x8d, 0x93, 0x4f, 0x00, 0xfd, 0x34, 0x18, 0xc2, 0xe4, 0xe3, 0xbd, 0xa8, 0x1a, 0x7c, 0xb9, 0xf7,
0x64, 0x8e, 0x5f, 0xed, 0xdf, 0xc6, 0x19, 0x5d, 0x59, 0xfa, 0x54, 0x4f, 0xff, 0x04, 0x00, 0x00,
0xff, 0xff, 0x00, 0xaf, 0x33, 0x33, 0xbe, 0x02, 0x00, 0x00,
}
// Reference imports to suppress errors if they are not otherwise used.
@ -480,7 +326,7 @@ type DownloaderServer interface {
type UnimplementedDownloaderServer struct {
}
func (*UnimplementedDownloaderServer) Query(context.Context, *DownloaderRequest) (*DownloaderResponse, error) {
func (*UnimplementedDownloaderServer) Query(ctx context.Context, req *DownloaderRequest) (*DownloaderResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Query not implemented")
}

@ -1,21 +1,21 @@
package consensus
// GetConsensusPhase ..
// GetConsensusPhase returns the current phase of the consensus
func (c *Consensus) GetConsensusPhase() string {
return c.phase.String()
}
// GetConsensusMode ..
// GetConsensusMode returns the current mode of the consensus
func (c *Consensus) GetConsensusMode() string {
return c.current.mode.String()
}
// GetCurViewID ..
// GetCurViewID returns the current view ID of the consensus
func (c *Consensus) GetCurViewID() uint64 {
return c.current.GetCurViewID()
}
// GetViewID ..
// GetViewChangingID returns the current view changing ID of the consensus
func (c *Consensus) GetViewChangingID() uint64 {
return c.current.GetViewChangingID()
}

@ -39,12 +39,14 @@ func (*PrivateDebugService) SetLogVerbosity(ctx context.Context, level int) (map
return map[string]interface{}{"verbosity": verbosity.String()}, nil
}
// ConsensusViewChangingID return the current view changing ID to RPC
func (s *PrivateDebugService) ConsensusViewChangingID(
ctx context.Context,
) uint64 {
return s.hmy.NodeAPI.GetConsensusViewChangingID()
}
// ConsensusCurViewID return the current view ID to RPC
func (s *PrivateDebugService) ConsensusCurViewID(
ctx context.Context,
) uint64 {

Loading…
Cancel
Save