Skip to content

Commit

Permalink
Merge pull request #119 from DataHighway-DHX/luke/jeff/updateDocusaurus
Browse files Browse the repository at this point in the history
docs: Proposed changes to Jeff/update docusaurus
  • Loading branch information
jeffstahlnecker authored Jun 22, 2021
2 parents a75ee22 + 84572ac commit 7e10012
Show file tree
Hide file tree
Showing 3 changed files with 162 additions and 40 deletions.
49 changes: 20 additions & 29 deletions MAINTENANCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,46 +5,37 @@

Most of the original diagrams that are included in the original v1.0.0 whitepaper were generated with Visual Paradigm, whose source file is .vpd format, and then converted to an image that was stored in the ./assets/images folder and embedded in the generated whitepaper. However some of the diagrams were modified by the MXC marketing team, and these were included in previous version [v1.1.0 whitepaper](https://github.com/DataHighway-DHX/documentation/releases). If you need to update any of the diagrams then please coordinate with the MXC marketing team.

1. Start your development environment, and then run the following while in the `./static/whitepapers/economig` folder to create a new release in PDF format. Replace `v1.2.0` below with the desired version:
1. Install Node.js v16.3.0

2. Start your development environment

```terminal
npx mr-pdf --initialDocsURL="http://localhost:3000/docs/whitepaper" \
--paginationSelector=".pagination-nav__item--next > a" \
--excludeSelectors=".margin-vert--xl a" --pdfMargin="20" \
--pdfFormat="A4" --outputPDFFilename="whitepaper_latest.pdf"
npm install && \
npm install -g [email protected] && \
npm start
```

2. Change into folder `./static/whitepapers/economic` folder and run the following to create a new release in PDF format. Replace `v1.2.0` or `v1_2_x` below with the desired version:

Important: Check it generated the latest PDF to reflect the Markdown changes you made correctly in ./docs/whitepaper.pdf and the copy of it ./versions/v1.2.0/whitepaper.pdf.

External links may reference the static location of the latest whitepaper in ./docs/whitepaper.pdf. A copy of each version is stored in a directory with the version name to make it easier for users to find older versions.

Note: `headerIds` must be `true` in config.json otherwise TOC links do not work.

4. Update the Whitepaper Table of Contents (TOC)
```terminal
cd ./static/whitepapers/economic
Generate the TOC of the Whitepaper and save to a file in Markdown format using [markdown-toc](https://github.com/jonschlinkert/markdown-toc):
mr-pdf --initialDocURLs="http://localhost:3000/docs/whitepaper" \
--contentSelector="article" \
--paginationSelector=".pagination-nav__item--next > a" \
--pdfMargin="50,50,50,50" \
--pdfFormat="A4" \
--outputPDFFilename="whitepaper_latest.pdf"
```bash
cd website &&
cd ./node_modules/markdown-toc/ && node cli.js --bullets "*" --no-firsth1 ../../../docs/whitepaper.md > ../../../output-markdown-toc.md && cd ../../../
cp ./whitepaper_latest.pdf ./whitepaper_v1_2_x.pdf
```

Convert the Markdown version of the TOC into HTML using [pandoc](https://pandoc.org/)

```bash
brew install pandoc
pandoc output-markdown-toc.md --from=gfm -t html -o output-html-toc.html
```

Copy the contents of output-html-toc.html into ./docs/whitepaper.md as indicated here:
Important:
* Remove the first few including page 1 that generates text "untitled" and the Table of Contents pages, so the first page starts with "DataHighway's Whitepaper"
* Check it generated the latest PDF to reflect the Markdown changes you made correctly in ./docs/whitepaper.mdx and the copy of it ./static/whitepapers/economic/v1.2.0/whitepaper.pdf.

```bash
<div class="pdf-only">
<span style="font-size: 1.5em; font-weight: 700;!important" class="pdf-only">Table of Contents</span>
<!-- INSERT TOC BELOW HERE -->
</div>
```
External links may reference the static location of the latest whitepaper in ./whitepapers/economic/whitepaper_latest.pdf. A copy of each version is stored in a directory with the version name to make it easier for users to find older versions.

### Troubleshooting

Expand Down
128 changes: 128 additions & 0 deletions docs/tutorials/tutorials-nodes-full-node-setup.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
---
id: tutorials-nodes-full-node-setup
title: Setup Full Node
sidebar_label: Setup Full Node
---

## How do you setup a Full Node?

This guide covers how to set up a DataHighway Full Node.


### Provisioning a server

Provision an appropriately sized server from a reputable VPS provider, e.g.: Vultr, DigitalOcean, Linode, OVH, Contabo, Scaleway, Amazon AWS, etc.

We recommend a node with at least 4GB of RAM, and Ubuntu 18.04 x64. Other operating systems will require adjustments to these instructions.

SSH into the server.

### Installing DataHighway and setting it up as a system service

First, clone the DataHighway-DHX/node repo, install any dependencies, and run the required build scripts.

```bash
apt update
apt install -y gcc libc6-dev
apt install -y cmake pkg-config libssl-dev git clang libclang-dev
```

Prefetch SSH publickeys

```bash
ssh-keyscan -H github.com >> ~/.ssh/known_hosts
```

Install rustup

```bash
curl https://sh.rustup.rs -sSf | sh -s -- -y
source $HOME/.cargo/env
export PATH=$HOME/.cargo/bin:$PATH
```

Get packages

```bash
git clone https://github.com/DataHighway-DHX/node.git
cd node
```

Build packages

```bash
curl https://getsubstrate.io -sSf | bash -s -- --fast && \
./scripts/init.sh
```

Build runtime code

```bash
cargo build --release
```


### Set up the node as a system service.
To do this, navigate into the root directory of the DataHighway-DHX/node repo and execute the following to create the service configuration file and make specific configuration updates for your node as detailed below:

```bash
{
echo '[Unit]'
echo 'Description=DataHighway'
echo '[Service]'
echo 'Type=simple'
echo 'WorkingDirectory=/home/foo/node'
echo 'ExecStart=/home/foo/node/target/release/datahighway --chain CHAIN_NAME --bootnodes BOOT_NODE --name YOUR_NODE_NAME'
echo '[Install]'
echo 'WantedBy=multi-user.target'
} > /etc/systemd/system/datahighway.service
```

WorkingDirectory=needs to be the full path to your node project which you cloned. eg:
```
/home/foo/node
```

ExecStart=needs to include the full path to the datahighway binary, eg:
```
/home/foo/node/target/release/datahighway
```

CHAIN_NAME=Specify the chain name where you want to connect your node to, eg
```
--chain harbour
```

YOUR_NODE_NAME=Name your node with the --name option which will be shown on telemetry, eg:
```
--name MyAwesomeNode
```
BOOT_NODE=specify one of our chain specific bootnodes, its IP and Peer-ID can be provided thru a discord request
```
--bootnodes /ip4/GET_IP_FROM_DISCORD/tcp/30333/p2p/GET_PEER_ID_FROM_DISCORD
```


Double check that the config has been written to /etc/systemd/system/datahighway.service correctly.
```
cat /etc/systemd/system/datahighway.service
```

Then enable the service so it runs on startup, and then try to start it now:

```bash
systemctl enable datahighway
systemctl start datahighway
```

Check the status of the service:

```bash
systemctl status datahighway
```

You should see the node connecting to the network and syncing the latest blocks. If you need to tail the latest output, you can use:

```bash
journalctl -u datahighway.service -f
```
25 changes: 14 additions & 11 deletions docs/tutorials/tutorials-nodes-validator-setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ title: Setup Validator Node
sidebar_label: Setup Validator Node
---

**DRAFT**

## How do you setup an Validator Node?
## How do you setup a Validator Node?

This guide covers how to set up a DataHighway Validator Node.

Expand Down Expand Up @@ -65,16 +63,16 @@ cargo build --release


### Set up the node as a system service.
To do this, navigate into the root directory of the DataHighway-DHX/node repo and execute the following to create the service configuration file (harbour):
To do this, navigate into the root directory of the DataHighway-DHX/node repo and execute the following to create the service configuration file and make specific configuration updates for your node as detailed below:

```bash
{
echo '[Unit]'
echo 'Description=DataHighway'
echo '[Service]'
echo 'Type=simple'
echo 'WorkingDirectory=`pwd`'
echo 'ExecStart=`pwd`/node/target/release/datahighway --chain `pwd`/node/node/src/chain-definition-custom/chain_def_harbour.json --bootnodes BootNode --name YOURNODENAME --validator --unsafe-ws-external --unsafe-rpc-external --rpc-cors=all --rpc-methods=Unsafe --execution=native -lruntime=debug'
echo 'WorkingDirectory=/home/foo/node'
echo 'ExecStart=/home/foo/node/target/release/datahighway --chain CHAIN_NAME --bootnodes BOOT_NODE --name YOUR_NODE_NAME --validator --unsafe-ws-external --unsafe-rpc-external --rpc-cors=all --rpc-methods=Unsafe --execution=native -lruntime=debug'
echo '[Install]'
echo 'WantedBy=multi-user.target'
} > /etc/systemd/system/datahighway.service
Expand All @@ -85,18 +83,23 @@ WorkingDirectory=needs to be the full path to your node project which you cloned
/home/foo/node
```

ExecStart=needs to be the full path to the datahighway binary, eg:
ExecStart=needs to include the full path to the datahighway binary, eg:
```
/home/foo/node/target/release/datahighway
```

Name your node with the --name option which will be shown on telemetry, eg:
CHAIN_NAME=Specify the chain name where you want to connect your node to, eg
```
--chain harbour
```

YOUR_NODE_NAME=Name your node with the --name option which will be shown on telemetry, eg:
```
--name MyValidator
--name MyAwesomeNode
```
BootNode=specify our bootnode to connect to the chain (vs. running your own one locally
BOOT_NODE=specify one of our chain specific bootnodes, its IP and Peer-ID can be provided thru a discord request
```
--bootnodes /ip4/18.185.37.254/tcp/30333/p2p/12D3KooWFmR35FFHiXcQv8hsFWDq6ofttqBPeMkd4Jt6qRgq3HnT
--bootnodes /ip4/GET_IP_FROM_DISCORD/tcp/30333/p2p/GET_PEER_ID_FROM_DISCORD
```

Note1: The Startup argument '--rpc-methods=Unsafe' is required to workaround ["Method not found"](https://github.com/paritytech/substrate/issues/6100)
Expand Down

0 comments on commit 7e10012

Please sign in to comment.