MCPcopy Index your code
hub / github.com/0gfoundation/0g-da-client

github.com/0gfoundation/0g-da-client @v1.0.1-testnet

Chat with this repo
repository ↗ · DeepWiki ↗ · release v1.0.1-testnet ↗ · + Follow
1,319 symbols 3,315 edges 124 files 341 documented · 26%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

0GDA

Overview

0GDA is a decentralized data availability (DA) service with deep consideration in security, scalability and decentralization. It is also the first DA solution with a built-in data storage layer. Users interact with 0G DA Client to submit and store their data into 0G DA Node for later retrieval.

To dive deep into the technical details, continue reading 0G DA spec.

Integration

Check out this example for how to integrate the 0GDA into your own applications.

For detailed public APIs, visit gRPC API section.

Deployment

Installation

  1. Install dependencies

  2. For Linux

    bash sudo apt-get update sudo apt-get install cmake * For Mac

    bash brew install cmake

  3. Install Go

  4. For Linux

  5. Download the Go installer

    bash wget https://go.dev/dl/go1.22.0.linux-amd64.tar.gz * Extract the archive

    bash rm -rf /usr/local/go && tar -C /usr/local -xzf go1.22.0.linux-amd64.tar.gz * Add /usr/local/go/bin to the PATH environment variable by adding the following line to your \~/.profile.

    bash export PATH=$PATH:/usr/local/go/bin * For Mac

    Download the Go installer from [https://go.dev/dl/go1.22.0.darwin-amd64.pkg](https://go.dev/dl/go1.19.3.darwin-amd64.pkg).\ Open the package file you downloaded and follow the prompts to install Go.

  6. Download the source code

    bash git clone -b v1.0.0-testnet https://github.com/0glabs/0g-da-client.git

Configuration

Field Description
--chain.rpc JSON RPC node endpoint for the blockchain network.
--chain.private-key Hex-encoded signer private key.
--chain.receipt-wait-rounds Maximum retries to wait for transaction receipt.
--chain.receipt-wait-interval Interval between retries when waiting for transaction receipt.
--chain.gas-limit Transaction gas limit.
--combined-server.use-memory-db Whether to use mem-db for blob storage.
--combined-server.storage.kv-db-path Path for level db.
--combined-server.storage.time-to-expire Expiration duration for blobs in level db.
--combined-server.log.level-file File log level.
--combined-server.log.level-std Standard output log level.
--combined-server.log.path Log file path.
--disperser-server.grpc-port Server listening port.
--disperser-server.retriever-address GRPC host for retriever.
--batcher.da-entrance-contract Hex-encoded da-entrance contract address.
--batcher.da-signers-contract Hex-encoded da-signers contract address.
--batcher.finalizer-interval Interval for finalizing operations.
--batcher.finalized-block-count Default number of blocks between finalized block and latest block.
--batcher.confirmer-num Number of Confirmer threads.
--batcher.max-num-retries-for-sign Number of retries before signing fails.
--batcher.batch-size-limit Maximum batch size in MiB.
--batcher.encoding-request-queue-size Size of the encoding request queue.
--batcher.encoding-interval Interval between blob encoding requests.
--batcher.pull-interval Interval for pulling from the encoded queue.
--batcher.signing-interval Interval between slice signing requests.
--batcher.signed-pull-interval Interval for pulling from the signed queue.
--encoder-socket GRPC host of the encoder.
--encoding-timeout Total time to wait for a response from encoder.
--signing-timeout Total time to wait for a response from signer.

Run

  1. Build combined server

    bash make build 2. Run combined server

    Update the following command by referencing the Configuration

    Reference:

    bash ./bin/combined \ --chain.rpc L1_RPC_ENDPOINT \ --chain.private-key YOUR_PRIVATE_KEY \ --chain.receipt-wait-rounds 180 \ --chain.receipt-wait-interval 1s \ --chain.gas-limit 2000000 \ --combined-server.use-memory-db \ --combined-server.storage.kv-db-path ./../run/ \ --combined-server.storage.time-to-expire 300 \ --disperser-server.grpc-port 51001 \ --batcher.da-entrance-contract ENTRANCE_CONTRACT_ADDR \ --batcher.da-signers-contract 0x0000000000000000000000000000000000001000 \ --batcher.finalizer-interval 20s \ --batcher.confirmer-num 3 \ --batcher.max-num-retries-for-sign 3 \ --batcher.finalized-block-count 50 \ --batcher.batch-size-limit 500 \ --batcher.encoding-interval 3s \ --batcher.encoding-request-queue-size 1 \ --batcher.pull-interval 10s \ --batcher.signing-interval 3s \ --batcher.signed-pull-interval 20s \ --encoder-socket DA_ENCODER_SERVER \ --encoding-timeout 600s \ --signing-timeout 600s \ --chain-read-timeout 12s \ --chain-write-timeout 13s \ --combined-server.log.level-file trace \ --combined-server.log.level-std trace \ --combined-server.log.path ./../run/run.log

Run via Docker

Guidance

Contributing

To make contributions to the project, please follow the guidelines here.

Extension points exported contracts — how you extend this code

Core symbols most depended-on inside this repo

Shape

Method 796
Function 258
Struct 204
Interface 31
Class 20
TypeAlias 9
FuncType 1

Languages

Go92%
Python8%

Modules by API surface

api/grpc/disperser/disperser.pb.go73 symbols
disperser/contract/da_signers/da_signers.go70 symbols
disperser/contract/da_entrance/da_entrance.go67 symbols
disperser/disperser.go40 symbols
common/geth/instrumented_client.go39 symbols
core/attestation.go31 symbols
common/mock/ethclient.go31 symbols
common/ethclient.go31 symbols
disperser/api/grpc/signer/signer.pb.go29 symbols
disperser/batcher/slice_signer.go27 symbols
api/grpc/disperser/disperser_grpc.pb.go25 symbols
inabox/deploy/subgraph.go23 symbols

For agents

$ claude mcp add 0g-da-client \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page