From 6c9a0fdf25b5baa23d7f5552cbde5f77f866b9c0 Mon Sep 17 00:00:00 2001 From: Zulkhair Abdullah Daim Date: Wed, 23 Oct 2024 20:00:36 +0700 Subject: [PATCH] add world.toml explanation docs --- docs/cardinal/game/configuration/cardinal.mdx | 111 ++++++++++++++++++ docs/cardinal/game/configuration/evm.mdx | 89 ++++++++++++++ docs/cardinal/game/configuration/nakama.mdx | 68 +++++++++++ docs/mint.json | 10 +- 4 files changed, 277 insertions(+), 1 deletion(-) create mode 100644 docs/cardinal/game/configuration/cardinal.mdx create mode 100644 docs/cardinal/game/configuration/evm.mdx create mode 100644 docs/cardinal/game/configuration/nakama.mdx diff --git a/docs/cardinal/game/configuration/cardinal.mdx b/docs/cardinal/game/configuration/cardinal.mdx new file mode 100644 index 000000000..675c4450c --- /dev/null +++ b/docs/cardinal/game/configuration/cardinal.mdx @@ -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 +``` \ No newline at end of file diff --git a/docs/cardinal/game/configuration/evm.mdx b/docs/cardinal/game/configuration/evm.mdx new file mode 100644 index 000000000..30ebc9a52 --- /dev/null +++ b/docs/cardinal/game/configuration/evm.mdx @@ -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 +``` \ No newline at end of file diff --git a/docs/cardinal/game/configuration/nakama.mdx b/docs/cardinal/game/configuration/nakama.mdx new file mode 100644 index 000000000..3233e5aa7 --- /dev/null +++ b/docs/cardinal/game/configuration/nakama.mdx @@ -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 +``` \ No newline at end of file diff --git a/docs/mint.json b/docs/mint.json index b3f46c9b9..908accd59 100644 --- a/docs/mint.json +++ b/docs/mint.json @@ -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" + ] + } ] }, {