Versions in this module Expand all Collapse all v0 v0.11.2 Mar 18, 2021 Changes in this version + var BanDuration = time.Hour * 24 + var BanThreshold = uint32(100) + var ConnectionRetryInterval = time.Second * 5 + var DefaultBlockCacheSize uint64 = 4096 * 10 * 1000 + var DefaultFilterCacheSize uint64 = 3120 * 10 * 1000 + var DisableDNSSeed = false + var ErrFilterFetchFailed = fmt.Errorf("unable to fetch cfilter") + var ErrGetUtxoCancelled = errors.New("get utxo request cancelled") + var ErrRescanExit = errors.New("rescan exited") + var ErrShuttingDown = errors.New("neutrino shutting down") + var MaxPeers = 125 + var QueryBatchTimeout = time.Second * 30 + var QueryEncoding = wire.WitnessEncoding + var QueryNumRetries = 2 + var QueryPeerConnectTimeout = time.Second * 30 + var QueryPeerCooldown = time.Second * 5 + var QueryTimeout = time.Second * 10 + var RequiredServices = wire.SFNodeNetwork | wire.SFNodeWitness | wire.SFNodeCF + var Services = wire.SFNodeWitness | wire.SFNodeCF + var TargetOutbound = 8 + var UserAgentName = "neutrino" + var UserAgentVersion = "0.11.0-beta" + func DisableLog() + func UseLogger(logger btclog.Logger) + type ChainService struct + BlockCache *lru.Cache + BlockHeaders headerfs.BlockHeaderStore + FilterCache *lru.Cache + FilterDB filterdb.FilterDatabase + RegFilterHeaders *headerfs.FilterHeaderStore + func NewChainService(cfg Config) (*ChainService, error) + func (s *ChainService) AddBytesReceived(bytesReceived uint64) + func (s *ChainService) AddBytesSent(bytesSent uint64) + func (s *ChainService) AddPeer(sp *ServerPeer) + func (s *ChainService) AddedNodeInfo() []*ServerPeer + func (s *ChainService) BanPeer(addr string, reason banman.Reason) error + func (s *ChainService) BestBlock() (*headerfs.BlockStamp, error) + func (s *ChainService) ChainParams() chaincfg.Params + func (s *ChainService) ConnectNode(addr string, permanent bool) error + func (s *ChainService) ConnectedCount() int32 + func (s *ChainService) ConnectedPeers() (<-chan query.Peer, func(), error) + func (s *ChainService) DisconnectNodeByAddr(addr string) error + func (s *ChainService) DisconnectNodeByID(id int32) error + func (s *ChainService) ForAllPeers(closure func(sp *ServerPeer)) + func (s *ChainService) GetBlock(blockHash chainhash.Hash, options ...QueryOption) (*vclutil.Block, error) + func (s *ChainService) GetBlockHash(height int64) (*chainhash.Hash, error) + func (s *ChainService) GetBlockHeader(blockHash *chainhash.Hash) (*wire.BlockHeader, error) + func (s *ChainService) GetBlockHeight(hash *chainhash.Hash) (int32, error) + func (s *ChainService) GetCFilter(blockHash chainhash.Hash, filterType wire.FilterType, options ...QueryOption) (*gcs.Filter, error) + func (s *ChainService) GetUtxo(options ...RescanOption) (*SpendReport, error) + func (s *ChainService) IsBanned(addr string) bool + func (s *ChainService) IsCurrent() bool + func (s *ChainService) NetTotals() (uint64, uint64) + func (s *ChainService) OutboundGroupCount(key string) int + func (s *ChainService) PeerByAddr(addr string) *ServerPeer + func (s *ChainService) Peers() []*ServerPeer + func (s *ChainService) RemoveNodeByAddr(addr string) error + func (s *ChainService) RemoveNodeByID(id int32) error + func (s *ChainService) SendTransaction(tx *wire.MsgTx) error + func (s *ChainService) Start() error + func (s *ChainService) Stop() error + func (s *ChainService) UpdatePeerHeights(latestBlkHash *chainhash.Hash, latestHeight int32, updateSource *ServerPeer) + type ChainSource interface + BestBlock func() (*headerfs.BlockStamp, error) + ChainParams func() chaincfg.Params + GetBlock func(chainhash.Hash, ...QueryOption) (*vclutil.Block, error) + GetBlockHeader func(*chainhash.Hash) (*wire.BlockHeader, uint32, error) + GetBlockHeaderByHeight func(uint32) (*wire.BlockHeader, error) + GetCFilter func(chainhash.Hash, wire.FilterType, ...QueryOption) (*gcs.Filter, error) + GetFilterHeaderByHeight func(uint32) (*chainhash.Hash, error) + Subscribe func(bestHeight uint32) (*blockntfns.Subscription, error) + type Config struct + AddPeers []string + AssertFilterHeader *headerfs.FilterHeader + BlockCacheSize uint64 + ChainParams chaincfg.Params + ConnectPeers []string + DataDir string + Database walletdb.DB + Dialer func(addr net.Addr) (net.Conn, error) + FilterCacheSize uint64 + NameResolver func(host string) ([]net.IP, error) + type GetUtxoRequest struct + BirthHeight uint32 + Input *InputWithScript + func (r *GetUtxoRequest) Result(cancel <-chan struct{}) (*SpendReport, error) + type GetUtxoRequestPQ []*GetUtxoRequest + func (pq *GetUtxoRequestPQ) IsEmpty() bool + func (pq *GetUtxoRequestPQ) Peek() *GetUtxoRequest + func (pq *GetUtxoRequestPQ) Pop() interface{} + func (pq *GetUtxoRequestPQ) Push(x interface{}) + func (pq GetUtxoRequestPQ) Len() int + func (pq GetUtxoRequestPQ) Less(i, j int) bool + func (pq GetUtxoRequestPQ) Swap(i, j int) + type InputWithScript struct + OutPoint wire.OutPoint + PkScript []byte + type QueryOption func(*queryOptions) + func DoneChan(doneChan chan<- struct{}) QueryOption + func Encoding(encoding wire.MessageEncoding) QueryOption + func MaxBatchSize(maxSize int64) QueryOption + func NumRetries(numRetries uint8) QueryOption + func OptimisticBatch() QueryOption + func OptimisticReverseBatch() QueryOption + func PeerConnectTimeout(timeout time.Duration) QueryOption + func PersistToDisk() QueryOption + func Timeout(timeout time.Duration) QueryOption + type Rescan struct + func NewRescan(chain ChainSource, options ...RescanOption) *Rescan + func (r *Rescan) Start() <-chan error + func (r *Rescan) Update(options ...UpdateOption) error + func (r *Rescan) WaitForShutdown() + type RescanChainSource struct + func (s *RescanChainSource) GetBlockHeader(hash *chainhash.Hash) (*wire.BlockHeader, uint32, error) + func (s *RescanChainSource) GetBlockHeaderByHeight(height uint32) (*wire.BlockHeader, error) + func (s *RescanChainSource) GetFilterHeaderByHeight(height uint32) (*chainhash.Hash, error) + func (s *RescanChainSource) Subscribe(bestHeight uint32) (*blockntfns.Subscription, error) + type RescanOption func(ro *rescanOptions) + func EndBlock(endBlock *headerfs.BlockStamp) RescanOption + func NotificationHandlers(ntfn rpcclient.NotificationHandlers) RescanOption + func ProgressHandler(handler ScanProgressHandler) RescanOption + func QueryOptions(options ...QueryOption) RescanOption + func QuitChan(quit <-chan struct{}) RescanOption + func StartBlock(startBlock *headerfs.BlockStamp) RescanOption + func StartTime(startTime time.Time) RescanOption + func TxIdx(txIdx uint32) RescanOption + func WatchAddrs(watchAddrs ...vclutil.Address) RescanOption + func WatchInputs(watchInputs ...InputWithScript) RescanOption + type ScanProgressHandler func(lastProcessedBlock uint32) + type ServerPeer struct + func (sp *ServerPeer) OnAddr(_ *peer.Peer, msg *wire.MsgAddr) + func (sp *ServerPeer) OnDisconnect() <-chan struct{} + func (sp *ServerPeer) OnFeeFilter(_ *peer.Peer, msg *wire.MsgFeeFilter) + func (sp *ServerPeer) OnHeaders(p *peer.Peer, msg *wire.MsgHeaders) + func (sp *ServerPeer) OnInv(p *peer.Peer, msg *wire.MsgInv) + func (sp *ServerPeer) OnRead(_ *peer.Peer, bytesRead int, msg wire.Message, err error) + func (sp *ServerPeer) OnReject(_ *peer.Peer, msg *wire.MsgReject) + func (sp *ServerPeer) OnVerAck(_ *peer.Peer, msg *wire.MsgVerAck) + func (sp *ServerPeer) OnVersion(_ *peer.Peer, msg *wire.MsgVersion) *wire.MsgReject + func (sp *ServerPeer) OnWrite(_ *peer.Peer, bytesWritten int, msg wire.Message, err error) + func (sp *ServerPeer) SubscribeRecvMsg() (<-chan wire.Message, func()) + type SpendReport struct + BlockHash *chainhash.Hash + BlockHeight uint32 + BlockIndex uint32 + Output *wire.TxOut + SpendingInputIndex uint32 + SpendingTx *wire.MsgTx + SpendingTxHeight uint32 + type UpdateOption func(uo *updateOptions) + func AddAddrs(addrs ...vclutil.Address) UpdateOption + func AddInputs(inputs ...InputWithScript) UpdateOption + func DisableDisconnectedNtfns(disabled bool) UpdateOption + func Rewind(height uint32) UpdateOption + type UtxoScanner struct + func NewUtxoScanner(cfg *UtxoScannerConfig) *UtxoScanner + func (s *UtxoScanner) Enqueue(input *InputWithScript, birthHeight uint32, ...) (*GetUtxoRequest, error) + func (s *UtxoScanner) Start() error + func (s *UtxoScanner) Stop() error + type UtxoScannerConfig struct + BestSnapshot func() (*headerfs.BlockStamp, error) + BlockFilterMatches func(ro *rescanOptions, blockHash *chainhash.Hash) (bool, error) + GetBlock func(chainhash.Hash, ...QueryOption) (*vclutil.Block, error) + GetBlockHash func(height int64) (*chainhash.Hash, error) v0.11.1 Mar 18, 2021