handshake.proto 1.44 KB
Newer Older
Juan Batiz-Benet's avatar
Juan Batiz-Benet committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package handshake.pb;

//import "github.com/jbenet/go-ipfs/net/mux/mux.proto";

// Handshake1 is delivered _before_ the secure channel is initialized
message Handshake1 {
  // protocolVersion determines compatibility between peers
  optional string protocolVersion = 1; // semver

  // agentVersion is like a UserAgent string in browsers, or client version in bittorrent
  // includes the client name and client. e.g.   "go-ipfs/0.1.0"
  optional string agentVersion = 2; // semver

  // we'll have more fields here later.
}

// Handshake3 is delivered _after_ the secure channel is initialized
message Handshake3 {

  // can include all the values in handshake1, for protocol version, etc.
  optional Handshake1 h1 = 5;

  // publicKey is this node's public key (which also gives its node.ID)
  // - may not need to be sent, as secure channel implies it has been sent.
  // - then again, if we change / disable secure channel, may still want it.
  optional bytes publicKey = 1;

  // listenAddrs are the multiaddrs the sender node listens for open connections on
  repeated bytes listenAddrs = 2;

  // protocols are the services this node is running
  repeated string protocols = 3;

  // oservedAddr is the multiaddr of the remote endpoint that the sender node perceives
  // this is useful information to convey to the other side, as it helps the remote endpoint
  // determine whether its connection to the local peer goes through NAT.
  optional bytes observedAddr = 4;
}