Skip to content

Frontend Wire Protocol

Nchinda Nchinda edited this page Oct 11, 2015 · 5 revisions

While Flare uses go as a system controller for Nodes, golang is not the most extensively developed language for making web apps and frontends. The graphical interface for nodes is a meteor server which connects over websockets to the controller. Below is their communication protocol.

##Configuration File ####Sending config the controller watches the config file set in the FLARECONF environment variable for changes and pushes those changes to the frontend.

Controller -> Frontend

flag: "config", text: string

  • flag must be the string config
  • text json representing the config file

####Setting Config Frontend -> Controller

flag: "setConfig", text: string

  • flag must be the string setConfig
  • text is a json string of the new configuration file

####Get Config deprecated, updates to the config file are now sent automatically

Frontend -> Controller

flag: "getConfig"

  • flag must be the string getConfig

Controller -> Frontend

flag: "config", text: string

  • flag must be the string config
  • text json representing the config file

##Log Operations ####Returning Logs Controller -> Frontend

flag: "log", type: string, success: bool

  • flag: must be the string "log"
  • type: is the type of log. must be one of tracing, session, spark, sparkUI
  • success: is a truthy representing whether retrieval succeeded or failed

####Requesting Logs Frontend -> Controller

flag: "getLog", type: string

  • type: is the type of log. must be one of tracing, session, spark, sparkUI

Controller -> Frontend

flag: "log", type: string, success: bool

  • flag: must be the string "log"
  • type: is the type of log. must be one of tracing, session, spark, sparkUI
  • success: is a truthy representing whether retrieval succeeded or failed

##Cassandra ####Cassandra Info the controller regularly polls cassandra for node info and if new data exists sends it to the frontend

Controller -> Frontend

flag: "cassandraNodeInfo", text: string

  • flag must be the string cassandraNodeInfo
  • text is the ouput from running cassandra nodetool info

####Cassandra Ring the controller regularly polls cassandra for the node ring and if new data exists sends it to the frontend

Controller -> Frontend

flag: "cassandraNodeRing", text: string

  • flag must be the string cassandraNodeRing
  • text is the ouput from running cassandra nodetool ring

##IPFS ####Upload JAR implementation pending

Frontend -> Controller

flag: "submit", id: string, name: string

  • flag must be the string sparkSubmit
  • id an identifier for this submission which will be sent back with any status updates
  • name the full path+name of the file to upload on the system

Controller -> Frontend

flag: "submit", id: string, name: string, success: bool

  • flag must be the string sparkSubmit
  • id an identifier for this submission which will be sent back with any status updates
  • name the full path+name of the file to upload on the system
  • success: is a truthy representing whether submission succeeded or failed