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

Bitcoind without docker #686

Merged
merged 10 commits into from Nov 26, 2020

Conversation

k9ert
Copy link
Collaborator

@k9ert k9ert commented Nov 23, 2020

This contains some improvements, some of them necessary for better cypress-testing:

  • You can now run bitcoind without docker (--nodocker) if you have bitcoind on the PATH somewhere
  • If you want the process to be quiet, run it with --quiet
  • adjust the mining period, so --mining-period 0.5 will mine a block every half a second
  • --datadir can now be specified and the default is /tmp/bitcoind_plain_datadir. We no longer create new temp-directories
  • A CTRL-C will now always terminate the process/container. In The case of docker, the datadir will be lost as well. In the case of a plain bitcoind, we now have -reset`
  • --reset remove the datadir
  • the blockheight is now printed in the output
  • All options are now properly documented

Here is an example-output:

(.env) ➜  specter-desktop git:(bitcoind_without_docker) ✗ python3 -m cryptoadvance.specter bitcoind --nodocker --mining-period 0.1 
Initializing HWI...
    --> starting plain bitcoind
    -->            url: http://bitcoin:secret@localhost:18443/wallet/
    --> user, password: bitcoin, secret
    -->     host, port: localhost, 18443
    -->    bitcoin-cli: bitcoin-cli -regtest -rpcuser=bitcoin -rpcpassword=secret getblockchaininfo 
    --> Now, mining a block every 0.100000 seconds, avoid it via --no-mining
    --> height: 619 | 0123456789 01^V2345^C
Aborted!
[2020-11-22 14:55:13,599] INFO in bitcoind: Killed bitcoind-process with pid 22058
(.env) ➜  specter-desktop git:(bitcoind_without_docker) ✗ python3 -m cryptoadvance.specter bitcoind --nodocker --reset             
Initializing HWI...
    --> Purging Datadirectory /tmp/bitcoind_plain_datadir ...
(.env) ➜  specter-desktop git:(bitcoind_without_docker) ✗ python3 -m cryptoadvance.specter bitcoind --nodocker --mining-period 0.1 
Initializing HWI...
    --> starting plain bitcoind
    -->            url: http://bitcoin:secret@localhost:18443/wallet/
    --> user, password: bitcoin, secret
    -->     host, port: localhost, 18443
    -->    bitcoin-cli: bitcoin-cli -regtest -rpcuser=bitcoin -rpcpassword=secret getblockchaininfo 
    --> Now, mining a block every 0.100000 seconds, avoid it via --no-mining
    --> height: 200 | 012^C
Aborted!
[2020-11-22 14:55:21,874] INFO in bitcoind: Killed bitcoind-process with pid 22113
(.env) ➜  specter-desktop git:(bitcoind_without_docker) ✗

@ben-kaufman
Copy link
Contributor

Looks good! Though reset doesn't work for me, I get:

python3 -m cryptoadvance.specter bitcoind --reset --nodocker                  
Initializing HWI...
    --> Killing bitcoind-process with id 20807 ...
[1]    20807 terminated  python3 -m cryptoadvance.specter bitcoind --reset --nodocker

@k9ert
Copy link
Collaborator Author

k9ert commented Nov 24, 2020

Yeah, that wasn't quite platform-independent. Should be better now?!

Copy link
Contributor

@ben-kaufman ben-kaufman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works now :) I see it always starts from block 200 after reset, is that intended?

@k9ert
Copy link
Collaborator Author

k9ert commented Nov 26, 2020

Works now :) I see it always starts from block 200 after reset, is that intended?
Partially. I would have expected 100. If you restart it, all wallets in .specterd get funded with a coinbase-transaction automatically. In order to be able to spend it immediately, i'm mining 100 more blocks. Makes sense?

I can have a look whether i can reduce that to 100.

@ben-kaufman
Copy link
Contributor

Ok yes makes sense, looks good to me then

@stepansnigirev stepansnigirev merged commit 2d4b284 into cryptoadvance:master Nov 26, 2020
@k9ert k9ert deleted the bitcoind_without_docker branch May 19, 2021 14:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants