csn

package
v0.0.0-...-6ac58e8 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2022 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidNetwork = errors.New("Invalid/not supported net flag given")
)
View Source
var HelpMsg = `` /* 753-byte string literal not displayed */
View Source
var PollardFilePath string = "pollardFile"

Functions

func PushTx

func PushTx(tx *wire.MsgTx) error

TODO implement. I guess push to the bridge node. But really it'd be better to just push it out to the regular p2p network.

func RunIBD

func RunIBD(cfg *Config, sig chan bool) error

RunIBD calls everything to run IBD

Types

type CompactState

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

CsnHook is the main stateful struct for the Compact State Node. It keeps track of what block its on and what transactions it's looking for

type Config

type Config struct {

	// enable tracing
	TraceProf string

	// enable cpu profiling
	CpuProf string

	// enable memory profiling
	MemProf string

	// enable profiling http server
	ProfServer string
	// contains filtered or unexported fields
}

func Parse

func Parse(args []string) (*Config, error)

type Csn

type Csn struct {
	CurrentHeight int32

	WatchOPs  map[wire.OutPoint]bool
	WatchAdrs map[[20]byte]bool
	// TODO use better addresses, either []byte or something fancy
	TxChan     chan wire.MsgTx
	HeightChan chan int32

	CheckSignatures bool
	Params          chaincfg.Params
	// contains filtered or unexported fields
}

CsnHook is the main stateful struct for the Compact State Node. It keeps track of what block its on and what transactions it's looking for

func (*Csn) IBDThread

func (c *Csn) IBDThread(cfg Config, sig chan bool)

run IBD from block proof data we get the new utxo info from the same txos text file

func (*Csn) RegisterAddress

func (ch *Csn) RegisterAddress(adr [20]byte)

func (*Csn) RegisterOutPoint

func (ch *Csn) RegisterOutPoint(op wire.OutPoint)

func (*Csn) ScanBlock

func (c *Csn) ScanBlock(b *btcutil.Block)

ScanBlock looks through a block using the CSN's maps and sends matches into the tx channel.

func (*Csn) Start

func (c *Csn) Start(cfg *Config, height int32, path, proxyURL string, haltSig chan bool) (
	chan wire.MsgTx, chan int32, error)

Start starts up a compact state node, and returns channels for txs and block heights.

func (*Csn) UnegisterOutPoint

func (ch *Csn) UnegisterOutPoint(op wire.OutPoint)

Jump to

Keyboard shortcuts

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