Skip to content

Commit 86ce244

Browse files
committed
first iteration of more formal docs
1 parent 20094ff commit 86ce244

14 files changed

Lines changed: 967 additions & 39 deletions

File tree

docs/operational-docs/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.env

docs/operational-docs/README.md

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# Emerald - Documentation
2+
3+
To install to view locally:
4+
5+
```bash
6+
python3 -m venv ~/mkdocs-env
7+
source ~/mkdocs-env/bin/activate
8+
pip install mkdocs mkdocs-material mkdocs-awesome-pages-plugin mkdocs-github-admonitions-plugin
9+
mkdocs --version # To verify the installation
10+
```
11+
12+
To view the documentation locally:
13+
14+
```bash
15+
mkdocs serve
16+
```
17+
18+
When you are done, deactivate the virtual environment:
19+
20+
```bash
21+
deactivate
22+
```
23+
24+
### How to Add Documentation
25+
26+
`mkdocs awesome-pages` plugin is used to auto generate the navigation for nested directories in `docs/`.
27+
28+
To add a new page, create a new markdown file in the `docs/{topic}/` directory. The file should have a `.md` extension.
29+
30+
Each directory 1 level into `docs/` should have an `index.md` file. This file should contain the title `Overview` and a brief description of the contents of the directory.
31+
32+
All nested directories only need to contain the documentation files for the topics they cover.
33+
Example `docs/infra/ovh/provision-server.md` will be automatically added to the navigation.
34+
35+
### How to Style Documentation
36+
37+
`mkdocs-github-admonitions-plugin` is used to support GitHub-style admonitions in markdown files. These are rendered consistently in both GitHub and in our MkDocs documentation.
38+
39+
For detailed information on formatting, including:
40+
- Using admonitions (notes, warnings, tips, etc.)
41+
- Code block formatting
42+
- Links and references
43+
- Other styling guidelines
44+
45+
Please refer to the [MkDocs Styling Guide](docs/mkdocs-styling-guide.md) for comprehensive styling guidelines and examples.
46+
47+
## Using Docker Compose
48+
49+
Setup your environment to have the same user inside the container.
50+
51+
```bash
52+
echo "UID=$(id -u)" > .env
53+
echo "GID=$(id -g)" >> .env
54+
echo "USERNAME=$(id -un)" >> .env
55+
```
56+
57+
Start the container, which also builds the image.
58+
59+
```bash
60+
docker compose up -d
61+
```
62+

docs/operational-docs/compose.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
services:
3+
mkdocs:
4+
build:
5+
context: .
6+
args:
7+
UID: ${UID}
8+
GID: ${GID}
9+
USERNAME: ${USERNAME}
10+
volumes:
11+
- ./:/docs
12+
ports:
13+
- "8000:8000"
14+

docs/operational-docs/dockerfile

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# -- --
2+
FROM python:3.9-slim
3+
4+
# -- install required packages
5+
RUN apt-get update && apt-get install -y --no-install-recommends \
6+
neovim \
7+
curl \
8+
git \
9+
ca-certificates \
10+
less \
11+
&& pip install mkdocs mkdocs-material mkdocs-awesome-pages-plugin mkdocs-github-admonitions-plugin \
12+
&& apt-get clean && rm -rf /var/lib/apt/lists/*
13+
14+
# Build args for user info
15+
ARG UID=1000
16+
ARG GID=1000
17+
ARG USERNAME=docsuser
18+
19+
# -- create group, user, and set permissions
20+
RUN addgroup --gid ${GID} ${USERNAME} && \
21+
adduser --disabled-password --uid ${UID} --gid ${GID} ${USERNAME}
22+
23+
COPY docs /docs/docs
24+
COPY mkdocs.yaml /docs/mkdocs.yaml
25+
# -- set working dir
26+
WORKDIR /docs
27+
28+
# -- run as user
29+
USER ${USERNAME}
30+
31+
EXPOSE 8000
32+
CMD ["mkdocs", "serve", "-a", "0.0.0.0:8000"]
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
moniker = "test-0"
2+
execution_authrpc_address = "http://<RETH_IP>:8545"
3+
engine_authrpc_address = "http://<RETH_IP>:8551"
4+
jwt_token_path = "/home/emerald/jwt"
5+
el_node_type = "archive"
6+
sync_timeout_ms = 1000000
7+
sync_initial_delay_ms = 100
8+
9+
max_retain_blocks = 0
10+
prune_at_block_interval = 5
11+
12+
[retry_config]
13+
initial_delay = "100ms"
14+
max_delay = "5s"
15+
max_elapsed_time = "30s"
16+
multiplier = 2.0
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
[Unit]
2+
Description=Emerald Consensus Engine (Malachite BFT)
3+
Wants=network-online.target
4+
5+
[Service]
6+
Type=simple
7+
User=emerald
8+
Group=emerald
9+
10+
# Working directory
11+
WorkingDirectory=/home/emerald
12+
13+
# Environment
14+
Environment="RUST_LOG=info"
15+
Environment="RUST_BACKTRACE=1"
16+
17+
# Start Emerald node
18+
ExecStart=/usr/local/bin/emerald start \
19+
--home /var/lib/emerald/node0
20+
ExecStart=/usr/local/bin/emerald start \
21+
--home /home/emerald/.emerald \
22+
--config /home/emerald/.emerald/config/emerald.toml \
23+
--log-level info
24+
25+
# Restart configuration
26+
Restart=on-failure
27+
RestartSec=10s
28+
TimeoutStopSec=30s
29+
KillMode=process
30+
KillSignal=SIGTERM
31+
32+
[Install]
33+
WantedBy=multi-user.target

0 commit comments

Comments
 (0)