Skip to content

Commit

Permalink
Add blobstream
Browse files Browse the repository at this point in the history
  • Loading branch information
Ferret-san committed Dec 19, 2023
1 parent dd90c11 commit 997edce
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 7 deletions.
5 changes: 3 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ USER root

# hadolint ignore=DL3018
RUN apk --no-cache add \
curl \
jq \
curl \
jq \
moreutils \
&& mkdir /bridge \
&& chown celestia:celestia /bridge

Expand Down
38 changes: 33 additions & 5 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ CHAINID="test"
# App & node has a celestia user with home dir /home/celestia
APP_PATH="/home/celestia/.celestia-app"
NODE_PATH="/home/celestia/bridge/"
GENESIS_FILE="/home/celestia/.celestia-app/config/genesis.json"

# Check if the folder exists
if [ -d "$APP_PATH" ]; then
Expand Down Expand Up @@ -33,24 +34,50 @@ celestia-appd collect-gentxs
# If you encounter: `sed: -I or -i may not be used with stdin` on MacOS you can mitigate by installing gnu-sed
# https://gist.github.com/andre3k1/e3a1a7133fded5de5a9ee99c87c6fa0d?permalink_comment_id=3082272#gistcomment-3082272
sed -i'.bak' 's#"tcp://127.0.0.1:26657"#"tcp://0.0.0.0:26657"#g' ~/.celestia-app/config/config.toml
sed -i'.bak' 's/timeout_commit = "25s"/timeout_commit = "1s"/g' ~/.celestia-app/config/config.toml
sed -i'.bak' 's/timeout_propose = "3s"/timeout_propose = "1s"/g' ~/.celestia-app/config/config.toml
sed -i'.bak' 's/timeout_commit = "11s"/timeout_commit = "300ms"/g' ~/.celestia-app/config/config.toml
sed -i'.bak' 's/timeout_propose = "10s"/timeout_propose = "500ms"/g' ~/.celestia-app/config/config.toml
sed -i'.bak' 's/timeout_propose_delta = "500ms"/timeout_propose_delta = "5ms"/g' ~/.celestia-app/config/config.toml
sed -i'.bak' 's/timeout_prevote = "1s"/timeout_prevote = "50ms"/g' ~/.celestia-app/config/config.toml
sed -i'.bak' 's/timeout_prevote_delta = "500ms"/timeout_prevote_delta = "1ms"/g' ~/.celestia-app/config/config.toml
sed -i'.bak' 's/timeout_precommit = "1s"/timeout_precommit = "50ms"/g' ~/.celestia-app/config/config.toml
sed -i'.bak' 's/timeout_precommit_delta = "500ms"/timeout_precommit_delta = "1ms"/g' ~/.celestia-app/config/config.toml
sed -i'.bak' 's/timeout_commit = "11s"/timeout_commit = "300ms"/g' ~/.celestia-app/config/config.toml
sed -i'.bak' 's/index_all_keys = false/index_all_keys = true/g' ~/.celestia-app/config/config.toml
sed -i'.bak' 's/mode = "full"/mode = "validator"/g' ~/.celestia-app/config/config.toml



# Update data commitment window
jq '.app_state.qgb.params.data_commitment_window = "101"' "$GENESIS_FILE" | sponge "$GENESIS_FILE"

echo "Updated data_commitment_window to 101 in $GENESIS_FILE"

echo $(cat ${GENESIS_FILE})

# Register the validator EVM address
{
# wait for block 1
sleep 20
sleep 5

echo "Showing valoper address"
celestia-appd keys show validator --home "${APP_PATH}" --bech val -a

echo "Checking registered EVM address"
celestia-appd query qgb evm "$(celestia-appd keys show validator --home "${APP_PATH}" --bech val -a)"

# private key: da6ed55cb2894ac2c9c10209c09de8e8b9d109b910338d5bf3d747a7e1fc9eb9
celestia-appd tx qgb register \
"$(celestia-appd keys show validator --home "${APP_PATH}" --bech val -a)" \
0x966e6f22781EF6a6A82BBB4DB3df8E225DfD9488 \
--from validator \
--home "${APP_PATH}" \
--fees 30000utia -b block \
-y
--fees "30000utia" \
-b block \
--chain-id="test" \
--yes

echo "Checking registered EVM address"
celestia-appd query qgb evm "$(celestia-appd keys show validator --home "${APP_PATH}" --bech val -a)"
} &

mkdir -p $NODE_PATH/keys
Expand All @@ -75,6 +102,7 @@ echo $CELESTIA_CUSTOM

celestia bridge init --node.store /home/celestia/bridge
export CELESTIA_NODE_AUTH_TOKEN=$(celestia bridge auth admin --node.store ${NODE_PATH})
echo "Auth Token $CELESTIA_NODE_AUTH_TOKEN"
echo "WARNING: Keep this auth token secret **DO NOT** log this auth token outside of development. CELESTIA_NODE_AUTH_TOKEN=$CELESTIA_NODE_AUTH_TOKEN"
celestia bridge start \
--node.store $NODE_PATH --gateway \
Expand Down

0 comments on commit 997edce

Please sign in to comment.