Post
Topic
Board Development & Technical Discussion
Merits 2 from 1 user
Re: Bitcoind and incoming blocks scanning
by
achow101
on 10/03/2016, 20:25:47 UTC
⭐ Merited by ABCbits (2)
Sorry, no so clear.

Do you mean run client like this ?

 sudo bin/bitcoind -datadir=.bitcoin -port=88888 -rpcport=99999 -rpcallowip=127.0.0.1 -rpcuser=bitcoinrpc -rpcpassword=password -blocknotify

Any examples ?

Thanks

Kinda. So you would run Bitcoind like this bitcoind -datadir=.bitcoin -port=88888 -rpcport=99999 -rpcallowip=127.0.0.1 -rpcuser=bitcoinrpc -rpcpassword=password -blocknotify=
where is whatever command you want to run whenever you receive a block.

An Example:
bitcoind -datadir=.bitcoin -port=88888 -rpcport=99999 -rpcallowip=127.0.0.1 -rpcuser=bitcoinrpc -rpcpassword=password -blocknotify="bitcoin-cli getblock %s > block-%s.txt"
%s in the command is replaced by the block hash automatically by this flag so you would literally have %s in the command wherever you need to have the block hash.

I think that should work, although I am testing it right now and will get back to you when that runs.
Edit: It works.