Skip to content

getbitpocket/bitcoin-p2p-messages

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status

bitcoin-p2p-protocol

  • ES6 implementation of the Bitcoin p2p protocol
  • messages should be created from javascript objects or buffers (hex strings)
  • Static Methods: Message.fromObject, Message.fromBuffer, Message.fromString
  • Instance Methods: message.toObject, message.toBuffer, message.toString
  • Reduce dependencies to a bare minimum: (buffer,crypto, biginteger)
  • Compatibility with other javascript bitcoin libraries: (bitcore, bitcoinjs, cryptocoinjs)

Convention

  • Build: From Buffer/Hex To Json/Object
  • Serialize: From Json/Object To Buffer/Hex
  • fromObject datatypes:
    • Hash: string or buffer
    • BigNumber: BN or number
    • timestamp: date object

Implementation status

Message fromBuffer toBuffer fromObject toObject
version 👍 👍 👍 👍
verack 👍 👍 👍 👍
addr 👍 👍 👍 👍
inv 👍 👍 👍 👍
getdata 👍 👍 👍 👍
notfound 👍 👍 👍 👍
getblocks 👍 👍 👍 👍
getheaders 👍 👍 👍 👍
tx 👍 👍 👍 👍
block 👍 👍 👍 👍
headers 👍 👍 👍 👍
getaddr 👍 👍 👍 👍
mempool 👍 👍 👍 👍
ping 👍 👍 👍 👍
pong 👍 👍 👍 👍
filterload 👍 👍 👍 👍
filteradd 👍 👍 👍 👍
filterclear 👍 👍 👍 👍
merkleblock 👍 👍 👍 👍
reject 👍 👍 👍 👍
sendheaders 👍 👍 👍 👍
alert 👎 👎 👎 👎

Run Tests

  • npm install
  • npm test

Contribute

Contributions are always welcome. Open issues are avaialbe: Issues