2023-07-05 10:21:06 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
set -eux
|
|
|
|
|
|
|
|
cluster="${1:-test}"
|
|
|
|
laconic_so="${LACONIC_SO:-laconic-so} --stack fixturenet-plugeth-tx --verbose --debug"
|
|
|
|
|
|
|
|
CONFIG_DIR=$(readlink -f "${CONFIG_DIR:-$(mktemp -d)}")
|
|
|
|
|
|
|
|
# By default assume we are running in the project root
|
|
|
|
export CERC_REPO_BASE_DIR="${CERC_REPO_BASE_DIR:-$(realpath $(git rev-parse --show-toplevel)/..)}"
|
|
|
|
|
|
|
|
# v5 migrations only go up to version 18
|
|
|
|
echo CERC_STATEDIFF_DB_GOOSE_MIN_VER=18 >> $CONFIG_DIR/stack.env
|
|
|
|
|
|
|
|
# Build and deploy a cluster with only what we need from the stack
|
|
|
|
$laconic_so setup-repositories \
|
2023-07-10 23:50:06 +00:00
|
|
|
--exclude github.com/dboreham/foundry,github.com/cerc-io/tx-spammer,github.com/cerc-io/ipld-eth-server,git.vdb.to/cerc-io/plugeth,git.vdb.to/cerc-io/plugeth-statediff \
|
2023-07-06 10:06:34 +00:00
|
|
|
--branches-file ./test/stack-refs.txt
|
2023-07-05 10:21:06 +00:00
|
|
|
|
|
|
|
$laconic_so build-containers \
|
|
|
|
--exclude cerc/ipld-eth-server,cerc/keycloak,cerc/tx-spammer,cerc/foundry
|
|
|
|
|
|
|
|
$laconic_so deploy \
|
2023-07-06 05:24:46 +00:00
|
|
|
--exclude foundry,keycloak,tx-spammer,ipld-eth-server \
|
2023-07-05 10:21:06 +00:00
|
|
|
--env-file $CONFIG_DIR/stack.env \
|
|
|
|
--cluster "$cluster" up
|
|
|
|
|
|
|
|
set +x
|
|
|
|
|
|
|
|
# Output vars if we are running on Github
|
|
|
|
if [[ -n "$GITHUB_ENV" ]]; then
|
|
|
|
bootnode_port=$($laconic_so deploy --cluster $cluster port fixturenet-eth-bootnode-geth 9898 | head -1 | cut -d':' -f2)
|
|
|
|
geth_port=$($laconic_so deploy --cluster $cluster port fixturenet-eth-geth-1 8545 | cut -d':' -f2)
|
|
|
|
eis_port=$($laconic_so deploy --cluster $cluster port ipld-eth-server 8081 | cut -d':' -f2)
|
|
|
|
|
|
|
|
echo GETH_BOOTNODE_URL="http://localhost:$bootnode_port" >> "$GITHUB_ENV"
|
|
|
|
echo GETH_URL="http://localhost:$geth_port" >> "$GITHUB_ENV"
|
|
|
|
echo IPLD_ETH_URL="http://localhost:$eis_port" >> "$GITHUB_ENV"
|
|
|
|
fi
|