Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update documentation to match latest versions of ethstorage-sdk and ethfs-cli #13

Merged
merged 7 commits into from
Aug 19, 2024
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added .gitbook/assets/ens.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed .gitbook/assets/image (10).png
Binary file not shown.
Binary file removed .gitbook/assets/image (9).png
Binary file not shown.
Binary file added .gitbook/assets/img10.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .gitbook/assets/img9.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 2 additions & 3 deletions SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,9 @@

## Tutorials on EthStorage early testnet

* [Upload Your First File/Folder with ethfs-uploader](tutorials/upload-your-first-file-folder-with-ethfs-uploader.md)
* [Upload Your First File with ethfs-sdk](tutorials/upload-your-first-file-with-ethfs-sdk.md)
* [Upload Your First File/Folder with ethfs-cli](tutorials/upload-your-first-file-folder-with-ethfs-cli.md)
iteyelmp marked this conversation as resolved.
Show resolved Hide resolved
* [Upload Your First File with ethstorage-sdk](tutorials/upload-your-first-file-with-ethstorage-sdk.md)
* [Bind Domain Names to Your FlatDirectory](tutorials/bind-domain-names-to-your-flatdirectory.md)
* [Register Your First W3NS Name](tutorials/register-your-first-w3ns-name.md)
* [Sample Applications](tutorials/sample-applications.md)

## Advanced topics
Expand Down
17 changes: 6 additions & 11 deletions information/networks.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
# Networks

EthStorage sidechain is fully EVM-compatible, and you can add the network to your MetaMask or wallets using the following information:
QuarkChain L2 Testnet is fully EVM-compatible, and you can add the network to your MetaMask or wallets using the following information:

### Galileo Testnet (Active)

