Author

Topic: "relayed_by" addres IP (Read 262 times)

legendary
Activity: 2870
Merit: 7490
Crypto Swap Exchange
August 24, 2019, 09:54:30 AM
#15
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'm not sure that really helps.


a) It's just holding it in memory and not exposing it to outside processes -- so not something you could consider "storing"
b) That's for blocks, not transactions

Yeah, additionally with commands such as getblock, getblockheader and decoderawtransaction doesn't show the sender of the block/transaction which asked by OP.
legendary
Activity: 2870
Merit: 7490
Crypto Swap Exchange
August 24, 2019, 01:22:25 AM
#12
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.
legendary
Activity: 1463
Merit: 1886
August 24, 2019, 09:23:43 AM
#11
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'm not sure that really helps.


a) It's just holding it in memory and not exposing it to outside processes -- so not something you could consider "storing"
b) That's for blocks, not transactions
legendary
Activity: 4410
Merit: 4766
August 24, 2019, 02: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.
legendary
Activity: 4410
Merit: 4766
August 23, 2019, 03: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
legendary
Activity: 1946
Merit: 1427
August 16, 2019, 07:34:25 AM
#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?
member
Activity: 138
Merit: 25
August 16, 2019, 07:27:05 AM
#6
I think, peers are not constant and must be often called getpeerinfo
legendary
Activity: 1946
Merit: 1427
August 16, 2019, 07:13:51 AM
#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.
member
Activity: 138
Merit: 25
August 16, 2019, 07:05:27 AM
#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?
legendary
Activity: 1946
Merit: 1427
August 16, 2019, 04: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.
member
Activity: 138
Merit: 25
August 16, 2019, 04: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?
member
Activity: 138
Merit: 25
August 16, 2019, 02:49:40 AM
#1
https://api.blockcypher.com/ has field "relayed_by"
How can be get this information, ZMQ gives me this info?
Jump to: