https://github.com/ranjbar-dev/btc-zmq-listener
listen on ZMQ and receive new transactions that bitcoin pushed into zmq
https://github.com/ranjbar-dev/btc-zmq-listener
Last synced: 4 months ago
JSON representation
listen on ZMQ and receive new transactions that bitcoin pushed into zmq
- Host: GitHub
- URL: https://github.com/ranjbar-dev/btc-zmq-listener
- Owner: ranjbar-dev
- Created: 2025-01-29T10:46:45.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2025-02-03T08:50:39.000Z (5 months ago)
- Last Synced: 2025-02-08T13:35:57.018Z (5 months ago)
- Language: Go
- Size: 91.8 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# btczmq
you can run a bitcoin node on prune mode ( use less Desk and it is configable ) and run this service beside bitcoin node, then you can connect to ws server port 8000 ( confiable on /config folder ) and receive new connections that gets into Bitcoin mempool
add you client ip address to give access to connect to ws server( /config/config.yaml file ).
when client connects to ws server, server pushes latest 1000 pending transactions to client.
screenshot
new transction data example:
```
{
"c": 1,
"d": {
"txid": "596f3ae6bde68fa114289830c5f3204e29b586b29614c6b00ef4c0ebccf9de90",
"inputs": [
{
"txid": "99030fe530a08080b0802c5540b2ab1e5e5caf20786383d0081cfa6915f39076",
"index": 56,
"address": "1GNfXR51TvWE8TenQRPVWmKHwUauhyyRF4"
}
],
"outputs": [
{
"address": "1M6gbBVHBxkMWNiTQ8kXgZpHz7nevwH7fR",
"value": 737686
}
],
"confirmations": 0
}
}
```### Build binary
`go build -o ./build/main ./cmd/main.go`
### Run binary
`./build/main /path-to-src/config/config.yaml`