From 84cb896dd36b177830d17e9fe2892f294f69412c Mon Sep 17 00:00:00 2001 From: Patrick Nagurny Date: Thu, 4 Jun 2015 11:58:15 -0400 Subject: [PATCH] Added custom message docs --- docs/messages.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/docs/messages.md b/docs/messages.md index 7cfc274..c70cfd0 100644 --- a/docs/messages.md +++ b/docs/messages.md @@ -88,3 +88,15 @@ Same as `getheaders` and `headers`, but the response comes one block at the time ### Transaction Message that contains a transaction. + +## Custom Messages + +It is possible to extend the default peer to peer messages and add custom ones. First you will need to create a message which resembles the default messages in `lib/messages/commands`. + +Then to add the custom message: + +```javascript +messages.add('custom', 'Custom', CustomMessage); + +var customMessage = messages.Custom('argument'); +```