Messages
Last updated
Last updated
Currently, version one of the Streamer Protocol supports only six message types:
Command | Purpose |
---|---|
The HELLO
message is the first message sent between the client and Mevlink node. It consists of the client's protocol version & their API Key ID, found in the Mevlink Dashboard.
Length | Description | |
---|---|---|
The CHALLENGE
message is sent by the Mevlink node in response to the client's HELLO
message. It contains the 16-byte HMAC challenge string.
Length | Description | |
---|---|---|
The The CHALLENGE_RESPONSE
consists of the HMAC-SHA256 digest
Once the messages above have been exchanged, the Mevlink node will begin sending TRANSACTION
messages to the client. The TRANSACTION
message includes the rlp encoded tx bytes, the unix timestamp of when tx was sent, and the unix timestamp of when Mevlink first learned about the transaction.
All rlp encoded transactions in the ethereumplex include a length specifier near the beginning. BSC uses legacy transactions and thus are also rlp encoded. Check out the ethereum rlp docs for more details or checkout how we parse this message in our streamer-go library.
The ordering of the emitted fields, timing information, and MAC is such that you can choose to react to transactions before you have timing information or have verified the authentication signature.
If the Mevlink node disconnects gracefully, it will do so with a DISCONNECT
message containing an error code describing why it closed the connection.
This feature is currently in beta and experiencing many updates and maintenance. We do not consider it's performance to be as strong as our transaction streaming service at the moment, but encourage you to try it as a value add.
If you'd like to propagate a transaction, you can send a EMIT_TRANSACTION
message with the RLP encoded transaction bytes.
Not live! Coming soon.
The EMIT_WHITELIST
message explicitly tells the node which peers you'd like us to send the propagation request transactions to.
Not live! Coming soon.
The EMIT_WHITELIST
message explicitly tells the node which peers you'd like us to NOT send the propagation request transactions to.
Length | Description | |
---|---|---|
Length | Description | |
---|---|---|
Length | Description | |
---|---|---|
Length | Description | |
---|---|---|
Length | Description | |
---|---|---|
Length | Description | |
---|---|---|
0x00
HELLO
The HELLO
message is the first message sent between the client and Mevlink node. It consists of the protocol version and user id.
0x01
CHALLENGE
The CHALLENGE
message is consists of the 16-byte HMAC challenge string
0x02
CHALLENGE_RESPONSE
The CHALLENGE_RESPONSE
consists of the HMAC-SHA256 digest using your API Key Secret
0x03
TRANSACTION
The TRANSACTION
message includes the rlp encoded tx bytes, the unix timestamp of when tx was sent, and the unix timestamp of when mevlink first learned about the transaction.
0x04
DISCONNECT
The DISCONNECT
message occurs before the connection is terminated and contains an error code
0x05
EMIT_TRANSACTION
Message to propagate a transaction.
Coming soon
EMIT_WHITELIST
The EMIT_WHITELIST
message explicitly tells the node which peers you'd like us to send the propagation request transactions to.
Coming soon
EMIT_BLACKLIST
The EMIT_BLACKLIST
message tells the node which peers not to send your propogation requests to, if any.
Command
1 byte
Message Type (0x00
)
Protocol Version
1 byte
Currently only 0x00
is supported
API Key ID
16 bytes
The API Key ID for your Mevlink acocunt
Command
1 byte
Message Type (0x01
)
Challenge
16 bytes
The HMAC challenge
Command
1 byte
Message Type (0x02
)
MAC
32 bytes
The HMAC-SHA256 digest response
Command
1 byte
Message Type (0x03
)
RLP encoded Transaction
variable size
The RLP encoded transaction bytes
Propegation Timestamp
8 bytes
Unix microsecond timestamp indicating when the Mevlink relay received and sent the transaction.
Noticed Timestamp
8 bytes
Unix microsecond timestamp indicating when Mevlink first learned about the transaction from other peers. Note that this may not be the earliest time any mevlink relay has heard about the transaction at time of sending.
MAC
32 bytes
The MAC authentication signature
Command
1 byte
Message Type (0x04
)
Error Code
1 byte
Command
1 byte
Message Type (0x05
)
RLP encoded transaction bytes
variable size
The HMAC-SHA256 digest response
Command
1 byte
Message Type (0x06
)
RLP encoded enodes
variable size
RLP encoded list of enodes
Command
1 byte
Message Type (0x07
)
RLP encoded enodes
variable size
RLP encoded list of enodes