SessionInitmessage, and waiting to receive the
SessionAckmessage back. The first
SessionInitmessage is expected to be sent by the initiator.
peer_pub_keyshould match the destination node's public key
node_pub_keyshould match the sender node expected public key (relevant for the initiator node only since he already knows the recipient node's identity)
signshould be a valid secp256k1 signature over the sha256 hash of a JSON-serialized msg containing fields 3-7
SessionInitmessage are valid, the receiver replies with a
SessionAckmessage. If a
SessionAckmessage is not received within a reasonable time frame (10 seconds is recommended), the sender may disconnect.
SessionInitmessage (Bob) has generated his ECDH keys, he can calculate the shared key by using the
SessionInitmessage. Once the
SessionAckmessage is received by the sender of the
SessionInitmessage (Alice), she can compute the shared key as well. All future communication from Alice to Bob must be encrypted with aes-256-cbc symmetric encryption using the shared key.
Pingmessage every 30 seconds.
Pingmessage may disconnect if a
Pongmessage is not received within 10 seconds.
Pongmessage is sent in response to the
Pingmessage. It serves to keep the connection alive by explicitly notifying the other end that the receiver is still active.
Disconnectingmessage is used to inform a connected peer that a disconnection is imminent and that the peer should disconnect immediately. A well-behaved host that sends a
Disconnectingmessage allows the peer at least 2 seconds to disconnect before disconnecting itself.
reasonis an optional parameter for specifying one of the following reasons for the disconnection:
GetNodesmessage is used to query a peer for its list of known, reachable OpenDEX nodes.
Nodesmessage is used to respond to the
NodeStateUpdatemessage is used to tell a peer about a change in the node state. An example of an update is the removal or addition of a supported trading pair.