From 5512467c14b3af213cc3d5847485cc6bb16e01b3 Mon Sep 17 00:00:00 2001 From: amalcaraz Date: Tue, 18 Sep 2018 00:34:38 +0200 Subject: [PATCH] Added docker docs to launch a client node + some docs corrections --- source/docs/index.md | 64 ++++++++++++++++++++++++++++++------ themes/nuls/languages/en.yml | 2 +- 2 files changed, 55 insertions(+), 11 deletions(-) diff --git a/source/docs/index.md b/source/docs/index.md index 448f226b..87378019 100644 --- a/source/docs/index.md +++ b/source/docs/index.md @@ -1,20 +1,57 @@ -title: How to run the node +title: How to run a client node -------------------------- -## What you'll need +## Using Docker + +The easiest way of launching a client node is using the [official docker image](https://hub.docker.com/r/nuls/client-node/) + +[Docker](https://www.docker.com/) is a tool designed to make it easier to create, deploy, and run applications by using containers. Containers allow a developer to package up an application with all of the parts it needs, such as libraries and other dependencies, and ship it all out as one package. + +You can run a full nuls client node with a single line: +```sh + docker run --name nuls-node -d \ + -p 127.0.0.1:6001:6001 \ + -p 8016:8016 \ + -p 8016:8016/udp \ + -v /tmp/nuls/logs:/nuls/logs \ + -v /tmp/nuls/data:/nuls/data \ + nuls/client-node:1.0.1 +``` + +By default the client interface is accessible in the port `6001`, so once the node is running, check that everything is working visiting the url [localhost:6001](http://localhost:6001) in your browser. + +After that, try open the commands shell of the node by running: +```sh + docker exec -it nuls-node /nuls/bin/cmd.sh + + # Then get a list of available shell commands + >> help +``` + +To see the node logs run: +```sh + docker logs -f nuls-node +``` + +All the data generated by the node is stored in the mounted volume `/tmp/nuls/data`. +You can read more details about how to configure the client node container [here](https://hub.docker.com/r/nuls/client-node/). + +## Building it from source code + +### What you will need * JDK 1.8 * Maven 3.3+ * Git 2.x * IDE ( Optional ) -## Getting Source +### Getting source ```sh $ git clone https://github.com/nuls-io/nuls.git && cd nuls ``` -## Build Source +### Building from source Make sure the JDK version is 1.8 @@ -26,8 +63,15 @@ Java version: 1.8.0_171, vendor: Oracle Corporation, runtime: /Library/Java/Java ``` If the Java version is not 1.8, it is recommended to install and set it to version 1.8. +In some linux distributions, the package `JavaFX` is not included as part of the `openjdk` package. You can get it installing the package `openjfx`: -Now,we can build the node. +```sh + apt-get update && \ + apt-get -y install \ + openjfx +``` + +Now, we can build the node. ``` $ mvn clean package @@ -37,8 +81,9 @@ After the command is successfully executed, you can find the compilation result > client-module/client/target/nuls-node.tar.gz -## Run Node +### Running the node +Unpackage the binaries: ```shell $ mvn clean package $ cd client-module/client/target @@ -47,10 +92,9 @@ $ tar -zxvf nuls-node.tar.gz -C nuls-node $ cd nuls-node/bin ``` -- Using start.sh running the nuls process. -- Using stop.sh stop the nuls process. -- Using cmd.sh running the nuls shell. - +- Use `./start.sh` to run the nuls process. +- Use `./stop.sh` to stop the nuls process. +- Use `./cmd.sh` to run the nuls shell. ## Use IDEA diff --git a/themes/nuls/languages/en.yml b/themes/nuls/languages/en.yml index a327fa87..ae8ae38a 100644 --- a/themes/nuls/languages/en.yml +++ b/themes/nuls/languages/en.yml @@ -20,7 +20,7 @@ page: sidebar: docs: started: Getting Started - overview: Guide + overview: Running a node manual: Manual protocol: