Pharos 백서

Pharos

원문

bitpro가 원문에서 글자만 모은 내용이에요. 표·그림·수식은 빠지거나 깨질 수 있어요. 전체 18쪽 중 4쪽

``` ### Entering the container ```sh docker exec -it atlantic-testnet /bin/bash ``` ### Join validator sets If your full node has synced up with the latest block, you can convert it to a validator. If you need to join Pharos Atlantic as a Validator, please contact and send domain file and pubkeys to <janesh@dplabs.xyz> or TG ([@janesh\_dani](https://t.me/janesh_dani/)) ⚠️ Note: If more than one-third of validators go offline, the Atlantic may halt due to consensus safety constraints. ⚠️ To join the network, the corresponding account needs to stake a certain amount of tokens. Please contact us to obtain the staking tokens. * Pack needed files into `node_info.tar.gz` * <mark style="color:green;">`tar -zcvf node_info.tar.gz /data/atlantic/domain.json`</mark> \ <mark style="color:green;">`/data/atlantic/resources/domain_keys/prime256v1/domain/new.pub`</mark> \ <mark style="color:green;">`/data/atlantic/resources/domain_keys/bls12381/domain/new.pub`</mark> * Domain config: * <mark style="color:green;">`/data/atlantic/domain.json`</mark> * Node pubkeys: * <mark style="color:green;">`/data/atlantic/resources/domain_keys/prime256v1/domain/new.pub`</mark> * <mark style="color:green;">`/data/atlantic/resources/domain_keys/bls12381/domain/new.pub`</mark> # Rapid Node Initialization To help developers and validators quickly join the Pharos Network without syncing from genesis, we provide regularly updated snapshot datasets for each network. These snapshots contain pre-synced state data and allow rapid setup of Devnet, Testnet, or Mainnet nodes. > ⚠️ Snapshots should only be used from trusted sources. Always verify integrity before replacing production data. *** ## Pharos Network * [Atlantic](/node-and-validator-guide/rapid-node-initialization/rapid-node-initialization-testnet) ### 💡 Notes & Best Practices * Snapshots currently contain the full block history. In the future, we will support pruned snapshots that include only the most recent blocks and state. * Full Cache Nodes should still sync from genesis. * After applying a snapshot, the node will continue syncing to the latest height. * Always ensure your snapshot corresponds to the correct network and version. # Rapid Node Initialization(Testnet) ## 🧰 Initialization Using Snapshots Follow these steps to bootstrap a Pharos node using the latest snapshot: ### ✅ **Step1: Download the Snapshot Dataset** We periodically publish [new snapshots](/node-and-validator-guide/pharos-network-snapshots). Use the following command to download and extract: ```bash wget https://snapshot.dplabs-internal.com/atlantic/atlantic-snapshot-2026-03-05-11.tar.gz tar -zxvf atlantic-snapshot-2026-03-05-11.tar.gz ``` > Only use snapshots that match your target network. ### 🧯 **Step2: Stop the Container** ```bash docker-compose down ``` ### 🧹 **Step3: Remove Local Data** ```bash rm -rf /data/$WORKSPACE/pharos-node/domain/light/data/public mv /data/$WORKSPACE/pharos-node/domain/light/data/local_storage /data/$WORKSPACE/pharos-node/domain/light/data/local_storage.bak ``` ### 📦 **Step4: Replace with the Latest Snapshot** ```bash mv public /data/$WORKSPACE/pharos-node/domain/light/data/public ``` ### 🚀 **Step5: Start the Container** ```bash docker-compose up -d ``` # Rapid Node Initialization(Devnet) ## 🧰 Initialization Using Snapshots Follow these steps to bootstrap a Pharos node using the latest snapshot: ### ✅ Step 1: Download the Latest Snapshot We periodically publish [new snapshots](/node-and-validator-guide/pharos-network-snapshots). Use the following command to download and extract: ```sh wget https://snapshot.dplabs-internal.com/devnet/snapshot-latest.tar.gz tar -zxvf snapshot-latest.tar.gz ``` > Check this page regularly for updates. Only use snapshots that match your target network. ### 🧯 Step 2: Stop the Running Node Container ```sh docker stop pharos-devnet ``` Make sure the node is fully stopped before continuing to avoid data corruption. ### 🧹 Step 3: Replace Old Data with the Snapshot Remove the outdated data directory and move in the extracted snapshot: ```sh rm -rf /data/pharos-devnet/pharos-node/domain/light/data/public mv public /data/pharos-devnet/pharos-node/domain/light/data/public ``` > Adjust the file path to match your actual mount or installation directory. ### 🚀 Step 4: Restart the Node Container ```sh docker start pharos-devnet ``` Your node should now resume from the latest synced snapshot. # Pharos Network Snapshots Welcome to the official snapshot page for Pharos Network. Here you can find regularly updated data snapshots for each network environment — Atlantic Testnet and Mainnet — to help you quickly synchronize and bootstrap your nodes without performing a full sync from genesis. Snapshots include the latest database state and can be used for fast setup, disaster recovery, or performance testing. ### 💡 Notes & Best Practices * Snapshots do not contain full block history, only the latest validated state. * Archival nodes should still sync from genesis. * After applying a snapshot, the node will continue syncing from the latest height. * Always ensure your snapshot corresponds to the correct network and version. > ⚠️ Always verify the snapshot source and integrity before applying it to your node.\\ See [Rapid Node Initialization](/node-and-validator-guide/rapid-node-initialization) for detailed instructions. *** ### Atlantic Full Cache Node Snapshot | Latest Snapshot | atlantic-snapshot-2026-10-02-04.tar.gz | | --------------- | ------------------------------------------------------------------------------------------------------------------------------ | | Last Updated | [atlantic-snapshot-2026-10-02-04.tar.gz](https://snapshot.dplabs-internal.com/atlantic/atlantic-snapshot-2026-10-02-04.tar.gz) | | Format | Compressed TAR archive | | Notes | Only includes the ***public*** database | | sha256 checksum | `5008dc0eba93079ffc060edf63723a9e846cc87eafc078bdbb092f72b2cba800` | *** ### Mainnet Full Cache Node Snapshot | Latest Snapshot | mainnet-snapshot-2026-07-01-03.tar.gz | | --------------- | --------------------------------------------------------------------------------------------------------------------------- | | Last Updated | [mainnet-snapshot-2026-07-01-03.tar.gz](https://snapshot.dplabs-internal.com/mainnet/mainnet-snapshot-2026-07-01-03.tar.gz) | | Format | Compressed TAR archive | | Notes | Only includes the ***public*** database | | sha256 checksum | `55cc3b1536f4bd7911d6fc703e4c1c15d15c7ea96306c38a75c3fb9e5d90542c` | *** # Node Debugging & Configuration ## Pharos Block Validation You can refer to the [Pharos Block Validation](https://silken-muskox-24e.notion.site/Pharos-Block-Validation-2ce8ec314f7580228d47cea4119df371) document for details on the Pharos consensus mechanism and block validation process. ## Block Sync Verification You can use the RPC API to check whether the node is actively syncing blocks. If the block number is increasing, the node is catching up to the latest chain height. ```sh curl 127.0.0.1:18100/ \ -X POST \ -H "Content-Type: application/json" \ --data '{"method":"eth_blockNumber","params":[],"id":1,"jsonrpc":"2.0"}' ``` ## Check if the Node has joined as a Validator ### Query the local NodeID ```sh cat /data/domain.json | grep "NODE_ID" ``` ### Send a transaction to join the Validator <https://pharosscan.xyz/tx/0xf0045f3551f3d70df2ce5a1b2abe51839c3c2cf4a3e487c89ef6e5a006e16b92?tab=state> ### Check NodeID in Pharos system contract ```sh curl -X POST --data '{ "jsonrpc": "2.0", "method": "eth_call", "params": [{ "to": "0x4100000000000000000000000000000000000000", "data": "0x9de70258" }, "latest"], "id": 1 }' -H "Content-Type: application/json" https://atlantic.dplabs-internal.com ``` ## Log Inspection All logs are written to the directory: ```sh cd /data/pharos-node/domain/light/log/ ``` To monitor logs in real-time, use: ```sh tail -f pharos.log ``` ## Port Configuration Ensure that the following ports are open and accessible for proper node operation: ```sh 18100 — RPC 18200 — P2P 19000 — Internal services ``` # Node Monitoring Setup This guide describes how to configure monitoring for your Pharos node using Prometheus Pushgateway. ## Overview Pharos nodes can push metrics to a Prometheus Pushgateway, which allows you to monitor node performance, block production, and other key metrics. ## Configuration To enable monitoring, add the `monitor_config` section to your `pharos.conf` file. ### Example Configuration > **Note:** These configuration keys require **v0.16.0 or later**. In earlier versions they were named `enable_pamir_cetina` and `pamir_cetina_*`. Using the wrong key names for your node version will silently disable metrics pushing without any error, so make sure the names match your node version. ```json { "chain": { "monitor_config": { "storage_enable_cetina": true, "storage_cetina_job_name": "your_job_name", "storage_cetina_push_address": "your_pushgateway_address", "storage_cetina_push_interval": 5, "storage_cetina_push_port": 9091 }, "secret_config": { "domain_key_path": "../keys/domain.key", "stabilizing_key_path": "../keys/stabilizing.key" }, "startup_config": { "init_config": { "meta_path": "../data", "host_ip": "127.0.0.1", "http_port": "18100", "rpc_port": "20000", "tcp_port": "19000", "ws_port": "18200" } } }, "storage": { "mygrid_conf": {}, "mygrid_env": { "storage_data_path": "../data" } } } ``` ### Configuration Parameters | Parameter | Description | Example | | ------------------------------ | -------------------------------------- | ---------------------------- | | `storage_enable_cetina` | Enable/disable metrics pushing | `true` | | `storage_cetina_job_name` | Job name for Prometheus metrics | `"atlantic_testnet"` | | `storage_cetina_push_address` | Pushgateway address (without protocol) | `"your_pushgateway_address"` | | `storage_cetina_push_interval` | Push interval in seconds | `5` | | `storage_cetina_push_port` | Pushgateway port | `9091` | > **Version note:** In v0.15.0 and earlier, these keys were named `enable_pamir_cetina`, `pamir_cetina_job_name`, `pamir_cetina_push_address`, `pamir_cetina_push_interval`, and `pamir_cetina_push_port` respectively. ## Setup Steps 1. Ensure you have a Prometheus Pushgateway running and accessible from your node 2. Edit your `pharos.conf` file and add the `monitor_config` section under `chain`: ```bash vim pharos.conf ``` 3. Replace the placeholder values: * `your_job_name`: A unique identifier for your node (e.g., `my_validator_node`) * `your_pushgateway_address`: Your Pushgateway hostname or IP 4. Restart your node to apply the changes: **For Docker:** ```bash docker compose restart ``` **For Binary:** ```bash ./ops stop --force ./ops start --config ./pharos.conf ``` # Rollback Blocks This guide describes how to revert the Pharos node to a previous block height. ## Step 1: Stop the Node **Docker:** ```bash cd /data/$WORKSPACE docker compose down ``` **Binary:** ```bash cd /data/$WORKSPACE ./ops stop ``` ## Step 2: Backup local\_storage ```bash mv /data/$WORKSPACE/data/local_storage /data/$WORKSPACE/data/local_storage.bak ``` ## Step 3: Revert Blocks **Revert to latest stable block:** ```bash cd /data/$WORKSPACE/bin ./pharos_cli revert -c ../pharos.conf -t stable ``` **Revert to a specific block number:** ```bash cd /data/$WORKSPACE/bin ./pharos_cli revert -c ../pharos.conf -t stable -n 1234567 ``` You will see an interactive confirmation prompt: ``` You are trying to revert stable block to 1234567, are you sure? [y/n] ``` Enter `y` to confirm. ## Step 4: Start the Node **Docker:** ```bash cd /data/$WORKSPACE docker compose up -d ``` **Binary:** ```bash ./ops start --config ./pharos.conf ``` # Pharos Testnet: Rebuild Node with Preserved Node Info This guide helps you **rebuild your Pharos Testnet node** while preserving your **existing validator identity** (node info). This is useful when resetting the database but retaining validator keys and configuration. *** ### **1️⃣ Stop and Backup the Existing Node** ``` docker stop pharos-testnet mv /data/testnet /data/testnet_bak docker rm pharos-testnet ``` *** ### **2️⃣ Start a Fresh Node Container** ``` docker run -d --name pharos-testnet \\ -v /data/testnet:/data \\ -p 18100:18100 -p 18200:18200 -p 19000:19000 \\ public.ecr.aws/k2g7b7g1/pharos/testnet:63b85b6b ``` *** ### **3️⃣ ⏳ Wait for Initial Sync (\~3 minutes)** **Do not run docker stop or docker-compose down during this step.** You can check sync progress using: ``` curl 127.0.0.1:18100/ \\ -X POST \\ -H "Content-Type: application/json" \\ --data '{"method":"eth_blockNumber","params":[],"id":1,"jsonrpc":"2.0"}' ``` *** ### **4️⃣ Stop the Node and Restore Node Identity** ``` docker stop pharos-testnet ``` Replace new config with the backup node info: ``` rm -rf /data/testnet/pharos-node/domain/light/data/ rm -rf /data/testnet/pharos-node/domain/light/certs/ rm -rf /data/testnet/resources/ mv /data/testnet_bak/pharos-node/domain/light/data/ /data/testnet/pharos-node/domain/light/data/ mv /data/testnet_bak/pharos-node/domain/light/certs/ /data/testnet/pharos-node/domain/light/certs/ mv /data/testnet_bak/resources/ /data/testnet/resources/ ``` *** ### **5️⃣ Restart and Finalize** ``` docker start pharos-testnet ``` Wait \~3 minutes again for sync to resume. You can check status using: ``` curl 127.0.0.1:18100/ \\ -X POST \\ -H "Content-Type: application/json" \\ --data '{"method":"eth_blockNumber","params":[],"id":1,"jsonrpc":"2.0"}' ``` *** ### **6️⃣ Clean Up Backup** ``` rm -rf /data/testnet_bak ``` # Pharos Node Monitoring We recommend deploying Prometheus, Pushgateway, and Grafana to monitor Pharos Node metrics. ## Deploy Prometheus and pushgateway If you have already deployed a Prometheus monitoring and alerting system, you can skip this step: 1. **Create the Prometheus namespace:** <pre class="language-sh"><code class="lang-sh"><strong>kubectl create namespace prometheus </strong></code></pre> 2. **Add the** <mark style="color:green;">`prometheus-community`</mark> **chart repository:** ```sh helm repo add prometheus-community https://prometheus-community.github.io/helm-charts ``` 3. **Deploy Prometheus:** ```sh helm upgrade -i prometheus prometheus-community/prometheus \ --namespace prometheus \ --set alertmanager.persistence.storageClass="gp2" \ --set server.persistentVolume.storageClass="gp2" ``` 4. **Verify that all pods in the** prometheus **namespace are in the** <mark style="color:green;">`READY`</mark> **state:** ```sh kubectl get pods -n prometheus ``` 5. **Get the Pushgateway Service IP/Domain:** ```sh kubectl -n prometheus-agent-namespace get svc ``` You should see the <mark style="color:green;">`prometheus-pushgateway`</mark> Service. Save the <mark style="color:green;">`IP address`</mark> of the Pushgateway Service. ## Modify the metrics push configuration file For detailed instructions on configuring the metrics push in your `pharos.conf`, see [Node Monitoring Setup](/node-and-validator-guide/node-monitoring-setup). # Enable AutoPruning in Pharos Node This guide describes how to enable automatic data pruning on your Pharos node to manage disk space. *** ## For v0.11+ Deployment (New Structure) If you deployed your node using the v0.11 deployment guide (Binary or Docker with the new structure), follow these steps. ### Step 1: Verify Node Status Check if the node is running: ```bash curl -X POST -H "Content-Type: application/json" \ --data '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}' \ http://localhost:18100 ``` ### Step 2: Enable Pruning **For Binary Deployment:** ```bash cd /data/$WORKSPACE/bin ./pharos_cli prune --c ../pharos.conf --enable_auto_prune ``` **For Docker Deployment:** ```bash docker exec -it pharos-node /bin/bash cd /data/bin ./pharos_cli prune --c ../pharos.conf --enable_auto_prune ``` ### Step 3: Query Pruning Settings (Optional) **For Binary Deployment:** ```bash cd /data/$WORKSPACE/bin ./pharos_cli prune --c ../pharos.conf --get ``` **For Docker Deployment:** ```bash docker exec -it pharos-node /bin/bash cd /data/bin ./pharos_cli prune --c ../pharos.conf --get ``` Expected output: ``` PruneInfo: enable_auto_prune: 1 auto_prune_reserved_window: 100000 prune_reserved_version: xxxxxx flushed_version: xxxxxx real_prune_reserved_version: xxxxxxx ``` If `enable_auto_prune` is `1`, auto pruning is enabled. *** ## For Legacy Deployment (Pre-v0.11) If you deployed your node using the old Python ops tool, follow these steps. ### Step 1: Verify Node Status ```bash curl 127.0.0.1:18100/ \ -X POST \ -H "Content-Type: application/json" \ --data '{"method":"eth_blockNumber","params":[],"id":1,"jsonrpc":"2.0"}' ``` ### Step 2: Enable Pruning Enter the container and enable auto-pruning: ```bash docker exec -it pharos-testnet /bin/bash cd /data/pharos-node/domain/client/bin/ ./pharos_cli prune --enable_auto_prune ``` ### Step 3: Query Pruning Settings (Optional) ```bash docker exec -it pharos-testnet /bin/bash cd /data/pharos-node/domain/client/bin/ ./pharos_cli prune --get ``` Expected output: ``` PruneInfo: enable_auto_prune: 1 auto_prune_reserved_window: 100000 prune_reserved_version: xxxxxx flushed_version: xxxxxx real_prune_reserved_version: xxxxxxx ``` If `enable_auto_prune` is `1`, auto pruning is enabled. # Block Explorer ## Overview A block explorer is one of the most essential tools when building on Pharos. It gives you visibility into everything happening on-chain — from transactions and blocks to smart contracts and account activity. As a developer, you’ll frequently use a block explorer to verify deployments, debug issues, and track interactions with your contracts. ## What You Can Do with a Block Explorer * View transactions and check their status * Inspect blocks and network activity * Explore wallet addresses and balances * Interact with and inspect smart contracts * Verify deployed contracts and view source code ## Why It Matters The block explorer acts as your primary interface for understanding on-chain behavior. Whether you're testing on Testnet or deploying to Mainnet, it helps you quickly validate that everything is working as expected. # Hemera SocialScan ## Overview Hemera SocialScan is the official block explorer for the Pharos Network. It provides real-time visibility into on-chain activity, allowing developers and users to inspect transactions, blocks, accounts, tokens, and smart contracts. For developers, the explorer provides a familiar interface of EVM that includes tools for contract verification, token analytics, and transaction debugging. ## Explorer Access | Parameter | Value | | ------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------- | | Explorer Link | <https://pharos.socialscan.io/> | | Developer APIs (Contract Verification API) | [`https://api.socialscan.io/pharos-mainnet/v1/explorer/command_api/contract`](https://api.socialscan.io/pharos-mainnet/v1/explorer/command_api/contract) | | Explorer Developer API Key | `102dfc05-661d-4efd-a81e-24afb3918c7f` | ## What You Can Do Hemera SocialScan supports common developer workflows: * View and track transactions in real time * Inspect blocks and network activity * Explore wallet addresses, balances, and interactions * View deployed smart contracts and their state * Verify smart contracts and access source code * Analyze token activity and transfers ## Contract Verification You can verify deployed smart contracts using the SocialScan Developer API. ## Notes * Ensure your contract is compiled with the correct settings before verification * Verification may fail if bytecode or compiler settings do not match * Use the explorer alongside your pre
프로젝트로 돌아가기