Skip to content

Create bitcoind and other containers in regtest for testing

License

Notifications You must be signed in to change notification settings

elnosh/btc-docker-test

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BTC Docker Test

Utility to create bitcoind and other containers in regtest. Useful for integration testing.

Supports

  • bitcoind
  • LND
  • CLN

You need to have Docker installed.

import (
    btcdocker "github.com/elnosh/btc-docker-test"
    "github.com/elnosh/btc-docker-test/lnd"
    "github.com/elnosh/btc-docker-test/cln"
) 

ctx := context.Background()

// create bitcoind container
bitcoind, err := btcdocker.NewBitcoind(ctx)
if err != nil {
    // handle err
}

blockchainInfo, err := bitcoind.Client.GetBlockchainInfo()

// create LND container
lnd, err := lnd.NewLnd(ctx, bitcoind)
if err != nil {
    // handle err
}

req := lnrpc.GetInfoRequest{}
info, err := lnd.Client.GetInfo(ctx, &req)

// create CLN container
cln, err := cln.NewCLN(ctx, bitcoind)
if err != nil {
    // handle err
}

Inspired by Bitcoind and Lnd

About

Create bitcoind and other containers in regtest for testing

Resources

License

Stars

Watchers

Forks

Languages