-
Notifications
You must be signed in to change notification settings - Fork 6
Ethereum Wire Protocol
marcinja edited this page Nov 12, 2015
·
3 revisions
While Flare uses go as a system controller for Nodes, the primary library for interacting with ethereum, web3, uses javascript. The controller connects over websockets to a meteor server which exists for the sole purpose of interacting with the ethereum network. Below is their communication protocol.
Initialization
This is the first thing sent from the controller to the ethereum handler and it allows the handler to define variables needed for further action.
flag: "init"
, privateKey:
string, ident:
string, coinbase:
string, contract:
string
-
flag
must be the stringinit
-
privateKey
is a 64 byte ethereum private key that can be used to sign transactions fromcoinbase
-
ident
is a unique node identifier -
coinbase
is either a 40 byte ethereum address or 42 byte ethereum address prefixed by '0x' representing the desired address to send payouts -
contract
is either a 40 byte ethereum address or 42 byte ethereum address prefixed by '0x' representing the address of the flareth contract being used
Processing Payment
The handler asynchronously accepts messages for new operations that the node has completed.
flag: "processPayment"
, operations:
uint
-
flag
must be the stringprocessPayment
-
operations
is the number of computations a node has done and is requesting payment for