Skip to content

Latest commit

 

History

History
27 lines (18 loc) · 665 Bytes

README.md

File metadata and controls

27 lines (18 loc) · 665 Bytes

bitcoin-listener

A simple and minimalist Bitcoin blockchain listener.

It connects directly to a bitcoin node and listen for events (e.g. new transactions)

This project does not require any external dependencies for connecting to the bitcoin network.

Sample Usage

BitcoinClient c = new BitcoinClient("localhost", 8333, NetworkParameters.TestNet3);
		
c.addTransactionListener(new TransactionListener() {
	@Override
	public void onTransaction(TxMessage tx, BitcoinConnection conn) {
		System.out.println("New Trasaction: " + tx);
	}
});

c.addBlockListener((block, conn) -> {
    System.out.println("New Block: " + block);
});

c.connect();