initchainsyncrpc

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2024 License: MIT Imports: 18 Imported by: 3

Documentation

Overview

Package initchainsyncrpc is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var File_initchainsyncrpc_initchainsync_proto protoreflect.FileDescriptor

Functions

func RegisterInitialChainSyncHandler added in v0.6.0

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

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

func RegisterInitialChainSyncHandlerClient added in v0.6.0

func RegisterInitialChainSyncHandlerClient(ctx context.Context, mux *runtime.ServeMux, client InitialChainSyncClient) error

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

func RegisterInitialChainSyncHandlerFromEndpoint added in v0.6.0

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

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

func RegisterInitialChainSyncHandlerServer added in v0.6.0

func RegisterInitialChainSyncHandlerServer(ctx context.Context, mux *runtime.ServeMux, server InitialChainSyncServer) error

RegisterInitialChainSyncHandlerServer registers the http handlers for service InitialChainSync to "mux". UnaryRPC :call InitialChainSyncServer 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 RegisterInitialChainSyncHandlerFromEndpoint instead.

func RegisterInitialChainSyncServer

func RegisterInitialChainSyncServer(s *grpc.Server, srv InitialChainSyncServer)

Types

type ChainSyncSubscription

type ChainSyncSubscription struct {
	// contains filtered or unexported fields
}

func (*ChainSyncSubscription) Descriptor deprecated

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

Deprecated: Use ChainSyncSubscription.ProtoReflect.Descriptor instead.

func (*ChainSyncSubscription) ProtoMessage

func (*ChainSyncSubscription) ProtoMessage()

func (*ChainSyncSubscription) ProtoReflect

func (x *ChainSyncSubscription) ProtoReflect() protoreflect.Message

func (*ChainSyncSubscription) Reset

func (x *ChainSyncSubscription) Reset()

func (*ChainSyncSubscription) String

func (x *ChainSyncSubscription) String() string

type ChainSyncUpdate

type ChainSyncUpdate struct {
	BlockHeight    int64  `protobuf:"varint,1,opt,name=block_height,json=blockHeight,proto3" json:"block_height,omitempty"`
	BlockHash      []byte `protobuf:"bytes,2,opt,name=block_hash,json=blockHash,proto3" json:"block_hash,omitempty"`
	BlockTimestamp int64  `protobuf:"varint,3,opt,name=block_timestamp,json=blockTimestamp,proto3" json:"block_timestamp,omitempty"`
	Synced         bool   `protobuf:"varint,4,opt,name=synced,proto3" json:"synced,omitempty"`
	// contains filtered or unexported fields
}

func (*ChainSyncUpdate) Descriptor deprecated

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

Deprecated: Use ChainSyncUpdate.ProtoReflect.Descriptor instead.

func (*ChainSyncUpdate) GetBlockHash

func (x *ChainSyncUpdate) GetBlockHash() []byte

func (*ChainSyncUpdate) GetBlockHeight

func (x *ChainSyncUpdate) GetBlockHeight() int64

func (*ChainSyncUpdate) GetBlockTimestamp

func (x *ChainSyncUpdate) GetBlockTimestamp() int64

func (*ChainSyncUpdate) GetSynced

func (x *ChainSyncUpdate) GetSynced() bool

func (*ChainSyncUpdate) ProtoMessage

func (*ChainSyncUpdate) ProtoMessage()

func (*ChainSyncUpdate) ProtoReflect

func (x *ChainSyncUpdate) ProtoReflect() protoreflect.Message

func (*ChainSyncUpdate) Reset

func (x *ChainSyncUpdate) Reset()

func (*ChainSyncUpdate) String

func (x *ChainSyncUpdate) String() string

type InitialChainSyncClient

type InitialChainSyncClient interface {
	// SubscribeChainSync is a streaming call that registers a client to receive
	// updates about the progress of the sync procedure. If an update message is
	// received with synced = true, then this will be the last update sent and
	// the server will be shutdown.
	SubscribeChainSync(ctx context.Context, in *ChainSyncSubscription, opts ...grpc.CallOption) (InitialChainSync_SubscribeChainSyncClient, error)
}

InitialChainSyncClient is the client API for InitialChainSync service.

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

type InitialChainSyncServer

type InitialChainSyncServer interface {
	// SubscribeChainSync is a streaming call that registers a client to receive
	// updates about the progress of the sync procedure. If an update message is
	// received with synced = true, then this will be the last update sent and
	// the server will be shutdown.
	SubscribeChainSync(*ChainSyncSubscription, InitialChainSync_SubscribeChainSyncServer) error
}

InitialChainSyncServer is the server API for InitialChainSync service.

type InitialChainSync_SubscribeChainSyncClient

type InitialChainSync_SubscribeChainSyncClient interface {
	Recv() (*ChainSyncUpdate, error)
	grpc.ClientStream
}

type InitialChainSync_SubscribeChainSyncServer

type InitialChainSync_SubscribeChainSyncServer interface {
	Send(*ChainSyncUpdate) error
	grpc.ServerStream
}

type Server

type Server struct {
	// contains filtered or unexported fields
}

Server implements the initial chain sync gRPC service server.

func New

func New() *Server

NewInitCHainSyncService initializes a new InitChainSyncService.

func (*Server) SetChainControl added in v0.5.0

func (s *Server) SetChainControl(cc lnwallet.WalletController)

SetChainControl sets the internal chain/wallet controller. MUST only be called once.

func (*Server) SubscribeChainSync

type UnimplementedInitialChainSyncServer

type UnimplementedInitialChainSyncServer struct {
}

UnimplementedInitialChainSyncServer can be embedded to have forward compatible implementations.

Jump to

Keyboard shortcuts

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