Skip to content

Commit

Permalink
GitBook: [#12] add docker quick start guide
Browse files Browse the repository at this point in the history
  • Loading branch information
Adán Sánchez de Pedro Crespo authored and gitbook-bot committed Dec 17, 2021
1 parent ee23dce commit 572dd74
Show file tree
Hide file tree
Showing 4 changed files with 80 additions and 3 deletions.
2 changes: 1 addition & 1 deletion SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
* [Requirements](node-operators/requirements.md)
* [What to Expect](node-operators/what-to-expect.md)
* [Docker Quick Start Guide](node-operators/docker-quick-start-guide.md)
* [Next steps](node-operators/next-steps.md)
* [Next steps](node-operators/nest-steps.md)
* [CLI Reference](node-operators/cli-reference.md)
* [Advanced Setups](node-operators/advanced-setups/README.md)
* [Run Witnet as a systemd service](node-operators/advanced-setups/run-witnet-as-a-systemd-service.md)
Expand Down
77 changes: 77 additions & 0 deletions node-operators/docker-quick-start-guide.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,79 @@
# Docker Quick Start Guide

**The Witnet Mainnet is open for anyone to join and and run their own full node.**

{% hint style="info" %}
You do not need to run a Witnet node to use Witnet from your Ethereum smart contracts. 

If you are a smart contracts developer, what you probably want is to use one of the [data feeds](../introduction/quick-tutorials/data-feeds-tutorial.md), a [randomness source](../introduction/quick-tutorials/randomness.md), or to connect to [APIs with HTTP GET/POST](../introduction/quick-tutorials/apis-and-http-get-post.md).
{% endhint %}

### Hardware requirements <a href="#hardware-requirements" id="hardware-requirements"></a>

Hardware requirements are listed in the node operators docs:

{% content-ref url="requirements.md" %}
[requirements.md](requirements.md)
{% endcontent-ref %}

### Up and running in 1 minute, using Docker <a href="#up-and-running-in-1-minute-using-docker" id="up-and-running-in-1-minute-using-docker"></a>

The most convenient method for running a Witnet node is through the `witnet/witnet-rust` Docker image. For alternate installation methods or more complex setups, take a look at the [docker-compose](advanced-setups/run-witnet-as-a-docker-compose-service.md) and [systemd](advanced-setups/run-witnet-as-a-systemd-service.md) integrations.

Firstly, you need to [install Docker](https://docs.docker.com/get-docker/) on the device you will be running the node from. Note: some GNU/Linux distributions require some [extra steps](https://docs.docker.com/install/linux/linux-postinstall/) to get Docker up and running.

The Witnet docker image downloads and runs a Witnet node in in just a matter on seconds. To start a node, use:

{% tabs %}
{% tab title="MacOS and Linux" %}
```
docker run -d \
--name witnet_node \
--volume ~/.witnet:/.witnet \
--publish 21337:21337 \
--restart always \
witnet/witnet-rust
```
{% endtab %}

{% tab title="Windows" %}
The home directory path is defined differently on Windows:

```
docker run -d --name witnet-node --volume %USERPROFILE%\.witnet\:/.witnet --publish 21337:21337 --restart always witnet/witnet-rust
```
{% endtab %}

{% tab title="Raspberry Pi" %}
For some reason, Docker on Raspbian for all Raspberry models requires your containers to operate in privileged mode. When running the command above, simply add the `--privileged` flag:

```
docker run -d --privileged --name witnet_node --volume ~/.witnet:/.witnet --publish 21337:21337 --restart always witnet/witnet-rust
```
{% endtab %}
{% endtabs %}

### Now what? <a href="#now-what" id="now-what"></a>

There are two **important** things you should do now to make the most of your Witnet node:

1. Open ports as explained below.
2. Follow the [Next Steps](nest-steps.md) guide to learn how to check the node status, progress and statistics:

{% content-ref url="nest-steps.md" %}
[nest-steps.md](nest-steps.md)
{% endcontent-ref %}

### Open your ports! <a href="#open-your-ports" id="open-your-ports"></a>

The best way to contribute to the growth and sustainability of the Witnet network is by opening up the listening port of your node, so that other nodes in the network can download block chain data from you and your transactions can be broadcasted more quickly.

For this feature to be effective, you will also need your IP address to be public (and ideally, static). If you are operating a node in your home network, you can request your ISP to assign you a static IP address or at least disable [CGN](https://en.wikipedia.org/wiki/Carrier-grade\_NAT) on it.

Depending on your setup, this will normally imply changing the settings on your router or firewall so as to forward all incoming connections to port `21337` from your external IP into the IP of the device or interface where the node is running.

You can find out how to verify that your ports are open in the [Next Steps](nest-steps.md) guide:

{% content-ref url="nest-steps.md" %}
[nest-steps.md](nest-steps.md)
{% endcontent-ref %}
2 changes: 2 additions & 0 deletions node-operators/nest-steps.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Next steps

2 changes: 0 additions & 2 deletions node-operators/next-steps.md

This file was deleted.

0 comments on commit 572dd74

Please sign in to comment.