rodentrabies / bp

Bitcoin Protocol components in Common Lisp
MIT License
37 stars 8 forks source link

Not an issue, just a comment #6

Closed jccerrillo closed 3 years ago

jccerrillo commented 3 years ago

This is really cool!

CL-USER> (bp:with-chain-supplier (bp:node-connection
                         :url "http://localhost:8332"
                         :username *rpcuser*
                         :password *rpcpsswrd*)
  (let* ((genesis-hash (bp:get-block-hash 0))
     (genesis-block (bp:get-block genesis-hash))
     (genesis-tx-input (aref (bp:tx-inputs (aref (bp:block-transactions genesis-block) 0)) 0))
     (genesis-commands (bp:script-commands (bp:txin-script-sig genesis-tx-input)))
     (genesis-note (cdr (aref genesis-commands 2))))
    (flexi-streams:octets-to-string genesis-note)))

"The Times 03/Jan/2009 Chancellor on brink of second bailout for banks"
rodentrabies commented 3 years ago

Thank you!