[debug] just build plugeth images
Some checks failed
Test Ethereum Fixturenet Stack / Run Ethereum Fixturenet stack test (push) Has been skipped
Test Ethereum Plugeth Fixturenet Stack / Test fixturenet-plugeth stack (push) Has been cancelled

This commit is contained in:
Roy Crihfield 2024-06-28 15:55:57 +08:00
parent 9d50f2cfbe
commit fdd0f49d6f

View File

@ -48,85 +48,89 @@ mkdir -p $CERC_REPO_BASE_DIR
$SO_COMMAND --stack ${stack_name} setup-repositories
echo "Building containers"
$SO_COMMAND --stack ${stack_name} build-containers
$SO_COMMAND --stack ${stack_name} build-containers \
--include cerc/plugeth-statediff,cerc/plugeth
test_deployment_dir=$CERC_REPO_BASE_DIR/test-deployment-dir
test_deployment_spec=$CERC_REPO_BASE_DIR/test-deployment-spec.yml
echo "Exiting for debugging"
exit 1
$SO_COMMAND --stack ${stack_name} deploy init --output $test_deployment_spec
# Check the file now exists
if [ ! -f "$test_deployment_spec" ]; then
test_fail_exit "deploy init test: spec file not present"
fi
echo "deploy init test: passed"
# test_deployment_dir=$CERC_REPO_BASE_DIR/test-deployment-dir
# test_deployment_spec=$CERC_REPO_BASE_DIR/test-deployment-spec.yml
$SO_COMMAND --stack ${stack_name} deploy create --spec-file $test_deployment_spec --deployment-dir $test_deployment_dir
# Check the deployment dir exists
if [ ! -d "$test_deployment_dir" ]; then
test_fail_exit "deploy create test: deployment directory not present"
fi
echo "deploy create test: passed"
# $SO_COMMAND --stack ${stack_name} deploy init --output $test_deployment_spec
# # Check the file now exists
# if [ ! -f "$test_deployment_spec" ]; then
# test_fail_exit "deploy init test: spec file not present"
# fi
# echo "deploy init test: passed"
dump_logs () {
echo "Test failed. Logs from stack:"
$SO_COMMAND deployment --dir $test_deployment_dir logs
}
trap dump_logs ERR
# $SO_COMMAND --stack ${stack_name} deploy create --spec-file $test_deployment_spec --deployment-dir $test_deployment_dir
# # Check the deployment dir exists
# if [ ! -d "$test_deployment_dir" ]; then
# test_fail_exit "deploy create test: deployment directory not present"
# fi
# echo "deploy create test: passed"
$SO_COMMAND deployment --dir $test_deployment_dir start
# dump_logs () {
# echo "Test failed. Logs from stack:"
# $SO_COMMAND deployment --dir $test_deployment_dir logs
# }
# trap dump_logs ERR
geth_endpoint=localhost:$($SO_COMMAND deployment --dir $test_deployment_dir port fixturenet-eth-geth-1 8545 | cut -d: -f2)
# $SO_COMMAND deployment --dir $test_deployment_dir start
timeout=900 # 15 minutes
log_info "Getting initial block number. Timeout set to $timeout seconds"
start_time=$(date +%s)
elapsed_time=0
initial_block_number=0
while [ "$initial_block_number" -eq 0 ] && [ $elapsed_time -lt $timeout ]; do
sleep 10
log_info "Waiting for initial block..."
initial_block_number=$(get_block_number $geth_endpoint)
current_time=$(date +%s)
elapsed_time=$((current_time - start_time))
done
# geth_endpoint=localhost:$($SO_COMMAND deployment --dir $test_deployment_dir port fixturenet-eth-geth-1 8545 | cut -d: -f2)
subsequent_block_number=$initial_block_number
# timeout=900 # 15 minutes
# log_info "Getting initial block number. Timeout set to $timeout seconds"
# start_time=$(date +%s)
# elapsed_time=0
# initial_block_number=0
# while [ "$initial_block_number" -eq 0 ] && [ $elapsed_time -lt $timeout ]; do
# sleep 10
# log_info "Waiting for initial block..."
# initial_block_number=$(get_block_number $geth_endpoint)
# current_time=$(date +%s)
# elapsed_time=$((current_time - start_time))
# done
# if initial block was 0 after timeout, assume chain did not start successfully and skip finding subsequent block
if [[ $initial_block_number -gt 0 ]]; then
timeout=300
log_info "Getting subsequent block number. Timeout set to $timeout seconds"
start_time=$(date +%s)
elapsed_time=0
# wait for 5 blocks or timeout
while [ "$subsequent_block_number" -le $((initial_block_number + 5)) ] && [ $elapsed_time -lt $timeout ]; do
sleep 10
log_info "Waiting for five blocks or $timeout seconds..."
subsequent_block_number=$(get_block_number $geth_endpoint)
current_time=$(date +%s)
elapsed_time=$((current_time - start_time))
done
fi
# subsequent_block_number=$initial_block_number
# will return 0 if either of the above loops timed out
block_number_difference=$((subsequent_block_number - initial_block_number))
# # if initial block was 0 after timeout, assume chain did not start successfully and skip finding subsequent block
# if [[ $initial_block_number -gt 0 ]]; then
# timeout=300
# log_info "Getting subsequent block number. Timeout set to $timeout seconds"
# start_time=$(date +%s)
# elapsed_time=0
# # wait for 5 blocks or timeout
# while [ "$subsequent_block_number" -le $((initial_block_number + 5)) ] && [ $elapsed_time -lt $timeout ]; do
# sleep 10
# log_info "Waiting for five blocks or $timeout seconds..."
# subsequent_block_number=$(get_block_number $geth_endpoint)
# current_time=$(date +%s)
# elapsed_time=$((current_time - start_time))
# done
# fi
log_info "Results of block height queries:"
echo "Initial block height: $initial_block_number"
echo "Subsequent block height: $subsequent_block_number"
# # will return 0 if either of the above loops timed out
# block_number_difference=$((subsequent_block_number - initial_block_number))
# Block height difference should be between 1 and some small number
[[ $block_number_difference -gt 1 && $block_number_difference -lt 100 ]]
# log_info "Results of block height queries:"
# echo "Initial block height: $initial_block_number"
# echo "Subsequent block height: $subsequent_block_number"
# Check that the block hash is present in the ipld-eth-db
echo "Querying ipld-eth-db for block number $subsequent_block_number"
block_hash_query="SELECT block_hash from eth.header_cids where block_number = $subsequent_block_number"
block_hash=$(
$SO_COMMAND deployment --dir $test_deployment_dir exec ipld-eth-db \
"psql -qtA -U vdbm -c '$block_hash_query' cerc_testing"
)
echo "Block hash in ipld-eth-db: $block_hash"
# # Block height difference should be between 1 and some small number
# [[ $block_number_difference -gt 1 && $block_number_difference -lt 100 ]]
[[ -n $block_hash ]]
# # Check that the block hash is present in the ipld-eth-db
# echo "Querying ipld-eth-db for block number $subsequent_block_number"
# block_hash_query="SELECT block_hash from eth.header_cids where block_number = $subsequent_block_number"
# block_hash=$(
# $SO_COMMAND deployment --dir $test_deployment_dir exec ipld-eth-db \
# "psql -qtA -U vdbm -c '$block_hash_query' cerc_testing"
# )
# echo "Block hash in ipld-eth-db: $block_hash"
echo "Test passed."
# [[ -n $block_hash ]]
# echo "Test passed."