Run your mirror node using GCS

Prerequisites:

Note: Buckets are also available in Amazon Web Services (AWS)

  • Docker

    • Check to see if you have it installed from your terminal: docker --version && docker-compose --version

    • For mirror node versions 0.35.0 and higher you will need docker v3.3.3+

  • Hedera Mirror Node Repository

    • You will be prompted to download the repo in the following steps.

  • PostgreSQL

    • Download PostgreSQL to be able to access the database.

1. Obtain Google Cloud Platform Requester Pay Information

You will need to grab the secret key, access key, and project ID from your Google Cloud Platform account

  • From the left navigation bar, select STORAGE > SETTINGS

  • Click on the Interoperability tab and scroll down to the User account HMAC section

  • Set your default project

  • Click create keys to generate access keys for your account

  • You should see the access key and secret columns populate on the table

  • You will use these keys to populate the application.yml configuration file in a later step

2. Clone Hedera Mirror Node Repository

  • Open your terminal

  • Clone the hedera-mirror-node repository

git clone https://github.com/hashgraph/hedera-mirror-node
  • CD to the hedera-mirror-node folder

cd hedera-mirror-node

3. Configure your application.yml file

  • Open the application.yml file found in the root directory with a text editor of your choice

  • Input the following information and uncomment each line

  • Buckets are preconfigured for each network

Item
Description

accessKey

Your project access key from your Google Cloud Platform account

cloudProvider

GCP

secretKey

Your secret key from your Google Cloud Platform account

gcpProjectId

Your Google Cloud Platform project ID

network

Enter the network you would to run your mirror node for

hedera:
  mirror:
    importer: 
      downloader:
        accessKey: GOOG....
        cloudProvider: "GCP"
        secretKey: h+....
        gcpProjectId: ENTER GCP PROJECT ID HERE
      network: PREVIEWNET/TESTNET/MAINNET #Pick one network

4. Start Your Hedera Mirror Node

  • From the hedera-mirror-node directory, run the following command in your terminal:

docker-compose up

5. Access Your Hedera Mirror Node Data

To access the mirror node data now available to you, access the hedera-mirror-node_db_1 container.

  • Open a new terminal

  • To view the hedera-mirror-node_db_1 container ID, enter the following command:

docker ps
  • Enter the following command to access the docker container

docker exec -it <containerId> bash
  • Enter the following command to access the database

psql "dbname=mirror_node host=localhost user=mirror_node password=mirror_node_pass port=5432"
  • Enter the following command to view the complete list of tables

\dt

Last updated

Was this helpful?

#2176: docs for mirror node minimum hardware spec #302

Change request updated