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

Improve docs clarity and usability #1857

Merged
merged 49 commits into from
May 21, 2024
Merged
Show file tree
Hide file tree
Changes from 47 commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
d2a7f9e
update README, organise versioning
LordGhostX May 2, 2024
d0135f9
upgrade Docusaurus to v3
LordGhostX May 2, 2024
afe1925
add search bar
LordGhostX May 2, 2024
7f9ca61
remove autogenerated sidebars
LordGhostX May 2, 2024
f87a570
resolve versioned sidebars
LordGhostX May 2, 2024
ccf3144
revamp configuration page
LordGhostX May 2, 2024
d858c18
update font to DM Sans
LordGhostX May 2, 2024
198fab3
add configuration options table generator
LordGhostX May 3, 2024
9ac8f2d
update footer
LordGhostX May 3, 2024
a8340e9
config arrangements
LordGhostX May 3, 2024
d8a632b
revamp snapshots guide
LordGhostX May 6, 2024
b3295fa
revamp requirements guide
LordGhostX May 6, 2024
a66f3d1
add environment variables steps
LordGhostX May 6, 2024
0f804bd
update docs sidebars
LordGhostX May 7, 2024
77498e6
revamp GCP guide
LordGhostX May 8, 2024
5b92c26
configure additional langs for prism
LordGhostX May 13, 2024
a492926
add initial FAQ
LordGhostX May 14, 2024
506fba1
add emoji to page headings
LordGhostX May 14, 2024
d76f510
update introduction guide
LordGhostX May 14, 2024
1229a20
add getting started guides
LordGhostX May 14, 2024
f83e067
add complete FAQ guide
LordGhostX May 14, 2024
a3b31df
add Docker running guide
LordGhostX May 14, 2024
49f6dac
add binaries running guide
LordGhostX May 14, 2024
d22c86b
add building from source running guide
LordGhostX May 14, 2024
ca77881
add updating docker guide
LordGhostX May 14, 2024
fdbb628
add updating binaries guide
LordGhostX May 14, 2024
06b37bd
add updating from source guide
LordGhostX May 14, 2024
f2dedb8
remove gRPC references
LordGhostX May 14, 2024
f3aa383
add guides to navbar
LordGhostX May 15, 2024
9213638
add API reference and request builder
LordGhostX May 15, 2024
b6439ed
add json-rpc guide
LordGhostX May 15, 2024
a2dcf99
add websocket guide
LordGhostX May 15, 2024
9938edc
add websocket testing guide
LordGhostX May 15, 2024
6869428
update snapshot to block 640855
LordGhostX May 15, 2024
52ef782
Merge branch 'main' into docs-revamp
LordGhostX May 15, 2024
4d98b70
Update README.md
LordGhostX May 15, 2024
acfca3d
add metrics visualisation guide
LordGhostX May 15, 2024
5133092
finish the monitoring docs
LordGhostX May 15, 2024
7cd5182
add loki guide
LordGhostX May 16, 2024
b6deac7
add grafana images
LordGhostX May 16, 2024
b39e652
update juno configs
LordGhostX May 17, 2024
353d1ec
add supported API versions
LordGhostX May 17, 2024
f27403c
optimise docs
LordGhostX May 19, 2024
096164a
add p2p guide intro
LordGhostX May 20, 2024
117fa93
improve guides card
LordGhostX May 20, 2024
b3ed4cc
update running snippet
LordGhostX May 20, 2024
b01e51e
add re-signing FAQ
LordGhostX May 20, 2024
d674f17
remove p2p guide from sidebars
LordGhostX May 21, 2024
05d8d2d
Merge branch 'main' into docs-revamp
LordGhostX May 21, 2024
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ Use the provided snapshots to quickly sync your Juno node with the current state
Fetch the snapshot from the provided URL:

```bash
wget -O juno_mainnet.tar https://juno-snapshots.nethermind.dev/mainnet/juno_mainnet_v0.9.3_519634.tar
wget -O juno_mainnet.tar https://juno-snapshots.nethermind.dev/mainnet/juno_mainnet_v0.11.7_640855.tar
```

2. **Prepare Directory**
Expand Down
41 changes: 29 additions & 12 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,44 @@
# Website
# Juno Documentation

