This document provides instructions on how to connect a local celestia-app instance to local celestia-node bridge node.
-
Delete previous binary
rm $(which celestia-appd) -
Delete previous local devnets
rm -rf ~/.celestia-app -
Build & run a celestia-app node
./scripts/build-run-single-node.sh
-
You'll see a line in terminal output like
Home directory: /var/folders/y0/dd92_x8x4tlf397xstgwfz_c0000gn/T/celestia_app_XXXXXXXXXXXXX.6VVjiaTmYou can export it for easy use later:
export CELESTIA_APP_HOME="/var/folders/y0/dd92_x8x4tlf397xstgwfz_c0000gn/T/celestia_app_XXXXXXXXXXXXX.6VVjiaTm"
WARNING: make go-install or make install inside the celestia-node repo doesn't always replace the celestia binary installed on your local machine. Before proceeding, verify that the version of celestia-node installed is the one you intend on testing.
-
Delete previous binary
rm $(which celestia) -
Delete previous local devnets
rm -rf ~/.celestia-bridge-private -
Install a new celestia-node binary
make go-install celestia version # verify the commit hash matches what you expect -
Initialize a bridge node
celestia bridge init --p2p.network private
-
In the celestia-appd terminal output, search for this log line and copy the hash after the
=received complete proposal block hash=90B6E859046F98EB95D3FD0F846AC4FA5D47A675A59BE680F71741295453E316 -
Paste the hash from the previous step to
~/.celestia-bridge-private/config.toml[Header] TrustedHash = "90B6E859046F98EB95D3FD0F846AC4FA5D47A675A59BE680F71741295453E316"
-
Start bridge node.
celestia bridge start --p2p.network private --core.ip 127.0.0.1 --gateway
-
After you run the above command, copy the celestia node address that was printed to your console. It should look something like
NAME: my_celes_key ADDRESS: celestia1mhewflflym3vyqml9kpvj4u2e39k5f2k3plfthYou can export it for easy use later:
export CELESTIA_NODE_ADDRESS=celestia1mhewflflym3vyqml9kpvj4u2e39k5f2k3plfth
Inside the celestia-app directory
-
Export validator address
export CELESTIA_APP_ADDRESS=$(./build/celestia-appd keys show validator --keyring-backend test --address --home $CELESTIA_APP_HOME)
-
Submit a test random blob
./build/celestia-appd tx blob TestRandBlob 100 --from $CELESTIA_APP_ADDRESS --fees 21000utia --yes --home $CELESTIA_APP_HOME
-
Send tokens from validator address to celestia-node address
./build/celestia-appd tx bank send --chain-id private --keyring-backend test --home $CELESTIA_APP_HOME --yes \ $CELESTIA_APP_ADDRESS \ $CELESTIA_NODE_ADDRESS \ 100000utia --fees 21000utia
Wait until your celestia-app terminal logs a line that contains
num_valid_txs=1to ensure your transaction was included in a block -
Submit a PFB
curl -X POST -d '{"namespace_id": "0c204d39600fddd3", "data": "f1f20ca8007e910a3bf8b2e61da0f26bca07ef78717a6ea54165f5", "gas_limit": 80000, "fee": 80000}' http://localhost:26659/submit_pfb
curl -X GET 'http://localhost:26659/namespaced_shares/0000000000000004/height/156'
curl -X GET 'http://localhost:26659/namespaced_data/0000000000000004/height/156'
Consider automating the manual copy + pasting of genesis hash with something like: