core

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2026 License: MIT Imports: 17 Imported by: 1

Documentation

Index

Constants

View Source
const (
	InvalidAddressOrKey   = -5  // RPC_INVALID_ADDRESS_OR_KEY (invalid address or key)
	InvalidParameter      = -8  // RPC_INVALID_PARAMETER (invalid, missing or duplicate parameter)
	VerifyError           = -25 // RPC_VERIFY_ERROR (general error during transaction or block submission)
	VerifyRejected        = -26 // RPC_VERIFY_REJECTED (transaction or block was rejected by network rules)
	AlreadyInUTXOSet      = -27 // RPC_VERIFY_ALREADY_IN_UTXO_SET (transaction already in utxo set)
	InWarmup              = -28 // RPC_IN_WARMUP (client still warming up)
	BlockNotFound         = -5  // deprecated (use InvalidAddressOrKey instead)
	BlockHeightOutOfRange = -8  // deprecated (use InvalidParameter instead)
)

Core RPC error codes

View Source
const ERROR_DELAY = 1 * time.Second // for ZMQ errors.
View Source
const RETRY_DELAY = 5 * time.Second // for connect errors.
View Source
const WAIT_FOR_SYNC_RETRY_DELAY = 30 * time.Second

Variables

This section is empty.

Functions

func NewCoreRPCClient

func NewCoreRPCClient(rpcHost string, rpcPort int, rpcUser string, rpcPass string) spec.Blockchain

NewCoreRPCClient returns a Dogecoin Core Node client. Thread-safe, can be shared across Goroutines.

func NewLogger added in v0.0.13

func NewLogger(chainEvents <-chan spec.BlockchainEvent) governor.Service

func NewSplitter added in v0.0.13

func NewSplitter(chainEvents <-chan spec.BlockchainEvent, chanSizes []int) (governor.Service, []chan spec.BlockchainEvent)

NewSplitter creates a channel fan-out splitter. Each channel will receive a copy of the event.

All channels are treated as blocking channels, so the system will proceed at the rate of the slowest channel receiver. (DogeWalker is a non-blocking receiver, so it will not be the bottleneck.)

`chainEvents` is the channel to receive events from. `chanSizes` is the size of each channel, e.g. []int{10, 100, 1000}.

Returns the splitter service and the channels.

func NewTipChaser

func NewTipChaser(coreAddrZMQ string, listener chan spec.BlockchainEvent, includeTx bool) governor.Service

* NewTipChaser listens to Core Node ZMQ interface. * * listener channel announces whenever Core finds a new Best Block Hash (Tip change) * set includeTx if you want to receive transaction events as well * set doNotBlock if you don't want to block when the listener channel is full * * `coreAddrZMQ` is the TCP address of Core ZMQ, e.g. "tcp://127.0.0.1:28332"

func SleepWithContext added in v0.0.3

func SleepWithContext(ctx context.Context, duration time.Duration) (cancelled bool)

Types

type CoreRPCClient

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

func (*CoreRPCClient) EstimateFee added in v0.0.7

func (c *CoreRPCClient) EstimateFee(ctx context.Context, confirmTarget int) (feePerKB koinu.Koinu, err error)

func (*CoreRPCClient) GetBestBlockHash

func (c *CoreRPCClient) GetBestBlockHash(ctx context.Context) (blockHash string, err error)

func (*CoreRPCClient) GetBlock

func (c *CoreRPCClient) GetBlock(blockHash string, ctx context.Context) (block doge.Block, size int, err error)

func (*CoreRPCClient) GetBlockCount

func (c *CoreRPCClient) GetBlockCount(ctx context.Context) (blockCount int64, err error)

func (*CoreRPCClient) GetBlockHash

func (c *CoreRPCClient) GetBlockHash(blockHeight int64, ctx context.Context) (hash string, err error)

func (*CoreRPCClient) GetBlockHeader

func (c *CoreRPCClient) GetBlockHeader(blockHash string, ctx context.Context) (txn spec.BlockHeader, err error)

func (*CoreRPCClient) GetBlockchainInfo added in v0.0.7

func (c *CoreRPCClient) GetBlockchainInfo(ctx context.Context) (info spec.BlockchainInfo, err error)

func (*CoreRPCClient) GetRawMempool added in v0.0.7

func (c *CoreRPCClient) GetRawMempool(ctx context.Context) (mem spec.RawMempool, err error)

func (*CoreRPCClient) GetRawMempoolTxList added in v0.0.7

func (c *CoreRPCClient) GetRawMempoolTxList(ctx context.Context) (txlist []string, err error)

func (*CoreRPCClient) GetRawTransaction added in v0.0.7

func (c *CoreRPCClient) GetRawTransaction(ctx context.Context, txID string) (tx doge.BlockTx, err error)

func (*CoreRPCClient) Request

func (c *CoreRPCClient) Request(ctx context.Context, method string, params []any, result any) (int, error)

func (*CoreRPCClient) RetryMode added in v0.0.3

func (c *CoreRPCClient) RetryMode(attempts int, delay time.Duration) spec.Blockchain

func (*CoreRPCClient) SendRawTransaction added in v0.0.8

func (c *CoreRPCClient) SendRawTransaction(ctx context.Context, txHex string) (txid string, err error)

func (*CoreRPCClient) WaitForSync added in v0.0.3

func (c *CoreRPCClient) WaitForSync(ctx context.Context) bool

type Logger added in v0.0.13

type Logger struct {
	governor.ServiceCtx
	// contains filtered or unexported fields
}

func (*Logger) Run added in v0.0.13

func (l *Logger) Run()

type Splitter added in v0.0.13

type Splitter struct {
	governor.ServiceCtx
	// contains filtered or unexported fields
}

func (*Splitter) Run added in v0.0.13

func (s *Splitter) Run()

Jump to

Keyboard shortcuts

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