Project 2 for Computer Systems, Semester 1, 2017 at the University of Melbourne. The server is essentially used for checking the validity of given proof-of-works and can also compute valid proof-of-works. Note that the protocol used by the server to connect to its clients is SSTP.
Run the server using:
prompt: ./server [port_number]
where [port_numer]
is a valid port number.
The server uses the following message protocols:
PING
, after which the server replies with aPONG
ERRO <reason>: BYTE[40]
, which indicates an error and a cause for the errorSOLN difficulty:uint32 seed:BYTE[64] solution:uint64
, here the server checks if the concatenation ofseed
and thesolution
does in fact produce thetarget
requirement derived from thedifficulty
valueWORK difficulty:uint32 seed:BYTE[64] start:uint64 worker_count:uint8
, herestart
in the initialnonce
value. The server puts this work in the work queue. Once a proof-of-work solution is found, it replies with the correspondingSOLN
messageABRT
, on receiving this, the server traverses the work queue and removes all the pending work for that client and prematurely kills all active computations for that client