Documentation
¶
Index ¶
- type Bitbox
- type BitboxDefaults
- func (b *BitboxDefaults) AccountAddress(node int, account string) (address string, err error)
- func (b *BitboxDefaults) AccountBalance(node int, account string) (balance float64, err error)
- func (b *BitboxDefaults) BlockHeight() (blocks int32, err error)
- func (b *BitboxDefaults) Client(nodeIndex int) *rpcclient.Client
- func (b *BitboxDefaults) CreateNodes(nodes int, create createNodeFunc) (err error)
- func (b *BitboxDefaults) Generate(node int, blocks uint32) (err error)
- func (b *BitboxDefaults) GetRawTransaction(txHash string) (result *btcutil.Tx, err error)
- func (b *BitboxDefaults) Info() *State
- func (b *BitboxDefaults) Send(node int, address string, amount float64) (tx string, err error)
- func (b *BitboxDefaults) Stop() (err error)
- type Bitcoind
- type Btcd
- type Node
- type State
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Bitbox ¶
type Bitbox interface {
//Start runs specified number of bitcoind nodes in regtest mode.
Start(nodes int) (err error)
//Stop terminates all nodes, nnd cleans data directories.
Stop() (err error)
//Info returns information about bitbox state.
Info() *State
//Generate perform blocks mining.
Generate(nodeIndex int, blocks uint32) (err error)
//Send sends funds from node to specified address.
Send(node int, address string, amount float64) (tx string, err error)
//Balance returns avaliable balance of specified nodes wallet.
Balance(node int) (balance float64, err error)
//Address generates new adderess of specified nodes wallet.
Address(node int) (address string, err error)
//GetRawTransaction returns raw transaction by hash.
GetRawTransaction(txHash string) (result *btcutil.Tx, err error)
//BlockHeight returns current block height.
BlockHeight() (blocks int32, err error)
//InitMempool makes mempool usable by sending transaction and generating blocks.
InitMempool() (err error)
}
Bitbox represent API interface to multiple bitcoin nodes, that are running in regtest/simnet mode.
type BitboxDefaults ¶
func (*BitboxDefaults) AccountAddress ¶
func (b *BitboxDefaults) AccountAddress(node int, account string) (address string, err error)
Address generates new adderess of specified nodes wallet.
func (*BitboxDefaults) AccountBalance ¶
func (b *BitboxDefaults) AccountBalance(node int, account string) (balance float64, err error)
Balance returns avaliable balance of specified nodes wallet.
func (*BitboxDefaults) BlockHeight ¶
func (b *BitboxDefaults) BlockHeight() (blocks int32, err error)
BlockHeight returns current block height.
func (*BitboxDefaults) CreateNodes ¶
func (b *BitboxDefaults) CreateNodes(nodes int, create createNodeFunc) (err error)
Start runs specified number of bitcoin nodes in regtest/simnet mode.
func (*BitboxDefaults) Generate ¶
func (b *BitboxDefaults) Generate(node int, blocks uint32) (err error)
Generate perform blocks mining.
func (*BitboxDefaults) GetRawTransaction ¶
func (b *BitboxDefaults) GetRawTransaction(txHash string) (result *btcutil.Tx, err error)
GetRawTransaction returns raw transaction by hash.
func (*BitboxDefaults) Info ¶
func (b *BitboxDefaults) Info() *State
Info returns information about bitbox state.
func (*BitboxDefaults) Stop ¶
func (b *BitboxDefaults) Stop() (err error)
Stop terminates all nodes, nnd cleans data directories.
type Bitcoind ¶
type Bitcoind struct {
BitboxDefaults
}
func (*Bitcoind) InitMempool ¶
InitMempool makes mempool usable by sending transaction and generating blocks.
type Btcd ¶
type Btcd struct {
BitboxDefaults
}
func (*Btcd) InitMempool ¶
InitMempool makes mempool usable by sending transaction and generating blocks.