Skip to content

Commit

Permalink
add world.toml explanation docs
Browse files Browse the repository at this point in the history
  • Loading branch information
zulkhair committed Oct 23, 2024
1 parent 5b45feb commit 435fa6d
Show file tree
Hide file tree
Showing 5 changed files with 316 additions and 1 deletion.
128 changes: 128 additions & 0 deletions docs/cardinal/game/configuration/cardinal.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
---
title: 'Cardinal'
description: 'This section configures Cardinal, which handles shard routing, logging, and rollup modes.'
---

```
[cardinal]
BASE_SHARD_ROUTER_KEY = string
BASE_SHARD_SEQUENCER_ADDRESS = string
CARDINAL_LOG_LEVEL = string
CARDINAL_LOG_PRETTY = boolean
CARDINAL_NAMESPACE = string
CARDINAL_ROLLUP_ENABLED = boolean
REDIS_ADDRESS = string
REDIS_PASSWORD = string
TELEMETRY_PROFILER_ENABLED = boolean
TELEMETRY_TRACE_ENABLED = boolean
```

### BASE_SHARD_ROUTER_KEY

A secure authentication token used for routing game shards. It ensures proper routing within the Cardinal system.

**Importance** : This value must be kept secure, as it is critical for shard operations.

**Example**
```
BASE_SHARD_ROUTER_KEY = 'e99e9ed8d90e593ec8ef86d6e9cbeb0de5aabfa415d2fd369d6ee1974dc2bb7d'
```

### BASE_SHARD_SEQUENCER_ADDRESS

The address of the sequencer service, which coordinates shard operations. If rollup mode is enabled, this address points to the sequencer handling transactions.

**Importance** : Required if Cardinal’s rollup mode is enabled.

**Example**
```
BASE_SHARD_SEQUENCER_ADDRESS = 'localhost:9601'
```

### CARDINAL_LOG_LEVEL

Sets the verbosity level of logging in Cardinal. The available levels are debug, info, warn, error, fatal, panic, disabled, and trace.

**Importance** : Determines the detail of logs generated, with info being the most commonly used level in production environments.

**Example**
```
CARDINAL_LOG_LEVEL = 'info'
```

### CARDINAL_LOG_PRETTY

When set to true, enables human-readable (pretty) logs for easier debugging. By default, it’s disabled to avoid a performance penalty.

**Importance** : Use for development and debugging, but disable in production for better performance.

**Example**
```
CARDINAL_LOG_PRETTY = true
```

### CARDINAL_NAMESPACE

A unique identifier for the Cardinal shard namespace. This ensures that different shards don’t interfere with each other and prevents signature replay attacks.

**Importance** : Must be unique per shard to maintain system security.

**Example**
```
CARDINAL_NAMESPACE = 'defaultnamespace'
```

### CARDINAL_ROLLUP_ENABLED

A unique identifier for the Cardinal shard namespace. This ensures that different shards don’t interfere with each other and prevents signature replay attacks.

**Importance** : Must be unique per shard to maintain system security.

**Example**
```
CARDINAL_ROLLUP_ENABLED = false
```

### REDIS_ADDRESS

The address of the Redis server

**Importance** : This parameter is unused if you are running cardinal using world cli v1.3.1

**Example**
```
REDIS_ADDRESS = 'localhost:6379'
```

### REDIS_PASSWORD

The password for the Redis server. Leave empty for no password.

**Importance** : Make sure to set this in production to secure your Redis instance. This parameter is unused if you are running cardinal using world cli v1.3.1

**Example**
```
REDIS_PASSWORD = ''
```

### TELEMETRY_PROFILER_ENABLED

Enables OpenTelemetry profiling, which collects performance data to help identify bottlenecks and inefficiencies.

**Importance** : Useful for performance monitoring and debugging in development environments.

**Example**
```
TELEMETRY_PROFILER_ENABLED = false
```

### TELEMETRY_TRACE_ENABLED

Enables Datadog trace profiling, allowing for continuous application monitoring and tracing.

**Importance** : Enable this in environments where you need detailed profiling of system performance.

**Example**
```
TELEMETRY_TRACE_ENABLED = false
```
18 changes: 18 additions & 0 deletions docs/cardinal/game/configuration/common.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
title: 'Common'
description: 'This section contains configuration options shared by Cardinal and EVM components.'
---

```
[common]
ROUTER_KEY = string
```

### ROUTER_KEY

A key used by both Cardinal and EVM to coordinate activities. This key ensures both systems are synchronized when handling routing operations.

**Example**
```
ROUTER_KEY = 'e99e9ed8d90e593ec8ef86d6e9cbeb0de5aabfa415d2fd369d6ee1974dc2bb7d'
```
104 changes: 104 additions & 0 deletions docs/cardinal/game/configuration/evm.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
---
title: 'EVM'
description: 'This section configures the Ethereum Virtual Machine (EVM) settings, including chain IDs, mnemonics, and faucet configurations.'
---

