Documentation
¶
Index ¶
- func MineBlocks(t *testing.T, cm *chain.Manager, addr types.Address, n int)
- func Network() (*consensus.Network, types.Block)
- func V2Network() (*consensus.Network, types.Block)
- type EphemeralWalletStore
- func (es *EphemeralWalletStore) Tip() (types.ChainIndex, error)
- func (es *EphemeralWalletStore) UnspentSiacoinElements() (utxos []types.SiacoinElement, _ error)
- func (es *EphemeralWalletStore) UpdateChainState(fn func(ux wallet.UpdateTx) error) error
- func (es *EphemeralWalletStore) WalletEventCount() (uint64, error)
- func (es *EphemeralWalletStore) WalletEvents(offset, limit int) ([]wallet.Event, error)
- type MemPeerStore
- func (ps *MemPeerStore) AddPeer(addr string) error
- func (ps *MemPeerStore) Ban(addr string, duration time.Duration, reason string) error
- func (ps *MemPeerStore) Banned(addr string) (bool, error)
- func (ps *MemPeerStore) PeerInfo(addr string) (syncer.PeerInfo, error)
- func (ps *MemPeerStore) Peers() ([]syncer.PeerInfo, error)
- func (ps *MemPeerStore) UpdatePeerInfo(addr string, fn func(*syncer.PeerInfo)) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MineBlocks ¶ added in v0.2.2
MineBlocks mines n blocks with the reward going to the given address.
Types ¶
type EphemeralWalletStore ¶
type EphemeralWalletStore struct {
// contains filtered or unexported fields
}
An EphemeralWalletStore is a Store that does not persist its state to disk. It is primarily useful for testing or as a reference implementation.
func NewEphemeralWalletStore ¶
func NewEphemeralWalletStore() *EphemeralWalletStore
NewEphemeralWalletStore returns a new EphemeralWalletStore.
func (*EphemeralWalletStore) Tip ¶
func (es *EphemeralWalletStore) Tip() (types.ChainIndex, error)
Tip returns the last indexed tip of the wallet.
func (*EphemeralWalletStore) UnspentSiacoinElements ¶
func (es *EphemeralWalletStore) UnspentSiacoinElements() (utxos []types.SiacoinElement, _ error)
UnspentSiacoinElements returns the wallet's unspent siacoin outputs.
func (*EphemeralWalletStore) UpdateChainState ¶ added in v0.0.4
func (es *EphemeralWalletStore) UpdateChainState(fn func(ux wallet.UpdateTx) error) error
UpdateChainState applies and reverts chain updates to the wallet.
func (*EphemeralWalletStore) WalletEventCount ¶ added in v0.0.2
func (es *EphemeralWalletStore) WalletEventCount() (uint64, error)
WalletEventCount returns the number of events relevant to the wallet.
func (*EphemeralWalletStore) WalletEvents ¶ added in v0.0.2
func (es *EphemeralWalletStore) WalletEvents(offset, limit int) ([]wallet.Event, error)
WalletEvents returns the wallet's events.
type MemPeerStore ¶ added in v0.2.2
type MemPeerStore struct {
// contains filtered or unexported fields
}
A MemPeerStore is an in-memory implementation of a PeerStore.
func NewMemPeerStore ¶ added in v0.2.2
func NewMemPeerStore() *MemPeerStore
NewMemPeerStore returns a new MemPeerStore.
func (*MemPeerStore) AddPeer ¶ added in v0.2.2
func (ps *MemPeerStore) AddPeer(addr string) error
AddPeer adds a peer to the store. If the peer already exists, nil should be returned.
func (*MemPeerStore) Ban ¶ added in v0.2.2
Ban temporarily bans one or more IPs. The addr should either be a single IP with port (e.g. 1.2.3.4:5678) or a CIDR subnet (e.g. 1.2.3.4/16).
func (*MemPeerStore) Banned ¶ added in v0.2.2
func (ps *MemPeerStore) Banned(addr string) (bool, error)
Banned returns false
func (*MemPeerStore) PeerInfo ¶ added in v0.2.2
func (ps *MemPeerStore) PeerInfo(addr string) (syncer.PeerInfo, error)
PeerInfo returns the metadata for the specified peer or ErrPeerNotFound if the peer wasn't found in the store.
func (*MemPeerStore) Peers ¶ added in v0.2.2
func (ps *MemPeerStore) Peers() ([]syncer.PeerInfo, error)
Peers returns the set of known peers.
func (*MemPeerStore) UpdatePeerInfo ¶ added in v0.2.2
func (ps *MemPeerStore) UpdatePeerInfo(addr string, fn func(*syncer.PeerInfo)) error
UpdatePeerInfo updates the metadata for the specified peer. If the peer is not found, the error should be ErrPeerNotFound.