Skip to content
/ brc Public

broadcaster backend, communicates through zmq with gateway. very simple component.

Notifications You must be signed in to change notification settings

darkwallet/brc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

===
brc
===

Broadcaster component. Allows you to connect to Bitcoin nodes and
broadcast a transaction to them with feedback over ZMQ sockets.

Push transaction with REQ socket to port 9109.
Socket will respond back with either 1 (true) or 0 (fail).
Failure only happens because it couldn't deserialize the transaction data
before broadcasting.

Port 9110 will reply back with a message that has 3 frames:

  [ tx_hash:32 ]
  [ success:8  ] (little-endian, number of successes)
  [ failure:8  ] (little-endian, number of failures)

The success and failures simply indicate whether the transaction got
delivered or not. It does not say anything about the validity of that
transaction.

If the transaction cannot be deserialized the daemon outputs "Bad stream"
but does nothing further.

You can change the ports in define.hpp

  $ ./brc -h
  INFO: Usage: brc [ZMQ_TRANSPORT] [CLIENT_CERTS_DIR]
  INFO: Example: brc tcp://*:8989
  INFO: An empty CLIENT_CERTS_DIR will accept all certificates.
  INFO: See ZMQ manual for more info.

Simple invocation:

  $ ./brc

For testing see the test/ subdirectory.

  $ cd test/
  $ python listen.py &
  $ python poke.py

And watch the output of the brc terminal.

About

broadcaster backend, communicates through zmq with gateway. very simple component.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published