v1

package
v3.1.7-near-hf Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 15, 2024 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation ¶

Overview ¶

Package v1 is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index ¶

Constants ¶

This section is empty.

Variables ¶

View Source
var (
	ErrInvalidLengthDowntime        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowDowntime          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupDowntime = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrInvalidLengthGenesis        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowGenesis          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupGenesis = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ParamKeyDowntimeDuration        = []byte("DowntimeDuration")
	DefaultParamKeyDowntimeDuration = 5 * time.Minute
	ParamKeyEpochDuration           = []byte("EpochDuration")
	DefaultParamKeyEpochDuration    = 30 * time.Minute
)
View Source
var (
	ErrInvalidLengthQuery        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowQuery          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupQuery = fmt.Errorf("proto: unexpected end of group")
)

Functions ¶

func ParamKeyTable ¶

func ParamKeyTable() paramtypes.KeyTable

ParamKeyTable the param key table for launch module

func RegisterQueryHandler ¶

func RegisterQueryHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterQueryHandler registers the http handlers for service Query to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterQueryHandlerClient ¶

func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QueryClient) error

RegisterQueryHandlerClient registers the http handlers for service Query to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "QueryClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "QueryClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "QueryClient" to call the correct interceptors.

func RegisterQueryHandlerFromEndpoint ¶

func RegisterQueryHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterQueryHandlerFromEndpoint is same as RegisterQueryHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterQueryHandlerServer ¶

func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error

RegisterQueryHandlerServer registers the http handlers for service Query to "mux". UnaryRPC :call QueryServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterQueryHandlerFromEndpoint instead.

func RegisterQueryServer ¶

func RegisterQueryServer(s grpc1.Server, srv QueryServer)

Types ¶

type Downtime ¶

type Downtime struct {
	// block defines the block that took time to produce.
	Block uint64 `protobuf:"varint,1,opt,name=block,proto3" json:"block,omitempty"`
	// duration defines the time elapsed between the previous block and this one.
	// this defines the effective downtime duration.
	Duration time.Duration `protobuf:"bytes,2,opt,name=duration,proto3,stdduration" json:"duration"`
}

Downtime defines a single downtime record.

func (*Downtime) Descriptor ¶

func (*Downtime) Descriptor() ([]byte, []int)

func (*Downtime) GetBlock ¶

func (m *Downtime) GetBlock() uint64

func (*Downtime) GetDuration ¶

func (m *Downtime) GetDuration() time.Duration

func (*Downtime) Marshal ¶

func (m *Downtime) Marshal() (dAtA []byte, err error)

func (*Downtime) MarshalTo ¶

func (m *Downtime) MarshalTo(dAtA []byte) (int, error)

func (*Downtime) MarshalToSizedBuffer ¶

func (m *Downtime) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Downtime) ProtoMessage ¶

func (*Downtime) ProtoMessage()

func (*Downtime) Reset ¶

func (m *Downtime) Reset()

func (*Downtime) Size ¶

func (m *Downtime) Size() (n int)

func (*Downtime) String ¶

func (m *Downtime) String() string

func (*Downtime) Unmarshal ¶

func (m *Downtime) Unmarshal(dAtA []byte) error

func (*Downtime) Validate ¶

func (m *Downtime) Validate() error

func (*Downtime) XXX_DiscardUnknown ¶

func (m *Downtime) XXX_DiscardUnknown()

func (*Downtime) XXX_Marshal ¶

func (m *Downtime) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Downtime) XXX_Merge ¶

func (m *Downtime) XXX_Merge(src proto.Message)

func (*Downtime) XXX_Size ¶

func (m *Downtime) XXX_Size() int

func (*Downtime) XXX_Unmarshal ¶

func (m *Downtime) XXX_Unmarshal(b []byte) error

type GenesisState ¶

type GenesisState struct {
	Params    Params      `protobuf:"bytes,1,opt,name=params,proto3" json:"params"`
	Downtimes []*Downtime `protobuf:"bytes,2,rep,name=downtimes,proto3" json:"downtimes,omitempty"`
	// last_block_time keeps track of when the last block time was set.
	// it's nullable because we might want it to be non existent.
	// we want it to exist when we have a genesis export-import migration scenario.
	LastBlockTime *time.Time `protobuf:"bytes,3,opt,name=last_block_time,json=lastBlockTime,proto3,stdtime" json:"last_block_time,omitempty"`
}

