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

Added docker docs to launch a client node + some docs corrections #5

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
64 changes: 54 additions & 10 deletions source/docs/index.md
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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
Expand All @@ -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
Expand All @@ -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

Expand Down
2 changes: 1 addition & 1 deletion themes/nuls/languages/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ page:
sidebar:
docs:
started: Getting Started
overview: Guide
overview: Running a node
manual: Manual

protocol:
Expand Down