- 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)
- 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
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 | 👎 | 👎 | 👎 | 👎 |
- npm install
- npm test
Contributions are always welcome. Open issues are avaialbe: Issues