Server component of Rein decentralized labor market.
Stores kv pairs and verifies signatures and authentication via ECDSA.
See server_setup.md
Building and initial run
git clone git@github.com:ReinProject/causeway.git
cd causeway
docker build --tag reinproject/causeway .
docker run -p 8332:8332 -p 2016:2016 --name reinproject-server reinproject/causeway
Run once built
docker start reinproject-server
docker-compose build --no-cache
docker-compose up
NOTE --no-cache could be omitted if no changes in source tree where happen o
- All requests via HTTP GET except where noted.
- Data returned as JSON, formatted with indent=4 for now.
Parameters
key - used to retrieve value
Returns
key - the key that was requested
value - the value stored for the key
Note: Charges bandwidth against sale record associated with key/value.
Parameters
key - string
value - string
address - account to charge for this data
nonce - latest unused 32-byte string retrieved via /nonce
signature - signature over concat(key + value + address + nonce) by
private key for address
Returns
status - "success" or "error: " + error reason
Parameters
key - string
address - account that owns this key
nonce = latest unused 32-byte string retrieved via /nonce
signature - signature over concat(key + address + nonce) by
private key for address
Parameters
address - manually entered account requesting a nonce, users will need to
pay to register in order to be eligible for nonces
Returns
nonce - random 32-byte string
Note: nonce will later be stored until used or next nonce generated for address
Parameters
None
Returns
List of available endpoints
Parameters
None
Returns
uptime - time in seconds that the service has been running
stored - bytes stored
free - bytes free
price - satoshis for 1 MB storage + 50 MB transfer
Parameters
None
Returns
price - satoshis for 1 MB storage + 50 MB transfer
Parameters
contact - email address to notify on expiration
address - owner of new hosting bucket
Returns
result - success or error
buckets - listing free space, reamining bandwidth, and expiration
- Hosting will purchased in buckets that expire in one year..
- A bucket holds 1 MB of data and comes with 50 MB of transfer.
- If a bucket expires, key/value-pairs are redistributed to an owner's newer buckets. Otherwise, the owner is notified via email that expiration is affecting hosting.
- Data is kept if bandwidth is exceeded just no longer served until more is purchased.
Parameters
contact - email or Bitmessage address to contact on expiration
address - account this will be used to fund
signature - signature for concatenation of contact and address by
private key for address
Returns
address - a dummy string, later an address suitable for funding an account
Parameters
address - account on which to report balance
nonce - latest unused 32-byte string retrieved via /nonce
signature - signature over concat(address and last nonce received via /nonce call)
Returns
balance - satoshis worth of value left on account