electrum

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2024 License: ISC Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DisableLog

func DisableLog()

DisableLog disables all library log output. Logging output is disabled by default until either UseLogger or SetLogWriter are called.

func UseLogger

func UseLogger(logger btclog.Logger)

UseLogger uses a specified Logger to output package logging info. This should be used in preference to SetLogWriter if the caller is also using btclog.

Types

type Balance

type Balance struct {
	Confirmed   btcutil.Amount `json:"confirmed"`
	Unconfirmed btcutil.Amount `json:"unconfirmed"`
}

type Config

type Config struct {
	// Listeners defines a slice of listeners for which the RPC server will
	// take ownership of and accept connections.  Since the RPC server takes
	// ownership of these listeners, they will be closed when the RPC server
	// is stopped.
	Listeners []net.Listener

	ListenerTLS []bool

	// MaxClients is the amount of clients that are allowed to connect to the
	// electrum server. Set to -1 to have no limits.
	MaxClients int32

	// WatchOnlyWallet is the wallet that keeps track of the balances and relevant
	// utxos.
	WatchOnlyWallet *wallet.WatchOnlyWalletManager

	Params       *chaincfg.Params
	BlockChain   *blockchain.BlockChain
	FeeEstimator *mempool.FeeEstimator
	Mempool      *mempool.TxPool
	MinRelayFee  btcutil.Amount

	AddRebroadcastInventory func(iv *wire.InvVect, data interface{})
	RelayTransactions       func(txns []*mempool.TxDesc)
	AnnounceNewTransactions func(txns []*mempool.TxDesc)
}

Config is a configuration struct used to initialize a new electrum server.

type ElectrumServer

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

func New

func New(config *Config) (*ElectrumServer, error)

New constructs a new instance of the electrum server.

func (*ElectrumServer) Start

func (s *ElectrumServer) Start()

func (*ElectrumServer) Stop

func (s *ElectrumServer) Stop()

type GetMerkleRes

type GetMerkleRes struct {
	Merkle      []string `json:"merkle"`
	BlockHeight int      `json:"block_height"`
	Pos         int      `json:"pos"`
}

type HeadersResponse

type HeadersResponse struct {
	Count int    `json:"count"`
	Hex   string `json:"hex"`
	Max   int    `json:"max"`
}

type HeadersSubscribeResponse

type HeadersSubscribeResponse struct {
	Hex    string `json:"hex"`
	Height int    `json:"height"`
}

type HostPort

type HostPort struct {
	TCPPort int `json:"tcp_port"`
	SslPort int `json:"ssl_port"`
}

type IDFromPosRes

type IDFromPosRes struct {
	TxHash string   `json:"tx_hash"`
	Merkle []string `json:"merkle"`
}

type ScriptHashHistory

type ScriptHashHistory struct {
	Height int    `json:"height"`
	TxHash string `json:"tx_hash"`
	Fee    int    `json:"fee,omitempty"`
}

type ServerFeaturesResponse

type ServerFeaturesResponse struct {
	GenesisHash   string              `json:"genesis_hash"`
	Hosts         map[string]HostPort `json:"hosts"`
	ProtocolMax   string              `json:"protocol_max"`
	ProtocolMin   string              `json:"protocol_min"`
	Pruning       bool                `json:"pruning,omitempty"`
	ServerVersion string              `json:"server_version"`
	HashFunction  string              `json:"hash_function"`
}

type Unspent

type Unspent struct {
	TxPos  int    `json:"tx_pos"`
	Value  int    `json:"value"`
	Height int    `json:"height"`
	TxHash string `json:"tx_hash"`
}

Jump to

Keyboard shortcuts

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