explorer

package
v0.3.4 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2023 License: BSD-2-Clause Imports: 10 Imported by: 0

Documentation

Overview

Package explorer implements the blockchain explorer microservice. The explorer scans transactions in the networks mined blocks and sends events when a monitored address or account is involved in a transaction.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Explorer

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

Explorer implements an explorer service.

func New

func New(dbtype string, db store.DB, mb msg.MsgBroker, bc map[string]block.Chain) *Explorer

New instantiates a new explorer service.

func (*Explorer) Explore

func (e *Explorer) Explore() chan string

Explore starts a go routine for each network available. The exploration of each network is controlled by a NetExplorer (see package explorer/netexplorer for details) and contains a map of the addresses being monitored and the current status of scanned blocks. The explorer consumes wallet requests to monitor new addresses. In case of graceful termination, the explorer will wait for all the blocks being scanned to finish and sending the events if any.

func (*Explorer) ExploreChain

func (e *Explorer) ExploreChain(net string, ret chan string)

ExploreChain starts a network explorer go routine for blockchain named 'net'. When the routine ends, returns its error status via the 'ret' channel given so the calling routine can control graceful termination. When a network does not have any monitored addresses, the explorer will keep waiting and will not scan any mined blocks.

func (*Explorer) ManageWalletRequests

func (e *Explorer) ManageWalletRequests(net string) error

ManageWalletRequests starts a go routine to receive and manage wallet requests for objects (addresses, ...) to be monitored for the blockchain named 'net'.

func (*Explorer) StopExplorer

func (e *Explorer) StopExplorer()

StopExplorer will send termination signals to all network explorer go routines.

Directories

Path Synopsis
Package netexplorer implements the exploration of block transactions for monitored addresses and adding/removing monitored addresses.
Package netexplorer implements the exploration of block transactions for monitored addresses and adding/removing monitored addresses.

Jump to

Keyboard shortcuts

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