Bitcoin Forum
April 24, 2024, 10:44:30 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Run Bitcoind without full sync  (Read 269 times)
deceive3w (OP)
Newbie
*
Offline Offline

Activity: 4
Merit: 0


View Profile
January 10, 2020, 08:15:16 AM
 #1

I want to using bitcoin-cli to listen new block and make notification when there have a receive transaction. i didnt want to have a ancient block, how to run bitcoin core without sync ancient block but just current blockheight
1713998670
Hero Member
*
Offline Offline

Posts: 1713998670

View Profile Personal Message (Offline)

Ignore
1713998670
Reply with quote  #2

1713998670
Report to moderator
1713998670
Hero Member
*
Offline Offline

Posts: 1713998670

View Profile Personal Message (Offline)

Ignore
1713998670
Reply with quote  #2

1713998670
Report to moderator
1713998670
Hero Member
*
Offline Offline

Posts: 1713998670

View Profile Personal Message (Offline)

Ignore
1713998670
Reply with quote  #2

1713998670
Report to moderator
"There should not be any signed int. If you've found a signed int somewhere, please tell me (within the next 25 years please) and I'll change it to unsigned int." -- Satoshi
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1713998670
Hero Member
*
Offline Offline

Posts: 1713998670

View Profile Personal Message (Offline)

Ignore
1713998670
Reply with quote  #2

1713998670
Report to moderator
ABCbits
Legendary
*
Offline Offline

Activity: 2856
Merit: 7404


Crypto Swap Exchange


View Profile
January 10, 2020, 08:58:07 AM
Merited by pooya87 (1)
 #2

Bitcoin Core don't support such feature, you must download and verify all block at least once. But if you don't mind download all blocks, but only store recent blocks, then pruned mode is what you're looking.

Using 3rd party API or SPV wallet (e.g. Electrum) are other choice you might be interested.

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
pooya87
Legendary
*
Offline Offline

Activity: 3430
Merit: 10498



View Profile
January 10, 2020, 09:04:42 AM
 #3

that is not how bitcoin works. if you don't first download and verify* all these "ancient" blocks you won't be able to know if the new blocks and transactions that you receive are valid or not. in other words what you call "ancient" block is necessary for decentralized security without needing a middle man.

* you can discard blocks after they were downloaded and verified to end up storing a smaller blockchain database. the process is known as pruning. https://bitcointalk.org/index.php?topic=5213552.0

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
deceive3w (OP)
Newbie
*
Offline Offline

Activity: 4
Merit: 0


View Profile
January 10, 2020, 10:53:20 AM
 #4

i have tried Electrum but the protocol methods is limited. i want to make notification when there have receive transaction on my child address. if i am using Electrum or third party API, i must get transaction in every block and compare there is such address in my database, that's could have more resource if block have more than 1000+ tx. in bitcoin-cli i think that's possible using method "listtransaction" to get only latest transaction in my child address. or do you have any suggest?. Thanks for response  Grin
joniboini
Legendary
*
Offline Offline

Activity: 2170
Merit: 1789



View Profile WWW
January 11, 2020, 04:09:36 AM
 #5

i have tried Electrum but the protocol methods is limited. i want to make notification when there have receive transaction on my child address. if i am using Electrum or third party API, i must get transaction in every block and compare there is such address in my database, that's could have more resource if block have more than 1000+ tx.

That's not really a problem imo. Electrum is quite fast, which is the point of an SPV client.

There is also an alternative for e-mail notifications that are available on a platform such as https://www.blockonomics.co/. You need to pay though.

███████████████████████████
███████▄████████████▄██████
████████▄████████▄████████
███▀█████▀▄███▄▀█████▀███
█████▀█▀▄██▀▀▀██▄▀█▀█████
███████▄███████████▄███████
███████████████████████████
███████▀███████████▀███████
████▄██▄▀██▄▄▄██▀▄██▄████
████▄████▄▀███▀▄████▄████
██▄███▀▀█▀██████▀█▀███▄███
██▀█▀████████████████▀█▀███
███████████████████████████
.
.Duelbits.
..........UNLEASH..........
THE ULTIMATE
GAMING EXPERIENCE
DUELBITS
FANTASY
SPORTS
████▄▄█████▄▄
░▄████
███████████▄
▐███
███████████████▄
███
████████████████
███
████████████████▌
███
██████████████████
████████████████▀▀▀
███████████████▌
███████████████▌
████████████████
████████████████
████████████████
████▀▀███████▀▀
.
▬▬
VS
▬▬
████▄▄▄█████▄▄▄
░▄████████████████▄
▐██████████████████▄
████████████████████
████████████████████▌
█████████████████████
███████████████████
███████████████▌
███████████████▌
████████████████
████████████████
████████████████
████▀▀███████▀▀
/// PLAY FOR  FREE  ///
WIN FOR REAL
..PLAY NOW..
HCP
Legendary
*
Offline Offline

Activity: 2086
Merit: 4316

<insert witty quote here>


View Profile
January 11, 2020, 04:34:19 AM
 #6

i have tried Electrum but the protocol methods is limited. i want to make notification when there have receive transaction on my child address. if i am using Electrum or third party API, i must get transaction in every block and compare there is such address in my database, that's could have more resource if block have more than 1000+ tx. in bitcoin-cli i think that's possible using method "listtransaction" to get only latest transaction in my child address. or do you have any suggest?. Thanks for response  Grin
If you're wanting "notifications"... you should probably be using walletnotify. That will trigger the specified script to execute whenever a transaction is received (or confirms etc) that relates to your wallet (and any of the addresses in it).

Quote from: bitcoind commandline arguments
  -walletnotify=<cmd>
       Execute command when a wallet transaction changes (%s in cmd is replaced
       by TxID)

As noted, you can pass in the TxID to that script by using the %s value... and you could then retrieve the information for that specific transaction using gettransaction and parse the JSON returned, instead of returning a bunch of transactions for ALL your addresses using listtransactions and trying to figure out which transaction is "new" etc.

█████████████████████████
████▐██▄█████████████████
████▐██████▄▄▄███████████
████▐████▄█████▄▄████████
████▐█████▀▀▀▀▀███▄██████
████▐███▀████████████████
████▐█████████▄█████▌████
████▐██▌█████▀██████▌████
████▐██████████▀████▌████
█████▀███▄█████▄███▀█████
███████▀█████████▀███████
██████████▀███▀██████████
█████████████████████████
.
BC.GAME
▄▄░░░▄▀▀▄████████
▄▄▄
██████████████
█████░░▄▄▄▄████████
▄▄▄▄▄▄▄▄▄██▄██████▄▄▄▄████
▄███▄█▄▄██████████▄████▄████
███████████████████████████▀███
▀████▄██▄██▄░░░░▄████████████
▀▀▀█████▄▄▄███████████▀██
███████████████████▀██
███████████████████▄██
▄███████████████████▄██
█████████████████████▀██
██████████████████████▄
.
..CASINO....SPORTS....RACING..
█░░░░░░█░░░░░░█
▀███▀░░▀███▀░░▀███▀
▀░▀░░░░▀░▀░░░░▀░▀
░░░░░░░░░░░░
▀██████████
░░░░░███░░░░
░░█░░░███▄█░░░
░░██▌░░███░▀░░██▌
░█░██░░███░░░█░██
░█▀▀▀█▌░███░░█▀▀▀█▌
▄█▄░░░██▄███▄█▄░░▄██▄
▄███▄
░░░░▀██▄▀


▄▄████▄▄
▄███▀▀███▄
██████████
▀███▄░▄██▀
▄▄████▄▄░▀█▀▄██▀▄▄████▄▄
▄███▀▀▀████▄▄██▀▄███▀▀███▄
███████▄▄▀▀████▄▄▀▀███████
▀███▄▄███▀░░░▀▀████▄▄▄███▀
▀▀████▀▀████████▀▀████▀▀
tranthidung
Legendary
*
Offline Offline

Activity: 2254
Merit: 3981


Farewell o_e_l_e_o


View Profile WWW
January 11, 2020, 05:16:26 AM
Last edit: January 11, 2020, 05:39:39 AM by tranthidung
 #7

I don't know whether there are available scripts to do it with Electrum wallet or not, but if you open your Electrum wallet, you will get notifications for new transactions, both receiving and sending (when you send your coins away).

Electrum wallet is a SPV and much lighter than Bitcoin Core, because it only download block headers, than cost 80 bytes for each block only.

In Electrum, you can use Filter options (for History feature).

  • Activating the Filter option (Wallet > History > Filter)
  • Using the History sub-tab
  • Clicking on All / Specific year / Custom *
  • After choosing Custom, you have to choose the start and end days for the period in which you want to get transaction history.
*: By default, it shows all of your transaction history, whole time, but you can narrow down the observing period by choosing either specific year or (start and end days with Custom) for your interests.
       

I think you can also export your history: Wallet > History > Export (to .csv).

