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 25, 2024
1 parent 5b45feb commit 6c9a0fd
Show file tree
Hide file tree
Showing 4 changed files with 277 additions and 1 deletion.
111 changes: 111 additions & 0 deletions docs/cardinal/game/configuration/cardinal.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
---
title: 'Cardinal'
description: 'This section configures Cardinal, which handles shard routing, logging, and rollup modes.'
---

```
[cardinal]
BASE_SHARD_ROUTER_KEY = "router_key"
BASE_SHARD_SEQUENCER_ADDRESS = "localhost:9601"
CARDINAL_LOG_LEVEL = "log_level"
CARDINAL_LOG_PRETTY = false
CARDINAL_NAMESPACE = "defaultnamespace"
CARDINAL_ROLLUP_ENABLED = false
REDIS_ADDRESS = "localhost:6379"
REDIS_PASSWORD = "redis_password"
TELEMETRY_PROFILER_ENABLED = false
TELEMETRY_TRACE_ENABLED = false
```

### BASE_SHARD_ROUTER_KEY

A secure authentication token used for routing game shards. It ensures proper routing within the Cardinal system.
Router key must be length 64 and only contain alphanumerics.

**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.
**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 (`trace`, `debug`, `info`, `warn`, `error`, `fatal`, `panic`, `disabled`)

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

### CARDINAL_LOG_PRETTY

When set to true, enables human-readable (pretty) logs for easier debugging, the default value is false.

**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.

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

### CARDINAL_ROLLUP_ENABLED

Enables or disables rollup mode, where Cardinal sequences and recovers transactions on the base shard, default value is false.

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

### REDIS_ADDRESS

The address of the Redis server, this parameter is unused if you are running cardinal using world cli v1.3.1, because world cli will force you to use local redis container

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

### REDIS_PASSWORD

The password for the Redis server. Leave empty for no password.
Make sure to set this in production to secure your Redis instance.

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

### TELEMETRY_PROFILER_ENABLED

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

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

### TELEMETRY_TRACE_ENABLED

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

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

```
[evm]
CHAIN_ID = "chain_id"
CHAIN_KEY_MNEMONIC = "chain_key_mnemonic"
DA_AUTH_TOKEN = "da_auth_token"
DA_BASE_URL = "http://celestia-devnet"
DA_NAMESPACE_ID = "defaultnamespace"
FAUCET_ADDRESS = "faucet_address"
FAUCET_AMOUNT = "0x56BC75E2D6310000" # 100 ETH
FAUCET_ENABLED = false
```

### CHAIN_ID

A unique identifier representing the blockchain network. This is critical for identifying the correct chain to which the EVM is connected.
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.

**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.

**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.

**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.

**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.

**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.

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

### FAUCET_ENABLED

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

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

```
[nakama]
ENABLE_ALLOWLIST = "false"
OUTGOING_QUEUE_SIZE = 64
NAKAMA_TRACE_ENABLED = true
NAKAMA_METRICS_ENABLED = true
NAKAMA_TRACE_SAMPLE_RATE = 0.6
NAKAMA_METRICS_INTERVAL = 30
```

### 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.

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

### OUTGOING_QUEUE_SIZE

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

**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.

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

### NAKAMA_METRICS_ENABLED

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

**Example**
```
NAKAMA_METRICS_ENABLED = true
```

### NAKAMA_TRACE_SAMPLE_RATE

Trace sample rate. valid values are between 0.0 to 1.0 inclusive. This is a float value.

**Example**
```
NAKAMA_TRACE_SAMPLE_RATE = 0.6
```

### NAKAMA_METRICS_INTERVAL

Prometheus scraping interval in seconds.

**Example**
```
NAKAMA_METRICS_INTERVAL = 30
```
10 changes: 9 additions & 1 deletion docs/mint.json
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,15 @@
"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/nakama"
]
}
]
},
{
Expand Down

0 comments on commit 6c9a0fd

Please sign in to comment.