manual removed files
This commit is contained in:
Binary file not shown.
Before Width: | Height: | Size: 105 KiB |
Binary file not shown.
Before Width: | Height: | Size: 248 KiB |
Binary file not shown.
Before Width: | Height: | Size: 163 KiB |
Binary file not shown.
Before Width: | Height: | Size: 170 KiB |
Binary file not shown.
Before Width: | Height: | Size: 172 KiB |
Binary file not shown.
Before Width: | Height: | Size: 192 KiB |
@@ -1,25 +0,0 @@
|
||||
<h1> Smart Contract For IT 3Bot Integration </h1>
|
||||
|
||||
<h2>Table of Contents</h2>
|
||||
|
||||
- [Introduction](#introduction)
|
||||
- [Use Cases](#use-cases)
|
||||
- [Overview](#overview)
|
||||
|
||||
***
|
||||
|
||||
## Introduction
|
||||
|
||||
The Smart Contract for IT allows you, your company or your community to execute the storage and running of your files and applications securely with consensus and automatic billing.
|
||||
|
||||
## Use Cases
|
||||
|
||||
With the 3Bot integration, you can use smart contracts to define different sets of Internet resources you need for various types of work, such as storing files, running applications, and communicating across the network.
|
||||
|
||||
You can use smart contracts to define different sets of Internet resources , such as storing files, running applications, communicate across the network, etc.
|
||||
|
||||
You can also define a consensus mechanism and create multi-signatures for smart contract execution or completion to deliver appropriate digital services.
|
||||
|
||||
## Overview
|
||||
|
||||

|
@@ -1,21 +0,0 @@
|
||||
<h1> Infrastructure As Code </h1>
|
||||
|
||||
<h2>Table of Contents</h2>
|
||||
|
||||
- [Introduction](#introduction)
|
||||
- [Overview](#overview)
|
||||
- [Smart Contract](#smart-contract)
|
||||
|
||||
***
|
||||
|
||||
## Introduction
|
||||
|
||||
IAC = DevOps is a process framework that ensures collaboration between Development and Operations Team to deploy code to production environment faster in a repeatable and automated way. ... In simple terms, DevOps can be defined as an alignment between development and IT operations with better communication and collaboration.
|
||||
|
||||
## Overview
|
||||
|
||||

|
||||
|
||||
## Smart Contract
|
||||
|
||||

|
@@ -1,50 +0,0 @@
|
||||
# Smart Contract for IT
|
||||
|
||||
Ability for every developer to launch IT workloads on the TFGrid using our TFGrid primitives.
|
||||
|
||||

|
||||
|
||||
<!-- TODO: need to describe better for 3.x TFGrid -->
|
||||
|
||||
## Smart Contract Together with 3bot
|
||||
|
||||
Is for TFGrid 2.0
|
||||
|
||||

|
||||
|
||||
3Bot is your virtual system administrator and can execute IT tasks on your behalf.
|
||||
|
||||
**STEP 1: IT Experts create smart contracts:**
|
||||
|
||||
IT experts create smart contracts describing what needs to be done in order to deploy this architecture. The smart contract has to be specific and describe each little detail of the IT architecture. The experts create knowledge for the 3bots (it's like god defining our DNA of our cells)
|
||||
|
||||
**STEP 2: Business and or Enduser customers consume smart contracts**:
|
||||
|
||||
Users have digital needs and in order to procure services for their digital needs they will find smart contracts describing applications (application setups) meeting their needs. Consumers will instruct their 3bot to deploy an IT workload following their requirements buy using a smart contract created
|
||||
|
||||
* e.g. give me an archive of 1 PB in CH, e.g. deploy a CRM for 100 users, …
|
||||
* e.g. deploy my new banking app feature X
|
||||
* e.g. deploy my artificial intelligence data mining job for …
|
||||
|
||||
**STEP 3: The 3bot executes the smart contract:**
|
||||
|
||||
Creates & Registers the “IT” smart contract in the BCDB (Blockchain Database). This is a complete end-to-end deployment cycle for all sorts of IT deployments - both simple and complicated, bound to one location of many. The 3bot will provision all the compute and storage capacity needed to meet the IT architecture’s requirement and do all the commercial trades required to get this. It will then leave instructions for the nodes in a digital notary system in order for nodes to be able to grab instructions on what they have to do in order to meet smart contract completion. The 3bot remains the orchestrator for this smart contract execution and will store and secure all intermediate and final state information in the notary service (blockchain database).
|
||||
|
||||
**STEP 4: Business IT Workload Stakeholders:**
|
||||
|
||||
is optional but when required stakeholder can be defined to give consensus and sign off on the successful execution of the “IT smart contract” delivering the appropriate digital service. Stakeholders can be defined in a “multi signature” blockchain to provide sign off on regulatory, commercial and other business requirements. Approvals can include IT expert checks the quality of the code, a legal guy checks GDPR, a business person checks budget etc.
|
||||
|
||||
**STEP 5: The capacity layer: 3 Nodes…**
|
||||
|
||||
* thousands of 3 nodes can work together to execute and deliver the “IT Smart Contract” (if required)
|
||||
* verify if consensus was reached between the business stakeholders
|
||||
* verify the validity of the smart contract and download the “IT workload definition”
|
||||
* download the right files to execute the smart contract and each file gets verified (signature)
|
||||
* run the required processes and again signatures are checked to make sure the workload is pure.
|
||||
* ensures that no person (hacker or IT person) can ever gain access or influence on the execution process.
|
||||
|
||||
|
||||
## Remarks
|
||||
|
||||
- in TFGrid 2.x smart contract for IT is implemented using ThreeFold Explorer and multisignature capabilities.
|
||||
- in TFGrid 3.0 this is being re-implemented on TF-Chain on Parity/Substrate blockchain, to become a fully decentralized process. See [here](smartcontract_tfgrid3).
|
@@ -1,97 +0,0 @@
|
||||
<h1> Smart Contract on TFGrid 3.0 </h1>
|
||||
|
||||
<h2>Table of Contents </h2>
|
||||
|
||||
- [Introduction](#introduction)
|
||||
- [Architecture](#architecture)
|
||||
- [1: To deploy a workload, the user interacts with this smart contract pallet and calls: `create_contract` with the input being:](#1-to-deploy-a-workload-the-user-interacts-with-this-smart-contract-pallet-and-calls-create_contract-with-the-input-being)
|
||||
- [2: The user sends the contractID and workload through the RMB to the destination Node.](#2-the-user-sends-the-contractid-and-workload-through-the-rmb-to-the-destination-node)
|
||||
- [3: The Node sends consumption reports to the chain](#3-the-node-sends-consumption-reports-to-the-chain)
|
||||
- [Notes](#notes)
|
||||
|
||||
***
|
||||
|
||||
## Introduction
|
||||
|
||||
From TFGrid 3.0, the 'Smart Contract for IT' concept for reserving capacity is fully decentralized and runs on TF-Chain, the ThreeFold blockchain infrastructure on Parity Substrate.
|
||||
|
||||
## Architecture
|
||||
|
||||
Two main components play a role in achieving a decentralised consensus between a user and a farmer.
|
||||
|
||||
- TFGrid Substrate Database Pallet TFGrid
|
||||
- TFGrid Smart Contract
|
||||
|
||||
The TF-Grid Substrate Database will keep a record of all Entities, Twins, Nodes and Farmers in the TF-Grid network. This makes it easy to integrate the Smart Contract on Substrate as well since we can read from that storage in runtime.
|
||||
|
||||

|
||||
|
||||
The Smart Contract on Substrate works as following:
|
||||
|
||||
## 1: To deploy a workload, the user interacts with this smart contract pallet and calls: `create_contract` with the input being:
|
||||
|
||||
The user must instruct his twin to create the contract. *This program containing his digital twin is yet to be defined.* A contract will always belong to a twin and to a node. This relationship is important because only the user's twin and target node's twin can update the contract.
|
||||
|
||||
```js
|
||||
contract = {
|
||||
version: contractVersion,
|
||||
contract_id: contractID,
|
||||
twin_id: NumericTwinID for the contract,
|
||||
// node_address is the node address.
|
||||
node_id: NumericNodeID
|
||||
// data is the encrypted deployment body. This encrypted the deployment with the **USER** public key. So only the user can read this data later on (or any other key that he keeps safe).
|
||||
// this data part is read only by the user and can actually hold any information to help him reconstruct his deployment or can be left empty.
|
||||
data: encrypted(deployment) // optional
|
||||
// hash: is the deployment predictable hash. the node must use the same method to calculate the challenge (bytes) to compute this same hash.
|
||||
//used for validating the deployment from node side.
|
||||
deployment_hash: hash(deployment),
|
||||
// public_ips: number of ips that need to be reserved by the contract and used by the deployment
|
||||
public_ips: 0,
|
||||
state: ContractState (created, deployed),
|
||||
public_ips_list: list of public ips on this contract
|
||||
}
|
||||
```
|
||||
|
||||
The `node_id` field is the target node's ID. A user can do lookup for a node to find its corresponding ID.
|
||||
|
||||
The workload data is encrypted by the user and contains the workload definition for the node.
|
||||
|
||||
If `public_ips` is specified, the contract will reserve the number of public ips requested on the node's corresponding farm. If there are not enough ips available an error will be returned. If the contract is canceled by either the user or the node, the IPs for that contract will be freed.
|
||||
|
||||
This pallet saves this data to storage and returns the user a `contract_id`.
|
||||
|
||||
## 2: The user sends the contractID and workload through the RMB to the destination Node.
|
||||
|
||||
The Node reads from the [RMB](https://github.com/threefoldtech/rmb) and sees a deploy command, it reads the contractID and workload definition from the payload.
|
||||
It decodes the workload and reads the contract from chain using the contract ID, the Node will check if the user that created the contract and the deployment hash on the contract is the same as what the Node receives over RMB. If all things check out, the Node deploys the workload.
|
||||
|
||||
## 3: The Node sends consumption reports to the chain
|
||||
|
||||
The Node periodically sends consumption reports back to the chain for each deployed contract. The chain will compute how much is being used and will bill the user based on the farmers prices (the chain can read these prices by quering the farmers storage and reading the pricing data). See [PricingPolicy](https://github.com/threefoldtech/substrate-pallets/blob/03a5823ce79200709d525ec182036b47a60952ef/pallet-tfgrid/src/types.rs#L120).
|
||||
|
||||
A report looks like:
|
||||
|
||||
json
|
||||
```
|
||||
{
|
||||
"contract_id": contractID,
|
||||
"timestamp": "timestampOfReport",
|
||||
"cru": cpus,
|
||||
"sru": ssdInBytes,
|
||||
"hru": hddInBytes,
|
||||
"mru": memInBytes,
|
||||
"nru": trafficInBytes
|
||||
}
|
||||
```
|
||||
|
||||
The node can call `add_reports` on this module to submit reports in batches.
|
||||
|
||||
Usage of SU, CU and NU will be computed based on the prices and the rules that Threefold set out for cloud pricing.
|
||||
|
||||
Billing will be done in Database Tokens and will be send to the corresponding farmer. If the user runs out of funds the chain will set the contract state to `cancelled` or it will be removed from storage. The Node needs to act on this 'contract cancelled' event and decommission the workload.
|
||||
|
||||
The main currency of this chain. More information on this is explained here: TODO
|
||||
|
||||
## Notes
|
||||
|
||||
Sending the workloads encrypted to the chain makes sure that nobody except the user can read his deployment data. It also facilitates a way for the user to recreate his workload data from the chain.
|
@@ -1,7 +0,0 @@
|
||||
<h1>Smart Contract IT</h1>
|
||||
|
||||
<h2>Table of Contents</h2>
|
||||
|
||||
- [Introduction](./smartcontract_tfgrid3.md)
|
||||
- [Infrastructure As Code (IAC)](./smartcontract_iac.md)
|
||||
- [3Bot Integration](./smartcontract_3bot.md)
|
Reference in New Issue
Block a user