Compare commits

...

5 Commits

Author SHA1 Message Date
itzelot01 eddf1f454b adding .fleek.json for auto build mdbook Proof of Concept 2023-11-09 21:04:22 +00:00
itzelot01 6c1e603954 initial commit 2023-10-26 20:58:08 +00:00
itzelot01 acb3a16bc6 Adding publish script and CIDs Updates 2023-09-26 20:49:02 +00:00
itzelot01 79f3f9c128 Adding IPFS Nodes Setup Section 2023-09-26 20:43:05 +00:00
itzelot01 01fd7fb2f0 Requirements and installation section filled 2023-08-31 23:06:35 +00:00
9 changed files with 521 additions and 27 deletions

11
.fleek.json Normal file
View File

@ -0,0 +1,11 @@
{
"build": {
"image": "peaceiris/mdbook",
"command": "mdbook build",
"publicDir": "docs",
"baseDir": "book",
"environment": {
"SOME_ENV": "Build finished!"
}
}

124
README.md
View File

@ -4,17 +4,126 @@ The DECA Project Documentation
## Introduction
## Requirements
A general DECA protocol specification and some example use cases.
## Installation
## Requirements
## Contribute
There are some requirements you need to fulfill to be able to work with DECA docs.
* ```Rust``` >= 1.66
* ```curl``` >= 7.88.1
* ```cargo``` >= 1.72.0
* ```mdBook``` >= v0.4.34
* ```git``` >= 2.39.2
> NOTE: These are the recommended versions since they were tested in the development environment.
## Installation.
The easiest way to get both Rust and Cargo's latest versions is by using the ```rustup``` script, which also means that you have to use the ```curl``` command.
### 1. Git Installation.
The first step is to install git on you Unix system. To do that, you only need to run the following command:
```shell
$ sudo apt install git
```
### 2. Curl Installation.
You have to repeat the same proccess to install ```curl```, use the apt command:
```sh
$ sudo apt install curl
```
Once you have ```curl``` installed you can go ahead and continue with the Rust and Cargo installations.
### 3. Rust and Cargo Installation.
To install Rust and Cargo on your Unix System you have to download the ```rustup installer script``` using the following command on the terminal:
```shell
$ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
```
By using the previous command you will get the latest Rust and Cargo's versions.
> Suggestion: You can make sure the installation was succesfull by using the following command:
>
> ```sh
> $ rustc --version
> ```
> It tells you the version of Rust that was installed.
> NOTE: Some important considerations when installing Rust:
>
> * When you install Rust, it will be installed only for the current user, in other words, the installation is not system-wide.
>
> * It is not required to be root or sudo to be able to install Rust.
Once you have completed your Rust and Cargo installations, you can now continue with the ```mdBook``` installation.
### 4. MdBook Installation.
DECA Docs uses ```mdBook``` as a way to create books with Markdown. Since ```mdBook``` is a command line tool, it is ideal for creating tutorials, API documentations, course materials, amongst other useful things.
You can follow the instructions bellow to download ```mdBook```.
First, you have to use the following command to build and install ```mdBook```:
```shell
$ cargo install mdbook
```
The command will automatically download ```mdBook```, build it and install it in Cargo's global binary directory.
Once installed, the next step is to get the DECA Docs repository. Follow the instructions below to get it.
### Clone the DECA Documentation repository.
After you have succesfully compleated all installations, you can now access the docummentation repository and contribute to the resources.
Run the next command on the terminal:
```shell
$ git clone https://git.decentralizedscience.org/DECA/docs.git
```
> * This command lets you copy the DECA Docs repository to your local machine.
> * It also means that you can pull down a full copy of all the repository data that it has at that point in time, including all versions of every file and folder for the project.
Once the repository has been cloned, you can have access to it by entering the following command on your terminal:
```shell
$ cd docs/
```
This command will lead you to the directory where you can find the DECA Docs README.md.
The last step is to run the server using the following command:
```shell
$ mdbook serve
```
You can view the page on any browser using the following link <http://127.0.0.1:3000>
> NOTE: If you want to access remotely use the `mdbook serve -n 0.0.0.0` which means any IP address can access the DECA Docs project.
## Contribute (Usage)
>ToDo
## Contract
* [Telegram](https://t.me/deca_currency/1)
* [Matrix](https://matrix.to/#/#DECA:matrix.org)
***Developers***
- [itzelot01](mailto:itzeltellez59@aragon.unam.mx)
## License
```
@ -29,3 +138,12 @@ Free Documentation License".
## References
1. Rust, "Learn Rust", <https://www.rust-lang.org/tools/install>, 2023-08-31.
2. A.Prakash, "How to install Rust and Cargo", <https://itsfoss.com/install-rust-cargo-ubuntu-linux/>, 2023-03-26.
3. The Cargo Book, "Installation", <https://web.mit.edu/rust-lang_v1.25/arch/amd64_ubuntu1404/share/doc/rust/html/cargo/getting-started/installation.html#build-and-install-cargo-from-source>, 2023-08-31.
4. Docs GitHub, "Cloning a repository", <https://docs.github.com/es/repositories/creating-and-managing-repositories/cloning-a-repository>, 2023-08-31.
5. mdBook Docummentation, "Introduction", <https://rust-lang.github.io/mdBook/#:~:text=mdBook%20is%20a%20command%20line,easily%20navigable%20and%20customizable%20presentation.&text=This%20guide%20is%20an%20example%20of%20what%20mdBook%20produces.>, 2023-08-31.

50
bookCIDs.txt Normal file
View File

@ -0,0 +1,50 @@
added bafkreigyony7zmbrvisi54friqzmx3dmmvxqg753hcfarrims5fjppjoxm book/404.html
added bafkreidztlvsltadop664dq3dw3223bpnihaldp23krtpfuj6wbscmmqxu book/FontAwesome/css/font-awesome.css
added bafkreifkldzt6i42b6yc6xd2nrc4aq6xvgwjucjtgwagnfhm23ko3qgwva book/FontAwesome/fonts/FontAwesome.ttf
added bafkreid37svw3om5lt57c4c4ubjw3xdylbkdftc7uqn326wq6aeqgozjpe book/FontAwesome/fonts/fontawesome-webfont.eot
added bafybeifkkyg3opqf3yygg6yu7pxdvm2odenwz4xdgpocov3oknoenysm24 book/FontAwesome/fonts/fontawesome-webfont.svg
added bafkreifkldzt6i42b6yc6xd2nrc4aq6xvgwjucjtgwagnfhm23ko3qgwva book/FontAwesome/fonts/fontawesome-webfont.ttf
added bafkreif2brm55nkfb5oligz7snqj5ywq3gkucwdx3x5cepukrj2tgr2pa4 book/FontAwesome/fonts/fontawesome-webfont.woff
added bafkreibk336lyba6pumpz4wuc6dz3rnatgl2uzgwow32hrfwzyz5ue7t7y book/FontAwesome/fonts/fontawesome-webfont.woff2
added bafkreicajihrjp3s27qq7z7xzyxrdrdvfoxsmns3webnoum6igqzmojl7q book/IPFSNodes.html
added bafkreicwmerubjxtmuswq3bft4n7fkfdpfqyd2l7zxi63jo6h4skyrznzy book/ayu-highlight.css
added bafkreig4pojhuk62sealqfnyts7j5oh6i2wnoxl3baynhxuazswsur3dhi book/book.js
added bafkreifo6hv2gvxzh6fl2p3pj4k7m654txwkfmd6efuxhdwwabnercso5a book/chapter_1.html
added bafkreiawezygv7ei3fpl4eltwvj6y4zmnxecuv3jreyv7x26o542644kiq book/clipboard.min.js
added bafkreih7qy6mjbkcmurdioy5445x4kajjqqc3tdkrhfwbgquca4dwzmeru book/css/chrome.css
added bafkreid3sh7lw3c4gu73lso5kbs5bq7ts3oq7bafh2idgegvxbctiqn6ym book/css/general.css
added bafkreigr4kora73dwhjs6wo4rhybrwi4w3a2rpvh7jo6cxrvfpfxrua35m book/css/print.css
added bafkreia3jc2oweb24d4kflaqakfvidohhcep4ifbepbt25v3q5nqdhoqgy book/css/variables.css
added bafkreihpjyi4cv5r4lujpawtbplsn4wv754dj2s6e2wqer2dex4ld4jgze book/elasticlunr.min.js
added bafkreiebcti7y5huwvrbvwnp3z3un3m467scbprrpjxcsar5ekmnlcvblm book/favicon.png
added bafkreig6epsqwhcn23qffm7cdvce7tklcnliwocavq6jtwn6j2jghqhple book/favicon.svg
added bafkreigpy52jxfxwhpjrypccwxchdp3vnakakpuepqiph2yagql3yur5ga book/fonts/OPEN-SANS-LICENSE.txt
added bafkreigr43kglkb3ugr34uw3mscindhvqevoto7zdk622oiaxiawll6psm book/fonts/SOURCE-CODE-PRO-LICENSE.txt
added bafkreibnwej6n27n5badyyd5wpoowwwmkpbeo4qnlfk5el35wvv6w4jzwy book/fonts/fonts.css
added bafkreidxg2vdlfwenbivymqj6l45ndh25fwzjqcwrg6mcgs5zzbgu3xc5a book/fonts/open-sans-v17-all-charsets-300.woff2
added bafkreibmpok4bdpq2iumv3dnjp7na3na66vww5xkltb7ow24nlsbnpcxdm book/fonts/open-sans-v17-all-charsets-300italic.woff2
added bafkreicinrtvsjzruczwvco3uh6qxf5ow47sg257mdn7fdl4nnlshqdzre book/fonts/open-sans-v17-all-charsets-600.woff2
added bafkreia2h2dfs5ycj5ceqnfhlinthoe3smjuzeyaplr5nykpettmrdmn7m book/fonts/open-sans-v17-all-charsets-600italic.woff2
added bafkreigcf7umodbw6hmgfeb3o4xk5wde2oupvbeuope4v7zcj7nykjbi4q book/fonts/open-sans-v17-all-charsets-700.woff2
added bafkreibdrluvsokecev65dowl6hlyxz5hbrbmcukerp34hxdcuf4tix5qe book/fonts/open-sans-v17-all-charsets-700italic.woff2
added bafkreib5fsasvx3u32zw72wt76cgtaanhqfsh2zmqwfojeyqfepyssibiy book/fonts/open-sans-v17-all-charsets-800.woff2
added bafkreif2cuq6yim5xg6fx7wa4pt2rfzwtwmlgdkoqu7ojksskmrhqrbixa book/fonts/open-sans-v17-all-charsets-800italic.woff2
added bafkreidmsrr7oclmboowcdqjl3jerla6rkg2p2jnc7u34vcphowo263cwi book/fonts/open-sans-v17-all-charsets-italic.woff2
added bafkreibohmotjldhoy5lkbss3imtaxklg2kmnnxgx427jomechhev5sg2i book/fonts/open-sans-v17-all-charsets-regular.woff2
added bafkreibl3wkbbmaudwz4xp2m7q4brtdpvutz5dtdsqeubydm22xxntf7z4 book/fonts/source-code-pro-v11-all-charsets-500.woff2
added bafkreibdogrtmogsfhq4a76nzed7aj6jo3i7it7xgnyt5ji2y2ozvpojfi book/highlight.css
added bafkreic2fno23vqighor7arcair6fkyy4ytqmgiszse3lrcqvmwi6jx7sa book/highlight.js
added bafkreideryiao36q6jyglkinhl3ws2xq5vts26onzykn4sjckgaufs4uy4 book/index.html
added bafkreiaj5cgcz6xsh2ukg62wqfbt5l7ks4btv5rs5teursgb52muizdxim book/mark.min.js
added bafkreihjpk3jhspndxjx46xmueaaxzphkq47umi2flozloacum6ivy3d3a book/print.html
added bafkreiczpmk46vuezeut4twnq3ho3p4i2nt74aud5qmhjlgvj6fxos2ulm book/searcher.js
added bafkreihwyhatou3c3vuxdcikv6fmjzd7amj3z3kajonf3nhqw6x2rwq6sa book/searchindex.js
added bafkreida6ladjrk4lopwlqgwtpqv57y2xfehhhdpqw3bnjv5qmrostf4ci book/searchindex.json
added bafkreifrli5vovgq2mpnhwgu54flacebm5v4ti2x3zhffojoqsxyajd6ym book/tomorrow-night.css
added bafybeiazjgra7f2bmhqd6ojrx2koty7m53gywrqbjmtbzuvxvs2mhflvyq book/FontAwesome/css
added bafybeibdyiw3m4bevtsghw3uae3tzmun2w52yearz46p66r4nkxe3qiymu book/FontAwesome/fonts
added bafybeidbnx3j45n4bnv7bwfzep7ndw4udyspfmzkeqf76hwwblcdt57tam book/FontAwesome
added bafybeigmf4pualxxiweq5xfjxywhgsy2l7bvtutmedpggigvd4euzvbyoe book/css
added bafybeia2qxbpzqe6n4qms3w2grldow2ul6hxelhnnihzmv4qh5sfilociq book/fonts
added bafybeia53xpa36cgjtncuviu4l7forw4v4my2p4ok2cvpljtp3cs7hofku book
added bafybeie3gerc6anagdz2fk7ntshlth2eivh6xtnmayaezqkkktl2t2muky

View File

@ -83,7 +83,7 @@
<nav id="sidebar" class="sidebar" aria-label="Table of contents">
<div class="sidebar-scrollbox">
<ol class="chapter"><li class="chapter-item expanded affix "><a href="../index.html" class="active">Introduction</a></li><li class="chapter-item expanded "><a href="chapter_1.html"><strong aria-hidden="true">1.</strong> Chapter 1</a></li></ol>
<ol class="chapter"><li class="chapter-item expanded affix "><a href="../index.html" class="active">Introduction</a></li><li class="chapter-item expanded "><a href="IPFSNodes.html"><strong aria-hidden="true">1.</strong> IPFSNodes</a></li></ol>
</div>
<div id="sidebar-resize-handle" class="sidebar-resize-handle"></div>
</nav>
@ -169,9 +169,84 @@
<h1 id="deca-docs"><a class="header" href="#deca-docs">DECA Docs</a></h1>
<p>The DECA Project Documentation</p>
<h2 id="introduction"><a class="header" href="#introduction">Introduction</a></h2>
<p>A general DECA protocol specification and some example use cases.</p>
<h2 id="requirements"><a class="header" href="#requirements">Requirements</a></h2>
<h2 id="installation"><a class="header" href="#installation">Installation</a></h2>
<h2 id="contribute"><a class="header" href="#contribute">Contribute</a></h2>
<p>There are some requirements you need to fulfill to be able to work with DECA docs.</p>
<ul>
<li><code>Rust</code> &gt;= 1.66</li>
<li><code>curl</code> &gt;= 7.88.1</li>
<li><code>cargo</code> &gt;= 1.72.0</li>
<li><code>mdBook</code> &gt;= v0.4.34</li>
<li><code>git</code> &gt;= 2.39.2</li>
</ul>
<blockquote>
<p>NOTE: These are the recommended versions since they were tested in the development environment.</p>
</blockquote>
<h2 id="installation"><a class="header" href="#installation">Installation.</a></h2>
<p>The easiest way to get both Rust and Cargo's latest versions is by using the <code>rustup</code> script, which also means that you have to use the <code>curl</code> command.</p>
<h3 id="1-git-installation"><a class="header" href="#1-git-installation">1. Git Installation.</a></h3>
<p>The first step is to install git on you Unix system. To do that, you only need to run the following command:</p>
<pre><code class="language-shell">$ sudo apt install git
</code></pre>
<h3 id="2-curl-installation"><a class="header" href="#2-curl-installation">2. Curl Installation.</a></h3>
<p>You have to repeat the same proccess to install <code>curl</code>, use the apt command:</p>
<pre><code class="language-sh"> $ sudo apt install curl
</code></pre>
<p>Once you have <code>curl</code> installed you can go ahead and continue with the Rust and Cargo installations.</p>
<h3 id="3-rust-and-cargo-installation"><a class="header" href="#3-rust-and-cargo-installation">3. Rust and Cargo Installation.</a></h3>
<p>To install Rust and Cargo on your Unix System you have to download the <code>rustup installer script</code> using the following command on the terminal:</p>
<pre><code class="language-shell">$ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
</code></pre>
<p>By using the previous command you will get the latest Rust and Cargo's versions. </p>
<blockquote>
<p>Suggestion: You can make sure the installation was succesfull by using the following command:</p>
<pre><code class="language-sh">$ rustc --version
</code></pre>
<p>It tells you the version of Rust that was installed.</p>
</blockquote>
<blockquote>
<p>NOTE: Some important considerations when installing Rust:</p>
<ul>
<li>
<p>When you install Rust, it will be installed only for the current user, in other words, the installation is not system-wide.</p>
</li>
<li>
<p>It is not required to be root or sudo to be able to install Rust.</p>
</li>
</ul>
</blockquote>
<p>Once you have completed your Rust and Cargo installations, you can now continue with the <code>mdBook</code> installation.</p>
<h3 id="4-mdbook-installation"><a class="header" href="#4-mdbook-installation">4. MdBook Installation.</a></h3>
<p>DECA Docs uses <code>mdBook</code> as a way to create books with Markdown. Since <code>mdBook</code> is a command line tool, it is ideal for creating tutorials, API documentations, course materials, amongst other useful things.</p>
<p>You can follow the instructions bellow to download <code>mdBook</code>. </p>
<p>First, you have to use the following command to build and install <code>mdBook</code>:</p>
<pre><code class="language-shell">$ cargo install mdbook
</code></pre>
<p>The command will automatically download <code>mdBook</code>, build it and install it in Cargo's global binary directory.</p>
<p>Once installed, the next step is to get the DECA Docs repository. Follow the instructions below to get it.</p>
<h3 id="clone-the-deca-documentation-repository"><a class="header" href="#clone-the-deca-documentation-repository">Clone the DECA Documentation repository.</a></h3>
<p>After you have succesfully compleated all installations, you can now access the docummentation repository and contribute to the resources.
Run the next command on the terminal:</p>
<pre><code class="language-shell">$ git clone https://git.decentralizedscience.org/DECA/docs.git
</code></pre>
<blockquote>
<ul>
<li>This command lets you copy the DECA Docs repository to your local machine.</li>
<li>It also means that you can pull down a full copy of all the repository data that it has at that point in time, including all versions of every file and folder for the project.</li>
</ul>
</blockquote>
<p>Once the repository has been cloned, you can have access to it by entering the following command on your terminal:</p>
<pre><code class="language-shell">$ cd docs/
</code></pre>
<p>This command will lead you to the directory where you can find the DECA Docs README.md.</p>
<p>The last step is to run the server using the following command:</p>
<pre><code class="language-shell">$ mdbook serve
</code></pre>
<p>You can view the page on any browser using the following link <a href="http://127.0.0.1:3000">http://127.0.0.1:3000</a></p>
<blockquote>
<p>NOTE: If you want to access remotely use the <code>mdbook serve -n 0.0.0.0</code> which means any IP address can access the DECA Docs project.</p>
</blockquote>
<h2 id="contribute-usage"><a class="header" href="#contribute-usage">Contribute (Usage)</a></h2>
<h2 id="contract"><a class="header" href="#contract">Contract</a></h2>
<ul>
<li><a href="https://t.me/deca_currency/1">Telegram</a></li>
@ -187,13 +262,30 @@ A copy of the license is included in the section entitled &quot;GNU
Free Documentation License&quot;.
</code></pre>
<h2 id="references"><a class="header" href="#references">References</a></h2>
<ol>
<li>
<p>Rust, &quot;Learn Rust&quot;, <a href="https://www.rust-lang.org/tools/install">https://www.rust-lang.org/tools/install</a>, 2023-08-31.</p>
</li>
<li>
<p>A.Prakash, &quot;How to install Rust and Cargo&quot;, <a href="https://itsfoss.com/install-rust-cargo-ubuntu-linux/">https://itsfoss.com/install-rust-cargo-ubuntu-linux/</a>, 2023-03-26.</p>
</li>
<li>
<p>The Cargo Book, &quot;Installation&quot;, <a href="https://web.mit.edu/rust-lang_v1.25/arch/amd64_ubuntu1404/share/doc/rust/html/cargo/getting-started/installation.html#build-and-install-cargo-from-source">https://web.mit.edu/rust-lang_v1.25/arch/amd64_ubuntu1404/share/doc/rust/html/cargo/getting-started/installation.html#build-and-install-cargo-from-source</a>, 2023-08-31.</p>
</li>
<li>
<p>Docs GitHub, &quot;Cloning a repository&quot;, <a href="https://docs.github.com/es/repositories/creating-and-managing-repositories/cloning-a-repository">https://docs.github.com/es/repositories/creating-and-managing-repositories/cloning-a-repository</a>, 2023-08-31.</p>
</li>
<li>
<p>mdBook Docummentation, &quot;Introduction&quot;, <a href="https://rust-lang.github.io/mdBook/#:~:text=mdBook%20is%20a%20command%20line,easily%20navigable%20and%20customizable%20presentation.&amp;text=This%20guide%20is%20an%20example%20of%20what%20mdBook%20produces.">https://rust-lang.github.io/mdBook/#:~:text=mdBook%20is%20a%20command%20line,easily%20navigable%20and%20customizable%20presentation.&amp;text=This%20guide%20is%20an%20example%20of%20what%20mdBook%20produces.</a>, 2023-08-31.</p>
</li>
</ol>
</main>
<nav class="nav-wrapper" aria-label="Page navigation">
<!-- Mobile navigation buttons -->
<a rel="next" href="chapter_1.html" class="mobile-nav-chapters next" title="Next chapter" aria-label="Next chapter" aria-keyshortcuts="Right">
<a rel="next" href="IPFSNodes.html" class="mobile-nav-chapters next" title="Next chapter" aria-label="Next chapter" aria-keyshortcuts="Right">
<i class="fa fa-angle-right"></i>
</a>
@ -204,29 +296,13 @@ Free Documentation License&quot;.
<nav class="nav-wide-wrapper" aria-label="Page navigation">
<a rel="next" href="chapter_1.html" class="nav-chapters next" title="Next chapter" aria-label="Next chapter" aria-keyshortcuts="Right">
<a rel="next" href="IPFSNodes.html" class="nav-chapters next" title="Next chapter" aria-label="Next chapter" aria-keyshortcuts="Right">
<i class="fa fa-angle-right"></i>
</a>
</nav>
</div>
<!-- Livereload script (if served using the cli tool) -->
<script>
const wsProtocol = location.protocol === 'https:' ? 'wss:' : 'ws:';
const wsAddress = wsProtocol + "//" + location.host + "/" + "__livereload";
const socket = new WebSocket(wsAddress);
socket.onmessage = function (event) {
if (event.data === "reload") {
socket.close();
location.reload();
}
};
window.onbeforeunload = function() {
socket.close();
}
</script>

3
publishSite.sh Executable file
View File

@ -0,0 +1,3 @@
#!/bin/env bash
ipfs add --cid-version 1 -r -w book/ > bookCIDs.txt

238
src/IPFSNodes.md Normal file
View File

@ -0,0 +1,238 @@
# DECA's IPFS Nodes Setup Guide
The following guide is on how to setup an IPFS node for DECA Protocol Requirements if you want to contribute and provide some infrastructure. This guide is based on Debian 12.1, improvements to our documentation are welcome.
## IPFS Instalation
1. Download the Linux Kubo binary from [`dist.ipfs.tech`](https://dist.ipfs.tech/#kubo).
```bash
$ wget https://dist.ipfs.tech/kubo/v0.22.0/kubo_v0.22.0_linux-amd64.tar.gz
```
1. Untargz the file:
```bash
$ tar -xvzf kubo_v0.22.0_linux-amd64.tar.gz
> x kubo/LICENSE
> x kubo/LICENSE-APACHE
> x kubo/LICENSE-MIT
> x kubo/README.md
> x kubo/install.sh
> x kubo/ipfs
```
1. Move into the `go-ipfs` folder and run the install script:
```bash
$ cd kubo
$ sudo bash install.sh
> Moved ./ipfs to /usr/local/bin
```
1. Test that IPFS has installed correctly:
```bash
ipfs --version
> ipfs version 0.22.0
```
## Setup ipfs service for deca
First time config setup for a server:
```sh
ipfs init --profile server
```
> This removes local discovery requests
### Enable Public Gateway
Modify the GateWay section with the IP Address 0.0.0.0 :
```sh
"Addresses": {
"API": "/ip4/127.0.0.1/tcp/5001",
"Announce": [],
"AppendAnnounce": [],
"Gateway": "/ip4/0.0.0.0/tcp/8080",
```
### Enable WebSocket on port 4004
Add swarm address in the config (specifically the ws line):
```sh
"Swarm": [
"/ip4/0.0.0.0/tcp/4001",
"/ip4/0.0.0.0/tcp/4004/ws",
"/ip6/::/tcp/4001",
"/ip4/0.0.0.0/udp/4001/quic",
"/ip6/::/udp/4001/quic"
]
```
### Enable Circuit Relay V2
Enable Swarm.RelayService with the following command:
```sh
ipfs config --json Swarm.RelayService.Enabled true
```
and
```sh
ipfs config --json Swarm.RelayClient.Enabled true
```
### Enable Public Gateway
To enable the public gateway setting your Gateway section should look as the
following:
```sh
"Gateway": {
"APICommands": [],
"DeserializedResponses": null,
"HTTPHeaders": {},
"NoDNSLink": false,
"NoFetch": false,
"PathPrefixes": [],
"PublicGateways":{
"devteam": {
"UseSubdomains": false,
"Paths": [
"/ipfs",
"/ipns"
]
}
},
"RootRedirect": ""
},
```
### Set IPFS as a daemon
Copy the following lines after the `sudo vim... command`, modify user and path to ipfs so that it matches with your system and user that runs ipfs:
```sh
$ sudo vim /etc/systemd/system/ipfs.service
[Unit]
Description=IPFS Daemon
After=network.target
[Service]
Type=notify
ExecStart=/usr/local/bin/ipfs daemon --enable-gc=true --migrate=true
ExecStop=/usr/local/bin/ipfs shutdown
User=nodemaster
Restart=on-failure
LimitNOFILE=10240
KillSignal=SIGINT
[Install]
WantedBy=multi-user.target
```
**NOTE: in this example user that runs ipfs is nodemaster, also the ipfs location is at /usr/local/bin/ipfs if you don't know the path, try `$ whereis ipfs`**
Enable the service
```sh
$ sudo systemctl daemon-reload
$ sudo systemctl enable ipfs.service
$ sudo systemctl start ipfs.service
$ sudo systemctl status ipfs.service
```
**NOTE: service must be set as active (running), if not please verify the preview steps**
## Set IPFS as a daemon and Nginx Reverse Proxy
### Nginx Reverse Proxy for a public gateway and websocket
> NOTE: websocket is required for the Orbitdb which hold search.deca.eco
> our carbon credits distributed database
The Gateway setup:
Change the server name for your own domain name:
```sh
server {
listen 80;
server_name gateway.decentralizescience.org;
location / {
proxy_pass http://localhost:8080;
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
allow all;
}
}
```
> Note: Remember to enable the service and get ssl with certbot
The enabling Secure WebSocket with nginx:
> NOTE: Change the server name for your own domain name.
```sh
server {
listen 80;
server_name ipfs.decentralizedscience.org;
location / {
proxy_pass http://127.0.0.1:4004;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
}
```
> NOTE: Remember to enable the service and get ssl with certbot
## Testing
### Verify Secure WebSocket connection
Doing an IPFS ping
```sh
ipfs ping /dns4/gateway.decentralizedscience.org/443/wss/p2p/12D3KooWQzickgUJ1N9dNZMJpNnFUCHmhndTVgexXnt6dQhPFcEE
PING 12D3KooWQzickgUJ1N9dNZMJpNnFUCHmhndTVgexXnt6dQhPFcEE.
Pong received: time=161.27 ms
Pong received: time=161.13 ms
Pong received: time=161.55 ms
```
Doing a swarm connect
```sh
ipfs swarm connect /dns4/gateway.decentralizedscience.org/443/wss/p2p/12D3KooWQzickgUJ1N9dNZMJpNnFUCHmhndTVgexXnt6dQhPFcEE
connect 12D3KooWQzickgUJ1N9dNZMJpNnFUCHmhndTVgexXnt6dQhPFcEE success
```
### check the IPFS public Gateway:
Browse by adding `/ipns/docs.deca.eco/` to your gateway address:
> You should see the IPFS official web3 website
Example:
https://gateway.decentralizedscience.org/ipns/docs.deca.eco/
## License
[**GPLV3**](./LICENSE). ?
## Contact.
***Developers***
- [p1r0](mailto:p1r0@nethunters.xyz)
## ToDo/Proposal
* Setup a DECA testnodes health by forking [this code](https://github.com/ipfs/public-gateway-checker)
* Setup and handle data with [ipfs-cluster](https://ipfscluster.io/)
## References
1. [Install IPFS Kubo](https://docs.ipfs.tech/install/command-line/#install-official-binary-distributions)
2. [Hosting a public IPFS gateway](https://gist.github.com/NatoBoram/09d244ab02af16fecb62b917f7bee3c0)
3. [file transfer](https://github.com/ipfs/go-ipfs/blob/master/docs/file-transfer.md)
4. [circuit relay](https://docs.libp2p.io/concepts/circuit-relay/)
5. [understanding circuit relay](https://blog.aira.life/understanding-ipfs-circuit-relay-ccc7d2a39)
6. [experimental features](https://github.com/ipfs/go-ipfs/blob/master/docs/experimental-features.md)

View File

@ -1 +0,0 @@
# Introduction

View File

@ -2,4 +2,4 @@
[Introduction](../README.md)
- [Chapter 1](./chapter_1.md)
- [IPFSNodes](./IPFSNodes.md)

View File

@ -1 +0,0 @@
# Chapter 1