The export file will contain some variables for you: transaction_hash, label (of your addresses), confirmations, and timestamp. You can sort your transactions out, over timestamp, label, and confirmations. If you filter directly on Electrum, it does not allow you to do multi-filter (by timestamp, and label and the others, so you have to do it handy.


What I present is for offline with export data, but I guess you can write some code to do it, in real-time (not sure). I hope my information give you some ideas to build up your scripts (I guess it is possible).

▄▄███████▄▄
▄██████████████▄
▄██████████████████▄
▄████▀▀▀▀███▀▀▀▀█████▄
▄█████████████▄█▀████▄
███████████▄███████████
██████████▄█▀███████████
██████████▀████████████
▀█████▄█▀█████████████▀
▀████▄▄▄▄███▄▄▄▄████▀
▀██████████████████▀
▀███████████████▀
▀▀███████▀▀
.
 MΞTAWIN  THE FIRST WEB3 CASINO   
.
.. PLAY NOW ..
pooya87
Legendary
*
Offline Offline

Activity: 3430
Merit: 10498



View Profile
January 11, 2020, 06:39:24 AM
 #8

Electrum protocol supports notifications. when you connect to an Electrum node you have an open socket and a bunch of subscriptions to certain addresses which the node will inform you about when there is any new transaction that involves those addresses.
more info can be found on the documentation: https://electrumx.readthedocs.io/en/latest/

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
barrysty1e
Hero Member
*****
Offline Offline

Activity: 636
Merit: 516



View Profile WWW
March 06, 2020, 05:39:14 AM
 #9

I want to using bitcoin-cli to listen new block and make notification when there have a receive transaction. i didnt want to have a ancient block, how to run bitcoin core without sync ancient block but just current blockheight

What you are after is done partially in https://github.com/bitcoin/bitcoin/pull/9483.
While it isnt true SPV mode, it will only synchronize the blockheaders on the chain; then request only blocks which are relevant to the inputs you hold in your wallet.

Hope this helps.

my father wears sneakers in the pool
maplelake
Jr. Member
*
Offline Offline

Activity: 47
Merit: 8


View Profile
March 08, 2020, 12:24:52 AM
 #10

Electrum protocol supports notifications. when you connect to an Electrum node you have an open socket and a bunch of subscriptions to certain addresses which the node will inform you about when there is any new transaction that involves those addresses.
more info can be found on the documentation: https://electrumx.readthedocs.io/en/latest/
what is Electrum protocal ? is it bitcoin feature or configuration option in bitcoin.conf ?
maplelake
Jr. Member
*
Offline Offline

Activity: 47
Merit: 8


View Profile
March 08, 2020, 12:27:30 AM
 #11

i have tried Electrum but the protocol methods is limited. i want to make notification when there have receive transaction on my child address. if i am using Electrum or third party API, i must get transaction in every block and compare there is such address in my database, that's could have more resource if block have more than 1000+ tx. in bitcoin-cli i think that's possible using method "listtransaction" to get only latest transaction in my child address. or do you have any suggest?. Thanks for response  Grin
If you're wanting "notifications"... you should probably be using walletnotify. That will trigger the specified script to execute whenever a transaction is received (or confirms etc) that relates to your wallet (and any of the addresses in it).

Quote from: bitcoind commandline arguments
  -walletnotify=<cmd>
       Execute command when a wallet transaction changes (%s in cmd is replaced
       by TxID)

As noted, you can pass in the TxID to that script by using the %s value... and you could then retrieve the information for that specific transaction using gettransaction and parse the JSON returned, instead of returning a bunch of transactions for ALL your addresses using listtransactions and trying to figure out which transaction is "new" etc.

I think it works. But not practice it.
maplelake
Jr. Member
*
Offline Offline

Activity: 47
Merit: 8


View Profile
March 08, 2020, 12:28:37 AM
 #12

I want to using bitcoin-cli to listen new block and make notification when there have a receive transaction. i didnt want to have a ancient block, how to run bitcoin core without sync ancient block but just current blockheight

Use prune to reduce the size of storage.
pooya87
Legendary
*
Offline Offline

Activity: 3430
Merit: 10498



View Profile
March 08, 2020, 04:37:47 AM
Merited by ABCbits (1)
 #13

Electrum protocol supports notifications. when you connect to an Electrum node you have an open socket and a bunch of subscriptions to certain addresses which the node will inform you about when there is any new transaction that involves those addresses.
more info can be found on the documentation: https://electrumx.readthedocs.io/en/latest/
what is Electrum protocal ? is it bitcoin feature or configuration option in bitcoin.conf ?

all the additional functionalities and commands that a certain type of bitcoin full nodes support create "Electrum protocol". all these features are added on top of bitcoin core to make it easier for SPV clients to connect to these special nodes and receive their transaction history, etc. faster and easier.

"bitcoin.conf" file is basic configuration that affect the way you run bitcoin core application and is unrelated to this.

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!