GenesisState is the genesis state of the downtime module.

func DefaultGenesisState ¶

func DefaultGenesisState() *GenesisState

DefaultGenesisState returns a default genesis state.

func (*GenesisState) Descriptor ¶

func (*GenesisState) Descriptor() ([]byte, []int)

func (*GenesisState) GetDowntimes ¶

func (m *GenesisState) GetDowntimes() []*Downtime

func (*GenesisState) GetLastBlockTime ¶

func (m *GenesisState) GetLastBlockTime() *time.Time

func (*GenesisState) GetParams ¶

func (m *GenesisState) GetParams() Params

func (*GenesisState) Marshal ¶

func (m *GenesisState) Marshal() (dAtA []byte, err error)

func (*GenesisState) MarshalTo ¶

func (m *GenesisState) MarshalTo(dAtA []byte) (int, error)

func (*GenesisState) MarshalToSizedBuffer ¶

func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*GenesisState) ProtoMessage ¶

func (*GenesisState) ProtoMessage()

func (*GenesisState) Reset ¶

func (m *GenesisState) Reset()

func (*GenesisState) Size ¶

func (m *GenesisState) Size() (n int)

func (*GenesisState) String ¶

func (m *GenesisState) String() string

func (*GenesisState) Unmarshal ¶

func (m *GenesisState) Unmarshal(dAtA []byte) error

func (*GenesisState) Validate ¶

func (m *GenesisState) Validate() error

func (*GenesisState) XXX_DiscardUnknown ¶

func (m *GenesisState) XXX_DiscardUnknown()

func (*GenesisState) XXX_Marshal ¶

func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*GenesisState) XXX_Merge ¶

func (m *GenesisState) XXX_Merge(src proto.Message)

func (*GenesisState) XXX_Size ¶

func (m *GenesisState) XXX_Size() int

func (*GenesisState) XXX_Unmarshal ¶

func (m *GenesisState) XXX_Unmarshal(b []byte) error

type Params ¶

type Params struct {
	// downtime_duration defines the minimum time elapsed between blocks
	// that we consider the chain to be down.
	DowntimeDuration time.Duration `protobuf:"bytes,1,opt,name=downtime_duration,json=downtimeDuration,proto3,stdduration" json:"downtime_duration"`
	// epoch_duration defines an estimation of the time elapsed between epochs
	EpochDuration time.Duration `protobuf:"bytes,2,opt,name=epoch_duration,json=epochDuration,proto3,stdduration" json:"epoch_duration"`
}

Params defines the parameters of the downtime module.

func DefaultParams ¶

func DefaultParams() Params

func (*Params) Descriptor ¶

func (*Params) Descriptor() ([]byte, []int)

func (*Params) GetDowntimeDuration ¶

func (m *Params) GetDowntimeDuration() time.Duration

func (*Params) GetEpochDuration ¶

func (m *Params) GetEpochDuration() time.Duration

func (*Params) Marshal ¶

func (m *Params) Marshal() (dAtA []byte, err error)

func (*Params) MarshalTo ¶

func (m *Params) MarshalTo(dAtA []byte) (int, error)

func (*Params) MarshalToSizedBuffer ¶

func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Params) ParamSetPairs ¶

func (m *Params) ParamSetPairs() paramtypes.ParamSetPairs

func (*Params) ProtoMessage ¶

func (*Params) ProtoMessage()

func (*Params) Reset ¶

func (m *Params) Reset()

func (*Params) Size ¶

func (m *Params) Size() (n int)

func (*Params) String ¶

func (m *Params) String() string

func (*Params) Unmarshal ¶

func (m *Params) Unmarshal(dAtA []byte) error

func (*Params) Validate ¶

func (m *Params) Validate() error

func (*Params) XXX_DiscardUnknown ¶

func (m *Params) XXX_DiscardUnknown()

func (*Params) XXX_Marshal ¶

func (m *Params) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Params) XXX_Merge ¶

func (m *Params) XXX_Merge(src proto.Message)

func (*Params) XXX_Size ¶

func (m *Params) XXX_Size() int

func (*Params) XXX_Unmarshal ¶

func (m *Params) XXX_Unmarshal(b []byte) error

type QueryClient ¶

type QueryClient interface {
	QueryParams(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error)
	QueryDowntime(ctx context.Context, in *QueryDowntimeRequest, opts ...grpc.CallOption) (*QueryDowntimeResponse, error)
}

