Bitcoin Forum
February 09, 2023, 07:08:22 AM *
News: Latest Bitcoin Core release: 24.0.1 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: [ANN] BTC Sniffer: Bitcoin P2P Network Sniffer & Events Trigger  (Read 2933 times)
sebicas (OP)
Member
**
Offline Offline

Activity: 69
Merit: 17


View Profile WWW
August 23, 2012, 04:01:25 PM
Merited by ETFbitcoin (7)
 #1

Github URL: https://github.com/sebicas/bitcoin-sniffer

BTC Sniffer is a Python script based on an easy version of jgarzik / pynode ( https://github.com/jgarzik/pynode ) that connects to any node on the Bitcoin Network and triggers the folloing events:

* new_block_event(block): Triggers when a Block is found
* new_tx_event(tx): Triggers when a Transactions is found

The purpose of BTC Sniffer is the add an easy way to listen to Bitcoin Network events and facilitate extensions without having to alter bitcoind's code itself, making it easy to upgrade you bitcoind node without having to rewrite your extensions.

The best possible scenario is having BTC Sniffer listening to a local bitcoind node, since we can assume you can trust your own node. But tecnicly, it can connect to any node on the network ( http://blockchain.info/connected-nodes )

IMPORTANT: BTC Sniffer doesn't do any validation, it just trust the node it connects for that, so if you use it on production, make sure you connect to a node you trust.

See how it works
------------------------------

Here is an example of the script output:

Code:
MacBook-Pro:bitcoin-sniffer sebicas$ ./sniffer.py

 Bitcoin Network Sniffer v0.0.1
 -------------------------------------------------------------------------
 Connecting to Bitcoin Node IP # 173.242.112.53:8333
 Connected & Sniffing :)

 - Valid TX: 68ca213684e40a673dba7bbcb1d9bebb2c696eb8da92f8e8d853cab772e92f52
 - Valid TX: 8192c04854d635755184f0f5a6444becba051750ef1ab8bf39967785f377d89e
 - Valid TX: 433b0f7f8b343d0ce25c0ad1e22b42fc57526cfa9ecc86511440d2d5f63961ec
 - Valid TX: 3839d9a481606105ae9f0513e66305cdb6e18149f8c7ae7aea0550d77b443f56
 - Valid TX: 12afb272778079c36f0e35ad9d147b37c9e34f42b12133efca6f57d68a68e548

 - Valid Block: 0000000000000408f197ce13e2271edc889b6ef3109036ce6ff2e30f2e9023df

 - Valid TX: 4649725078f30f4b18099a6ede4c991c16c16887e4ff860b33cb7fa8d6c01c3a
 - Valid TX: 712419473ed2a429de1757030d8551f6ee5d360fdfc9648f5647fbd6f166ed2b
 - Valid TX: 17546dea9122dc13c81fc177c2fba0eda30674fbc29619f24b556095a52efdc3
 - Valid TX: da2621f6ef147e78dfe210e3d3718fb620dc9c8bfbbebd3b1e7e49645e20c53f
 - Valid TX: ddc70dc5119150d2731f6b4193522ad22cbe3800164022a34b94b2c2e899cc1c

Use Case Examples
------------------------------

You can use BTC Sniffer to easily:

1. Push notifications to an external messaging server ( Amazon SNS, ZeroMQ, RabbitMQ, etc )
2. Store real time transactions on any database format you want ( MySQL, MongoDB, etc )
3. Use sockets to display real time stream of network events on your website
4. Create a real time charts and statistics

And anything else you can think of. Smiley

Any questions you can find me at #bitcoin-dev IRC Channel.
1675926502
Hero Member
*
Offline Offline

Posts: 1675926502

View Profile Personal Message (Offline)

Ignore
1675926502
Reply with quote  #2

1675926502
Report to moderator
The forum was founded in 2009 by Satoshi and Sirius. It replaced a SourceForge forum.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1675926502
Hero Member
*
Offline Offline

Posts: 1675926502

View Profile Personal Message (Offline)

Ignore
1675926502
Reply with quote  #2

1675926502
Report to moderator
sebicas (OP)
Member
**
Offline Offline

Activity: 69
Merit: 17


View Profile WWW
October 06, 2017, 03:19:49 AM
 #2

Unfortunately not, when I did this, not much existed... I am sure today you can find way more completed libraries.
BitcoinsGreat
Sr. Member
****
Offline Offline

Activity: 812
Merit: 268


PNNV.COM Live bitcoin price monitor


View Profile WWW
October 11, 2017, 06:11:39 PM
 #3

Open source? I hope so, since this is about ten minutes of coding and is the easiest thing to do. Would hate to have someone install a Trojan over some elementary school code signal and triggers, not even real coding in the first place, just response triggers. So, please tell us that it is all out there for everyone to see, because otherwise, no one will touch it.


████████
██
██
██
██
██
██
██
██
██
██
██▄▄▄▄▄▄
▀▀▀▀▀▀▀▀
.PNNV.com..>..Live BTCitcoin Monitor.
████████
██
██
██
██
██
██
██
██
██
██
▄▄▄▄▄▄██
▀▀▀▀▀▀▀▀
TryNinja
Legendary
*
Offline Offline

Activity: 2380
Merit: 5006



View Profile WWW
October 11, 2017, 08:07:08 PM
Last edit: October 12, 2017, 11:16:27 PM by TryNinja
 #4

Open source? I hope so, since this is about ten minutes of coding and is the easiest thing to do. Would hate to have someone install a Trojan over some elementary school code signal and triggers, not even real coding in the first place, just response triggers. So, please tell us that it is all out there for everyone to see, because otherwise, no one will touch it.
You could have spent 10 seconds of your life to at least read the first 2 lines of the thread where OP links his GitHub repo and says that "BTC Sniffer is a Python script" instead of posting this.

Edit: LOL. Just saw after the last post that this was posted 5 years ago.

CasinoKiller
Sr. Member
****
Offline Offline

Activity: 301
Merit: 250



View Profile
October 11, 2017, 11:34:43 PM
 #5

My granny would do better coding, ha-ha  Roll Eyes

FundYourselfNow
Revolutionizing CrowdfundingJOIN ICO NOW!

itod
Legendary
*
Offline Offline

Activity: 1974
Merit: 1075


^ Will code for Bitcoins


View Profile
October 12, 2017, 11:01:30 PM
Merited by ETFbitcoin (1), allyouracid (1)
 #6

My granny would do better coding, ha-ha  Roll Eyes


Man, this was pioneer coding from the early days, when there was almost nothing like such library. Look at the timestamps, Aug 25, 2012 = more than 5 years ago, have some respect.
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!