This repo implements a celestia da-server
for Alt-DA mode using generic
commitments.
The da-server
connects to a celestia-node running as a sidecar process.
celestia da-server accepts the following flags for celestia storage using celestia go client
--celestia.server value celestia rpc endpoint (default: "http://localhost:26658") [$OP_ALTDA_CELESTIA_SERVER]
--celestia.namespace value celestia namespace [$OP_ALTDA_CELESTIA_NAMESPACE]
--addr value alt da server listening address (default: "127.0.0.1") [$OP_ALTDA_ADDR]
--port value alt da server listening port (default: 3100) [$OP_ALTDA_PORT]
--s3.credential-type value The way to authenticate to S3, options are [iam, static] [$OP_ALTDA_S3_CREDENTIAL_TYPE]
--s3.bucket value bucket name for S3 storage [$OP_ALTDA_S3_BUCKET]
--s3.path value path for S3 storage [$OP_ALTDA_S3_PATH]
--s3.endpoint value endpoint for S3 storage [$OP_ALTDA_S3_ENDPOINT]
--s3.access-key-id value access key id for S3 storage [$OP_ALTDA_S3_ACCESS_KEY_ID]
--s3.access-key-secret value access key secret for S3 storage [$OP_ALTDA_S3_ACCESS_KEY_SECRET]
--s3.timeout value S3 timeout (default: 5s) [$OP_ALTDA_S3_TIMEOUT]
--routing.fallback Enable fallback (default: false) [$OP_ALTDA_FALLBACK]
--routing.cache Enable cache. (default: false) [$OP_ALTDA_CACHE]
--celestia.auth-token value celestia rpc auth token [$OP_ALTDA_CELESTIA_AUTH_TOKEN]
--celestia.tx-client.key-name value celestia tx client key name (default: "my_celes_key") [$OP_ALTDA_CELESTIA_TX_CLIENT_KEY_NAME]
--celestia.tx-client.keyring-path value celestia tx client keyring path e.g. ~/.celestia-light-mocha-4/keys [$OP_ALTDA_CELESTIA_TX_CLIENT_KEYRING_PATH]
--celestia.tx-client.core-grpc.addr value celestia tx client core grpc addr (default: "http://localhost:9090") [$OP_ALTDA_CELESTIA_TX_CLIENT_CORE_GRPC_ADDR]
--celestia.tx-client.core-grpc.tls-enabled celestia tx client core grpc TLS (default: true) [$OP_ALTDA_CELESTIA_TX_CLIENT_CORE_GRPC_TLS_ENABLED]
--celestia.tx-client.core-grpc.auth-token value celestia tx client core grpc auth token [$OP_ALTDA_CELESTIA_TX_CLIENT_CORE_GRPC_AUTH_TOKEN]
--celestia.tx-client.p2p-network value celestia tx client p2p network (default: "mocha-4") [$OP_ALTDA_CELESTIA_TX_CLIENT_P2P_NETWORK]
--celestia.compact-blobid enable compact celestia blob IDs. false indicates share offset and size will be included in the blob ID (default: true) [$OP_ALTDA_CELESTIA_BLOBID_COMPACT]
--log.level value The lowest log level that will be output (default: INFO) [$OP_ALTDA_LOG_LEVEL]
--log.format value Format the log output. Supported formats: 'text', 'terminal', 'logfmt', 'json', 'json-pretty', (default: text) [$OP_ALTDA_LOG_FORMAT]
--log.color Color the log output if in terminal mode (default: false) [$OP_ALTDA_LOG_COLOR]
--log.pid Show pid in the log (default: false) [$OP_ALTDA_LOG_PID]
--help, -h show help
--version, -v print the version
Connecting to a celestia node requires configuring the --celestia.server
--celestia.namespace
and --celestia.auth-token
flags.
The celestia server endpoint should be set to the celestia-node rpc server,
usually http://127.0.0.1:26658
.
A random valid namespace can be generated by running the following command:
export NAMESPACE=00000000000000000000000000000000000000$(openssl rand -hex 10)
The auth token is auto generated by celestia-node and is required to submit blob transactions to the celestia-node.
Optionally, celestia da-server can be configured to use the Celestia Client which provides a more efficient way to submit transactions to the celestia network.
The transaction client can be configured to use a service provider such as Quicknode to submit transactions and read data from the celestia network.
Configuration options for the transaction client are same as those required for starting a celestia light node. Refer to the documentation for running a Celestia Light node using Quicknode for details.
As an example, here are the flags required to configure the transaction client on mocha testnet using Quicknode:
--celestia.server https://your-quicknode-endpoint.celestia-mocha.quiknode.pro/your-auth-token
--celestia.namespace your-namespace
--celestia.tx-client.core-grpc.addr your-quicknode-endpoint.celestia-mocha.quiknode.pro:9090
--celestia.tx-client.core-grpc.auth-token your-auth-token
--celestia.tx-client.p2p-network mocha-4
--celestia.tx-client.keyring-path ~/.celestia-light-mocha-4/keys
To test the integration against devnet, you'll need to configure kurtosis-devnet/simple.yaml
:
-
Configure
da_server_params
inkurtosis-devnet/simple.yaml
:da_params: image: opcelestia/localestia-da-server:latest
-
Add
altda_deploy_config
tooptimism_package
in the samesimple.yaml
file:altda_deploy_config: use_altda: false da_commitment_type: GenericCommitment da_challenge_window: 100 da_resolve_window: 100 da_bond_size: 0 da_resolver_refund_percentage: 0
-
Start the devnet from the
kurtosis-devnet
directory:cd kurtosis-devnet just simple-devnet
The da_params
docker image uses localestia to simulate a celestia network.
For more detailed information refer to the Optimism Alt-DA mode documentation.