QueryClient is the client API for Query service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewQueryClient ¶

func NewQueryClient(cc grpc1.ClientConn) QueryClient

type QueryDowntimeRequest ¶

type QueryDowntimeRequest struct {
	EpochStartBlock uint64 `protobuf:"varint,1,opt,name=epoch_start_block,json=epochStartBlock,proto3" json:"epoch_start_block,omitempty"`
}

QueryDowntimeRequest is the request type for the Query/QueryDowntime RPC method.

func (*QueryDowntimeRequest) Descriptor ¶

func (*QueryDowntimeRequest) Descriptor() ([]byte, []int)

func (*QueryDowntimeRequest) GetEpochStartBlock ¶

func (m *QueryDowntimeRequest) GetEpochStartBlock() uint64

func (*QueryDowntimeRequest) Marshal ¶

func (m *QueryDowntimeRequest) Marshal() (dAtA []byte, err error)

func (*QueryDowntimeRequest) MarshalTo ¶

func (m *QueryDowntimeRequest) MarshalTo(dAtA []byte) (int, error)

func (*QueryDowntimeRequest) MarshalToSizedBuffer ¶

func (m *QueryDowntimeRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*QueryDowntimeRequest) ProtoMessage ¶

func (*QueryDowntimeRequest) ProtoMessage()

func (*QueryDowntimeRequest) Reset ¶

func (m *QueryDowntimeRequest) Reset()

func (*QueryDowntimeRequest) Size ¶

func (m *QueryDowntimeRequest) Size() (n int)

func (*QueryDowntimeRequest) String ¶

func (m *QueryDowntimeRequest) String() string

func (*QueryDowntimeRequest) Unmarshal ¶

func (m *QueryDowntimeRequest) Unmarshal(dAtA []byte) error

func (*QueryDowntimeRequest) XXX_DiscardUnknown ¶

func (m *QueryDowntimeRequest) XXX_DiscardUnknown()

func (*QueryDowntimeRequest) XXX_Marshal ¶

func (m *QueryDowntimeRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*QueryDowntimeRequest) XXX_Merge ¶

func (m *QueryDowntimeRequest) XXX_Merge(src proto.Message)

func (*QueryDowntimeRequest) XXX_Size ¶

func (m *QueryDowntimeRequest) XXX_Size() int

func (*QueryDowntimeRequest) XXX_Unmarshal ¶

func (m *QueryDowntimeRequest) XXX_Unmarshal(b []byte) error

type QueryDowntimeResponse ¶

type QueryDowntimeResponse struct {
	CumulativeDowntimeDuration time.Duration `` /* 143-byte string literal not displayed */
}

QueryDowntimeResponse is the response type for the Query/QueryDowntime RPC method.

func (*QueryDowntimeResponse) Descriptor ¶

func (*QueryDowntimeResponse) Descriptor() ([]byte, []int)

func (*QueryDowntimeResponse) GetCumulativeDowntimeDuration ¶

func (m *QueryDowntimeResponse) GetCumulativeDowntimeDuration() time.Duration

func (*QueryDowntimeResponse) Marshal ¶

func (m *QueryDowntimeResponse) Marshal() (dAtA []byte, err error)

func (*QueryDowntimeResponse) MarshalTo ¶

func (m *QueryDowntimeResponse) MarshalTo(dAtA []byte) (int, error)

func (*QueryDowntimeResponse) MarshalToSizedBuffer ¶

func (m *QueryDowntimeResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*QueryDowntimeResponse) ProtoMessage ¶

func (*QueryDowntimeResponse) ProtoMessage()

func (*QueryDowntimeResponse) Reset ¶

func (m *QueryDowntimeResponse) Reset()

func (*QueryDowntimeResponse) Size ¶

func (m *QueryDowntimeResponse) Size() (n int)

func (*QueryDowntimeResponse) String ¶

func (m *QueryDowntimeResponse) String() string

func (*QueryDowntimeResponse) Unmarshal ¶

func (m *QueryDowntimeResponse) Unmarshal(dAtA []byte) error

func (*QueryDowntimeResponse) XXX_DiscardUnknown ¶

func (m *QueryDowntimeResponse) XXX_DiscardUnknown()

func (*QueryDowntimeResponse) XXX_Marshal ¶

func (m *QueryDowntimeResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*QueryDowntimeResponse) XXX_Merge ¶

func (m *QueryDowntimeResponse) XXX_Merge(src proto.Message)

