Skip to main content

Data Availability (DA) Node


Overview

While there are various approaches to running a DA (Data Availability) node, this guide outlines our recommended method and the necessary hardware specifications. It's important to note that your DA signer needs to operate a DA node to verify encoded blob data, sign it, and store it for future farming and rewards.

Hardware Requirements

The following table outlines the hardware requirements for different types of DA nodes:

Node TypeMemoryCPUDiskBandwidthAdditional Notes
DA Node16 GB8 cores1 TB NVME SSD100 MBpsFor Download / Upload
DA Retriever8 GB2 cores-100 MBpsFor Download / Upload
DA Client8 GB2 cores-100 MBpsFor Download / Upload
DA Encoder----NVIDIA Drivers: 12.04 on the RTX 4090*

Note Other NVIDIA GPUs might require parameter adjustments and haven't been optimized yet.

Additional Information

Each type of DA node plays a crucial role in the Data Availability system:

  • DA Node: Performs the core functions of verifying, signing, and storing encoded blob data.
  • DA Retriever: Responsible for retrieving data from the network.
  • DA Client: Interacts with the DA layer, facilitating data operations.
  • DA Encoder: Handles the encoding of data, utilizing GPU acceleration where available.

For detailed setup instructions and best practices for each node type, please refer to our comprehensive documentation.

DA Node Installation

Step 1: Clone and Build the Repository

  1. Open a terminal or command prompt.

  2. Clone the repository and checkout the specific version:

    git clone https://github.com/0glabs/0g-da-node.git
    cd 0g-da-node
    git checkout tags/v1.1.2 -b v1.1.2
  3. Build the project:

    cargo build --release
  4. Download necessary parameters:

    ./dev_support/download_params.sh

Step 2: Generate BLS Private Key (if needed)

If you don't have a BLS private key, generate one:

cargo run --bin key-gen

Keep the generated BLS private key secure.

Step 3: Configure the Node

  1. Create a configuration file named config.toml in the project root directory.

  2. Add the following content to the file, adjusting values as needed:

    log_level = "info"

    data_path = "./db/"

    # path to downloaded params folder
    encoder_params_dir = "params/"

    # grpc server listen address
    grpc_listen_address = "0.0.0.0:34000"
    # chain eth rpc endpoint
    eth_rpc_endpoint = "https://rpc-testnet.0g.ai"
    # public grpc service socket address to register in DA contract
    # ip:34000 (keep same port as the grpc listen address)
    # or if you have dns, fill your dns
    socket_address = "<public_ip/dns>:34000"

    # data availability contract to interact with
    da_entrance_address = "0x857C0A28A8634614BB2C96039Cf4a20AFF709Aa9" # testnet config
    # deployed block number of da entrance contract
    start_block_number = 940000 # testnet config

    # signer BLS private key
    signer_bls_private_key = ""
    # signer eth account private key
    signer_eth_private_key = ""
    # miner eth account private key, (could be the same as `signer_eth_private_key`, but not recommended)
    miner_eth_private_key = ""

    # whether to enable data availability sampling
    enable_das = "true"

    Make sure to fill in the signer_bls_private_key, signer_eth_private_key, and miner_eth_private_key fields with your actual private keys.

Step 4: Run the Node

Start the 0g DA node using the following command:

./target/release/server --config config.toml

This will start the node using the configuration file you created.

Step 5: Verify the Node is Running

On the first run, the DA node will register the signer information in the DA contract. You can monitor the console output to ensure the node is running correctly and has successfully registered.

Node Operations

As a DA node operator, your node will perform the following tasks:

  • Encoded blob data verification
  • Signing of verified data
  • Storing blob data for further farming
  • Receiving rewards for these operations

Troubleshooting

  • If you encounter any issues, check the console output for error messages.
  • Ensure that the ports specified in your config.toml file are not being used by other applications.
  • Verify that you have the latest stable version of Rust installed.
  • Make sure your system meets the minimum hardware requirements.

Conclusion

You have now successfully set up and run a 0g DA node as a DA Signer. For more advanced configuration options and usage instructions, please refer to the official GitHub repository.

Remember to keep your private keys secure and regularly update your node software to ensure optimal performance and security.