Documentation ¶
Overview ¶
Package neutrinorpc is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Constants
- Variables
- func DisableLog()
- func RegisterNeutrinoKitHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterNeutrinoKitHandlerClient(ctx context.Context, mux *runtime.ServeMux, client NeutrinoKitClient) error
- func RegisterNeutrinoKitHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterNeutrinoKitHandlerServer(ctx context.Context, mux *runtime.ServeMux, server NeutrinoKitServer) error
- func RegisterNeutrinoKitJSONCallbacks(...)
- func RegisterNeutrinoKitServer(s grpc.ServiceRegistrar, srv NeutrinoKitServer)
- func UseLogger(logger btclog.Logger)
- type AddPeerRequest
- type AddPeerResponse
- type Config
- type DisconnectPeerRequest
- func (*DisconnectPeerRequest) Descriptor() ([]byte, []int)deprecated
- func (x *DisconnectPeerRequest) GetPeerAddrs() string
- func (*DisconnectPeerRequest) ProtoMessage()
- func (x *DisconnectPeerRequest) ProtoReflect() protoreflect.Message
- func (x *DisconnectPeerRequest) Reset()
- func (x *DisconnectPeerRequest) String() string
- type DisconnectPeerResponse
- type GetBlockHashRequest
- func (*GetBlockHashRequest) Descriptor() ([]byte, []int)deprecated
- func (x *GetBlockHashRequest) GetHeight() int32
- func (*GetBlockHashRequest) ProtoMessage()
- func (x *GetBlockHashRequest) ProtoReflect() protoreflect.Message
- func (x *GetBlockHashRequest) Reset()
- func (x *GetBlockHashRequest) String() string
- type GetBlockHashResponse
- func (*GetBlockHashResponse) Descriptor() ([]byte, []int)deprecated
- func (x *GetBlockHashResponse) GetHash() string
- func (*GetBlockHashResponse) ProtoMessage()
- func (x *GetBlockHashResponse) ProtoReflect() protoreflect.Message
- func (x *GetBlockHashResponse) Reset()
- func (x *GetBlockHashResponse) String() string
- type GetBlockHeaderRequest
- func (*GetBlockHeaderRequest) Descriptor() ([]byte, []int)deprecated
- func (x *GetBlockHeaderRequest) GetHash() string
- func (*GetBlockHeaderRequest) ProtoMessage()
- func (x *GetBlockHeaderRequest) ProtoReflect() protoreflect.Message
- func (x *GetBlockHeaderRequest) Reset()
- func (x *GetBlockHeaderRequest) String() string
- type GetBlockHeaderResponse
- func (*GetBlockHeaderResponse) Descriptor() ([]byte, []int)deprecated
- func (x *GetBlockHeaderResponse) GetBits() string
- func (x *GetBlockHeaderResponse) GetConfirmations() int64
- func (x *GetBlockHeaderResponse) GetHash() string
- func (x *GetBlockHeaderResponse) GetHeight() int32
- func (x *GetBlockHeaderResponse) GetMerkleroot() string
- func (x *GetBlockHeaderResponse) GetNonce() uint32
- func (x *GetBlockHeaderResponse) GetNtx() int32
- func (x *GetBlockHeaderResponse) GetPreviousBlockHash() string
- func (x *GetBlockHeaderResponse) GetRawHex() []byte
- func (x *GetBlockHeaderResponse) GetSize() int64
- func (x *GetBlockHeaderResponse) GetStrippedSize() int64
- func (x *GetBlockHeaderResponse) GetTime() int64
- func (x *GetBlockHeaderResponse) GetVersion() int32
- func (x *GetBlockHeaderResponse) GetVersionHex() string
- func (x *GetBlockHeaderResponse) GetWeight() int64
- func (*GetBlockHeaderResponse) ProtoMessage()
- func (x *GetBlockHeaderResponse) ProtoReflect() protoreflect.Message
- func (x *GetBlockHeaderResponse) Reset()
- func (x *GetBlockHeaderResponse) String() string
- type GetBlockRequest
- type GetBlockResponse
- func (*GetBlockResponse) Descriptor() ([]byte, []int)deprecated
- func (x *GetBlockResponse) GetBits() string
- func (x *GetBlockResponse) GetConfirmations() int64
- func (x *GetBlockResponse) GetHash() string
- func (x *GetBlockResponse) GetHeight() int32
- func (x *GetBlockResponse) GetMerkleroot() string
- func (x *GetBlockResponse) GetNonce() uint32
- func (x *GetBlockResponse) GetNtx() int32
- func (x *GetBlockResponse) GetPreviousBlockHash() string
- func (x *GetBlockResponse) GetRawHex() []byte
- func (x *GetBlockResponse) GetSize() int64
- func (x *GetBlockResponse) GetStrippedSize() int64
- func (x *GetBlockResponse) GetTime() int64
- func (x *GetBlockResponse) GetTx() []string
- func (x *GetBlockResponse) GetVersion() int32
- func (x *GetBlockResponse) GetVersionHex() string
- func (x *GetBlockResponse) GetWeight() int64
- func (*GetBlockResponse) ProtoMessage()
- func (x *GetBlockResponse) ProtoReflect() protoreflect.Message
- func (x *GetBlockResponse) Reset()
- func (x *GetBlockResponse) String() string
- type GetCFilterRequest
- type GetCFilterResponse
- func (*GetCFilterResponse) Descriptor() ([]byte, []int)deprecated
- func (x *GetCFilterResponse) GetFilter() []byte
- func (*GetCFilterResponse) ProtoMessage()
- func (x *GetCFilterResponse) ProtoReflect() protoreflect.Message
- func (x *GetCFilterResponse) Reset()
- func (x *GetCFilterResponse) String() string
- type IsBannedRequest
- type IsBannedResponse
- type NeutrinoKitClient
- type NeutrinoKitServer
- type StatusRequest
- type StatusResponse
- func (*StatusResponse) Descriptor() ([]byte, []int)deprecated
- func (x *StatusResponse) GetActive() bool
- func (x *StatusResponse) GetBlockHash() string
- func (x *StatusResponse) GetBlockHeight() int32
- func (x *StatusResponse) GetPeers() []string
- func (x *StatusResponse) GetSynced() bool
- func (*StatusResponse) ProtoMessage()
- func (x *StatusResponse) ProtoReflect() protoreflect.Message
- func (x *StatusResponse) Reset()
- func (x *StatusResponse) String() string
- type UnimplementedNeutrinoKitServer
- func (UnimplementedNeutrinoKitServer) AddPeer(context.Context, *AddPeerRequest) (*AddPeerResponse, error)
- func (UnimplementedNeutrinoKitServer) DisconnectPeer(context.Context, *DisconnectPeerRequest) (*DisconnectPeerResponse, error)
- func (UnimplementedNeutrinoKitServer) GetBlock(context.Context, *GetBlockRequest) (*GetBlockResponse, error)
- func (UnimplementedNeutrinoKitServer) GetBlockHash(context.Context, *GetBlockHashRequest) (*GetBlockHashResponse, error)
- func (UnimplementedNeutrinoKitServer) GetBlockHeader(context.Context, *GetBlockHeaderRequest) (*GetBlockHeaderResponse, error)
- func (UnimplementedNeutrinoKitServer) GetCFilter(context.Context, *GetCFilterRequest) (*GetCFilterResponse, error)
- func (UnimplementedNeutrinoKitServer) IsBanned(context.Context, *IsBannedRequest) (*IsBannedResponse, error)
- func (UnimplementedNeutrinoKitServer) Status(context.Context, *StatusRequest) (*StatusResponse, error)
- type UnsafeNeutrinoKitServer
Constants ¶
const Subsystem = "NRPC"
Subsystem defines the logging code for this subsystem.
Variables ¶
var File_neutrinorpc_neutrino_proto protoreflect.FileDescriptor
var NeutrinoKit_ServiceDesc = grpc.ServiceDesc{ ServiceName: "neutrinorpc.NeutrinoKit", HandlerType: (*NeutrinoKitServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Status", Handler: _NeutrinoKit_Status_Handler, }, { MethodName: "AddPeer", Handler: _NeutrinoKit_AddPeer_Handler, }, { MethodName: "DisconnectPeer", Handler: _NeutrinoKit_DisconnectPeer_Handler, }, { MethodName: "IsBanned", Handler: _NeutrinoKit_IsBanned_Handler, }, { MethodName: "GetBlockHeader", Handler: _NeutrinoKit_GetBlockHeader_Handler, }, { MethodName: "GetBlock", Handler: _NeutrinoKit_GetBlock_Handler, }, { MethodName: "GetCFilter", Handler: _NeutrinoKit_GetCFilter_Handler, }, { MethodName: "GetBlockHash", Handler: _NeutrinoKit_GetBlockHash_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "neutrinorpc/neutrino.proto", }
NeutrinoKit_ServiceDesc is the grpc.ServiceDesc for NeutrinoKit service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func DisableLog ¶
func DisableLog()
DisableLog disables all library log output. Logging output is disabled by default until UseLogger is called.
func RegisterNeutrinoKitHandler ¶
func RegisterNeutrinoKitHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterNeutrinoKitHandler registers the http handlers for service NeutrinoKit to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterNeutrinoKitHandlerClient ¶
func RegisterNeutrinoKitHandlerClient(ctx context.Context, mux *runtime.ServeMux, client NeutrinoKitClient) error
RegisterNeutrinoKitHandlerClient registers the http handlers for service NeutrinoKit to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "NeutrinoKitClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "NeutrinoKitClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "NeutrinoKitClient" to call the correct interceptors.
func RegisterNeutrinoKitHandlerFromEndpoint ¶
func RegisterNeutrinoKitHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterNeutrinoKitHandlerFromEndpoint is same as RegisterNeutrinoKitHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterNeutrinoKitHandlerServer ¶
func RegisterNeutrinoKitHandlerServer(ctx context.Context, mux *runtime.ServeMux, server NeutrinoKitServer) error
RegisterNeutrinoKitHandlerServer registers the http handlers for service NeutrinoKit to "mux". UnaryRPC :call NeutrinoKitServer 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 RegisterNeutrinoKitHandlerFromEndpoint instead.
func RegisterNeutrinoKitServer ¶
func RegisterNeutrinoKitServer(s grpc.ServiceRegistrar, srv NeutrinoKitServer)
Types ¶
type AddPeerRequest ¶
type AddPeerRequest struct { // Peer to add. PeerAddrs string `protobuf:"bytes,1,opt,name=peer_addrs,json=peerAddrs,proto3" json:"peer_addrs,omitempty"` // contains filtered or unexported fields }
func (*AddPeerRequest) Descriptor
deprecated
func (*AddPeerRequest) Descriptor() ([]byte, []int)
Deprecated: Use AddPeerRequest.ProtoReflect.Descriptor instead.
func (*AddPeerRequest) GetPeerAddrs ¶
func (x *AddPeerRequest) GetPeerAddrs() string
func (*AddPeerRequest) ProtoMessage ¶
func (*AddPeerRequest) ProtoMessage()
func (*AddPeerRequest) ProtoReflect ¶
func (x *AddPeerRequest) ProtoReflect() protoreflect.Message
func (*AddPeerRequest) Reset ¶
func (x *AddPeerRequest) Reset()
func (*AddPeerRequest) String ¶
func (x *AddPeerRequest) String() string
type AddPeerResponse ¶
type AddPeerResponse struct {
// contains filtered or unexported fields
}
func (*AddPeerResponse) Descriptor
deprecated
func (*AddPeerResponse) Descriptor() ([]byte, []int)
Deprecated: Use AddPeerResponse.ProtoReflect.Descriptor instead.
func (*AddPeerResponse) ProtoMessage ¶
func (*AddPeerResponse) ProtoMessage()
func (*AddPeerResponse) ProtoReflect ¶
func (x *AddPeerResponse) ProtoReflect() protoreflect.Message
func (*AddPeerResponse) Reset ¶
func (x *AddPeerResponse) Reset()
func (*AddPeerResponse) String ¶
func (x *AddPeerResponse) String() string
type DisconnectPeerRequest ¶
type DisconnectPeerRequest struct { // Peer to disconnect. PeerAddrs string `protobuf:"bytes,1,opt,name=peer_addrs,json=peerAddrs,proto3" json:"peer_addrs,omitempty"` // contains filtered or unexported fields }
func (*DisconnectPeerRequest) Descriptor
deprecated
func (*DisconnectPeerRequest) Descriptor() ([]byte, []int)
Deprecated: Use DisconnectPeerRequest.ProtoReflect.Descriptor instead.
func (*DisconnectPeerRequest) GetPeerAddrs ¶
func (x *DisconnectPeerRequest) GetPeerAddrs() string
func (*DisconnectPeerRequest) ProtoMessage ¶
func (*DisconnectPeerRequest) ProtoMessage()
func (*DisconnectPeerRequest) ProtoReflect ¶
func (x *DisconnectPeerRequest) ProtoReflect() protoreflect.Message
func (*DisconnectPeerRequest) Reset ¶
func (x *DisconnectPeerRequest) Reset()
func (*DisconnectPeerRequest) String ¶
func (x *DisconnectPeerRequest) String() string
type DisconnectPeerResponse ¶
type DisconnectPeerResponse struct {
// contains filtered or unexported fields
}
func (*DisconnectPeerResponse) Descriptor
deprecated
func (*DisconnectPeerResponse) Descriptor() ([]byte, []int)
Deprecated: Use DisconnectPeerResponse.ProtoReflect.Descriptor instead.
func (*DisconnectPeerResponse) ProtoMessage ¶
func (*DisconnectPeerResponse) ProtoMessage()
func (*DisconnectPeerResponse) ProtoReflect ¶
func (x *DisconnectPeerResponse) ProtoReflect() protoreflect.Message
func (*DisconnectPeerResponse) Reset ¶
func (x *DisconnectPeerResponse) Reset()
func (*DisconnectPeerResponse) String ¶
func (x *DisconnectPeerResponse) String() string
type GetBlockHashRequest ¶
type GetBlockHashRequest struct { // The block height or index. Height int32 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"` // contains filtered or unexported fields }
func (*GetBlockHashRequest) Descriptor
deprecated
func (*GetBlockHashRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetBlockHashRequest.ProtoReflect.Descriptor instead.
func (*GetBlockHashRequest) GetHeight ¶
func (x *GetBlockHashRequest) GetHeight() int32
func (*GetBlockHashRequest) ProtoMessage ¶
func (*GetBlockHashRequest) ProtoMessage()
func (*GetBlockHashRequest) ProtoReflect ¶
func (x *GetBlockHashRequest) ProtoReflect() protoreflect.Message
func (*GetBlockHashRequest) Reset ¶
func (x *GetBlockHashRequest) Reset()
func (*GetBlockHashRequest) String ¶
func (x *GetBlockHashRequest) String() string
type GetBlockHashResponse ¶
type GetBlockHashResponse struct { // The block hash. Hash string `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"` // contains filtered or unexported fields }
func (*GetBlockHashResponse) Descriptor
deprecated
func (*GetBlockHashResponse) Descriptor() ([]byte, []int)
Deprecated: Use GetBlockHashResponse.ProtoReflect.Descriptor instead.
func (*GetBlockHashResponse) GetHash ¶
func (x *GetBlockHashResponse) GetHash() string
func (*GetBlockHashResponse) ProtoMessage ¶
func (*GetBlockHashResponse) ProtoMessage()
func (*GetBlockHashResponse) ProtoReflect ¶
func (x *GetBlockHashResponse) ProtoReflect() protoreflect.Message
func (*GetBlockHashResponse) Reset ¶
func (x *GetBlockHashResponse) Reset()
func (*GetBlockHashResponse) String ¶
func (x *GetBlockHashResponse) String() string
type GetBlockHeaderRequest ¶
type GetBlockHeaderRequest struct { // Block hash in hex notation. Hash string `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"` // contains filtered or unexported fields }
func (*GetBlockHeaderRequest) Descriptor
deprecated
func (*GetBlockHeaderRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetBlockHeaderRequest.ProtoReflect.Descriptor instead.
func (*GetBlockHeaderRequest) GetHash ¶
func (x *GetBlockHeaderRequest) GetHash() string
func (*GetBlockHeaderRequest) ProtoMessage ¶
func (*GetBlockHeaderRequest) ProtoMessage()
func (*GetBlockHeaderRequest) ProtoReflect ¶
func (x *GetBlockHeaderRequest) ProtoReflect() protoreflect.Message
func (*GetBlockHeaderRequest) Reset ¶
func (x *GetBlockHeaderRequest) Reset()
func (*GetBlockHeaderRequest) String ¶
func (x *GetBlockHeaderRequest) String() string
type GetBlockHeaderResponse ¶
type GetBlockHeaderResponse struct { // The block hash (same as provided). Hash string `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"` // The number of confirmations. Confirmations int64 `protobuf:"varint,2,opt,name=confirmations,proto3" json:"confirmations,omitempty"` // The block size excluding witness data. StrippedSize int64 `protobuf:"varint,3,opt,name=stripped_size,json=strippedSize,proto3" json:"stripped_size,omitempty"` // The block size (bytes). Size int64 `protobuf:"varint,4,opt,name=size,proto3" json:"size,omitempty"` // The block weight as defined in BIP 141. Weight int64 `protobuf:"varint,5,opt,name=weight,proto3" json:"weight,omitempty"` // The block height or index. Height int32 `protobuf:"varint,6,opt,name=height,proto3" json:"height,omitempty"` // The block version. Version int32 `protobuf:"varint,7,opt,name=version,proto3" json:"version,omitempty"` // The block version. VersionHex string `protobuf:"bytes,8,opt,name=version_hex,json=versionHex,proto3" json:"version_hex,omitempty"` // The merkle root. Merkleroot string `protobuf:"bytes,9,opt,name=merkleroot,proto3" json:"merkleroot,omitempty"` // The block time in seconds since epoch (Jan 1 1970 GMT). Time int64 `protobuf:"varint,10,opt,name=time,proto3" json:"time,omitempty"` // The nonce. Nonce uint32 `protobuf:"varint,11,opt,name=nonce,proto3" json:"nonce,omitempty"` // The bits in hex notation. Bits string `protobuf:"bytes,12,opt,name=bits,proto3" json:"bits,omitempty"` // The number of transactions in the block. Ntx int32 `protobuf:"varint,13,opt,name=ntx,proto3" json:"ntx,omitempty"` // The hash of the previous block. PreviousBlockHash string `protobuf:"bytes,14,opt,name=previous_block_hash,json=previousBlockHash,proto3" json:"previous_block_hash,omitempty"` // The raw hex of the block. RawHex []byte `protobuf:"bytes,15,opt,name=raw_hex,json=rawHex,proto3" json:"raw_hex,omitempty"` // contains filtered or unexported fields }
func (*GetBlockHeaderResponse) Descriptor
deprecated
func (*GetBlockHeaderResponse) Descriptor() ([]byte, []int)
Deprecated: Use GetBlockHeaderResponse.ProtoReflect.Descriptor instead.
func (*GetBlockHeaderResponse) GetBits ¶
func (x *GetBlockHeaderResponse) GetBits() string
func (*GetBlockHeaderResponse) GetConfirmations ¶
func (x *GetBlockHeaderResponse) GetConfirmations() int64
func (*GetBlockHeaderResponse) GetHash ¶
func (x *GetBlockHeaderResponse) GetHash() string
func (*GetBlockHeaderResponse) GetHeight ¶
func (x *GetBlockHeaderResponse) GetHeight() int32
func (*GetBlockHeaderResponse) GetMerkleroot ¶
func (x *GetBlockHeaderResponse) GetMerkleroot() string
func (*GetBlockHeaderResponse) GetNonce ¶
func (x *GetBlockHeaderResponse) GetNonce() uint32
func (*GetBlockHeaderResponse) GetNtx ¶
func (x *GetBlockHeaderResponse) GetNtx() int32
func (*GetBlockHeaderResponse) GetPreviousBlockHash ¶
func (x *GetBlockHeaderResponse) GetPreviousBlockHash() string
func (*GetBlockHeaderResponse) GetRawHex ¶
func (x *GetBlockHeaderResponse) GetRawHex() []byte
func (*GetBlockHeaderResponse) GetSize ¶
func (x *GetBlockHeaderResponse) GetSize() int64
func (*GetBlockHeaderResponse) GetStrippedSize ¶
func (x *GetBlockHeaderResponse) GetStrippedSize() int64
func (*GetBlockHeaderResponse) GetTime ¶
func (x *GetBlockHeaderResponse) GetTime() int64
func (*GetBlockHeaderResponse) GetVersion ¶
func (x *GetBlockHeaderResponse) GetVersion() int32
func (*GetBlockHeaderResponse) GetVersionHex ¶
func (x *GetBlockHeaderResponse) GetVersionHex() string
func (*GetBlockHeaderResponse) GetWeight ¶
func (x *GetBlockHeaderResponse) GetWeight() int64
func (*GetBlockHeaderResponse) ProtoMessage ¶
func (*GetBlockHeaderResponse) ProtoMessage()
func (*GetBlockHeaderResponse) ProtoReflect ¶
func (x *GetBlockHeaderResponse) ProtoReflect() protoreflect.Message
func (*GetBlockHeaderResponse) Reset ¶
func (x *GetBlockHeaderResponse) Reset()
func (*GetBlockHeaderResponse) String ¶
func (x *GetBlockHeaderResponse) String() string
type GetBlockRequest ¶
type GetBlockRequest struct { // Block hash in hex notation. Hash string `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"` // contains filtered or unexported fields }
func (*GetBlockRequest) Descriptor
deprecated
func (*GetBlockRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetBlockRequest.ProtoReflect.Descriptor instead.
func (*GetBlockRequest) GetHash ¶
func (x *GetBlockRequest) GetHash() string
func (*GetBlockRequest) ProtoMessage ¶
func (*GetBlockRequest) ProtoMessage()
func (*GetBlockRequest) ProtoReflect ¶
func (x *GetBlockRequest) ProtoReflect() protoreflect.Message
func (*GetBlockRequest) Reset ¶
func (x *GetBlockRequest) Reset()
func (*GetBlockRequest) String ¶
func (x *GetBlockRequest) String() string
type GetBlockResponse ¶
type GetBlockResponse struct { // The block hash (same as provided). Hash string `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"` // The number of confirmations. Confirmations int64 `protobuf:"varint,2,opt,name=confirmations,proto3" json:"confirmations,omitempty"` // The block size excluding witness data. StrippedSize int64 `protobuf:"varint,3,opt,name=stripped_size,json=strippedSize,proto3" json:"stripped_size,omitempty"` // The block size (bytes). Size int64 `protobuf:"varint,4,opt,name=size,proto3" json:"size,omitempty"` // The block weight as defined in BIP 141. Weight int64 `protobuf:"varint,5,opt,name=weight,proto3" json:"weight,omitempty"` // The block height or index. Height int32 `protobuf:"varint,6,opt,name=height,proto3" json:"height,omitempty"` // The block version. Version int32 `protobuf:"varint,7,opt,name=version,proto3" json:"version,omitempty"` // The block version. VersionHex string `protobuf:"bytes,8,opt,name=version_hex,json=versionHex,proto3" json:"version_hex,omitempty"` // The merkle root. Merkleroot string `protobuf:"bytes,9,opt,name=merkleroot,proto3" json:"merkleroot,omitempty"` // List of transaction ids. Tx []string `protobuf:"bytes,10,rep,name=tx,proto3" json:"tx,omitempty"` // The block time in seconds since epoch (Jan 1 1970 GMT). Time int64 `protobuf:"varint,11,opt,name=time,proto3" json:"time,omitempty"` // The nonce. Nonce uint32 `protobuf:"varint,12,opt,name=nonce,proto3" json:"nonce,omitempty"` // The bits in hex notation. Bits string `protobuf:"bytes,13,opt,name=bits,proto3" json:"bits,omitempty"` // The number of transactions in the block. Ntx int32 `protobuf:"varint,14,opt,name=ntx,proto3" json:"ntx,omitempty"` // The hash of the previous block. PreviousBlockHash string `protobuf:"bytes,15,opt,name=previous_block_hash,json=previousBlockHash,proto3" json:"previous_block_hash,omitempty"` // The raw hex of the block. RawHex []byte `protobuf:"bytes,16,opt,name=raw_hex,json=rawHex,proto3" json:"raw_hex,omitempty"` // contains filtered or unexported fields }
func (*GetBlockResponse) Descriptor
deprecated
func (*GetBlockResponse) Descriptor() ([]byte, []int)
Deprecated: Use GetBlockResponse.ProtoReflect.Descriptor instead.
func (*GetBlockResponse) GetBits ¶
func (x *GetBlockResponse) GetBits() string
func (*GetBlockResponse) GetConfirmations ¶
func (x *GetBlockResponse) GetConfirmations() int64
func (*GetBlockResponse) GetHash ¶
func (x *GetBlockResponse) GetHash() string
func (*GetBlockResponse) GetHeight ¶
func (x *GetBlockResponse) GetHeight() int32
func (*GetBlockResponse) GetMerkleroot ¶
func (x *GetBlockResponse) GetMerkleroot() string
func (*GetBlockResponse) GetNonce ¶
func (x *GetBlockResponse) GetNonce() uint32
func (*GetBlockResponse) GetNtx ¶
func (x *GetBlockResponse) GetNtx() int32
func (*GetBlockResponse) GetPreviousBlockHash ¶
func (x *GetBlockResponse) GetPreviousBlockHash() string
func (*GetBlockResponse) GetRawHex ¶
func (x *GetBlockResponse) GetRawHex() []byte
func (*GetBlockResponse) GetSize ¶
func (x *GetBlockResponse) GetSize() int64
func (*GetBlockResponse) GetStrippedSize ¶
func (x *GetBlockResponse) GetStrippedSize() int64
func (*GetBlockResponse) GetTime ¶
func (x *GetBlockResponse) GetTime() int64
func (*GetBlockResponse) GetTx ¶
func (x *GetBlockResponse) GetTx() []string
func (*GetBlockResponse) GetVersion ¶
func (x *GetBlockResponse) GetVersion() int32
func (*GetBlockResponse) GetVersionHex ¶
func (x *GetBlockResponse) GetVersionHex() string
func (*GetBlockResponse) GetWeight ¶
func (x *GetBlockResponse) GetWeight() int64
func (*GetBlockResponse) ProtoMessage ¶
func (*GetBlockResponse) ProtoMessage()
func (*GetBlockResponse) ProtoReflect ¶
func (x *GetBlockResponse) ProtoReflect() protoreflect.Message
func (*GetBlockResponse) Reset ¶
func (x *GetBlockResponse) Reset()
func (*GetBlockResponse) String ¶
func (x *GetBlockResponse) String() string
type GetCFilterRequest ¶
type GetCFilterRequest struct { // Block hash in hex notation. Hash string `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"` // contains filtered or unexported fields }
func (*GetCFilterRequest) Descriptor
deprecated
func (*GetCFilterRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetCFilterRequest.ProtoReflect.Descriptor instead.
func (*GetCFilterRequest) GetHash ¶
func (x *GetCFilterRequest) GetHash() string
func (*GetCFilterRequest) ProtoMessage ¶
func (*GetCFilterRequest) ProtoMessage()
func (*GetCFilterRequest) ProtoReflect ¶
func (x *GetCFilterRequest) ProtoReflect() protoreflect.Message
func (*GetCFilterRequest) Reset ¶
func (x *GetCFilterRequest) Reset()
func (*GetCFilterRequest) String ¶
func (x *GetCFilterRequest) String() string
type GetCFilterResponse ¶
type GetCFilterResponse struct { // GCS filter. Filter []byte `protobuf:"bytes,1,opt,name=filter,proto3" json:"filter,omitempty"` // contains filtered or unexported fields }
func (*GetCFilterResponse) Descriptor
deprecated
func (*GetCFilterResponse) Descriptor() ([]byte, []int)
Deprecated: Use GetCFilterResponse.ProtoReflect.Descriptor instead.
func (*GetCFilterResponse) GetFilter ¶
func (x *GetCFilterResponse) GetFilter() []byte
func (*GetCFilterResponse) ProtoMessage ¶
func (*GetCFilterResponse) ProtoMessage()
func (*GetCFilterResponse) ProtoReflect ¶
func (x *GetCFilterResponse) ProtoReflect() protoreflect.Message
func (*GetCFilterResponse) Reset ¶
func (x *GetCFilterResponse) Reset()
func (*GetCFilterResponse) String ¶
func (x *GetCFilterResponse) String() string
type IsBannedRequest ¶
type IsBannedRequest struct { // Peer to lookup. PeerAddrs string `protobuf:"bytes,1,opt,name=peer_addrs,json=peerAddrs,proto3" json:"peer_addrs,omitempty"` // contains filtered or unexported fields }
func (*IsBannedRequest) Descriptor
deprecated
func (*IsBannedRequest) Descriptor() ([]byte, []int)
Deprecated: Use IsBannedRequest.ProtoReflect.Descriptor instead.
func (*IsBannedRequest) GetPeerAddrs ¶
func (x *IsBannedRequest) GetPeerAddrs() string
func (*IsBannedRequest) ProtoMessage ¶
func (*IsBannedRequest) ProtoMessage()
func (*IsBannedRequest) ProtoReflect ¶
func (x *IsBannedRequest) ProtoReflect() protoreflect.Message
func (*IsBannedRequest) Reset ¶
func (x *IsBannedRequest) Reset()
func (*IsBannedRequest) String ¶
func (x *IsBannedRequest) String() string
type IsBannedResponse ¶
type IsBannedResponse struct { Banned bool `protobuf:"varint,1,opt,name=banned,proto3" json:"banned,omitempty"` // contains filtered or unexported fields }
func (*IsBannedResponse) Descriptor
deprecated
func (*IsBannedResponse) Descriptor() ([]byte, []int)
Deprecated: Use IsBannedResponse.ProtoReflect.Descriptor instead.
func (*IsBannedResponse) GetBanned ¶
func (x *IsBannedResponse) GetBanned() bool
func (*IsBannedResponse) ProtoMessage ¶
func (*IsBannedResponse) ProtoMessage()
func (*IsBannedResponse) ProtoReflect ¶
func (x *IsBannedResponse) ProtoReflect() protoreflect.Message
func (*IsBannedResponse) Reset ¶
func (x *IsBannedResponse) Reset()
func (*IsBannedResponse) String ¶
func (x *IsBannedResponse) String() string
type NeutrinoKitClient ¶
type NeutrinoKitClient interface { // Status returns the status of the light client neutrino instance, // along with height and hash of the best block, and a list of connected // peers. Status(ctx context.Context, in *StatusRequest, opts ...grpc.CallOption) (*StatusResponse, error) // AddPeer adds a new peer that has already been connected to the server. AddPeer(ctx context.Context, in *AddPeerRequest, opts ...grpc.CallOption) (*AddPeerResponse, error) // DisconnectPeer disconnects a peer by target address. Both outbound and // inbound nodes will be searched for the target node. An error message will // be returned if the peer was not found. DisconnectPeer(ctx context.Context, in *DisconnectPeerRequest, opts ...grpc.CallOption) (*DisconnectPeerResponse, error) // IsBanned returns true if the peer is banned, otherwise false. IsBanned(ctx context.Context, in *IsBannedRequest, opts ...grpc.CallOption) (*IsBannedResponse, error) // GetBlockHeader returns a block header with a particular block hash. GetBlockHeader(ctx context.Context, in *GetBlockHeaderRequest, opts ...grpc.CallOption) (*GetBlockHeaderResponse, error) // GetBlock returns a block with a particular block hash. GetBlock(ctx context.Context, in *GetBlockRequest, opts ...grpc.CallOption) (*GetBlockResponse, error) // GetCFilter returns a compact filter from a block. GetCFilter(ctx context.Context, in *GetCFilterRequest, opts ...grpc.CallOption) (*GetCFilterResponse, error) // Deprecated: Do not use. // // Deprecated, use chainrpc.GetBlockHash instead. // GetBlockHash returns the header hash of a block at a given height. GetBlockHash(ctx context.Context, in *GetBlockHashRequest, opts ...grpc.CallOption) (*GetBlockHashResponse, error) }
NeutrinoKitClient is the client API for NeutrinoKit service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
func NewNeutrinoKitClient ¶
func NewNeutrinoKitClient(cc grpc.ClientConnInterface) NeutrinoKitClient
type NeutrinoKitServer ¶
type NeutrinoKitServer interface { // Status returns the status of the light client neutrino instance, // along with height and hash of the best block, and a list of connected // peers. Status(context.Context, *StatusRequest) (*StatusResponse, error) // AddPeer adds a new peer that has already been connected to the server. AddPeer(context.Context, *AddPeerRequest) (*AddPeerResponse, error) // DisconnectPeer disconnects a peer by target address. Both outbound and // inbound nodes will be searched for the target node. An error message will // be returned if the peer was not found. DisconnectPeer(context.Context, *DisconnectPeerRequest) (*DisconnectPeerResponse, error) // IsBanned returns true if the peer is banned, otherwise false. IsBanned(context.Context, *IsBannedRequest) (*IsBannedResponse, error) // GetBlockHeader returns a block header with a particular block hash. GetBlockHeader(context.Context, *GetBlockHeaderRequest) (*GetBlockHeaderResponse, error) // GetBlock returns a block with a particular block hash. GetBlock(context.Context, *GetBlockRequest) (*GetBlockResponse, error) // GetCFilter returns a compact filter from a block. GetCFilter(context.Context, *GetCFilterRequest) (*GetCFilterResponse, error) // Deprecated: Do not use. // // Deprecated, use chainrpc.GetBlockHash instead. // GetBlockHash returns the header hash of a block at a given height. GetBlockHash(context.Context, *GetBlockHashRequest) (*GetBlockHashResponse, error) // contains filtered or unexported methods }
NeutrinoKitServer is the server API for NeutrinoKit service. All implementations must embed UnimplementedNeutrinoKitServer for forward compatibility
type StatusRequest ¶
type StatusRequest struct {
// contains filtered or unexported fields
}
func (*StatusRequest) Descriptor
deprecated
func (*StatusRequest) Descriptor() ([]byte, []int)
Deprecated: Use StatusRequest.ProtoReflect.Descriptor instead.
func (*StatusRequest) ProtoMessage ¶
func (*StatusRequest) ProtoMessage()
func (*StatusRequest) ProtoReflect ¶
func (x *StatusRequest) ProtoReflect() protoreflect.Message
func (*StatusRequest) Reset ¶
func (x *StatusRequest) Reset()
func (*StatusRequest) String ¶
func (x *StatusRequest) String() string
type StatusResponse ¶
type StatusResponse struct { // Indicates whether the neutrino backend is active or not. Active bool `protobuf:"varint,1,opt,name=active,proto3" json:"active,omitempty"` // Is fully synced. Synced bool `protobuf:"varint,2,opt,name=synced,proto3" json:"synced,omitempty"` // Best block height. BlockHeight int32 `protobuf:"varint,3,opt,name=block_height,json=blockHeight,proto3" json:"block_height,omitempty"` // Best block hash. BlockHash string `protobuf:"bytes,4,opt,name=block_hash,json=blockHash,proto3" json:"block_hash,omitempty"` // Connected peers. Peers []string `protobuf:"bytes,5,rep,name=peers,proto3" json:"peers,omitempty"` // contains filtered or unexported fields }
func (*StatusResponse) Descriptor
deprecated
func (*StatusResponse) Descriptor() ([]byte, []int)
Deprecated: Use StatusResponse.ProtoReflect.Descriptor instead.
func (*StatusResponse) GetActive ¶
func (x *StatusResponse) GetActive() bool
func (*StatusResponse) GetBlockHash ¶
func (x *StatusResponse) GetBlockHash() string
func (*StatusResponse) GetBlockHeight ¶
func (x *StatusResponse) GetBlockHeight() int32
func (*StatusResponse) GetPeers ¶
func (x *StatusResponse) GetPeers() []string
func (*StatusResponse) GetSynced ¶
func (x *StatusResponse) GetSynced() bool
func (*StatusResponse) ProtoMessage ¶
func (*StatusResponse) ProtoMessage()
func (*StatusResponse) ProtoReflect ¶
func (x *StatusResponse) ProtoReflect() protoreflect.Message
func (*StatusResponse) Reset ¶
func (x *StatusResponse) Reset()
func (*StatusResponse) String ¶
func (x *StatusResponse) String() string
type UnimplementedNeutrinoKitServer ¶
type UnimplementedNeutrinoKitServer struct { }
UnimplementedNeutrinoKitServer must be embedded to have forward compatible implementations.
func (UnimplementedNeutrinoKitServer) AddPeer ¶
func (UnimplementedNeutrinoKitServer) AddPeer(context.Context, *AddPeerRequest) (*AddPeerResponse, error)
func (UnimplementedNeutrinoKitServer) DisconnectPeer ¶
func (UnimplementedNeutrinoKitServer) DisconnectPeer(context.Context, *DisconnectPeerRequest) (*DisconnectPeerResponse, error)
func (UnimplementedNeutrinoKitServer) GetBlock ¶
func (UnimplementedNeutrinoKitServer) GetBlock(context.Context, *GetBlockRequest) (*GetBlockResponse, error)
func (UnimplementedNeutrinoKitServer) GetBlockHash ¶
func (UnimplementedNeutrinoKitServer) GetBlockHash(context.Context, *GetBlockHashRequest) (*GetBlockHashResponse, error)
func (UnimplementedNeutrinoKitServer) GetBlockHeader ¶
func (UnimplementedNeutrinoKitServer) GetBlockHeader(context.Context, *GetBlockHeaderRequest) (*GetBlockHeaderResponse, error)
func (UnimplementedNeutrinoKitServer) GetCFilter ¶
func (UnimplementedNeutrinoKitServer) GetCFilter(context.Context, *GetCFilterRequest) (*GetCFilterResponse, error)
func (UnimplementedNeutrinoKitServer) IsBanned ¶
func (UnimplementedNeutrinoKitServer) IsBanned(context.Context, *IsBannedRequest) (*IsBannedResponse, error)
func (UnimplementedNeutrinoKitServer) Status ¶
func (UnimplementedNeutrinoKitServer) Status(context.Context, *StatusRequest) (*StatusResponse, error)
type UnsafeNeutrinoKitServer ¶
type UnsafeNeutrinoKitServer interface {
// contains filtered or unexported methods
}
UnsafeNeutrinoKitServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to NeutrinoKitServer will result in compilation errors.