func (*QueryDowntimeResponse) XXX_Size ¶

func (m *QueryDowntimeResponse) XXX_Size() int

func (*QueryDowntimeResponse) XXX_Unmarshal ¶

func (m *QueryDowntimeResponse) XXX_Unmarshal(b []byte) error

type QueryParamsRequest ¶

type QueryParamsRequest struct {
}

func (*QueryParamsRequest) Descriptor ¶

func (*QueryParamsRequest) Descriptor() ([]byte, []int)

func (*QueryParamsRequest) Marshal ¶

func (m *QueryParamsRequest) Marshal() (dAtA []byte, err error)

func (*QueryParamsRequest) MarshalTo ¶

func (m *QueryParamsRequest) MarshalTo(dAtA []byte) (int, error)

func (*QueryParamsRequest) MarshalToSizedBuffer ¶

func (m *QueryParamsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*QueryParamsRequest) ProtoMessage ¶

func (*QueryParamsRequest) ProtoMessage()

func (*QueryParamsRequest) Reset ¶

func (m *QueryParamsRequest) Reset()

func (*QueryParamsRequest) Size ¶

func (m *QueryParamsRequest) Size() (n int)

func (*QueryParamsRequest) String ¶

func (m *QueryParamsRequest) String() string

func (*QueryParamsRequest) Unmarshal ¶

func (m *QueryParamsRequest) Unmarshal(dAtA []byte) error

func (*QueryParamsRequest) XXX_DiscardUnknown ¶

func (m *QueryParamsRequest) XXX_DiscardUnknown()

func (*QueryParamsRequest) XXX_Marshal ¶

func (m *QueryParamsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*QueryParamsRequest) XXX_Merge ¶

func (m *QueryParamsRequest) XXX_Merge(src proto.Message)

func (*QueryParamsRequest) XXX_Size ¶

func (m *QueryParamsRequest) XXX_Size() int

func (*QueryParamsRequest) XXX_Unmarshal ¶

func (m *QueryParamsRequest) XXX_Unmarshal(b []byte) error

type QueryParamsResponse ¶

type QueryParamsResponse struct {
	Params *Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params,omitempty"`
}

func (*QueryParamsResponse) Descriptor ¶

func (*QueryParamsResponse) Descriptor() ([]byte, []int)

func (*QueryParamsResponse) GetParams ¶

func (m *QueryParamsResponse) GetParams() *Params

func (*QueryParamsResponse) Marshal ¶

func (m *QueryParamsResponse) Marshal() (dAtA []byte, err error)

func (*QueryParamsResponse) MarshalTo ¶

func (m *QueryParamsResponse) MarshalTo(dAtA []byte) (int, error)

func (*QueryParamsResponse) MarshalToSizedBuffer ¶

func (m *QueryParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*QueryParamsResponse) ProtoMessage ¶

func (*QueryParamsResponse) ProtoMessage()

func (*QueryParamsResponse) Reset ¶

func (m *QueryParamsResponse) Reset()

func (*QueryParamsResponse) Size ¶

func (m *QueryParamsResponse) Size() (n int)

func (*QueryParamsResponse) String ¶

func (m *QueryParamsResponse) String() string

func (*QueryParamsResponse) Unmarshal ¶

func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error

func (*QueryParamsResponse) XXX_DiscardUnknown ¶

func (m *QueryParamsResponse) XXX_DiscardUnknown()

func (*QueryParamsResponse) XXX_Marshal ¶

func (m *QueryParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*QueryParamsResponse) XXX_Merge ¶

func (m *QueryParamsResponse) XXX_Merge(src proto.Message)

func (*QueryParamsResponse) XXX_Size ¶

func (m *QueryParamsResponse) XXX_Size() int

func (*QueryParamsResponse) XXX_Unmarshal ¶

func (m *QueryParamsResponse) XXX_Unmarshal(b []byte) error

type QueryServer ¶

type QueryServer interface {
	QueryParams(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error)
	QueryDowntime(context.Context, *QueryDowntimeRequest) (*QueryDowntimeResponse, error)
}

QueryServer is the server API for Query service.

type UnimplementedQueryServer ¶

type UnimplementedQueryServer struct {
}

UnimplementedQueryServer can be embedded to have forward compatible implementations.

func (*UnimplementedQueryServer) QueryDowntime ¶

func (*UnimplementedQueryServer) QueryParams ¶

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL