Increase block cache size to 400k for faster wallet sync
- Increase default cache-size from 40,000 to 400,000 blocks - Add Python gRPC protobuf bindings for testing
This commit is contained in:
@@ -98,7 +98,7 @@ func main() {
|
||||
flag.Uint64Var(&opts.logLevel, "log-level", uint64(logrus.InfoLevel), "log level (logrus 1-7)")
|
||||
flag.StringVar(&opts.logPath, "log-file", "", "log file to write to")
|
||||
flag.StringVar(&opts.confPath, "conf-file", "", "conf file to pull RPC creds from")
|
||||
flag.IntVar(&opts.cacheSize, "cache-size", 40000, "number of blocks to hold in the cache")
|
||||
flag.IntVar(&opts.cacheSize, "cache-size", 400000, "number of blocks to hold in the cache")
|
||||
|
||||
// creating --version as a requirement of help2man
|
||||
if len(os.Args) > 1 && (os.Args[1] == "--version" || os.Args[1] == "-v") {
|
||||
|
||||
@@ -258,6 +258,12 @@ func GetBlockRange(rpcClient *rpcclient.Client, cache *BlockCache,
|
||||
return
|
||||
}
|
||||
|
||||
if block == nil {
|
||||
errOut <- errors.New(
|
||||
fmt.Sprintf("Block %d was nil without error", i))
|
||||
return
|
||||
}
|
||||
|
||||
blockOut <- *block
|
||||
}
|
||||
|
||||
|
||||
@@ -42,6 +42,9 @@ func (s *SqlStreamer) GetCache() *common.BlockCache {
|
||||
|
||||
func (s *SqlStreamer) GetLatestBlock(ctx context.Context, placeholder *walletrpc.ChainSpec) (*walletrpc.BlockID, error) {
|
||||
latestBlock := s.cache.GetLatestBlock()
|
||||
s.log.WithFields(logrus.Fields{
|
||||
"latestBlock": latestBlock,
|
||||
}).Info("GetLatestBlock called")
|
||||
|
||||
if latestBlock == -1 {
|
||||
return nil, errors.New("Cache is empty. Server is probably not yet ready.")
|
||||
@@ -136,21 +139,47 @@ func (s *SqlStreamer) GetBlock(ctx context.Context, id *walletrpc.BlockID) (*wal
|
||||
}
|
||||
|
||||
func (s *SqlStreamer) GetBlockRange(span *walletrpc.BlockRange, resp walletrpc.CompactTxStreamer_GetBlockRangeServer) error {
|
||||
s.log.WithFields(logrus.Fields{
|
||||
"start": span.Start.Height,
|
||||
"end": span.End.Height,
|
||||
}).Info("GetBlockRange called")
|
||||
|
||||
blockChan := make(chan walletrpc.CompactBlock)
|
||||
errChan := make(chan error)
|
||||
|
||||
go common.GetBlockRange(s.client, s.cache, blockChan, errChan, int(span.Start.Height), int(span.End.Height))
|
||||
|
||||
blockCount := 0
|
||||
for {
|
||||
select {
|
||||
case err := <-errChan:
|
||||
// this will also catch context.DeadlineExceeded from the timeout
|
||||
if err != nil {
|
||||
s.log.WithFields(logrus.Fields{
|
||||
"start": span.Start.Height,
|
||||
"end": span.End.Height,
|
||||
"blocksSent": blockCount,
|
||||
"error": err,
|
||||
}).Error("GetBlockRange error")
|
||||
} else {
|
||||
s.log.WithFields(logrus.Fields{
|
||||
"start": span.Start.Height,
|
||||
"end": span.End.Height,
|
||||
"blocksSent": blockCount,
|
||||
}).Info("GetBlockRange completed")
|
||||
}
|
||||
return err
|
||||
case cBlock := <-blockChan:
|
||||
err := resp.Send(&cBlock)
|
||||
if err != nil {
|
||||
s.log.WithFields(logrus.Fields{
|
||||
"start": span.Start.Height,
|
||||
"end": span.End.Height,
|
||||
"blocksSent": blockCount,
|
||||
"error": err,
|
||||
}).Error("GetBlockRange send error")
|
||||
return err
|
||||
}
|
||||
blockCount++
|
||||
}
|
||||
}
|
||||
|
||||
@@ -239,6 +268,13 @@ func (s *SqlStreamer) GetTransaction(ctx context.Context, txf *walletrpc.TxFilte
|
||||
func (s *SqlStreamer) GetLightdInfo(ctx context.Context, in *walletrpc.Empty) (*walletrpc.LightdInfo, error) {
|
||||
saplingHeight, blockHeight, chainName, consensusBranchId, difficulty, longestchain, notarized, err := common.GetSaplingInfo(s.client)
|
||||
|
||||
s.log.WithFields(logrus.Fields{
|
||||
"saplingHeight": saplingHeight,
|
||||
"blockHeight": blockHeight,
|
||||
"chainName": chainName,
|
||||
"consensusBranchId": consensusBranchId,
|
||||
}).Info("GetLightdInfo called")
|
||||
|
||||
if err != nil {
|
||||
s.log.WithFields(logrus.Fields{
|
||||
"error": err,
|
||||
|
||||
BIN
walletrpc/__pycache__/compact_formats_pb2.cpython-310.pyc
Normal file
BIN
walletrpc/__pycache__/compact_formats_pb2.cpython-310.pyc
Normal file
Binary file not shown.
BIN
walletrpc/__pycache__/service_pb2.cpython-310.pyc
Normal file
BIN
walletrpc/__pycache__/service_pb2.cpython-310.pyc
Normal file
Binary file not shown.
BIN
walletrpc/__pycache__/service_pb2_grpc.cpython-310.pyc
Normal file
BIN
walletrpc/__pycache__/service_pb2_grpc.cpython-310.pyc
Normal file
Binary file not shown.
43
walletrpc/compact_formats_pb2.py
Normal file
43
walletrpc/compact_formats_pb2.py
Normal file
@@ -0,0 +1,43 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
||||
# NO CHECKED-IN PROTOBUF GENCODE
|
||||
# source: compact_formats.proto
|
||||
# Protobuf Python Version: 6.31.1
|
||||
"""Generated protocol buffer code."""
|
||||
from google.protobuf import descriptor as _descriptor
|
||||
from google.protobuf import descriptor_pool as _descriptor_pool
|
||||
from google.protobuf import runtime_version as _runtime_version
|
||||
from google.protobuf import symbol_database as _symbol_database
|
||||
from google.protobuf.internal import builder as _builder
|
||||
_runtime_version.ValidateProtobufRuntimeVersion(
|
||||
_runtime_version.Domain.PUBLIC,
|
||||
6,
|
||||
31,
|
||||
1,
|
||||
'',
|
||||
'compact_formats.proto'
|
||||
)
|
||||
# @@protoc_insertion_point(imports)
|
||||
|
||||
_sym_db = _symbol_database.Default()
|
||||
|
||||
|
||||
|
||||
|
||||
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x15\x63ompact_formats.proto\x12\x15\x63\x61sh.z.wallet.sdk.rpc\"\xa1\x01\n\x0c\x43ompactBlock\x12\x14\n\x0cprotoVersion\x18\x01 \x01(\r\x12\x0e\n\x06height\x18\x02 \x01(\x04\x12\x0c\n\x04hash\x18\x03 \x01(\x0c\x12\x10\n\x08prevHash\x18\x04 \x01(\x0c\x12\x0c\n\x04time\x18\x05 \x01(\r\x12\x0e\n\x06header\x18\x06 \x01(\x0c\x12-\n\x03vtx\x18\x07 \x03(\x0b\x32 .cash.z.wallet.sdk.rpc.CompactTx\"\xa1\x01\n\tCompactTx\x12\r\n\x05index\x18\x01 \x01(\x04\x12\x0c\n\x04hash\x18\x02 \x01(\x0c\x12\x0b\n\x03\x66\x65\x65\x18\x03 \x01(\r\x12\x33\n\x06spends\x18\x04 \x03(\x0b\x32#.cash.z.wallet.sdk.rpc.CompactSpend\x12\x35\n\x07outputs\x18\x05 \x03(\x0b\x32$.cash.z.wallet.sdk.rpc.CompactOutput\"\x1a\n\x0c\x43ompactSpend\x12\n\n\x02nf\x18\x01 \x01(\x0c\"=\n\rCompactOutput\x12\x0b\n\x03\x63mu\x18\x01 \x01(\x0c\x12\x0b\n\x03\x65pk\x18\x02 \x01(\x0c\x12\x12\n\nciphertext\x18\x03 \x01(\x0c\x42\x0bZ\twalletrpcb\x06proto3')
|
||||
|
||||
_globals = globals()
|
||||
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
|
||||
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'compact_formats_pb2', _globals)
|
||||
if not _descriptor._USE_C_DESCRIPTORS:
|
||||
_globals['DESCRIPTOR']._loaded_options = None
|
||||
_globals['DESCRIPTOR']._serialized_options = b'Z\twalletrpc'
|
||||
_globals['_COMPACTBLOCK']._serialized_start=49
|
||||
_globals['_COMPACTBLOCK']._serialized_end=210
|
||||
_globals['_COMPACTTX']._serialized_start=213
|
||||
_globals['_COMPACTTX']._serialized_end=374
|
||||
_globals['_COMPACTSPEND']._serialized_start=376
|
||||
_globals['_COMPACTSPEND']._serialized_end=402
|
||||
_globals['_COMPACTOUTPUT']._serialized_start=404
|
||||
_globals['_COMPACTOUTPUT']._serialized_end=465
|
||||
# @@protoc_insertion_point(module_scope)
|
||||
24
walletrpc/compact_formats_pb2_grpc.py
Normal file
24
walletrpc/compact_formats_pb2_grpc.py
Normal file
@@ -0,0 +1,24 @@
|
||||
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
|
||||
"""Client and server classes corresponding to protobuf-defined services."""
|
||||
import grpc
|
||||
import warnings
|
||||
|
||||
|
||||
GRPC_GENERATED_VERSION = '1.78.0'
|
||||
GRPC_VERSION = grpc.__version__
|
||||
_version_not_supported = False
|
||||
|
||||
try:
|
||||
from grpc._utilities import first_version_is_lower
|
||||
_version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION)
|
||||
except ImportError:
|
||||
_version_not_supported = True
|
||||
|
||||
if _version_not_supported:
|
||||
raise RuntimeError(
|
||||
f'The grpc package installed is at version {GRPC_VERSION},'
|
||||
+ ' but the generated code in compact_formats_pb2_grpc.py depends on'
|
||||
+ f' grpcio>={GRPC_GENERATED_VERSION}.'
|
||||
+ f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}'
|
||||
+ f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.'
|
||||
)
|
||||
60
walletrpc/service_pb2.py
Normal file
60
walletrpc/service_pb2.py
Normal file
@@ -0,0 +1,60 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
||||
# NO CHECKED-IN PROTOBUF GENCODE
|
||||
# source: service.proto
|
||||
# Protobuf Python Version: 6.31.1
|
||||
"""Generated protocol buffer code."""
|
||||
from google.protobuf import descriptor as _descriptor
|
||||
from google.protobuf import descriptor_pool as _descriptor_pool
|
||||
from google.protobuf import runtime_version as _runtime_version
|
||||
from google.protobuf import symbol_database as _symbol_database
|
||||
from google.protobuf.internal import builder as _builder
|
||||
_runtime_version.ValidateProtobufRuntimeVersion(
|
||||
_runtime_version.Domain.PUBLIC,
|
||||
6,
|
||||
31,
|
||||
1,
|
||||
'',
|
||||
'service.proto'
|
||||
)
|
||||
# @@protoc_insertion_point(imports)
|
||||
|
||||
_sym_db = _symbol_database.Default()
|
||||
|
||||
|
||||
import compact_formats_pb2 as compact__formats__pb2
|
||||
|
||||
|
||||
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\rservice.proto\x12\x15\x63\x61sh.z.wallet.sdk.rpc\x1a\x15\x63ompact_formats.proto\"\'\n\x07\x42lockID\x12\x0e\n\x06height\x18\x01 \x01(\x04\x12\x0c\n\x04hash\x18\x02 \x01(\x0c\"h\n\nBlockRange\x12-\n\x05start\x18\x01 \x01(\x0b\x32\x1e.cash.z.wallet.sdk.rpc.BlockID\x12+\n\x03\x65nd\x18\x02 \x01(\x0b\x32\x1e.cash.z.wallet.sdk.rpc.BlockID\"V\n\x08TxFilter\x12-\n\x05\x62lock\x18\x01 \x01(\x0b\x32\x1e.cash.z.wallet.sdk.rpc.BlockID\x12\r\n\x05index\x18\x02 \x01(\x04\x12\x0c\n\x04hash\x18\x03 \x01(\x0c\".\n\x0eRawTransaction\x12\x0c\n\x04\x64\x61ta\x18\x01 \x01(\x0c\x12\x0e\n\x06height\x18\x02 \x01(\x04\"7\n\x0cSendResponse\x12\x11\n\terrorCode\x18\x01 \x01(\x05\x12\x14\n\x0c\x65rrorMessage\x18\x02 \x01(\t\"\x0b\n\tChainSpec\"\x07\n\x05\x45mpty\"\xe4\x01\n\nLightdInfo\x12\x0f\n\x07version\x18\x01 \x01(\t\x12\x0e\n\x06vendor\x18\x02 \x01(\t\x12\x14\n\x0ctaddrSupport\x18\x03 \x01(\x08\x12\x11\n\tchainName\x18\x04 \x01(\t\x12\x1f\n\x17saplingActivationHeight\x18\x05 \x01(\x04\x12\x19\n\x11\x63onsensusBranchId\x18\x06 \x01(\t\x12\x13\n\x0b\x62lockHeight\x18\x07 \x01(\x04\x12\x12\n\ndifficulty\x18\x08 \x01(\x04\x12\x14\n\x0clongestchain\x18\t \x01(\x04\x12\x11\n\tnotarized\x18\n \x01(\x04\"i\n\nCoinsupply\x12\x0e\n\x06result\x18\x01 \x01(\t\x12\x0c\n\x04\x63oin\x18\x02 \x01(\t\x12\x0e\n\x06height\x18\x03 \x01(\x04\x12\x0e\n\x06supply\x18\x04 \x01(\x04\x12\x0e\n\x06zfunds\x18\x05 \x01(\x04\x12\r\n\x05total\x18\x06 \x01(\x04\"%\n\x12TransparentAddress\x12\x0f\n\x07\x61\x64\x64ress\x18\x01 \x01(\t\"b\n\x1dTransparentAddressBlockFilter\x12\x0f\n\x07\x61\x64\x64ress\x18\x01 \x01(\t\x12\x30\n\x05range\x18\x02 \x01(\x0b\x32!.cash.z.wallet.sdk.rpc.BlockRange2\xf2\x05\n\x11\x43ompactTxStreamer\x12T\n\x0eGetLatestBlock\x12 .cash.z.wallet.sdk.rpc.ChainSpec\x1a\x1e.cash.z.wallet.sdk.rpc.BlockID\"\x00\x12Q\n\x08GetBlock\x12\x1e.cash.z.wallet.sdk.rpc.BlockID\x1a#.cash.z.wallet.sdk.rpc.CompactBlock\"\x00\x12[\n\rGetBlockRange\x12!.cash.z.wallet.sdk.rpc.BlockRange\x1a#.cash.z.wallet.sdk.rpc.CompactBlock\"\x00\x30\x01\x12Z\n\x0eGetTransaction\x12\x1f.cash.z.wallet.sdk.rpc.TxFilter\x1a%.cash.z.wallet.sdk.rpc.RawTransaction\"\x00\x12_\n\x0fSendTransaction\x12%.cash.z.wallet.sdk.rpc.RawTransaction\x1a#.cash.z.wallet.sdk.rpc.SendResponse\"\x00\x12r\n\x0fGetAddressTxids\x12\x34.cash.z.wallet.sdk.rpc.TransparentAddressBlockFilter\x1a%.cash.z.wallet.sdk.rpc.RawTransaction\"\x00\x30\x01\x12R\n\rGetLightdInfo\x12\x1c.cash.z.wallet.sdk.rpc.Empty\x1a!.cash.z.wallet.sdk.rpc.LightdInfo\"\x00\x12R\n\rGetCoinsupply\x12\x1c.cash.z.wallet.sdk.rpc.Empty\x1a!.cash.z.wallet.sdk.rpc.Coinsupply\"\x00\x42\x0bZ\twalletrpcb\x06proto3')
|
||||
|
||||
_globals = globals()
|
||||
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
|
||||
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'service_pb2', _globals)
|
||||
if not _descriptor._USE_C_DESCRIPTORS:
|
||||
_globals['DESCRIPTOR']._loaded_options = None
|
||||
_globals['DESCRIPTOR']._serialized_options = b'Z\twalletrpc'
|
||||
_globals['_BLOCKID']._serialized_start=63
|
||||
_globals['_BLOCKID']._serialized_end=102
|
||||
_globals['_BLOCKRANGE']._serialized_start=104
|
||||
_globals['_BLOCKRANGE']._serialized_end=208
|
||||
_globals['_TXFILTER']._serialized_start=210
|
||||
_globals['_TXFILTER']._serialized_end=296
|
||||
_globals['_RAWTRANSACTION']._serialized_start=298
|
||||
_globals['_RAWTRANSACTION']._serialized_end=344
|
||||
_globals['_SENDRESPONSE']._serialized_start=346
|
||||
_globals['_SENDRESPONSE']._serialized_end=401
|
||||
_globals['_CHAINSPEC']._serialized_start=403
|
||||
_globals['_CHAINSPEC']._serialized_end=414
|
||||
_globals['_EMPTY']._serialized_start=416
|
||||
_globals['_EMPTY']._serialized_end=423
|
||||
_globals['_LIGHTDINFO']._serialized_start=426
|
||||
_globals['_LIGHTDINFO']._serialized_end=654
|
||||
_globals['_COINSUPPLY']._serialized_start=656
|
||||
_globals['_COINSUPPLY']._serialized_end=761
|
||||
_globals['_TRANSPARENTADDRESS']._serialized_start=763
|
||||
_globals['_TRANSPARENTADDRESS']._serialized_end=800
|
||||
_globals['_TRANSPARENTADDRESSBLOCKFILTER']._serialized_start=802
|
||||
_globals['_TRANSPARENTADDRESSBLOCKFILTER']._serialized_end=900
|
||||
_globals['_COMPACTTXSTREAMER']._serialized_start=903
|
||||
_globals['_COMPACTTXSTREAMER']._serialized_end=1657
|
||||
# @@protoc_insertion_point(module_scope)
|
||||
403
walletrpc/service_pb2_grpc.py
Normal file
403
walletrpc/service_pb2_grpc.py
Normal file
@@ -0,0 +1,403 @@
|
||||
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
|
||||
"""Client and server classes corresponding to protobuf-defined services."""
|
||||
import grpc
|
||||
import warnings
|
||||
|
||||
import compact_formats_pb2 as compact__formats__pb2
|
||||
import service_pb2 as service__pb2
|
||||
|
||||
GRPC_GENERATED_VERSION = '1.78.0'
|
||||
GRPC_VERSION = grpc.__version__
|
||||
_version_not_supported = False
|
||||
|
||||
try:
|
||||
from grpc._utilities import first_version_is_lower
|
||||
_version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION)
|
||||
except ImportError:
|
||||
_version_not_supported = True
|
||||
|
||||
if _version_not_supported:
|
||||
raise RuntimeError(
|
||||
f'The grpc package installed is at version {GRPC_VERSION},'
|
||||
+ ' but the generated code in service_pb2_grpc.py depends on'
|
||||
+ f' grpcio>={GRPC_GENERATED_VERSION}.'
|
||||
+ f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}'
|
||||
+ f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.'
|
||||
)
|
||||
|
||||
|
||||
class CompactTxStreamerStub(object):
|
||||
"""Missing associated documentation comment in .proto file."""
|
||||
|
||||
def __init__(self, channel):
|
||||
"""Constructor.
|
||||
|
||||
Args:
|
||||
channel: A grpc.Channel.
|
||||
"""
|
||||
self.GetLatestBlock = channel.unary_unary(
|
||||
'/cash.z.wallet.sdk.rpc.CompactTxStreamer/GetLatestBlock',
|
||||
request_serializer=service__pb2.ChainSpec.SerializeToString,
|
||||
response_deserializer=service__pb2.BlockID.FromString,
|
||||
_registered_method=True)
|
||||
self.GetBlock = channel.unary_unary(
|
||||
'/cash.z.wallet.sdk.rpc.CompactTxStreamer/GetBlock',
|
||||
request_serializer=service__pb2.BlockID.SerializeToString,
|
||||
response_deserializer=compact__formats__pb2.CompactBlock.FromString,
|
||||
_registered_method=True)
|
||||
self.GetBlockRange = channel.unary_stream(
|
||||
'/cash.z.wallet.sdk.rpc.CompactTxStreamer/GetBlockRange',
|
||||
request_serializer=service__pb2.BlockRange.SerializeToString,
|
||||
response_deserializer=compact__formats__pb2.CompactBlock.FromString,
|
||||
_registered_method=True)
|
||||
self.GetTransaction = channel.unary_unary(
|
||||
'/cash.z.wallet.sdk.rpc.CompactTxStreamer/GetTransaction',
|
||||
request_serializer=service__pb2.TxFilter.SerializeToString,
|
||||
response_deserializer=service__pb2.RawTransaction.FromString,
|
||||
_registered_method=True)
|
||||
self.SendTransaction = channel.unary_unary(
|
||||
'/cash.z.wallet.sdk.rpc.CompactTxStreamer/SendTransaction',
|
||||
request_serializer=service__pb2.RawTransaction.SerializeToString,
|
||||
response_deserializer=service__pb2.SendResponse.FromString,
|
||||
_registered_method=True)
|
||||
self.GetAddressTxids = channel.unary_stream(
|
||||
'/cash.z.wallet.sdk.rpc.CompactTxStreamer/GetAddressTxids',
|
||||
request_serializer=service__pb2.TransparentAddressBlockFilter.SerializeToString,
|
||||
response_deserializer=service__pb2.RawTransaction.FromString,
|
||||
_registered_method=True)
|
||||
self.GetLightdInfo = channel.unary_unary(
|
||||
'/cash.z.wallet.sdk.rpc.CompactTxStreamer/GetLightdInfo',
|
||||
request_serializer=service__pb2.Empty.SerializeToString,
|
||||
response_deserializer=service__pb2.LightdInfo.FromString,
|
||||
_registered_method=True)
|
||||
self.GetCoinsupply = channel.unary_unary(
|
||||
'/cash.z.wallet.sdk.rpc.CompactTxStreamer/GetCoinsupply',
|
||||
request_serializer=service__pb2.Empty.SerializeToString,
|
||||
response_deserializer=service__pb2.Coinsupply.FromString,
|
||||
_registered_method=True)
|
||||
|
||||
|
||||
class CompactTxStreamerServicer(object):
|
||||
"""Missing associated documentation comment in .proto file."""
|
||||
|
||||
def GetLatestBlock(self, request, context):
|
||||
"""Compact Blocks
|
||||
"""
|
||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
||||
context.set_details('Method not implemented!')
|
||||
raise NotImplementedError('Method not implemented!')
|
||||
|
||||
def GetBlock(self, request, context):
|
||||
"""Missing associated documentation comment in .proto file."""
|
||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
||||
context.set_details('Method not implemented!')
|
||||
raise NotImplementedError('Method not implemented!')
|
||||
|
||||
def GetBlockRange(self, request, context):
|
||||
"""Missing associated documentation comment in .proto file."""
|
||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
||||
context.set_details('Method not implemented!')
|
||||
raise NotImplementedError('Method not implemented!')
|
||||
|
||||
def GetTransaction(self, request, context):
|
||||
"""Transactions
|
||||
"""
|
||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
||||
context.set_details('Method not implemented!')
|
||||
raise NotImplementedError('Method not implemented!')
|
||||
|
||||
def SendTransaction(self, request, context):
|
||||
"""Missing associated documentation comment in .proto file."""
|
||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
||||
context.set_details('Method not implemented!')
|
||||
raise NotImplementedError('Method not implemented!')
|
||||
|
||||
def GetAddressTxids(self, request, context):
|
||||
"""t-Address support
|
||||
"""
|
||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
||||
context.set_details('Method not implemented!')
|
||||
raise NotImplementedError('Method not implemented!')
|
||||
|
||||
def GetLightdInfo(self, request, context):
|
||||
"""Misc
|
||||
"""
|
||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
||||
context.set_details('Method not implemented!')
|
||||
raise NotImplementedError('Method not implemented!')
|
||||
|
||||
def GetCoinsupply(self, request, context):
|
||||
"""Missing associated documentation comment in .proto file."""
|
||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
||||
context.set_details('Method not implemented!')
|
||||
raise NotImplementedError('Method not implemented!')
|
||||
|
||||
|
||||
def add_CompactTxStreamerServicer_to_server(servicer, server):
|
||||
rpc_method_handlers = {
|
||||
'GetLatestBlock': grpc.unary_unary_rpc_method_handler(
|
||||
servicer.GetLatestBlock,
|
||||
request_deserializer=service__pb2.ChainSpec.FromString,
|
||||
response_serializer=service__pb2.BlockID.SerializeToString,
|
||||
),
|
||||
'GetBlock': grpc.unary_unary_rpc_method_handler(
|
||||
servicer.GetBlock,
|
||||
request_deserializer=service__pb2.BlockID.FromString,
|
||||
response_serializer=compact__formats__pb2.CompactBlock.SerializeToString,
|
||||
),
|
||||
'GetBlockRange': grpc.unary_stream_rpc_method_handler(
|
||||
servicer.GetBlockRange,
|
||||
request_deserializer=service__pb2.BlockRange.FromString,
|
||||
response_serializer=compact__formats__pb2.CompactBlock.SerializeToString,
|
||||
),
|
||||
'GetTransaction': grpc.unary_unary_rpc_method_handler(
|
||||
servicer.GetTransaction,
|
||||
request_deserializer=service__pb2.TxFilter.FromString,
|
||||
response_serializer=service__pb2.RawTransaction.SerializeToString,
|
||||
),
|
||||
'SendTransaction': grpc.unary_unary_rpc_method_handler(
|
||||
servicer.SendTransaction,
|
||||
request_deserializer=service__pb2.RawTransaction.FromString,
|
||||
response_serializer=service__pb2.SendResponse.SerializeToString,
|
||||
),
|
||||
'GetAddressTxids': grpc.unary_stream_rpc_method_handler(
|
||||
servicer.GetAddressTxids,
|
||||
request_deserializer=service__pb2.TransparentAddressBlockFilter.FromString,
|
||||
response_serializer=service__pb2.RawTransaction.SerializeToString,
|
||||
),
|
||||
'GetLightdInfo': grpc.unary_unary_rpc_method_handler(
|
||||
servicer.GetLightdInfo,
|
||||
request_deserializer=service__pb2.Empty.FromString,
|
||||
response_serializer=service__pb2.LightdInfo.SerializeToString,
|
||||
),
|
||||
'GetCoinsupply': grpc.unary_unary_rpc_method_handler(
|
||||
servicer.GetCoinsupply,
|
||||
request_deserializer=service__pb2.Empty.FromString,
|
||||
response_serializer=service__pb2.Coinsupply.SerializeToString,
|
||||
),
|
||||
}
|
||||
generic_handler = grpc.method_handlers_generic_handler(
|
||||
'cash.z.wallet.sdk.rpc.CompactTxStreamer', rpc_method_handlers)
|
||||
server.add_generic_rpc_handlers((generic_handler,))
|
||||
server.add_registered_method_handlers('cash.z.wallet.sdk.rpc.CompactTxStreamer', rpc_method_handlers)
|
||||
|
||||
|
||||
# This class is part of an EXPERIMENTAL API.
|
||||
class CompactTxStreamer(object):
|
||||
"""Missing associated documentation comment in .proto file."""
|
||||
|
||||
@staticmethod
|
||||
def GetLatestBlock(request,
|
||||
target,
|
||||
options=(),
|
||||
channel_credentials=None,
|
||||
call_credentials=None,
|
||||
insecure=False,
|
||||
compression=None,
|
||||
wait_for_ready=None,
|
||||
timeout=None,
|
||||
metadata=None):
|
||||
return grpc.experimental.unary_unary(
|
||||
request,
|
||||
target,
|
||||
'/cash.z.wallet.sdk.rpc.CompactTxStreamer/GetLatestBlock',
|
||||
service__pb2.ChainSpec.SerializeToString,
|
||||
service__pb2.BlockID.FromString,
|
||||
options,
|
||||
channel_credentials,
|
||||
insecure,
|
||||
call_credentials,
|
||||
compression,
|
||||
wait_for_ready,
|
||||
timeout,
|
||||
metadata,
|
||||
_registered_method=True)
|
||||
|
||||
@staticmethod
|
||||
def GetBlock(request,
|
||||
target,
|
||||
options=(),
|
||||
channel_credentials=None,
|
||||
call_credentials=None,
|
||||
insecure=False,
|
||||
compression=None,
|
||||
wait_for_ready=None,
|
||||
timeout=None,
|
||||
metadata=None):
|
||||
return grpc.experimental.unary_unary(
|
||||
request,
|
||||
target,
|
||||
'/cash.z.wallet.sdk.rpc.CompactTxStreamer/GetBlock',
|
||||
service__pb2.BlockID.SerializeToString,
|
||||
compact__formats__pb2.CompactBlock.FromString,
|
||||
options,
|
||||
channel_credentials,
|
||||
insecure,
|
||||
call_credentials,
|
||||
compression,
|
||||
wait_for_ready,
|
||||
timeout,
|
||||
metadata,
|
||||
_registered_method=True)
|
||||
|
||||
@staticmethod
|
||||
def GetBlockRange(request,
|
||||
target,
|
||||
options=(),
|
||||
channel_credentials=None,
|
||||
call_credentials=None,
|
||||
insecure=False,
|
||||
compression=None,
|
||||
wait_for_ready=None,
|
||||
timeout=None,
|
||||
metadata=None):
|
||||
return grpc.experimental.unary_stream(
|
||||
request,
|
||||
target,
|
||||
'/cash.z.wallet.sdk.rpc.CompactTxStreamer/GetBlockRange',
|
||||
service__pb2.BlockRange.SerializeToString,
|
||||
compact__formats__pb2.CompactBlock.FromString,
|
||||
options,
|
||||
channel_credentials,
|
||||
insecure,
|
||||
call_credentials,
|
||||
compression,
|
||||
wait_for_ready,
|
||||
timeout,
|
||||
metadata,
|
||||
_registered_method=True)
|
||||
|
||||
@staticmethod
|
||||
def GetTransaction(request,
|
||||
target,
|
||||
options=(),
|
||||
channel_credentials=None,
|
||||
call_credentials=None,
|
||||
insecure=False,
|
||||
compression=None,
|
||||
wait_for_ready=None,
|
||||
timeout=None,
|
||||
metadata=None):
|
||||
return grpc.experimental.unary_unary(
|
||||
request,
|
||||
target,
|
||||
'/cash.z.wallet.sdk.rpc.CompactTxStreamer/GetTransaction',
|
||||
service__pb2.TxFilter.SerializeToString,
|
||||
service__pb2.RawTransaction.FromString,
|
||||
options,
|
||||
channel_credentials,
|
||||
insecure,
|
||||
call_credentials,
|
||||
compression,
|
||||
wait_for_ready,
|
||||
timeout,
|
||||
metadata,
|
||||
_registered_method=True)
|
||||
|
||||
@staticmethod
|
||||
def SendTransaction(request,
|
||||
target,
|
||||
options=(),
|
||||
channel_credentials=None,
|
||||
call_credentials=None,
|
||||
insecure=False,
|
||||
compression=None,
|
||||
wait_for_ready=None,
|
||||
timeout=None,
|
||||
metadata=None):
|
||||
return grpc.experimental.unary_unary(
|
||||
request,
|
||||
target,
|
||||
'/cash.z.wallet.sdk.rpc.CompactTxStreamer/SendTransaction',
|
||||
service__pb2.RawTransaction.SerializeToString,
|
||||
service__pb2.SendResponse.FromString,
|
||||
options,
|
||||
channel_credentials,
|
||||
insecure,
|
||||
call_credentials,
|
||||
compression,
|
||||
wait_for_ready,
|
||||
timeout,
|
||||
metadata,
|
||||
_registered_method=True)
|
||||
|
||||
@staticmethod
|
||||
def GetAddressTxids(request,
|
||||
target,
|
||||
options=(),
|
||||
channel_credentials=None,
|
||||
call_credentials=None,
|
||||
insecure=False,
|
||||
compression=None,
|
||||
wait_for_ready=None,
|
||||
timeout=None,
|
||||
metadata=None):
|
||||
return grpc.experimental.unary_stream(
|
||||
request,
|
||||
target,
|
||||
'/cash.z.wallet.sdk.rpc.CompactTxStreamer/GetAddressTxids',
|
||||
service__pb2.TransparentAddressBlockFilter.SerializeToString,
|
||||
service__pb2.RawTransaction.FromString,
|
||||
options,
|
||||
channel_credentials,
|
||||
insecure,
|
||||
call_credentials,
|
||||
compression,
|
||||
wait_for_ready,
|
||||
timeout,
|
||||
metadata,
|
||||
_registered_method=True)
|
||||
|
||||
@staticmethod
|
||||
def GetLightdInfo(request,
|
||||
target,
|
||||
options=(),
|
||||
channel_credentials=None,
|
||||
call_credentials=None,
|
||||
insecure=False,
|
||||
compression=None,
|
||||
wait_for_ready=None,
|
||||
timeout=None,
|
||||
metadata=None):
|
||||
return grpc.experimental.unary_unary(
|
||||
request,
|
||||
target,
|
||||
'/cash.z.wallet.sdk.rpc.CompactTxStreamer/GetLightdInfo',
|
||||
service__pb2.Empty.SerializeToString,
|
||||
service__pb2.LightdInfo.FromString,
|
||||
options,
|
||||
channel_credentials,
|
||||
insecure,
|
||||
call_credentials,
|
||||
compression,
|
||||
wait_for_ready,
|
||||
timeout,
|
||||
metadata,
|
||||
_registered_method=True)
|
||||
|
||||
@staticmethod
|
||||
def GetCoinsupply(request,
|
||||
target,
|
||||
options=(),
|
||||
channel_credentials=None,
|
||||
call_credentials=None,
|
||||
insecure=False,
|
||||
compression=None,
|
||||
wait_for_ready=None,
|
||||
timeout=None,
|
||||
metadata=None):
|
||||
return grpc.experimental.unary_unary(
|
||||
request,
|
||||
target,
|
||||
'/cash.z.wallet.sdk.rpc.CompactTxStreamer/GetCoinsupply',
|
||||
service__pb2.Empty.SerializeToString,
|
||||
service__pb2.Coinsupply.FromString,
|
||||
options,
|
||||
channel_credentials,
|
||||
insecure,
|
||||
call_credentials,
|
||||
compression,
|
||||
wait_for_ready,
|
||||
timeout,
|
||||
metadata,
|
||||
_registered_method=True)
|
||||
Reference in New Issue
Block a user