-
Notifications
You must be signed in to change notification settings - Fork 4
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
-
flagmust be the stringinit -
privateKeyis a 64 byte ethereum private key that can be used to sign transactions fromcoinbase -
identis a unique node identifier -
coinbaseis either a 40 byte ethereum address or 42 byte ethereum address prefixed by '0x' representing the desired address to send payouts -
contractis 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
-
flagmust be the stringprocessPayment -
operationsis the number of computations a node has done and is requesting payment for