Skip to content

Message API

Used to validate and send a message to the Snapchain node. Valid messages are accepted and gossiped to other nodes in the network.

API

Method NameRequest TypeResponse TypeDescription
SubmitMessageMessageMessageSubmits a Message to the node
SubmitBulkMessagesSubmitBulkMessagesRequestSubmitBulkMessagesResponseSubmits several Messages to the node
ValidateMessageMessageValidationResponseValidates a Message on the node without merging and gossiping

SubmitBulkMessagesRequest

FieldTypeLabelDescription
messagesMessagerepeatedAn array of Messages to submit. All messages will submitted, even if earlier ones fail

SubmitBulkMessagesResponse

FieldTypeLabelDescription
messagesBulkMessageResponserepeatedAn array of BulkMessageResponse, one for each submitted message indicating success or failure

BulkMessageResponse

FieldTypeLabelDescription
messageMessageoneOfThe message if it was submitted successfully
message_errorMessageErroroneOfFailure reason if the message was not submitted successfully

MessageError

FieldTypeLabelDescription
hashbytesMessage hash
errCodestringFailure error code
messagestringDescription of the failure reason

ValidationResponse

FieldTypeLabelDescription
validbooleanWhether the message is valid or not
messageMessageThe message being validated (same as request)