rollmint icon indicating copy to clipboard operation
rollmint copied to clipboard

Celestia Kurtosis Package

Open Manav-Aggarwal opened this issue 1 year ago • 1 comments

Manav-Aggarwal avatar Aug 19 '24 16:08 Manav-Aggarwal

Update

Currently dealing with an issue connecting to a celestia node in docker. I've been testing running the celestia light node in docker and running the GM tutorial against it to validate that all the commands work prior to moving to kurtosis.

However I keep getting connection refused messages.

error while initializing BlockManager: RPC client error: sendRequest failed: Post "http://localhost:26658": read tcp 127.0.0.1:49362->127.0.0.1:26658: read: connection reset by peer
Error intercepting command:  failed to run entrypoint: exit status 1

The docker run command in the celestia docs doesn't publish any ports, so I've tested add -p 7980:7980 and -p 26658:26658 but with no impact.

MSevey avatar Sep 06 '24 15:09 MSevey

some other data points. when running the light node directly you can curl the port and get the following

% curl http://0.0.0.0:26658/
{"error":{"code":-32600,"message":"Invalid request"},"id":null,"jsonrpc":"2.0"}

when running the light node in docker and do the same curl command you get the following:

% curl http://0.0.0.0:26658/
curl: (56) Recv failure: Connection reset by peer

MSevey avatar Oct 02 '24 20:10 MSevey

Adding 26658 to the exposed ports in the dockerfile and adding -p 26658:26658 to the docker command changes the error to

error while initializing BlockManager: RPC client error: sendRequest failed: Post "http://0.0.0.0:26658/": EOF

just adding the -p flag to the docker run command has the same result.

MSevey avatar Oct 02 '24 20:10 MSevey

Updated docker command to get GM working

docker run -p 26658:26658 -e NODE_TYPE=$NODE_TYPE -e P2P_NETWORK=$NETWORK \
	-v /Users/matt/.docker_data/celestia-light-arabica:/home/celestia \
    ghcr.io/celestiaorg/celestia-node:v0.18.1-arabica \
    celestia $NODE_TYPE start --core.ip $RPC_URL --p2p.network $NETWORK

Ports

-p 26658:26658

Only 2121 is exposed by default in the celestia node docker file. As such we need to use the -p flag to expose the ports on run time. This resolved the first error:

error while initializing BlockManager: RPC client error: sendRequest failed: Post "http://localhost:26658": read tcp 127.0.0.1:49362->127.0.0.1:26658: read: connection reset by peer

Node Config

The next error was this:

error while initializing BlockManager: RPC client error: sendRequest failed: Post "http://0.0.0.0:26658/": EOF

And you could see it with curl as well. see example above

For this the celestia da node config needed to be updated for the url being used for the RPC. This was 2 part. First we needed to persist the data itself in order to access the node config:

-v /Users/matt/.docker_data/celestia-light-arabica:/home/celestia 

In this /Users/matt/.docker_data/celestia-light-arabica is the folder I created on my local machine to store the data and /home/celestia is the folder in the docker container where node data is stored.

After doing this, the config.toml file for the node needs to be modified from this:

[RPC]
  Address = "localhost"
  Port = "26658"
  SkipAuth = false

to this:

[RPC]
  Address = "0.0.0.0"
  Port = "26658"
  SkipAuth = false

This is because the docker networking is mapping to 0.0.0.0 which localhost will not auto forward to in this situation.

MSevey avatar Oct 03 '24 13:10 MSevey

Next steps for getting it working in kurtosis.

  • [x] Dynamically set Auth Token
  • [x] Dynamically set DA height
  • [x] Dynamically update the RPC address in the node config file https://github.com/celestiaorg/celestia-node/pull/3808
  • [x] Understand importance of DA_BLOCK_HEIGHT
  • [x] Make DA_BLOCK_HEIGHT and DA_NAMESPACE inputs (potentially optional inputs?)

DA_BLOCK_HEIGHT is a performance flag.

Block height
docker exec -it $CEL celestia header network-head | jq -r '.result.header.height'

Auth token
docker exec -it $CEL celestia light auth write --p2p.network arabica

MSevey avatar Oct 03 '24 13:10 MSevey

Updated docker command

docker run -p 26658:26658 -e NODE_TYPE=$NODE_TYPE -e P2P_NETWORK=$NETWORK \
    --rm --name celestia-$NODE_TYPE-$NETWORK \
    -v /Users/matt/.docker_data/celestia-light-arabica:/home/celestia \
    ghcr.io/celestiaorg/celestia-node:v0.18.1-arabica \
    celestia $NODE_TYPE start --core.ip $RPC_URL --p2p.network $NETWORK

MSevey avatar Oct 03 '24 15:10 MSevey

need to initialize the cel_key and fund the address of the light node.

Might need to just print the node address for the user to fund.

MSevey avatar Oct 03 '24 16:10 MSevey

Current long term blocker is how to persist data with the kurtosis packages.

Shouldn't be a blocker for the tutorials as starting the node and rolling fresh each time isn't too big a deal.

MSevey avatar Oct 03 '24 21:10 MSevey

Putting faucet as a follow up for the tutorial and just have the user request funds.

MSevey avatar Oct 04 '24 13:10 MSevey

Closing due to issue with persisted data on kurtosis.

MSevey avatar Oct 11 '24 20:10 MSevey