Skip to content
This repository has been archived by the owner on Feb 10, 2025. It is now read-only.

DWS-149 DWS-145 publish docs for domains and SSH keys #9

Merged
merged 1 commit into from
Aug 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
38 changes: 38 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Docs
on:
pull_request:
branches: [main]
types: [closed]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
publish:
name: Deploy Docs
if: ${{ github.event.pull_request.merged }}
runs-on: ubuntu-latest
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Check out repo
uses: actions/checkout@v2
# Node is required for npm
- name: Set up Node
uses: actions/setup-node@v2
with:
node-version: "14"
# Install and build Docusaurus website
- name: Build Docusaurus website
run: |
cd docs
npm install
npm run build
- name: Deploy to GitHub Pages
if: success()
uses: crazy-max/ghaction-github-pages@v2
with:
target_branch: gh-pages
build_dir: docs/build
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
28 changes: 25 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,28 @@
vue/node_modules
vue/dist
release/
# Dependencies
/docs/node_modules

# Production
/docs/build

# Generated files
.docusaurus
.cache-loader

# Misc
.idea/
.vscode/
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*



vue/node_modules
vue/dist
release/
98 changes: 0 additions & 98 deletions dns_description.md

This file was deleted.

12 changes: 0 additions & 12 deletions dns_proposal.json

This file was deleted.

41 changes: 41 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# DWS Docs

DWS Docs portal is built using [Docusaurus 2](https://docusaurus.io/).

### Installation

```
$ npm
```

### Local Development

```
$ npm start
```

This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.

### Build

```
$ npm run build
```

This command generates static content into the `build` directory and can be served using any static contents hosting service.

### Deployment

Using SSH:

```
$ USE_SSH=true npm run deploy
```

Not using SSH:

```
$ GIT_USER=<Your GitHub username> npm run deploy
```

If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch.
3 changes: 3 additions & 0 deletions docs/babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
presets: [require.resolve('@docusaurus/core/lib/babel/preset')],
};
4 changes: 4 additions & 0 deletions docs/docs/domains/_category_.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"label": "Decentralized Domains",
"position": 3
}
19 changes: 19 additions & 0 deletions docs/docs/domains/dws-dns-server.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
sidebar_position: 2
---

# DWS DNS Server

DNS Server starts with a node process. By default it listen for UDP/1053, this parameter can be changed in client.toml in config path (`~/.deweb/config/config.toml`).
Parameter: `dns.lport`

DNS server works in coroutine and making requests to main process via GRPC to port TCP/26657 (`rpc.laddr`).
It has 10-seconds cache to prevent constant requests to GRPC server.

To listen on port UDP/53, node process must be executed as a root user. To prevent the whole node running by root user we have a special command which will run only DNS server:

```
sudo dewebd q deweb run-dns-server 53
```

Currently DNS Server supports only A and MX records.
134 changes: 134 additions & 0 deletions docs/docs/domains/dws-domains.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
---
sidebar_position: 1
---

# DWS Domains

Decentralized Web Services Blockchain has a DWS Domains module. User can buy domain of any level.

Initial Top-level domain (TLD) price is defined in genesis as 100 DWS and can be changed via the governance proposal.

Each domain ownership is 2 years from buy time. After 2 years the domain owner has the 2 weeks window to extend the ownership by pay the full price (100 DWS).

For example Alice can buy domain `hello/` for 100 DWS. Then Alice can say that anyone can buy a subdomain `*.hello/` for 10 DWS. Any subdomain which Alice will sell will belong to the buyer for 2 years.

For example Bob will buy domain `bob.hello` for 10 DWS. 10 DWS will be transfered to Alice and Bob will get `bob.hello` domain ownership for 2 years. Alice will not have any permission to get this domain back from Bob. After 2 years Bob will have a 2 weeks window to extend the ownership for 10 DWS, which will be transfered to Alice. If Alice changed the price of subdomains to 20 DWS, Bob will still pay 10 DWS per 2 years, as it was the initial price.

## Buy domain

If we want to buy a domain, we can set DNS records:

```
BasicDataEmpty='{}'
BasicData='{"records": [{"type": "A","values": ["192.168.1.10"]}]}'
BasicDataWithSubPrice='{"records":[{"type": "A","values":["192.168.1.10"]}],"sub_domains_sale": true,"sub_domains_sale_price": 10000}'
BasicDataWithMX='{"records": [{"type": "A","values": ["192.168.1.10"]},{"type": "MX","values": ["mx.bob.alice.deweb."]}]}'
```

