Bitcoin Forum
December 12, 2024, 09:06:33 PM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: "relayed_by" addres IP  (Read 263 times)
Frodek (OP)
Member
**
Offline Offline

Activity: 138
Merit: 25


View Profile
August 16, 2019, 07:49:40 AM
 #1

https://api.blockcypher.com/ has field "relayed_by"
How can be get this information, ZMQ gives me this info?
Frodek (OP)
Member
**
Offline Offline

Activity: 138
Merit: 25


View Profile
August 16, 2019, 09:25:14 AM
 #2

IP of previous node can be obtained only by standalnone using protocol? Or is way to get that info from Bitcoin client - for exmaple by ZMQ?
AdolfinWolf
Legendary
*
Offline Offline

Activity: 1946
Merit: 1427


View Profile
August 16, 2019, 09:37:04 AM
 #3

IP of previous node can be obtained only by standalnone using protocol? Or is way to get that info from Bitcoin client - for exmaple by ZMQ?

I believe this is how most block explorers get it (the relay IP of a new transaction that is:) (Not sure if it's still up to date either.)

Blockchain.info lists the first IP address it sees a new transaction from.

If you aren't the one creating the transaction, and aren't accidentally the node right in between the node that does and blockchain.info, it's unlikely that you're the first to do so. Furthermore, they may not even be connected to you the whole time.

To see what transactions are being relayed, start bitcoind with -debug=net, and look for 'inv' messages in the debug.log file.
Basically: the relayed_by stat is pretty darn useless.

I'm not sure if ZMQ actually gives info regarding IP adresses. https://bitcoin.stackexchange.com/a/40755 says only notifications for blocks/tx's.

and https://github.com/bitcoin/bitcoin/blob/master/doc/zmq.md

Might very well be wrong though.

Frodek (OP)
Member
**
Offline Offline

Activity: 138
Merit: 25


View Profile
August 16, 2019, 12:05:27 PM
 #4

I run bitcoin with -debug=net
in log I have "got inv tx=hash, new peer=1"
peer = 1 or 9 but how get IP address from peer number?
AdolfinWolf
Legendary
*
Offline Offline

Activity: 1946
Merit: 1427


View Profile
August 16, 2019, 12:13:51 PM
 #5

I run bitcoin with -debug=net
in log I have "got inv tx=hash, new peer=1"
peer = 1 or 9 but how get IP address from peer number?

GetPeerInfo (?) https://bitcoincore.org/en/doc/0.16.0/rpc/network/getpeerinfo/

Again though, you will see which node relayed the transaction to YOU. It's obviously not the node that is the original owner of the tx.

And thus, as others have also stated in the past, the information is rather useless. I don't really understand what you would want this for.

Frodek (OP)
Member
**
Offline Offline

Activity: 138
Merit: 25


View Profile
August 16, 2019, 12:27:05 PM
 #6

I think, peers are not constant and must be often called getpeerinfo
AdolfinWolf
Legendary
*
Offline Offline

Activity: 1946
Merit: 1427


View Profile
August 16, 2019, 12:34:25 PM
 #7

I think, peers are not constant and must be often called getpeerinfo
You can change that by only connecting to certain nodes but then the stat becomes even more useless as you're bound to only get new tx's relayed by those nodes anyway.
So really the question becomes about what you're trying to achieve with this?






I'm not sure how blockcypher and blockchain.com do it, or why they think this stat is useful to add anyway. Are they connected to what, 1000 peers?

franky1
Legendary
*
Offline Offline

Activity: 4438
Merit: 4820



View Profile
August 23, 2019, 08:23:24 PM
 #8

relayed by is about where the node got its tx from(the node directly connected to the node) its not about who created the tx/block

but normally Bitcoin client (such as Bitcoin Core) don't record from whom they receive a block/transaction.

bitcoin core client does.
its done because if it receives bad data, it gives the node that sent it a score and if the score reaches a certain level the node bans the malicious node

I DO NOT TRADE OR ACT AS ESCROW ON THIS FORUM EVER.
Please do your own research & respect what is written here as both opinion & information gleaned from experience. many people replying with insults but no on-topic content substance, automatically are 'facepalmed' and yawned at
franky1
Legendary
*
Offline Offline

Activity: 4438
Merit: 4820



View Profile
August 24, 2019, 07:21:40 AM
 #9

but normally Bitcoin client (such as Bitcoin Core) don't record from whom they receive a block/transaction.

bitcoin core client does.
its done because if it receives bad data, it gives the node that sent it a score and if the score reaches a certain level the node bans the malicious node

I know that, but AFAIK Bitcoin Core don't add information about which node (along with details such as node's IP, version, service, etc.) send a transaction/block on that transaction/block which needed in this case.

hint:
https://github.com/bitcoin/bitcoin/blob/85883a9f8ea09f65092dc822a7ca98e64b96f4ab/src/net_processing.cpp#L120
Quote
    * Sources of received blocks, saved to be able to send them reject
     * messages or ban them when processing happens afterwards.

I DO NOT TRADE OR ACT AS ESCROW ON THIS FORUM EVER.
Please do your own research & respect what is written here as both opinion & information gleaned from experience. many people replying with insults but no on-topic content substance, automatically are 'facepalmed' and yawned at
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!