* Network ID: 3334
* RPC: https://galileo.web3q.io:8545
* Explorer: [https://explorer.galileo.web3q.io/](https://explorer.galileo.web3q.io/)
* Token: W3Q
* W3NS resolver: 0x076B3e04dd300De7db95Ba3F5db1eD31f3139aE0
* W3NS NS: 0xD379B91ac6a93AF106802EB076d16A54E3519CED
* W3NS controller: 0x714a5b66dE4DabC56229360A7A27Fdee74d5fABa
* FlatDirectoryFactory: [https://explorer.galileo.web3q.io/address/0xA99589A04517d585861ce77c10a3EeE99f70B69a/write-contract](https://explorer.galileo.web3q.io/address/0xA99589A04517d585861ce77c10a3EeE99f70B69a/write-contract)
### QuarkChain L2 Testnet (Active)

* Network ID: 43069
* RPC: https://rpc.testnet.l2.quarkchain.io:8545
* Explorer: [https://explorer.testnet.l2.quarkchain.io/](https://explorer.testnet.l2.quarkchain.io/)
* Token: QKC
11 changes: 2 additions & 9 deletions tutorials/bind-domain-names-to-your-flatdirectory.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,14 @@
# Bind Domain Names to Your FlatDirectory

In the previous section, your website has been uploaded to a FlatDirectory contract and users can visit it through a web3 URL that contains the FlatDirectory contract address. What if we want to use a more user-friendly domain name instead of a contract address in the URL? Sure, we now support two domain services: ENS and W3NS, and you can bind any EVM-compatible contract address to the name!
In the previous section, your website has been uploaded to a FlatDirectory contract and users can visit it through a web3 URL that contains the FlatDirectory contract address. What if we want to use a more user-friendly domain name instead of a contract address in the URL? Sure, we now support domain services: ENS, and you can bind any EVM-compatible contract address to the name!

## ENS Support

ENS is the most widely used name service in crypto, but interacting with a smart contract on ETH is super expensive (especially uploading a large amount of data), so it will be great to bind an ENS name to an [EIP-3770](https://eips.ethereum.org/EIPS/eip-3770) Address (a chain-specific address standard), and users can upload data on a cheaper chain/layer2 and still be able to use their ENS name to point to that.

As ENS users, you can add a new text record named “contentcontract” (the value is an EIP-3770 address) in the ENS setting panel, and the Web3URL gateway will handle the rest of it.

<figure><img src="../.gitbook/assets/Screen Shot 2022-11-24 at 14.42.35.png" alt=""><figcaption></figcaption></figure>
<figure><img src="../.gitbook/assets/ens.png" alt=""><figcaption></figcaption></figure>

Check out [https://w3url.w3eth.io](https://w3url.w3eth.io) and its [ENS setting page.](https://app.ens.domains/name/eth-store.eth/details)&#x20;

## W3NS Support

W3NS is a domain name service built on our Galileo testnet. If you don't have an ENS name and still want to use a domain name in your web3 URL, you can register a name in W3NS by following this [guide](register-your-first-w3ns-name.md).

After you get a W3NS name, you also need to set your FlatDirectory contract address in the "Web handler" field in the W3NS setting panel.

<figure><img src="../.gitbook/assets/image (13).png" alt=""><figcaption></figcaption></figure>
37 changes: 0 additions & 37 deletions tutorials/register-your-first-w3ns-name.md

This file was deleted.

17 changes: 8 additions & 9 deletions tutorials/sample-applications.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
# Sample Applications

The following summarizes some decentralized applications built on top of Galileo networks
The following summarizes some decentralized applications built on top of QuarkChain L2 networks

## Galileo Testnet (ChainID 3334)
## QuarkChain L2 Testnet (ChainID 43069)

* Tutorial: [https://tutorial.w3q.w3q-g.w3link.io/](https://tutorial.w3q.w3q-g.w3link.io/)
* W3NS: [https://w3ns.w3q.w3q-g.w3link.io/](https://w3ns.w3q.w3q-g.w3link.io/)
* Blog platform: [https://dblog.w3q.w3q-g.w3link.io/](https://dblog.w3q.w3q-g.w3link.io/)
* W3Box: [https://w3box.w3q.w3q-g.w3link.io/](https://w3box.w3q.w3q-g.w3link.io/)
* W3Drive: [https://w3drive.w3q.w3q-g.w3link.io/](https://w3drive.w3q.w3q-g.w3link.io/)
* W3Mail: [https://w3mail.w3q.w3q-g.w3link.io/](https://w3mail.w3q.w3q-g.w3link.io/)
* QRobot: [https://qrobot.w3q.w3q-g.w3link.io/](https://qrobot.w3q.w3q-g.w3link.io/)
* Blog platform: [https://w3-blog.w3eth.io/](https://w3-blog.w3eth.io/)
* W3Box: [https://w3-box.w3eth.io/](https://w3-box.w3eth.io/)
* W3Drive: [https://w3-drive.w3eth.io/](https://w3-drive.w3eth.io/)
* W3Mail: [https://w3-email.w3eth.io/](https://w3-email.w3eth.io/)
* W3Music: [https://w3-music.w3eth.io/](https://w3-music.w3eth.io/)
* QRobot: [https://w3-qrobot.w3eth.io/](https://w3-qrobot.w3eth.io/)



Expand Down
95 changes: 95 additions & 0 deletions tutorials/upload-your-first-file-folder-with-ethfs-cli.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
# Upload Your First File/Folder with ethfs-cli

## **Introduction**

In this tutorial, we will demonstrate how to upload files or folders using the **ethfs-cli** tool. We assume that

* there is a folder to be uploaded; (dist)
* there are two files in the folder. (hello.txt and img/1.jpeg)

<figure><img src="../.gitbook/assets/image (17).png" alt=""><figcaption></figcaption></figure>

## Step 1: Install ethfs-cli

You can install ethfs-cli by the following command

`npm i -g ethfs-cli`

The npm page of ethfs-cli can be found [here](https://www.npmjs.com/package/ethfs-cli).

## Step 2: Create the FlatDirectory Contract

We want to create a [FlatDirectory](https://docs.web3url.io/advanced-topics/flatdirectory) with the private key 0x112233... on the QuarkChain L2 Testnet

```
ethfs-cli create -p 0x112233... -c 43069
```

If we want to create it on the other chains that support EVM, we need to change the chainId, such as the Sepolia.

```
ethfs-cli create -p 0x112233... -c 11155111
```

The RPC URL of the chain can also be specified.

```
ethfs-cli create -p 0x112233... -r https://...
```

You will get a FlatDirectory address: [<mark style="color:blue;">0x5fF2c5a1c66Fc7303E47DC3cFf804EEFc73EB6AD</mark>](https://explorer.testnet.l2.quarkchain.io/address/0x5fF2c5a1c66Fc7303E47DC3cFf804EEFc73EB6AD/transactions) after the transaction is confirmed.

<figure><img src="../.gitbook/assets/img10.png" alt=""><figcaption></figcaption></figure>

## Step 3: Upload Files

In this section, you will upload the folder into the FlatDirectory that you just created.

Run the command to upload the file.

```
ethfs-cli upload -a <address> -p <private-key> -f <directory|file> -c [chain-id] -t <upload-type> -e
```

The command to upload the contents of the "_dist"_ folder to the address "_0x5fF2...B6AD"_ is:

```
ethfs-cli upload -a 0x5fF2... -p 0x112233... -f /Users/.../dist -c 43069 -t blob -e
```

The execution results are as follows.

<figure><img src="../.gitbook/assets/img9.png" alt=""><figcaption></figcaption></figure>
iteyelmp marked this conversation as resolved.
Show resolved Hide resolved

## Step 4: Set Default File

You can also set the default file for FlatDirectory using the _default_ command.

Run the command to set the default file.

```
ethfs-cli default -a <address> -f <name> -p <private-key> -c <chain-id>
```

The command to set the default file "_hello.txt"_ for "_0x5fF2...B6AD_" is:

```
ethfs-cli default -a 0x5fF2 -f hello.txt -p 0x1122.. -c 43069
```

## Step 5: Browse Your File!

Now, you should be able to browse the files that are just uploaded via

`https://${address}.3336.w3link.io/${filename}`

Our two file access addresses are:

[https://0x5fF2c5a1c66Fc7303E47DC3cFf804EEFc73EB6AD.3336.w3link.io/hello.txt](https://0x5fF2c5a1c66Fc7303E47DC3cFf804EEFc73EB6AD.3336.w3link.io/hello.txt)

[https://0x5fF2c5a1c66Fc7303E47DC3cFf804EEFc73EB6AD.3336.w3link.io/img/1.jpeg](https://0x5fF2c5a1c66Fc7303E47DC3cFf804EEFc73EB6AD.3336.w3link.io/img/1.jpeg)

Because the default file has been set to "_hello.txt"_ above, you can access it through the following link.

[https://0x5fF2c5a1c66Fc7303E47DC3cFf804EEFc73EB6AD.3336.w3link.io/](https://0x5fF2c5a1c66Fc7303E47DC3cFf804EEFc73EB6AD.3336.w3link.io/)

Loading