Crates.io | ddc_bucket |
lib.rs | ddc_bucket |
version | 0.5.1 |
source | src |
created_at | 2022-08-04 12:15:17.697684 |
updated_at | 2022-08-04 14:31:03.008054 |
description | DDC v2 Smart Contracts -- Orchestrate the network around clusters and buckets |
homepage | |
repository | |
max_upload_size | |
id | 638712 |
size | 131,618 |
The functionalities are separate between DDC core and a number of DDC engines.
The core of DDC is responsible for the following tasks.
This is achieved by a smart contracts, interfaces, and data formats.
A DDC engine does this:
A cluster is the main coordination point between a set of nodes and a set of users.
There are several decisions required to organize a service around a cluster:
A cluster may be managed by a trusted party using an external account, or by a smart contract. A smart-contract-as-manager may in turn take cluster-related decisions by consensus of several accounts in a multisig, by consensus of a community in a DAO or a reputation system, and by cryptonomics such as proof-of-storage based on zero-knowledge crypto, or by connecting to the nominated-proof-of-stake mechanism of the blockchain itself.
sequenceDiagram
actor Provider
participant Contract
actor Manager
Provider ->> Contract: trusts a manager
Provider ->> Contract: registers his nodes
Manager ->> Contract: discovers and selects nodes
Manager ->> Contract: creates a cluster
loop
Manager ->> Contract: maintains the cluster
Contract ->> Provider: distributes payments
end
sequenceDiagram
actor App
App ->> Contract: discovers and selects a cluster
App ->> Contract: creates a bucket
loop
App ->> Contract: deposits funds
end
sequenceDiagram
actor App
App ->> Node: requests a service within a bucket
Node ->> Contract: checks the status of the bucket
Node ->> App: serves the request
graph LR
Bucket[[Bucket]]
Account[Account]
Cluster((Cluster))
Node[(Node)]
Bucket -- is owned by --> Account
Bucket -- uses resources --> Cluster
Cluster -- reserves resources --> Node
Cluster -- takes payments from --> Account
Node -- is owned by --> Account
Cluster -- distributes payments to --> Account
graph BT;
Cluster_1((Cluster 1))
Cluster_1 -. is managed by ..-> Manager_1
Cluster_1 -- vNode_0 --> Node_1
Cluster_1 -- vNode_1 --> Node_2
Cluster_1 -- vNode_2 --> Node_1
Cluster_1 -- vNode_3 --> Node_2
Node_1[(Node 1)]
Node_1 -. is owned by .-> Provider_1
Node_2[(Node 2)]
Node_2 -. is owned by .-> Provider_2
Bucket_1[[Bucket 1]]
Bucket_1 -. is owned by ...-> User_1
Bucket_1 -- is allocated into --> Cluster_1