Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Accept new fixes and features #67

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@
?/regtest/*
!?/regtest/server.pem
!?/regtest/server.cert

*.bak

29 changes: 22 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,15 @@ B2=-datadir=2 $(B2_FLAGS)
BLOCKS=1
ADDRESS=
AMOUNT=
ACCOUNT=
FEERATE=1
ADDRESSLABEL=
ADDRESSTYPE=
W1=wallet1
W2=wallet2
PORT1=19000
RPCPORT1=19001
PORT2=19010
RPCPORT2=19011

start:
$(BITCOIND) $(B1) -daemon
Expand All @@ -26,16 +34,16 @@ getinfo:
$(BITCOINCLI) $(B2) -getinfo

sendfrom1:
$(BITCOINCLI) $(B1) sendtoaddress $(ADDRESS) $(AMOUNT)
$(BITCOINCLI) $(B1) -named sendtoaddress address="$(ADDRESS)" amount=$(AMOUNT) fee_rate=$(FEERATE)

sendfrom2:
$(BITCOINCLI) $(B2) sendtoaddress $(ADDRESS) $(AMOUNT)
$(BITCOINCLI) $(B2) -named sendtoaddress address="$(ADDRESS)" amount=$(AMOUNT) fee_rate=$(FEERATE)

address1:
$(BITCOINCLI) $(B1) getnewaddress $(ACCOUNT)
$(BITCOINCLI) $(B1) getnewaddress $(ADDRESSLABEL) $(ADDRESSTYPE)

address2:
$(BITCOINCLI) $(B2) getnewaddress $(ACCOUNT)
$(BITCOINCLI) $(B2) getnewaddress $(ADDRESSLABEL) $(ADDRESSTYPE)

stop:
$(BITCOINCLI) $(B1) stop
Expand All @@ -46,7 +54,14 @@ clean:
find 2/regtest/* -not -name 'server.*' -delete

docker-build:
docker build --tag bitcoin-testnet-box .
docker build -t bitcoin-testnet-box .

docker-run:
docker run -ti bitcoin-testnet-box
docker run -t -i -p $(PORT1):$(RPCPORT1) -p $(PORT2):$(RPCPORT2) bitcoin-testnet-box

wallet1:
$(BITCOINCLI) $(B1) createwallet $(W1)

wallet2:
$(BITCOINCLI) $(B2) createwallet $(W2)

57 changes: 12 additions & 45 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,51 +48,20 @@ $ make start

```
$ make getinfo
bitcoin-cli -datadir=1 getinfo
{
"version" : 90300,
"protocolversion" : 70002,
"walletversion" : 60000,
"balance" : 0.00000000,
"blocks" : 0,
"timeoffset" : 0,
"connections" : 1,
"proxy" : "",
"difficulty" : 0.00000000,
"testnet" : false,
"keypoololdest" : 1413617762,
"keypoolsize" : 101,
"paytxfee" : 0.00000000,
"relayfee" : 0.00001000,
"errors" : ""
}
bitcoin-cli -datadir=2 getinfo
{
"version" : 90300,
"protocolversion" : 70002,
"walletversion" : 60000,
"balance" : 0.00000000,
"blocks" : 0,
"timeoffset" : 0,
"connections" : 1,
"proxy" : "",
"difficulty" : 0.00000000,
"testnet" : false,
"keypoololdest" : 1413617762,
"keypoolsize" : 101,
"paytxfee" : 0.00000000,
"relayfee" : 0.00001000,
"errors" : ""
}
```
## Creating wallets

```
bitcoin-cli -datadir=1 createwallet wallet1
make wallet1
```

```
bitcoin-cli -datadir=2 createwallet wallet2
make wallet2
```

## Verify that there is a wallet on each node
```
$ make getinfo
```

## Generating blocks
Expand All @@ -108,13 +77,10 @@ To generate a block:
$ make generate
```

To generate more than 1 block:
We need to generate at least 100 blocks before there is a balance in the first wallet.

```
$ make generate BLOCKS=10
```
To generate more than 1 block:

## Need to generate at least 100 blocks before there will be a balance in the first wallet
```
$ make generate BLOCKS=200
```
Expand Down Expand Up @@ -170,7 +136,7 @@ Pull the image
* `docker pull freewil/bitcoin-testnet-box`

or build it yourself from this directory
* `docker build -t bitcoin-testnet-box .`
* `make docker-build`

### Running docker container
The docker image will run two bitcoin nodes in the background and is meant to be
Expand All @@ -182,9 +148,10 @@ from outside the container.

or if you built the docker image yourself:

`$ docker run -t -i -p 19001:19001 -p 19011:19011 bitcoin-testnet-box`
`$ make docker-run`

## Running without docker
To run without docker, one should download the supported Bitcoin core version.
To find the supported version, search for the `BITCOIN_CORE_VERSION` environment variable
in the `Dockerfile` file.