Bitcoin Forum
May 07, 2024, 10:34:43 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Electrum address syncronization  (Read 173 times)
vistore (OP)
Newbie
*
Offline Offline

Activity: 2
Merit: 2


View Profile
September 26, 2019, 07:37:48 PM
Merited by hugeblack (1), o_e_l_e_o (1)
 #1

I need to periodically check the balance of a number of bitcoin addresses (a few tens or hundreds addresses). I noticed that Electrum may syncronize a thousand or more imported addresses in a matter of a few seconds. But I failed to realise how it is done searching through Electrum source code.

Which methods it uses? Does it really import all these addresses into currently connected remote node and then calls listunspent no matter how many addresses I insert into the wallet?

Can you please point me to a code snippet that implements such funtionality
1715078083
Hero Member
*
Offline Offline

Posts: 1715078083

View Profile Personal Message (Offline)

Ignore
1715078083
Reply with quote  #2

1715078083
Report to moderator
The grue lurks in the darkest places of the earth. Its favorite diet is adventurers, but its insatiable appetite is tempered by its fear of light. No grue has ever been seen by the light of day, and few have survived its fearsome jaws to tell the tale.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1715078083
Hero Member
*
Offline Offline

Posts: 1715078083

View Profile Personal Message (Offline)

Ignore
1715078083
Reply with quote  #2

1715078083
Report to moderator
1715078083
Hero Member
*
Offline Offline

Posts: 1715078083

View Profile Personal Message (Offline)

Ignore
1715078083
Reply with quote  #2

1715078083
Report to moderator
alexrossi
Legendary
*
Offline Offline

Activity: 3724
Merit: 1739


Join the world-leading crypto sportsbook NOW!


View Profile
September 26, 2019, 09:57:41 PM
 #2

Not a programmer so I can't link the code snippet

What I can tell you is that electrum servers have custom limits about how many queries per hour a single IP may do. After that limit the connection is cut and restored throttled for a generous amount of time.

  ▄▄███████▄███████▄▄▄
 █████████████
▀▀▀▀▀▀████▄▄
███████████████
       ▀▀███▄
███████████████
          ▀███
 █████████████
             ███
███████████▀▀               ███
███                         ███
███                         ███
 ███                       ███
  ███▄                   ▄███
   ▀███▄▄             ▄▄███▀
     ▀▀████▄▄▄▄▄▄▄▄▄████▀▀
         ▀▀▀███████▀▀▀
░░░████▄▄▄▄
░▄▄░
▄▄███████▄▀█████▄▄
██▄████▌▐█▌█████▄██
████▀▄▄▄▌███░▄▄▄▀████
██████▄▄▄█▄▄▄██████
█░███████░▐█▌░███████░█
▀▀██▀░██░▐█▌░██░▀██▀▀
▄▄▄░█▀░█░██░▐█▌░██░█░▀█░▄▄▄
██▀░░░░▀██░▐█▌░██▀░░░░▀██
▀██
█████▄███▀▀██▀▀███▄███████▀
▀███████████████████████▀
▀▀▀▀███████████▀▀▀▀
▄▄██████▄▄
▀█▀
█  █▀█▀
  ▄█  ██  █▄  ▄
█ ▄█ █▀█▄▄█▀█ █▄ █
▀▄█ █ ███▄▄▄▄███ █ █▄▀
▀▀ █    ▄▄▄▄    █ ▀▀
   ██████   █
█     ▀▀     █
▀▄▀▄▀▄▀▄▀▄▀▄
▄ ██████▀▀██████ ▄
▄████████ ██ ████████▄
▀▀███████▄▄███████▀▀
▀▀▀████████▀▀▀
█████████████LEADING CRYPTO SPORTSBOOK & CASINO█████████████
MULTI
CURRENCY
1500+
CASINO GAMES
CRYPTO EXCLUSIVE
CLUBHOUSE
FAST & SECURE
PAYMENTS
.
..PLAY NOW!..
pooya87
Legendary
*
Offline Offline

Activity: 3444
Merit: 10555



View Profile
September 27, 2019, 05:04:25 AM
 #3

Which methods it uses? Does it really import all these addresses into currently connected remote node and then calls listunspent no matter how many addresses I insert into the wallet?

what you are looking for is not in Electrum source code but in server source code. the Electrum code is just the client that is sending the request to the Electrum node/servers which will then be processed by them and they return the response. they way servers work is that they have already indexed their blockchain (which is why it needs a much bigger disk space compared to a regular node) so they can look up requests easier.
i'm not really sure what code they use but i believe most of them are running this: https://github.com/kyuupichan/electrumx

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
adroitful_one
Legendary
*
Offline Offline

Activity: 1568
Merit: 1041

1GhxHtabWhEpdb7e7oEJ2vd542n33BwTHR


View Profile
September 27, 2019, 10:30:51 AM
 #4

If you want to do this through Electrum, you'll probably end up having to make an Electrum server. Here is a bit of the API:
https://electrumx.readthedocs.io/en/latest/protocol-methods.html

That should get you started. Specifically the RPC interface sections. This is for the ElectrumX server in Python by the way.
vistore (OP)
Newbie
*
Offline Offline

Activity: 2
Merit: 2


View Profile
September 27, 2019, 07:53:11 PM
 #5

Thank you guys for your help!
I finally desided on this tool: https://github.com/dan-da/hd-wallet-addrs
With a little or even no modification this will do almost exactly what I wanted. At least this will allow me to do it fast. If the number of addresses will grow and I will be limited in allowed rates (by third party services) I will switch to full node and/or electrumx. it would be nice if I reached the permissible limits soon, then the project is working!
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!