fairDataSociety / fdp-contracts

Fair Data Protocol smart contracts and its utilities
4 stars 1 forks source link

Proposal: Swarm DB - Compute Node #85

Open molekilla opened 2 years ago

molekilla commented 2 years ago

Swarm DB - Compute Node

Swarm DB Compute Node

Summary

A Compute node executes WASM executables which are uploaded and stored in Swarm and registered in a Work Order registry, for non-recurrent work orders, and a Jobs registry, for recurring work orders.

A node sole responsibility is to compute data or datasets stored in Swarm or any IPLD-compatible store, eg Filecoin, IPFS. Because it only understand how to execute WASM, any Beeson Query Language usage is done internally in the context of the WASM Engine.

Guide-level explanation

WASM

A node implements both EIP-3668 and EIP-5559: Cross Chain Write Deferral Protocol to accept storage tasks, executes them and update its state to a blockchain.

There are two types of nodes as described in Swarm DB - Indexing and computing, indexing and compute nodes.

We defined a combination of WASM blocks, one being the WASM Engine and another the WASM Runnable orchestrator:

Get WASM Executable from a work order ---> Client Node API | WASM Runnable | WASM Engine | OS

A node can be any P2P client, thus we might have a compute node inside a web browser and an indexing node in a cell phone.

Additionally, a set of smart contracts are required that uses the above EIPs specifications.

Reference technology implementation

Copyright

Copyright and related rights waived via CC0.

Author

@molekilla (Rogelio Morrell)