freewil / bitcoin-testnet-box

Create your own private bitcoin testnet
MIT License
593 stars 273 forks source link

Cannot generate blocks #56

Closed IvanVnucec closed 2 years ago

IvanVnucec commented 3 years ago

When I run make start and then make generate I get the following error:

$ make generate
bitcoin-cli -datadir=1  -generate 1
error code: -18
error message:
No wallet is loaded. Load a wallet using loadwallet or create a new one with createwallet. (Note: A default wallet is no longer automatically created)

I think the problem is with the 0.21.0 version of bitcoin-cli because that version hasn't got default wallet. I think that is the issue with the #52. Maybe downgrade the version to the correct one or update README and Dockerfile with the creation of the bitcoin wallet commands. https://github.com/freewil/bitcoin-testnet-box/blob/29944ca45207ac517f477d3e97813f83d2ed04b5/Dockerfile#L16

IvanVnucec commented 3 years ago

Here are listed bitcoin-cli versions: https://bitcoincore.org/bin/

IvanVnucec commented 3 years ago

Ok, it seems that I've managed to find the solution:

  1. Run make start-gui. (won’t work in Docker)
  2. Two windows appears. Create Wallets on both and close both windows.
  3. Run make start
  4. (optional) Run docker container
  5. Generate a block by make start and then make generate and the output should be something like:
    {
    "address": "bcrt1qcffaf0vp26k93egylyra8nh4h43lkep4yq49wg",
    "blocks": [
    "4fd42fb4533ecfc561d0a2e8a4783aa3a35820c57f7c3a950aa311bf6c00f43b"
    ]
    }
IvanVnucec commented 3 years ago

Anyhow, the creation of the Bitcoin wallet should be automated and/or documented in the README.md file.

IvanVnucec commented 3 years ago

I see now in README that there exist a way to create a wallet for the second client, so maybe in the step 2 we don't need to create the wallet for the second one.