Documentation
¶
Overview ¶
utilities for mocking lightning interactions within docker
Index ¶
- Constants
- Variables
- func MockLndInvoiceMain(t *testing.T) (encoded string, decoded *zpay32.Invoice)
- type LightningMocker
- func (c LightningMocker) CreateBtcdContainer() (id string, err error)
- func (c LightningMocker) CreateLndContainer(name string) (id string, err error)
- func (c LightningMocker) CreateVolumes() error
- func (c LightningMocker) RecreateBtcdContainerMining(containerId string, miningAddress string) (id string, err error)
- func (c LightningMocker) Teardown() error
Constants ¶
View Source
const MiningAddressName = "MINING_ADDRESS"
Variables ¶
View Source
var EnvArgs = []string{
"RPCUSER",
"RPCPASS",
"NETWORK=simnet",
"DEBUG",
}
View Source
var HostnameCmd = []string{"hostname", "-i"}
View Source
var Volumes = []string{"shared", "bitcoin", "lnd"}
Functions ¶
Types ¶
type LightningMocker ¶
type LightningMocker struct {
docker.Client
}
func NewLightningMocker ¶
func NewLightningMocker() LightningMocker
func (LightningMocker) CreateBtcdContainer ¶
func (c LightningMocker) CreateBtcdContainer() (id string, err error)
func (LightningMocker) CreateLndContainer ¶
func (c LightningMocker) CreateLndContainer(name string) (id string, err error)
func (LightningMocker) CreateVolumes ¶
func (c LightningMocker) CreateVolumes() error
idempotently create volumes
func (LightningMocker) RecreateBtcdContainerMining ¶
func (c LightningMocker) RecreateBtcdContainerMining(containerId string, miningAddress string) (id string, err error)
recreate the btcd container with the correct mining address TODO reduce redundant code here
func (LightningMocker) Teardown ¶
func (c LightningMocker) Teardown() error
Click to show internal directories.
Click to hide internal directories.