```
[evm]
CHAIN_ID = string
CHAIN_KEY_MNEMONIC = string
DA_AUTH_TOKEN = string
DA_BASE_URL = string
DA_NAMESPACE_ID = string
FAUCET_ADDRESS = string
FAUCET_AMOUNT = string
FAUCET_ENABLED = boolean
```

### CHAIN_ID

A unique identifier representing the blockchain network. This is critical for identifying the correct chain to which the EVM is connected.

**Importance** : Must be set to the correct chain ID to ensure proper blockchain communication.

**Example**
```
CHAIN_ID = 'world-420'
```

### CHAIN_KEY_MNEMONIC

Mnemonic phrases, also known as seed phrases or recovery phrases, used for generating cryptographic keys for your blockchain wallet.

**Importance** : These should be stored securely, as they are used to recover the wallet.

**Example**
```
CHAIN_KEY_MNEMONIC = 'enact adjust liberty squirrel bulk ticket invest tissue antique window thank slam unknown fury script among bread social switch glide wool clog flag enroll'
```

### DA_AUTH_TOKEN

An authentication token obtained from the Celestia client, which is used to interact with Celestia’s Data Availability layer.

**Importance** : Required for secure communication with the Celestia client.

**Example**
```
DA_AUTH_TOKEN = 'ywi27664820'
```

### DA_BASE_URL

The base URL for the Celestia client, which connects the EVM to Celestia’s Data Availability (DA) network.

**Importance** : Must be set correctly to ensure successful communication with the DA network.

**Example**
```
DA_BASE_URL = 'http://celestia-devnet'
```

### DA_NAMESPACE_ID

The namespace ID for the Celestia client. This is used to separate data within the DA layer.

**Importance** : Each namespace should be unique to properly segment data.

**Example**
```
DA_NAMESPACE_ID = '67480c4a88c4d12935d4'
```

### FAUCET_ADDRESS

The Ethereum address (without the leading 0x) to which the faucet sends tokens. This address will receive tokens when the faucet is enabled.

**Importance** : Ensure this is correctly set when using the faucet for testing or gameplay purposes.

**Example**
```
FAUCET_ADDRESS = 'aa9288F88233Eb887d194fF2215Cf1776a6FEE41'
```

### FAUCET_AMOUNT

The amount of ETH, expressed in wei (the smallest unit of ETH), to be distributed by the faucet. This value is encoded as a hexadecimal.

**Importance** : Defines the token distribution when the faucet is enabled.

**Example**
```
FAUCET_AMOUNT = '0x56BC75E2D6310000' # 100 ETH
```

### FAUCET_ENABLED

Enables or disables the faucet feature, which automatically distributes tokens to the specified address.

**Importance** : Set this to true for testing or development environments where token distribution is needed.

**Example**
```
FAUCET_ENABLED = false
```
56 changes: 56 additions & 0 deletions docs/cardinal/game/configuration/nakama.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
---
title: 'Nakama'
description: 'This section configures Nakama, including allowlist, metrics, and tracing settings.'
---

```
[nakama]
ENABLE_ALLOWLIST = boolean
OUTGOING_QUEUE_SIZE = integer
NAKAMA_TRACE_ENABLED = boolean
NAKAMA_METRICS_ENABLED = boolean
```

### ENABLE_ALLOWLIST

Enables Nakama’s allowlist feature, which allows for beta keys. This is useful for restricted access to certain parts of the game during development or early access.

**Importance** : Set this to true if you plan to use Nakama’s beta key system.

**Example**
```
ENABLE_ALLOWLIST = 'false'
```

### OUTGOING_QUEUE_SIZE

Specifies the maximum number of undelivered notifications Nakama will allow before shutting down a client connection.

**Importance** : Helps control load by limiting the number of queued notifications.

**Example**
```
OUTGOING_QUEUE_SIZE = 64
```

### NAKAMA_TRACE_ENABLED

Enables tracing within Nakama, which integrates with external tracing tools such as Jaeger for visualizing system performance.

**Importance** : Useful for performance monitoring and debugging.

**Example**
```
NAKAMA_TRACE_ENABLED = true
```

### NAKAMA_METRICS_ENABLED

Enables metrics collection within Nakama, integrating with Prometheus for system metrics tracking.

**Importance** : Critical for monitoring system health and performance over time.

**Example**
```
NAKAMA_METRICS_ENABLED = true
```
11 changes: 10 additions & 1 deletion docs/mint.json
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,16 @@
"cardinal/game/query",
"cardinal/game/cql",
"cardinal/game/evm",
"cardinal/game/persona"
"cardinal/game/persona",
{
"group": "Configurations (world.toml)",
"pages": [
"cardinal/game/configuration/cardinal",
"cardinal/game/configuration/evm",
"cardinal/game/configuration/common",
"cardinal/game/configuration/nakama"
]
}
]
},
{
Expand Down

0 comments on commit 435fa6d

Please sign in to comment.