From c9fa1a4aaf81adc9d9685122eaac959c9f927d9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9C=D0=B8=D1=85=D0=B0=D0=B9=D0=BB=D0=BE=20=D0=A8=D0=B0?= =?UTF-8?q?=D1=84=D0=BE=D1=80=D0=BE=D1=81=D1=82=D0=BE=D0=B2?= Date: Mon, 8 Apr 2024 17:23:37 +0300 Subject: [PATCH 1/4] Updated "Makefile". Fixed the commands "sendfrom?" not working if no fall-back fee is configured. Modified the parameters of the commands "address?". Implemented the new commands "wallet?". --- Makefile | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 010d9a5..815b66a 100644 --- a/Makefile +++ b/Makefile @@ -8,7 +8,11 @@ B2=-datadir=2 $(B2_FLAGS) BLOCKS=1 ADDRESS= AMOUNT= -ACCOUNT= +FEERATE=1 +ADDRESSLABEL= +ADDRESSTYPE= +W1=wallet1 +W2=wallet2 start: $(BITCOIND) $(B1) -daemon @@ -26,16 +30,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 @@ -50,3 +54,10 @@ docker-build: docker-run: docker run -ti bitcoin-testnet-box + +wallet1: + $(BITCOINCLI) $(B1) createwallet $(W1) + +wallet2: + $(BITCOINCLI) $(B2) createwallet $(W2) + From 06d8cb91eb201fc54615d312f43d62310d15d272 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9C=D0=B8=D1=85=D0=B0=D0=B9=D0=BB=D0=BE=20=D0=A8=D0=B0?= =?UTF-8?q?=D1=84=D0=BE=D1=80=D0=BE=D1=81=D1=82=D0=BE=D0=B2?= Date: Mon, 8 Apr 2024 17:26:45 +0300 Subject: [PATCH 2/4] Included .bak files in ".gitignore". --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index f0e6da7..1b4864c 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,6 @@ ?/regtest/* !?/regtest/server.pem !?/regtest/server.cert + +*.bak + From 17ab88c1c494d8158a81243faebb3924bb2a6193 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9C=D0=B8=D1=85=D0=B0=D0=B9=D0=BB=D0=BE=20=D0=A8=D0=B0?= =?UTF-8?q?=D1=84=D0=BE=D1=80=D0=BE=D1=81=D1=82=D0=BE=D0=B2?= Date: Fri, 12 Apr 2024 17:03:11 +0300 Subject: [PATCH 3/4] Updated "README.md". Deleted the [obsolete] output samples for "make getinfo". Brought in the "make" commands for wallet creation. Slightly edited the block generation guidelines. --- README.md | 52 +++++++++------------------------------------------- 1 file changed, 9 insertions(+), 43 deletions(-) diff --git a/README.md b/README.md index 0f0b3d0..6a2ea72 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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 ``` From f9eca8d8504bb6ff4c35c87b509b7c9f0e1ff4dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9C=D0=B8=D1=85=D0=B0=D0=B9=D0=BB=D0=BE=20=D0=A8=D0=B0?= =?UTF-8?q?=D1=84=D0=BE=D1=80=D0=BE=D1=81=D1=82=D0=BE=D0=B2?= Date: Sat, 13 Apr 2024 16:19:44 +0300 Subject: [PATCH 4/4] Updated the guidelines for running a Docker container. Updated the "Makefile" targets. Referred to the existing "Makefile" targets in "README.md". --- Makefile | 8 ++++++-- README.md | 5 +++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 815b66a..1f409a6 100644 --- a/Makefile +++ b/Makefile @@ -13,6 +13,10 @@ ADDRESSLABEL= ADDRESSTYPE= W1=wallet1 W2=wallet2 +PORT1=19000 +RPCPORT1=19001 +PORT2=19010 +RPCPORT2=19011 start: $(BITCOIND) $(B1) -daemon @@ -50,10 +54,10 @@ 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) diff --git a/README.md b/README.md index 6a2ea72..c9e5461 100644 --- a/README.md +++ b/README.md @@ -136,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 @@ -148,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. +