enum EventType {
	READY = 1;
	JOIN = 2;
	LEAVE = 3;
	ON_STREAM_OPEN = 4;
	ON_STREAM_CLOSE = 5;
	ON_STREAM_DATA = 6;
	ON_STREAM_ERROR = 7;
	ON_PEER = 8;
	CONNECT = 9;
	ON_UPDATED = 10;
}

message SwarmEvent {
	required EventType type = 1;

	// The name of the topic to use
	optional bytes topic = 2;

	// Data sent as part of a stream
	// Also there for error messages
	optional bytes data = 3;

	// The ID of a peer either in discovery or new stream
	optional string peer = 4;

	// The ID of the stream sending data or emitting an event
	optional int32 stream = 5;
}
