Skip to content

Commit

Permalink
ci: use up to date docker images of core and node (#34)
Browse files Browse the repository at this point in the history
* update celestia node to v0.5.0-rc5
* update celestia core to v0.10.0-rc1
* change chain-id to test
* remove fix-genesis.sh (no longer required)
* make start-celestia-appd.sh very similar to
https://github.com/celestiaorg/celestia-app/blob/93f2c71806d6f5aae21fb656c49e15ba3a5a70ed/scripts/single-node.sh
* start-bridge.sh:
  * update celestia node CLI parameters
  * fix order of arguments of `wait-for-it.sh`
* use gateway port in integration tests
  • Loading branch information
tzdybal authored Nov 18, 2022
1 parent 4868ef6 commit b904798
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 47 deletions.
4 changes: 2 additions & 2 deletions integration_test/cnc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ func (i *IntegrationTestSuite) SetupSuite() {

i.dockerCompose = testcontainers.NewLocalDockerCompose(composeFilePaths, identifier)
i.dockerCompose.WaitForService("bridge0",
wait.ForHTTP("/balance").WithPort("26658").
wait.ForHTTP("/balance").WithPort("26659").
WithStartupTimeout(60*time.Second).
WithPollInterval(3*time.Second))
execError := i.dockerCompose.WithCommand([]string{"up", "-d"}).Invoke()
Expand Down Expand Up @@ -71,7 +71,7 @@ func (i *IntegrationTestSuite) TestNewClient() {
}

func (i *IntegrationTestSuite) TestDataRoundTrip() {
client, err := cnc.NewClient("http://localhost:26658", cnc.WithTimeout(30*time.Second))
client, err := cnc.NewClient("http://localhost:26659", cnc.WithTimeout(30*time.Second))
i.NoError(err)
i.NotNil(client)

Expand Down
13 changes: 0 additions & 13 deletions integration_test/docker/fix-genesis.sh

This file was deleted.

18 changes: 10 additions & 8 deletions integration_test/docker/start-bridge.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,16 @@
apt-get update
apt-get install -y curl jq

./celestia bridge --node.store /bridge init
/wait-for-it.sh -t 30 192.167.10.10:26657/header -- \
./celestia bridge init --node.store /bridge
/wait-for-it.sh 192.167.10.10:26657 -t 90 -- \
curl -s http://192.167.10.10:26657/block?height=1 | jq '.result.block_id.hash' | tr -d '"' > genesis.hash

export CELESTIA_CUSTOM=ephemeral:`cat genesis.hash`
curl -s http://192.167.10.10:26657/block_by_hash?hash=0x`cat genesis.hash`
echo # newline

export CELESTIA_CUSTOM=test:`cat genesis.hash`
echo $CELESTIA_CUSTOM
./celestia bridge --node.store /bridge --rpc.port 26658 \
--core.grpc 192.167.10.10:9090 \
--core.remote tcp://192.167.10.10:26657 \
--keyring.accname node \
start
./celestia bridge start \
--node.store /bridge --gateway \
--core.ip 192.167.10.10 \
--keyring.accname validator
42 changes: 24 additions & 18 deletions integration_test/docker/start-celestia-appd.sh
Original file line number Diff line number Diff line change
@@ -1,25 +1,31 @@
#!/usr/bin/env bash

chain_id=ephemeral
token=celestia
node_name=node
key_type=test
celestia_appd=/celestia-app/celestia-appd
CHAINID="test"

rm -rf $node_name/config/genesis.json $node_name/config/gentx
pwd
$celestia_appd --home $node_name init $node_name --chain-id $chain_id
$celestia_appd --home $node_name keys add $node_name --keyring-backend $key_type
addr=`$celestia_appd --home $node_name keys show $node_name --address --keyring-backend test`
echo $addr
$celestia_appd --home $node_name add-genesis-account $addr 800000000000$token
rm -rf /root/.celestia-app

apk add moreutils # required for sponge
/fix-genesis.sh $node_name/config/genesis.json $token
# Build genesis file incl account for passed address
coins="1000000000000000utia"
celestia-appd init $CHAINID --chain-id $CHAINID
celestia-appd keys add validator --keyring-backend="test"
# this won't work because the some proto types are decalared twice and the logs output to stdout (dependency hell involving iavl)
celestia-appd add-genesis-account $(celestia-appd keys show validator -a --keyring-backend="test") $coins
celestia-appd gentx validator 5000000000utia \
--keyring-backend="test" \
--chain-id $CHAINID \
--orchestrator-address $(celestia-appd keys show validator -a --keyring-backend="test") \
--evm-address 0x966e6f22781EF6a6A82BBB4DB3df8E225DfD9488 # private key: da6ed55cb2894ac2c9c10209c09de8e8b9d109b910338d5bf3d747a7e1fc9eb9

celestia-appd collect-gentxs

$celestia_appd --home $node_name gentx $node_name 5000000000$token --keyring-backend=$key_type --chain-id $chain_id
$celestia_appd --home $node_name collect-gentxs
# Set proper defaults and change ports
# 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/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

sed -i $node_name/config/config.toml -e 's/"full"/"validator"/'
$celestia_appd --home $node_name --rpc.laddr tcp://0.0.0.0:26657 start
# Start the celestia-app
celestia-appd start
11 changes: 5 additions & 6 deletions integration_test/docker/test-docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ version: '3'
services:
core0:
container_name: core0
image: "ghcr.io/celestiaorg/celestia-app-ephemeral:latest"
image: "ghcr.io/celestiaorg/celestia-app:v0.10.0-rc1"
entrypoint: [
"/bin/bash"
]
Expand All @@ -12,8 +12,7 @@ services:
]
volumes:
- ${PWD}/docker/start-celestia-appd.sh:/start-celestia-appd.sh:ro
- ${PWD}/docker/fix-genesis.sh:/fix-genesis.sh:ro
- keyring-volume:/celestia-app/node/keyring-test
- keyring-volume:/root/.celestia-app/keyring-test
networks:
localnet:
ipv4_address: 192.167.10.10
Expand All @@ -22,7 +21,7 @@ services:
container_name: bridge0
depends_on:
- core0
image: "ghcr.io/celestiaorg/celestia-node:sha-25652db"
image: "ghcr.io/celestiaorg/celestia-node:0.5.0-rc5"
entrypoint: [
"/bin/bash"
]
Expand All @@ -35,10 +34,10 @@ services:
- keyring-volume:/bridge/keys/keyring-test/:ro

expose:
- "26658/tcp"
- "26659/tcp"

ports:
- "26658:26658"
- "26659:26659"

networks:
localnet:
Expand Down

0 comments on commit b904798

Please sign in to comment.