If we want to start selling the subdomains, we should set `"sub_domains_sale": true` and `"sub_domains_sale_price": 10000`, where `sub_domains_sale_price` is in `udws` denom.

First we can mint a TLD `deweb`:

```
dewebd tx domain register deweb --data="$BasicData" --from bob --chain-id deweb-testnet-1 --gas 2000000 --output json -b block
```

## Extend domain ownership (Prolongation)

Prolongation request is sent via the register command. It is allowed only for the domain owner. Other users will receive the message that
the domain is already registered.

Let's create a domain `test.deweb`:

```
dewebd tx domain register test.deweb --data="$BasicData" --from bob --chain-id deweb-testnet-1 --gas 2000000 --output json -b block
```

If Alice will try to register domain in Bob's zone she will receive an error `parent domain check error: domain deweb does not belong to this user`:

```
dewebd tx domain register alice.deweb --data="$BasicData" --from alice --chain-id deweb-testnet-1 --gas 2000000 --output json -b block
```

## Edit domain settings

Bob can edit domain and allow anyone to buy subdomains of the domain he own. He will receive payments for these domains:

```
BasicDataWithSubPrice='{"records":[{"type": "A","values":["192.168.1.10"]}],"sub_domains_sale": true,"sub_domains_sale_price": 10000}'
dewebd tx domain edit deweb --data="BasicDataWithSubPrice" --from bob --chain-id deweb-testnet-1 --gas 2000000 --output json -b block
```

## Subdomain ownership examples

Then Alice can register subdomain and pay the fee to Bob:

```
BasicData='{"records": [{"type": "A","values": ["192.168.1.10"]}]}'
dewebd tx domain register newalice.deweb --data="$BasicData" --from alice --chain-id deweb-testnet-1 --gas 2000000 --output json -b block
```

But Bob also can register subdomain for Alice (her address `deweb1x6s67chad4p2rznmclskw7xr3qfppfhjkqs3ee`):

```
dewebd tx domain register alice.deweb --data="$BasicData" --recipient=deweb1x6s67chad4p2rznmclskw7xr3qfppfhjkqs3ee --from bob --chain-id deweb-testnet-1 --gas 2000000 --output json -b block
```

Then Alice can register domain `www.alice.deweb` because she is the owner of `alice.deweb`:

```
dewebd tx domain register www.aliced.deweb --data="$BasicData" --from alice --chain-id deweb-testnet-1 --gas 2000000 --output json -b block
```

Alice can register domain for Bob in her zone and then transfer this Domain to Bob, so he will become an owner of `bob.alice.deweb`:

```
dewebd tx domain register bob.aliced.deweb --data="$BasicData" --from alice --chain-id deweb-testnet-1 --gas 2000000 --output json -b block
```

## 2-step transfer

This is used to sell the domain to exact deweb address for exact price.

Firstly the domain owner Alice sends the transaction with expected domain receiver and price. Only selected receiver Bob (his address is `deweb138sq5w8yxsdzgvs7lse5j3dtr3e2t5z08cw8aj`) can buy the domain. If no receiver determined, anyone can buy this domain.

```
dewebd tx domain transfer bob.aliced.deweb --recipient=deweb138sq5w8yxsdzgvs7lse5j3dtr3e2t5z08cw8aj --price=10000 --from alice --chain-id deweb-testnet-1 --gas 2000000 --output json -b block
dewebd tx domain transfer bob.aliced.deweb --from bob --chain-id deweb-testnet-1 --gas 2000000 --output json -b block
```

To cancel created transfer:

```
dewebd tx domain transfer bob.aliced.deweb --cancel=true --from alice --chain-id deweb-testnet-1 --gas 2000000 --output json -b block
```

## Module parameters

Parameters that can be changed via Government proposal:

- DomainPrice
- DomainExpiration
- DomainOwnerProlongation
- BlockedTLDs

```json title="dns_proposal.json"
{
"title": "Increase the lease time for domains",
"description": "Set lease time to 60 minutes for domains",
"changes": [
{
"subspace": "nft",
"key": "DomainExpiration",
"value": "60"
}
],
"deposit": "10000000udws"
}
```

Submit proposal:

```
dewebd tx gov submit-proposal param-change dns_proposal.json --from alice --chain-id deweb-testnet-1 --gas 2000000
```
4 changes: 4 additions & 0 deletions docs/docs/guides/_category_.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"label": "Guides",
"position": 2
}
Loading