aboutsummaryrefslogtreecommitdiffstats
path: root/static/punks/10.webp
diff options
context:
space:
mode:
Diffstat (limited to 'static/punks/10.webp')
0 files changed, 0 insertions, 0 deletions
a> 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
import bitcoin from 'bitcoinjs-lib'
import Bitcoin from 'bitcoin-core'
import zmq from 'zeromq'

const sock = zmq.socket('sub')

;(async () => {
  let b = new Bitcoin({
    username: 'adam',
    password: 'MPJzfq97',
    port: 18332,
  })
  let res = await b.getBlockCount()
  console.log(res)

  sock.connect('tcp://127.0.0.1:18502')
  sock.subscribe('rawtx')
  sock.on('message', (t, m) => {
    let tx = bitcoin.Transaction.fromBuffer(m)
    console.log(tx)
  })
})()