This website is built using [Docusaurus 2](https://docusaurus.io/), a modern static website generator.
The Juno Documentation can be accessed at <https://juno.nethermind.io/> and is built using [Docusaurus](https://docusaurus.io/), a modern static website generator.

### Installation
## Installation

```
$ npm install
```bash
npm install
```

### Local Development
## Local Development

```
$ npm run start
```bash
npm run start # Run 'node generate-config.js' in the root directory to generate the Juno configuration options table
```

This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.

### Build
## Deployment

```bash
npm run build # Runs 'node generate-config.js' and then 'docusaurus build'
# The 'generate-config.js' script extracts Juno's configuration details and generates a table for the Configuring Juno guide
```
$ npm run build

This command generates static content into the `build` directory and can be served using any static contents hosting service. Deployment is handled using GitHub pages.

## Troubleshooting

Docusaurus depends heavily on caching to improve site performance. If you make changes that do not appear in the website, try clearing the cache by running:

```bash
npm run clear
```

This command generates static content into the `build` directory and can be served using any static contents hosting service.
## Versioning

To generate a new version of the documentation, run the following command:

```bash
npm run docusaurus docs:version <VERSION NAME>
```

Deployment is handled using GitHub pages.
To view versions of the documentation that have not yet been released, visit `http://localhost:3000/next/`.
48 changes: 48 additions & 0 deletions docs/docs/_config-options.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<!-- This file is generated automatically. Any manual modifications will be overwritten. -->

| Config Option | Default Value | Description |
| - | - | - |
| `cn-core-contract-address` | | Custom network core contract address |
| `cn-feeder-url` | | Custom network feeder URL |
| `cn-gateway-url` | | Custom network gateway URL |
| `cn-l1-chain-id` | | Custom network L1 chain id |
| `cn-l2-chain-id` | | Custom network L2 chain id |
| `cn-name` | | Custom network name |
| `cn-unverifiable-range` | `[]` | Custom network range of blocks to skip hash verifications (e.g. `0,100`) |
| `colour` | `true` | Use `--colour=false` command to disable colourized outputs (ANSI Escape Codes) |
| `config` | | The YAML configuration file |
| `db-cache-size` | `8` | Determines the amount of memory (in megabytes) allocated for caching data in the database |
| `db-max-handles` | `1024` | A soft limit on the number of open files that can be used by the DB |
| `db-path` | `juno` | Location of the database files |
| `eth-node` | | WebSocket endpoint of the Ethereum node. To verify the correctness of the L2 chain, Juno must connect to an Ethereum node and parse events in the Starknet contract |
| `grpc` | `false` | Enable the HTTP gRPC server on the default port |
| `grpc-host` | `localhost` | The interface on which the gRPC server will listen for requests |
| `grpc-port` | `6064` | The port on which the gRPC server will listen for requests |
| `gw-api-key` | | API key for gateway endpoints to avoid throttling |
| `gw-timeout` | `5` | Timeout for requests made to the gateway |
| `http` | `false` | Enables the HTTP RPC server on the default port and interface |
| `http-host` | `localhost` | The interface on which the HTTP RPC server will listen for requests |
| `http-port` | `6060` | The port on which the HTTP server will listen for requests |
| `log-level` | `info` | Options: trace, debug, info, warn, error |
| `max-vm-queue` | | Maximum number for requests to queue after reaching max-vms before starting to reject incoming requests. Default is set to double the value of `max-vms` |
| `max-vms` | | Maximum number for VM instances to be used for RPC calls concurrently. Default is set to three times the number of CPU cores |
| `metrics` | `false` | Enables the Prometheus metrics endpoint on the default port |
| `metrics-host` | `localhost` | The interface on which the Prometheus endpoint will listen for requests |
| `metrics-port` | `9090` | The port on which the Prometheus endpoint will listen for requests |
| `network` | `mainnet` | Options: mainnet, sepolia, sepolia-integration |
| `p2p` | `false` | EXPERIMENTAL: Enables p2p server |
| `p2p-addr` | | EXPERIMENTAL: Specify p2p source address as multiaddr |
| `p2p-feeder-node` | `false` | EXPERIMENTAL: Run juno as a feeder node which will only sync from feeder gateway and gossip the new blocks to the network |
| `p2p-peers` | | EXPERIMENTAL: Specify list of p2p peers split by a comma. These peers can be either Feeder or regular nodes |
| `p2p-private-key` | | EXPERIMENTAL: Hexadecimal representation of a private key on the Ed25519 elliptic curve |
| `pending-poll-interval` | `5` | Sets how frequently pending block will be updated (0s will disable fetching of pending block) |
| `pprof` | `false` | Enables the pprof endpoint on the default port |
| `pprof-host` | `localhost` | The interface on which the pprof HTTP server will listen for requests |
| `pprof-port` | `6062` | The port on which the pprof HTTP server will listen for requests |
| `remote-db` | | gRPC URL of a remote Juno node |
| `rpc-call-max-steps` | `4000000` | Maximum number of steps to be executed in starknet_call requests |
| `rpc-cors-enable` | `false` | Enable CORS on RPC endpoints |
| `rpc-max-block-scan` | `18446744073709551615` | Maximum number of blocks scanned in single starknet_getEvents call |
| `ws` | `false` | Enables the WebSocket RPC server on the default port |
| `ws-host` | `localhost` | The interface on which the WebSocket RPC server will listen for requests |
| `ws-port` | `6061` | The port on which the WebSocket server will listen for requests |
102 changes: 102 additions & 0 deletions docs/docs/configuring.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
---
title: Configuring Juno
---

# Configuring Juno :gear:

Juno can be configured using several methods, with the following order of precedence:

1. [Command line parameters (flags)](#command-line-params)
2. [Environment variables](#environment-variables)
3. [Configuration file](#configuration-file)

## Command line params

Juno can be configured directly on the command line by prefixing `--` to each option name:

```bash
./build/juno --http --http-port 6060 --http-host 0.0.0.0
```

When using Docker, append the command line parameters after the image name to configure Juno:

```bash
docker run nethermind/juno --http --http-port 6060 --http-host 0.0.0.0
```

:::tip
Command line parameters override [environment variables](#environment-variables) and [configuration file](#configuration-file).
:::

## Environment variables

Juno can be configured through environment variables by prefixing the variable names with `JUNO_` and using the configuration options in [SCREAMING_SNAKE_CASE](https://en.wiktionary.org/wiki/screaming_snake_case) format.

To set the `http`, `http-port`, and `http-host` configurations, Juno should be run in this format:

```bash
JUNO_HTTP=true JUNO_HTTP_PORT=6060 JUNO_HTTP_HOST=0.0.0.0 ./build/juno
```

When using Docker, start Juno using the `-e` command option:

```bash
docker run \
-e "JUNO_HTTP=true JUNO_HTTP_PORT=6060 JUNO_HTTP_HOST=0.0.0.0" \
nethermind/juno
```

:::tip
Environment variables rank second in configuration precedence. [Command line parameters](#command-line-params) override environment variables.
:::

## Configuration file

Juno can be configured using a [YAML](https://en.wikipedia.org/wiki/YAML) file:

```yaml title="Sample YAML File" showLineNumbers
log-level: info
network: mainnet
http: true
http-port: 6060
metrics: true
metrics-port: 9090
```

To run Juno with a configuration file, use the `config` option to specify the path of the configuration file:

```bash
# Standalone binary
./build/juno --config <CONFIG FILE PATH>

# Docker container
docker run nethermind/juno --config <CONFIG FILE PATH>
```

:::info
By default, Juno looks for the configuration file in the `$XDG_CONFIG_HOME` directory.
:::

:::tip
Configuration file rank third in configuration precedence. [Command line parameters](#command-line-params) and [environment variables](#environment-variables) override configuration file.
:::

## Configuration options

To list all available command line options, you can use the `--help` parameter:

```bash
# Standalone binary
./build/juno --help

# Docker container
docker run nethermind/juno --help
```

Below is a list of all configuration options available in Juno, along with their default values and descriptions:

```mdx-code-block
import ConfigOptions from "./_config-options.md";

<ConfigOptions />
```
64 changes: 0 additions & 64 deletions docs/docs/example_config.md

This file was deleted.

Loading
Loading