{"id":24614068,"url":"https://github.com/atoma-network/atoma-node","last_synced_at":"2025-10-06T06:30:48.833Z","repository":{"id":251194333,"uuid":"773065590","full_name":"atoma-network/atoma-node","owner":"atoma-network","description":"Welcome to the compute digital revolution! Here, you'll discover everything you need to deploy an Atoma node and join the future of decentralized AI.","archived":false,"fork":false,"pushed_at":"2025-01-23T11:56:33.000Z","size":4413,"stargazers_count":23,"open_issues_count":17,"forks_count":5,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-23T12:29:57.412Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/atoma-network.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-03-16T16:45:08.000Z","updated_at":"2025-01-23T11:56:37.000Z","dependencies_parsed_at":"2024-11-11T00:20:05.598Z","dependency_job_id":"7a48bdbf-cf71-47f3-a8b9-7455b7f40bb1","html_url":"https://github.com/atoma-network/atoma-node","commit_stats":null,"previous_names":["atoma-network/atoma-node"],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atoma-network%2Fatoma-node","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atoma-network%2Fatoma-node/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atoma-network%2Fatoma-node/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atoma-network%2Fatoma-node/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/atoma-network","download_url":"https://codeload.github.com/atoma-network/atoma-node/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":235503998,"owners_count":19000704,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-01-24T21:02:17.156Z","updated_at":"2025-10-06T06:30:48.819Z","avatar_url":"https://github.com/atoma-network.png","language":"Rust","funding_links":[],"categories":["Rust"],"sub_categories":[],"readme":"# Atoma Node Infrastructure\n\n![Atoma Banner](https://github.com/atoma-network/atoma-node/blob/ja-update-banners/atoma-assets/atoma-banner.png)\n\n[![Discord](https://img.shields.io/discord/1172593757586214964?label=Discord\u0026logo=discord\u0026logoColor=white)](https://discord.com/channels/1172593757586214964/1258484557083054081)\n[![Twitter](https://img.shields.io/twitter/follow/Atoma_Network?style=social)](https://x.com/Atoma_Network)\n[![Documentation](https://img.shields.io/badge/docs-mintify-blue?logo=mintify)](https://docs.atoma.network)\n[![License](https://img.shields.io/github/license/atoma-network/atoma-node)](LICENSE)\n\n## Introduction\n\nAtoma is a decentralized cloud compute network for AI that enables:\n\n- **Verifiable Compute**: Transparent and trustworthy AI model execution, for both inference, text embeddings, multi-modality, etc, through Atoma's novel Sampling Consensus algorithm (see Atoma's [whitepaper](https://github.com/atoma-network/atoma-docs/blob/main/papers/atoma_whitepaper.pdf))\n- **Private Inference**: Secure processing with strong privacy guarantees, through the use of secure hardware enclaves (see [Atoma's confidential compute paper](https://arxiv.org/abs/2410.13752))\n- **Decentralized Infrastructure**: A permissionless network of compute nodes, orchestrated by Atoma's smart contract on the Sui blockchain (see [repo](https://github.com/atoma-network/atoma-contracts)). It includes payments, request authentication, load balancing, and more\n- **Governance**: Atoma's governance is fully decentralized, with all the network participants being able to vote on the future of the network.\n- **LLM Focus**: Specialized in serving Large Language Models compute, through a fully compatible OpenAI API.\n- **Application Layer**: Atoma's node software is designed to be modular and easy to integrate with other AI services. In particular, you can build any AI application at scale, through the Atoma's API. This includes AI agents, chatbots, image generation applications, personal assistants, etc. All of these applications can leverage the best in class open source LLM models, offering full data privacy and security to the end user.\n\nThis repository contains the node software that enables node operators to participate in the Atoma Network. By running an Atoma node, you can:\n\n1. Contribute with your hardware to provide computing power to the network;\n2. Earn rewards for processing AI workloads;\n3. Help build a more accessible and democratic AI infrastructure.\n\n### Community Links\n\n- 🌐 [Official Website](https://www.atoma.network)\n- 📖 [Documentation](https://atoma.gitbook.io/atoma-docs)\n- 🐦 [Twitter](https://x.com/Atoma_Network)\n- 💬 [Discord](https://discord.com/channels/1172593757586214964/1258484557083054081)\n\n## Spawn an Atoma Node\n\n### Install the Sui client locally\n\nThe first step in setting up an Atoma node is installing the Sui client locally. Please refer to the [Sui installation guide](https://docs.sui.io/build/install) for more information.\n\nOnce you have the Sui client installed, locally, you need to connect to a Sui RPC node to be able to interact with the Sui blockchain and therefore the Atoma smart contract. Please refer to the [Connect to a Sui Network guide](https://docs.sui.io/guides/developer/getting-started/connect) for more information.\n\nYou then need to create a wallet and fund it with some testnet SUI. Please refer to the [Sui wallet guide](https://docs.sui.io/guides/developer/getting-started/get-address) for more information. If you plan to run the Atoma node on Sui's testnet, you can request testnet SUI tokens by following the [docs](https://docs.sui.io/guides/developer/getting-started/get-coins).\n\n### Register with the Atoma Testnet smart contract\n\nPlease refer to the [setup script](https://github.com/atoma-network/atoma-contracts/blob/main/sui/dev/setup.py) to register with the Atoma Testnet smart contract. This will assign you a node badge and a package ID, which you'll need to configure in the `config.toml` file.\n\n### Docker Deployment\n\n#### Prerequisites\n\n- Docker and Docker Compose (\u003e= v2.22) installed\n- NVIDIA Container Toolkit installed (for GPU support)\n- Access to HuggingFace models (and token if using gated models)\n- Sui wallet configuration\n\n#### Quickstart\n\n1. Clone the repository\n\n```bash\ngit clone https://github.com/atoma-network/atoma-node.git\ncd atoma-node\n```\n\n1. Configure environment variables by creating `.env` file, you'll need a hugging face token use `.env.example` for reference:\n\n```bash\n# Hugging Face Configuration\nHF_CACHE_PATH=~/.cache/huggingface\nHF_TOKEN=   # Required for gated models\n\n# Inference Server Configuration\nINFERENCE_SERVER_PORT=50000    # External port for vLLM service\nMODEL=meta-llama/Llama-3.1-70B-Instruct\nMAX_MODEL_LEN=4096            # Context length\nGPU_COUNT=1                   # Number of GPUs to use\nTENSOR_PARALLEL_SIZE=1        # Should be equal to GPU_COUNT\n\n# Sui Configuration\nSUI_CONFIG_PATH=~/.sui/sui_config\n\n# Atoma Node Service Configuration\nATOMA_SERVICE_PORT=3000       # External port for Atoma service\n```\n\n3. Configure `config.toml`, using `config.example.toml` as template:\n\n```toml\n[atoma_service]\nchat_completions_service_urls = { \"meta-llama/Llama-3.2-3B-Instruct\" = \"http://chat-completions:8000\"}\nembeddings_service_url = \"http://embeddings:80\"\nimage_generations_service_url = \"http://image-generations:80\"\n# List of models to be used by the service, the current value here is just a placeholder, please change it to the models you want to deploy\nmodels = [\"meta-llama/Llama-3.2-3B-Instruct\"]\nrevisions = [\"main\"]\nservice_bind_address = \"0.0.0.0:3000\"\n\n[atoma_sui]\nhttp_rpc_node_addr = \"https://fullnode.testnet.sui.io:443\"                              # Current RPC node address for testnet\natoma_db = \"0x02920289f426dd1f3c2572d613f7dc92be95041720864a73d44d65585530efc5\"         # Current ATOMA DB object ID for testnet\natoma_package_id = \"0x8903298ba49a8e83d438e014b2cfd18404324f3a0274b9507b520d5745b85208\" # Current ATOMA package ID for testnet\nusdc_package_id = \"0xa1ec7fc00a6f40db9693ad1415d0c193ad3906494428cf252621037bd7117e29\"  # Current USDC package ID for testnet\nrequest_timeout = { secs = 300, nanos = 0 }                                             # Some reference value\nmax_concurrent_requests = 10                                                            # Some reference value\nlimit = 100                                                                             # Some reference value\nnode_small_ids = [1]                                                                    # List of node IDs under control of the node wallet\nsui_config_path = \"/root/.sui/sui_config/client.yaml\"                                   # Path to the Sui client configuration file, accessed from the docker container (if this is not the case, pass in the full path, on your host machine which is by default ~/.sui/sui_config/client.yaml)\nsui_keystore_path = \"/root/.sui/sui_config/sui.keystore\"                                # Path to the Sui keystore file, accessed from the docker container (if this is not the case, pass in the full path, on your host machine which is by default ~/.sui/sui_config/sui.keystore)\ncursor_path = \"./cursor.toml\"                                                           # Path to the Sui events cursor file\n\n[atoma_state]\n# Path inside the container\n# Replace the placeholder values with the ones for your local environment (in the .env file)\ndatabase_url = \"postgres://\u003cPOSTGRES_USER\u003e:\u003cPOSTGRES_PASSWORD\u003e@postgres-db:5432/\u003cPOSTGRES_DB\u003e\"\n\n[atoma_daemon]\n# WARN: Do not expose this port to the public internet, as it is used only for internal communication between the Atoma Node and the Atoma Network\nservice_bind_address = \"0.0.0.0:3001\"\n# Replace the placeholder values with the actual node badge and small ID assigned by the Atoma's smart contract, upon node registration\nnode_badges = [\n    [\n        \"\u003cNODE_BADGE_ID\u003e\",\n        \u003cNODE_SMALL_ID\u003e,\n    ],\n] # List of node badges, where each badge is a tuple of (badge_id, small_id), both values are assigned once the node registers itself\n\n[atoma_p2p]\n# Interval for sending heartbeat messages to peers (in seconds)\nheartbeat_interval = { secs = 30, nanos = 0 }\n# Maximum duration a connection can remain idle before closing (in seconds)\nidle_connection_timeout = { secs = 60, nanos = 0 }\n# Address to listen for incoming QUIC connections (format: \"/ip4/x.x.x.x/udp/x\")\n# Address to listen for incoming QUIC connections (format: \"/ip4/x.x.x.x/udp/x\")\nlisten_addrs = [\n    \"/ip4/0.0.0.0/tcp/4001\",\n    \"/ip4/0.0.0.0/udp/4001/quic-v1\",\n]\n# Node's small ID (assigned by Atoma smart contract)\nnode_small_id = 1\n# The HTTP(s) public URL of the node, that it can be reached to perform LLM inference,\npublic_url = \"https://\u003cPUBLIC_URL\u003e\"\n# required, replace this with the country (ISO 3166-1 alpha-2) of the node (https://www.iso.org/obp/ui/#search/code/\ncountry = \"\"\n# List of endpoints serving metrics to collect, in the form of a map of model name to a tuple of (serving_engine, metrics_endpoint)\n# (e.g. `\"meta-llama/Llama-3.2-3B-Instruct\" = (\"vllm\", \"http://chat-completions:8000/metrics\")`)\nmetrics_endpoints = { \"meta-llama/Llama-3.2-3B-Instruct\" = [\"vllm\", \"http://chat-completions:8000/metrics\"] }\n```\n\n1. Create required directories\n\n```bash\nmkdir -p data logs\n```\n\n1. Start the containers with the desired inference services, please note if you don't have a GPU, you'll need to use the you will need to use a `vllm_cpu`  backend, but these are only compatible with  `x86_64` architectures. Otherwise we recommend using the `mistral` for CPUs.\n\nWe currently support the following inference services:\n\n##### Chat Completions\n\n| Backend                                                  | Architecture/Platform | Docker Compose Profile           |\n| -------------------------------------------------------- | --------------------- | -------------------------------- |\n| [vLLM](https://github.com/vllm-project/vllm)             | CUDA                  | `chat_completions_vllm`          |\n| [vLLM](https://github.com/vllm-project/vllm)             | x86_64                | `chat_completions_vllm_cpu`      |\n| [vLLM](https://github.com/vllm-project/vllm)             | ROCm                  | `chat_completions_vllm_rocm`     |\n| [mistral.rs](https://github.com/EricLBuehler/mistral.rs) | x86_64, aarch64       | `chat_completions_mistralrs_cpu` |\n\n##### Embeddings\n\n| Backend                                                                               | Architecture/Platform | Docker Compose Profile |\n| ------------------------------------------------------------------------------------- | --------------------- | ---------------------- |\n| [Text Embeddings Inference](https://github.com/huggingface/text-embeddings-inference) | CUDA                  | `embeddings_tei`       |\n\n##### Image Generations\n\n| Backend                                                  | Architecture/Platform | Docker Compose Profile        |\n| -------------------------------------------------------- | --------------------- | ----------------------------- |\n| [mistral.rs](https://github.com/EricLBuehler/mistral.rs) | CUDA                  | `image_generations_mistralrs` |\n\nAlso please note that if you are on an ARM64 architecture, you need to set the `PLATFORM=linux/arm64` environment variable and then run the `docker compose up` command.\n\n```bash\n# Build and start all services\nCOMPOSE_PROFILES=chat_completions_vllm,embeddings_tei,image_generations_mistralrs  docker compose up --build\n\n# Build and start without nvidia runtime\nCOMPOSE_PROFILES=vllm-cpu,no-gpu docker compose up --build\n\n# Only start one service\nCOMPOSE_PROFILES=chat_completions_vllm docker compose up --build\n\n# Run in detached mode\nCOMPOSE_PROFILES=chat_completions_vllm,embeddings_tei,image_generations_mistralrs docker compose up -d --build\n```\n\nThe deployment defaults to `info` level logs, in order to change the log level upon deployment, you can run set the `ATOMA_LOG_LEVELS` env variable at runtime.\n\n```bash\nATOMA_LOG_LEVELS=atoma_p2p=info,debug docker compose up -d --build\n```\n\nSome examples for the `ATOMA_LOG_LEVELS`\n- `info,atoma_p2p=off,libp2p_mdns=off,opentelemetry_sdk=off,quinn_udp=off,tracing_loki=off` - no p2p/metrics logs\n- `info,sqlx=debug` for showing the sql queries\n\n#### Container Architecture\n\nThe deployment consists of two main services:\n\n- **LLM Inference Service**: Handles the AI model inference\n- **Atoma Node**: Manages the node operations and connects to the Atoma Network\n\n#### Service URLs\nAtoma Node: `http://localhost:3000` (configured via ATOMA_SERVICE_PORT). You are free to change the port to any other available port, as long as it is not already in use by another service. Moreover, in order for your node to be accessible by the Atoma Network, you need to make sure that the port is open to the public internet, through your router's firewall and NAT configuration. Moreover, it is recommended to use a static IP address for your node, in order to avoid having to reconfigure your router's NAT table every time you restart your node. The Atoma Node service handles all the required authentication and authorization for the LLM Inference Service, ensuring that only authenticated (and already paid for) requests are processed.\n\n\n#### Volume Mounts\n\n- HuggingFace cache: `~/.cache/huggingface:/root/.cache/huggingface`\n- Sui configuration: `~/.sui/sui_config:/root/.sui/sui_config`\n- Logs: `./logs:/app/logs`\n- PostgreSQL database: `./data:/app/data`\n\n#### Managing the Deployment\n\nCheck service status:\n\n```bash\ndocker compose ps\n```\n\nView logs:\n\n```bash\n# All services\ndocker compose logs\n\n# Specific service\ndocker compose logs atoma-node-no-nvidia-1 # No nvidia run\ndocker compose logs atoma-node-1 #  Nvidia runtime\ndocker compose logs vllm # vLLM service\n\n# Follow logs\ndocker compose logs -f\n```\n\nStop services:\n\n```bash\ndocker compose down\n```\n\n#### Troubleshooting\n\n1. Check if services are running:\n\n```bash\ndocker compose ps\n```\n\n1. Test vLLM service:\n\n```bash\ncurl http://localhost:50000/health\n```\n\n1. Test Atoma Node service:\n\n```bash\ncurl http://localhost:3000/health\n```\n\n1. Check GPU availability:\n\n```bash\ndocker compose exec vllm nvidia-smi\n```\n\n1. View container networks:\n\n```bash\ndocker network ls\ndocker network inspect atoma-network\n```\n\n#### Security Considerations\n\n1. Firewall Configuration\n\n```bash\n# Allow Atoma service port\nsudo ufw allow 3000/tcp\n\n# Allow Atoma p2p service port\nsudo ufw allow 4001/tcp\n```\n\nWe suggest to not expose the underlying inference backend service (e.g. vLLM, TEI, etc) to the exterior, as it could lead\nto serve AI inference requests without being authorized directly via the Atoma node middleware (which will lead to possible serving non-paid requests).\n\n1. HuggingFace Token\n\n- Store HF_TOKEN in .env file\n- Never commit .env file to version control\n- Consider using Docker secrets for production deployments\n\n1. Sui Configuration\n\n- Ensure Sui configuration files have appropriate permissions\n- Keep keystore file secure and never commit to version control\n\n### Testing\n\nSince the `AtomaStateManager` instance relies on a PostgreSQL database, we need to have a local instance running to run the tests. You can spawn one using the `docker-compose.test.yaml` file:\n\n```bash\ndocker compose -f docker-compose.test.yaml up --build -d\n```\n\nIt might be necessary that you clean up the database before or after running the tests. You can do so by running:\n\n```bash\ndocker compose -f docker-compose.test.yaml down\n```\n\nand remove the specific postgres volumes:\n\n```bash\ndocker system prune -af --volumes\n```\n\nNotice that by running the above commands you will lose all the data stored in the database.\n\n### Manual deployment\n\n#### 1. Installing Rust\n\nInstall Rust using rustup:\n\n```bash\ncurl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh\n```\n\nFollow the prompts and restart your terminal. Verify the installation:\n\n```bash\nrustc --version\ncargo --version\n```\n\n#### 2. Cloning the Repository\n\n```bash\ngit clone https://github.com/atoma-network/atoma-node.git\ncd atoma-node\n```\n\n#### 3. Configuring the Node\n\nThe application uses a TOML configuration file with the following sections:\n\n##### `[atoma_service]`\n\n- `chat_completions_service_urls`: Map of model names to endpoint URLs for the inference service (e.g., `{ \"meta-llama/Llama-3.2-3B-Instruct\" = \"http://chat-completions:8000\"}`)\n- `embeddings_service_url` (optional): Endpoint URL for the embeddings service\n- `image_generations_service_url` (optional): Endpoint URL for the image generations service\n- `models`: List of model names deployed by the Atoma Service\n- `revisions`: List of model revisions supported by the service\n- `service_bind_address`: Address and port for the Atoma Service to bind to\n\n##### `[atoma_sui]`\n\n- `http_rpc_node_addr`: HTTP URL for a Sui RPC node, that the Atoma Sui's subscriber will use to listen to events on the Sui network.\n- `atoma_db`: ObjectID for Atoma's DB on the Sui network\n- `atoma_package_id`: ObjectID for Atoma's package on the Sui network\n- `usdc_package_id`: ObjectID for USDC token package\n- `request_timeout` (optional): Duration for request timeouts\n- `max_concurrent_requests` (optional): Maximum number of concurrent Sui client requests\n- `limit` (optional): Limit for dynamic fields retrieval per event subscriber loop\n- `node_small_ids`: List of node small IDs controlled by the current Sui wallet. Node small IDs are assigned to each node upon registration on the Atoma's smart contract.\n- `task_small_ids`: List of task small IDs to which the current node is subscribed to. By default, it should be empty\n- `sui_config_path`: Path to the Sui configuration file\n- `sui_keystore_path`: Path to the Sui keystore file\n- `cursor_path`: Path to the Sui events cursor file\n\n##### `[atoma_state]`\n\n- `database_url`: PostgreSQL database connection URL\n\n##### `[atoma_daemon]`\n\n- `service_bind_address`: Address and port for the Atoma Daemon to bind to\n- `node_badges`: List of node badges, where each badge is a tuple of (badge_id, small_id)\n\n##### `[atoma_p2p]`\n\n- `heartbeat_interval`: Interval for sending heartbeat messages to peers (in seconds)\n- `idle_connection_timeout`: Maximum duration a connection can remain idle before closing (in seconds)\n- `listen_addrs`: Addresses to listen for incoming connections\n- `node_small_id`: Node's small ID (assigned by Atoma smart contract, upon registration)\n- `public_url`: The HTTP(s) public URL of the node\n- `country`: Country code of the node (ISO 3166-1 alpha-2)\n- `metrics_endpoints`: Map of model names to tuples of (serving_engine, metrics_endpoint)\n\n##### Example Configuration\n\n```toml\n[atoma-service]\nchat_completions_service_url = \"\u003cchat_completions_service_url\u003e\"\nembeddings_service_url = \"\u003cEMBEDDINGS_SERVICE_URL\u003e\"\nimage_generations_service_url = \"\u003cimage_generations_service_url\u003e\"\nmodels = [\"\u003cMODEL_1\u003e\", \"\u003cMODEL_2\u003e\"]\nrevisions = [\"\u003cREVISION_1\u003e\", \"\u003cREVISION_2\u003e\"]\nservice_bind_address = \"\u003cHOST\u003e:\u003cPORT\u003e\"\n\n[atoma-sui]\nhttp_rpc_node_addr = \"\u003cSUI_RPC_NODE_URL\u003e\"\natoma_db = \"\u003cATOMA_DB_OBJECT_ID\u003e\"\natoma_package_id = \"\u003cATOMA_PACKAGE_OBJECT_ID\u003e\"\ntoma_package_id = \"\u003cTOMA_PACKAGE_OBJECT_ID\u003e\"\nrequest_timeout = { secs = 300, nanos = 0 }\nmax_concurrent_requests = 10\nlimit = 100\nnode_small_ids = [0, 1, 2]  # List of node IDs under control\ntask_small_ids = []  # List of task IDs under control\nsui_config_path = \"\u003cPATH_TO_SUI_CONFIG\u003e\" # Example: \"~/.sui/sui_config/client.yaml\" (default)\nsui_keystore_path = \"\u003cPATH_TO_SUI_KEYSTORE\u003e\" # Example: \"~/.sui/sui_config/sui.keystore\" (default)\n\n[atoma-state]\n# Path inside the container\n# Replace the placeholder values with the ones for your local environment (in the .env file)\ndatabase_url = \"postgres://\u003cPOSTGRES_USER\u003e:\u003cPOSTGRES_PASSWORD\u003e@localhost:5432/\u003cPOSTGRES_DB\u003e\"\n```\n\n#### 4. Running the Atoma Node\n\nAfter configuring your node, you can run it using the following command:\n\n```bash\nRUST_LOG=debug cargo run --release --bin atoma-node -- \\\n  --config-path /path/to/config.toml\n```\n\nOr if you've built the binary:\n\n```bash\n./target/release/atoma-node \\\n  --config-path /path/to/config.toml\n```\n\nCommand line arguments:\n\n- `--config-path` (`-c`): Path to your TOML configuration file\n- `--address-index` (`-a`): Index of the address to use from the keystore (defaults to 0)\n\n#### 5. Spawn the background inference service\n\nWe currently support the following inference services:\n\n- [atoma-inference-service](https://github.com/atoma-network/atoma-inference-service)\n- [vLLM](https://github.com/vllm-project/vllm)\n\nPlease refer to the documentation of the inference service you want to use to spawn the service. Make sure to set the correct inference service URL in the Atoma Node configuration, above.\n\n#### 6. Managing Logs\n\nThe Atoma node uses a comprehensive logging system that writes to both console and files:\n\n##### Log Location\n\n- Logs are stored in the `./logs` directory\n- The main log file is named `atoma-node-service.log`\n- Logs rotate daily to prevent excessive file sizes\n\n##### Log Formats\n\n- **Console Output**: Human-readable format with pretty printing, ideal for development\n- **File Output**: JSON format with detailed metadata, perfect for log aggregation systems\n\n##### Log Levels\n\nThe default logging level is `info`, but you can adjust it using the `RUST_LOG` environment variable:\n\n```bash\n# Set specific log levels\nexport RUST_LOG=debug,atoma_node_service=trace\n\n# Run with custom log level\nRUST_LOG=debug cargo run --release --bin atoma-node -- [args]\n```\n\nCommon log levels (from most to least verbose):\n\n- `trace`: Very detailed debugging information\n- `debug`: Useful debugging information\n- `info`: General information about operation\n- `warn`: Warning messages\n- `error`: Error messages\n\n##### Viewing Logs\n\nYou can use standard Unix tools to view and analyze logs:\n\n```bash\n# View latest logs\ntail -f ./logs/atoma-node-service.log\n\n# Search for specific events\ngrep \"event_name\" ./logs/atoma-node-service.log\n\n# View JSON logs in a more readable format (requires jq)\ncat ./logs/atoma-node-service.log | jq '.'\n```\n\n##### Log Rotation\n\n- Logs automatically rotate daily\n- Old logs are preserved with the date appended to the filename\n- You may want to set up log cleanup periodically to manage disk space:\n\n```bash\n# Example cleanup script for logs older than 30 days\nfind ./logs -name \"atoma-node-service.log.*\" -mtime +30 -delete\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fatoma-network%2Fatoma-node","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fatoma-network%2Fatoma-node","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fatoma-network%2Fatoma-node/lists"}