diff --git a/src/content/docs/validator/external-chains/hedera.mdx b/src/content/docs/validator/external-chains/hedera.mdx index 8cdb38a3..a1919ff6 100644 --- a/src/content/docs/validator/external-chains/hedera.mdx +++ b/src/content/docs/validator/external-chains/hedera.mdx @@ -22,6 +22,8 @@ sudo apt install build-essential gcc g++ ### Clone Hedera Mirror Node Repository - [Official Documentation](https://docs.hedera.com/hedera/core-concepts/mirror-nodes/run-your-own-beta-mirror-node) +- [Bootstraping DB Guide](https://github.com/hashgraph/hedera-mirror-node/blob/main/docs/database/bootstrap.md) +- [Mirror Node Configurations](https://github.com/hashgraph/hedera-mirror-node/blob/main/docs/configuration.md) Open your terminal and run the following commands @@ -32,6 +34,19 @@ cd hedera-mirror-node ### Configure Mirror Node +Before starting your verifier, ensure you have the historical database dump in place. Without it, your verifier will not have the full historical state, causing it to vote "no" on proposals. +Follow Hedera’s official [Database Bootstrap Guide](https://github.com/hashgraph/hedera-mirror-node/blob/main/docs/database/bootstrap.md) to properly import the Mirror Node historical data [*minimal dump*](https://github.com/hashgraph/hedera-mirror-node/blob/main/docs/database/bootstrap.md#download-minimal-db-data-files) before running the verifier. +Verifiers must have this data bootsrapped to vote correctly. + +**Important Note for Deployment: It is recommended to first test your mirror node configuration on testnet:** +> 1. Set the `startDate` to match your contract deployment date +> 2. Allow the node to sync from that date +> 3. Verify that all data is being captured correctly +> 4. Make any necessary configuration adjustments +> 5. Once everything is working as expected on testnet, apply the same configuration to mainnet +> +> This approach allows you to validate your setup and fine-tune any parameters before moving to production. + The `application.yml` file is the main configuration file for the Hedera Mirror Node. We'll update that file with GCP/AWS Secret and Access keys and the type of Hedera Network we want to mirror. ```application.toml @@ -43,7 +58,23 @@ hedera: cloudProvider: "GCP/s3" #Choose GCP for google or s3 for AWS secretKey: Enter secret key from your GCP/AWS account gcpProjectId: ENTER GCP PROJECT ID HERE / N/A for AWS - network: PREVIEWNET/TESTNET/MAINNET #Pick one network + startDate: 1970-01-01T00:00:00Z + network: testnet + parser: + # Exclude specific transaction types + exclude: + # Exclude all consensus messages to reduce storage + - transaction: [CONSENSUSSUBMITMESSAGE] + # Exclude treasury account + - entity: [0.0.98] + + record: + entity: + persist: + # Disable topic message storage + topics: false + # Disable topic message lookups + topicMessageLookups: false ``` ### Run Your Mirror Node @@ -100,9 +131,37 @@ npm run build ### Create a file named .env in the root directory of the project. ```bash -CHAIN_ID= The network chain id. Local and previewnet envs should use 0x12a (298). Previewnet, Testnet and Mainnet should use 0x129 (297), 0x128 (296) and 0x127 (295) respectively - -MIRROR_NODE_URL= The Mirror Node API endpoint. Official endpoints are Previewnet (https://previewnet.mirrornode.hedera.com), Testnet (https://testnet.mirrornode.hedera.com), Mainnet (https://mainnet-public.mirrornode.hedera.com). +# CHAIN_ID corresponds to the network chain ID: +# - Local environment (using a local mirror node) and Previewnet: 0x12a (298) +# - Previewnet: 0x129 (297) +# - Testnet: 0x128 (296) +# - Mainnet: 0x127 (295) +CHAIN_ID= + +# MIRROR_NODE_URL is the endpoint for the Mirror Node API. +# For public networks, a single HTTPS endpoint is provided: +# - Previewnet: https://previewnet.mirrornode.hedera.com +# - Testnet: https://testnet.mirrornode.hedera.com +# - Mainnet: https://mainnet-public.mirrornode.hedera.com +# +# For local environments, the mirror node runs by default on separate ports: +# - JSON-RPC (web3) is exposed on port 8545 +# - REST endpoints are exposed on port 5551 +# +# Unlike public networks (which proxy all APIs behind a single port 443 endpoint), +# the default local configuration does not consolidate these ports. +# +# If you are using a local relay and want to access both the contracts/call (web3) +# and the REST endpoints seamlessly, you need to set up a reverse proxy (e.g., Nginx or Apache) +# that maps different URL paths to the respective ports. +# +# For example, you might proxy: +# - /contracts to http://localhost:8545 +# - /rest to http://localhost:5551 +# +# Then, set MIRROR_NODE_URL to the reverse proxy endpoint (e.g., http://localhost:8080), +# and configure the relay accordingly. +MIRROR_NODE_URL= HEDERA_NETWORK= Which network to connect to. Can be MAINNET, PREVIEWNET, TESTNET or OTHER @@ -142,6 +201,6 @@ Logs should appear like this [2024-10-03 16:49:33.460 +0000] INFO (relay/145017 on xxxxx): Configurations successfully loaded [2024-10-03 16:49:33.461 +0000] TRACE (hbar-rate-limit/145017 on xxxxx): remainingBudget=11000000000 tℏ, resetTimestamp=1727974253461 [2024-10-03 16:49:33.508 +0000] INFO (relay/145017 on xxxxx): SDK client successfully configured to "testnet" for account 0.0.12345 with request timeout value: 10000 -[2024-10-03 16:49:33.511 +0000] INFO (mirror-node/145017 on xxxxx): Mirror Node client successfully configured to REST url: https://testnet.mirrornode.hedera.com/api/v1/ and Web3 url: https://testnet.mirrornode.hedera.com/api/v1/ +[2024-10-03 16:49:33.511 +0000] INFO (mirror-node/145017 on xxxxx): Mirror Node client successfully configured to REST url: http://localhost:8080/api/v1/ and Web3 url: http://localhost:8080/api/v1/ [2024-10-03 16:49:33.512 +0000] INFO (relay/145017 on xxxxx): Relay running with chainId=0x128 ```