diff --git a/docs/participate/aeweb/cli.md b/docs/participate/aeweb/cli.md new file mode 100644 index 0000000..c85d2bd --- /dev/null +++ b/docs/participate/aeweb/cli.md @@ -0,0 +1,75 @@ +--- +id: deploy +title: AEWeb - Deploy +sidebar_label: Deploy +sidebar_position: 3 +--- + + +# AEWeb CLI (Command-Line Interface) + +Repository: https://github.com/archethic-foundation/aeweb-cli + +This tool, built with NodeJS, can be used to deploy files and websites to the Archethic blockchain. +Once installed, as instructed in the README, the `aeweb` command is available. + +## aeweb generate-address + +This command is used to generate an address from a seed. + +:::info Use case +You might use this on TestNet for example, to determine an address to use the [faucet](https://testnet.archethic.net/faucet) on. +::: + + +```bash +$ aeweb generate-address --seed myseedphrase --index 0 +00005da88a4adaf5b40c958a20db981bd168008e03efbb7fc9d35e11be182a0d3065 +``` + + + +## aeweb deploy + +This command is used to deploy the content of a folder or a single file. It will create the [transactions](./how-it-works), estimate the fees and, after confirmation, will write the transactions on the network. + +Parameters: +- `seed` The keychain seed, used to prove you are the owner of the transaction chain used to pay the fees +- `endpoint` https://testnet.archethic.net | https://mainnet.archethic.net | http://127.0.0.1:4000 +- `path` The path of the folder/file to upload + + +``` +$ aeweb deploy --seed myseedphrase --endpoint https://testnet.archethic.net --path ./website +Connecting to https://testnet.archethic.net +Creating file structure and compress content... +Creating transactions ... +Estimating fees ... +Total Fee Requirement would be : 2.58933391 UCO ( $ 0.23 | € 0.22), for 3 transactions. +Do you want to continue. (yes/no) yes +Sending 3 transactions... +Transaction 1... +Waiting transaction validation... +Transaction confirmed ! +See transaction in explorer: https://testnet.archethic.net/explorer/transaction/000013c531... +----------- +Transaction 2... +Waiting transaction validation... +Transaction confirmed ! +See transaction in explorer: https://testnet.archethic.net/explorer/transaction/0000a78a35... +----------- +Transaction 3... +Waiting transaction validation... +Transaction confirmed ! +See transaction in explorer: https://testnet.archethic.net/explorer/transaction/0000f1126e... +----------- +Website is deployed at: https://testnet.archethic.net/api/web_hosting/00007d9167... +``` + +:::info There Can Be Only One +**There can only be a single deployment per seed.** Which makes it possible to update it by running the exact same command. The endpoint of your deployment will not change. + +If you need to deploy another website, use another seed (and transfer funds to it via the Wallet app). +::: + + diff --git a/docs/participate/aeweb/dns.md b/docs/participate/aeweb/dns.md index 25ec76b..d3a1c31 100644 --- a/docs/participate/aeweb/dns.md +++ b/docs/participate/aeweb/dns.md @@ -1,7 +1,8 @@ --- id: dns -title: AEWeb (DNS) +title: AEWeb - Domain names sidebar_label: Domain Names +sidebar_position: 2 --- DNS (Domain Name System) is a mechanism which resolves websites names to server IP addresses, making website's URL nicer. diff --git a/docs/participate/aeweb/how-it-works.md b/docs/participate/aeweb/how-it-works.md index 3f8f304..a028882 100644 --- a/docs/participate/aeweb/how-it-works.md +++ b/docs/participate/aeweb/how-it-works.md @@ -42,26 +42,30 @@ The reference transaction's address will become the address of the website manag ```json { "aewebVersion": 1, + "hashFunction": "sha-1", "metaData": { "index.html": { - "addresses": ["0FB27DAC...."], + "size": 68420, + "hash": "ABC123F...", "encoding": "gzip", - "size": "10000", - "hash": "0df1Acd..." + "addresses": ["0FB27DAC...."] }, "scripts/main.js": { - "addresses": ["0AC1BFA9..."], - ... - }, - } + "size": 255121, + "hash": "01AB2CD...", + "encoding": "gzip", + "addresses": ["0AC1BFA9..."] + } + } } ``` -The other transactions will contain the content of the files +The other transactions (called `data`) will contain the content of the files encoded in base64 ```json { - "index.html": "b298kJKFS98dj7Xdnsq...." // base64 of the file's content + "index.html": "b298kJKFS98dj7Xdnsq....", + "scripts/main.js": "aGVsbG8gd29ybGQ=" } ``` @@ -76,41 +80,44 @@ For example, you could have a website which contains: 5 files: 1. Reference: -```json +```jsonc { "aewebVersion": 1, + "hashFunction": "sha-1", "metaData": { "index.html": { - "addresses": ["0ac7fj..."], ... + "addresses": ["0ac7fj..."] }, - "app.css": { - "addresses": ["0ac7fj..."], + "assets/app.css": { ... + "addresses": ["0ac7fj..."] }, - "image.jpg": { - "addresses": ["0ac7fj...", "1fb2ha..."], + "assets/image.jpg": { ... - } + // image.jpg is too big to fit in a single data transaction + "addresses": ["0ac7fj...", "1fb2ha..."] } } ``` 2. HTML + CSS + Image (chunked by 30%) -```json +```jsonc +// data transaction: "0ac7fj..." { "index.html": "...", - "app.css": "..." - "image.jpg": "..." + "assets/app.css": "..." + "assets/image.jpg": "..." } ``` 3. Image (remaining chunks) -```json +```jsonc +// data transaction: "1fb2ha..." { - "image.jpg": "..." + "assets/image.jpg": "..." } ``` @@ -121,7 +128,7 @@ Any Archethic node expose an API dedicated for the web hosting by AEWeb. This API takes a reference address as a parameter, and then proceeds to take the path of the file, just like any web server would do. ```sh -https://mainnet.archethic.net/api/web_hosting/0cs19fd13......../image.jpg +https://mainnet.archethic.net/api/web_hosting/0c19fd13......../image.jpg ``` ![aeweb_CDN](/img/aeweb_CDN.svg)