Skip to content

test validator #176

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions tests/test-validator.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#!/bin/bash

set -euo pipefail

echo "Starting validator"

solana-test-validator --reset \
--bpf-program DELeGGvXpWV2fqJUhqcF5ZSYMS4JTLjteaAMARRSaeSh tests/fixtures/delegation.so \
--bpf-program KeyspM2ssCJbqUhQ4k7sveSiY4WjnYsrXkC8oDbwde5 tests/fixtures/session_keys.so \
--bpf-program WorLD15A7CrDwLcLy4fRqtaTb9fbd8o8iqiEMUDse2n target/deploy/world.so \
--bpf-program CmP2djJgABZ4cRokm4ndxuq6LerqpNHLBsaUv2XKEJua target/deploy/bolt_component.so \
--bpf-program 7X4EFsDJ5aYTcEjKzJ94rD8FRKgQeXC89fkpeTS4KaqP target/deploy/bolt_system.so \
--bpf-program Fn1JzzEdyb55fsyduWS94mYHizGhJZuhvjX6DVvrmGbQ target/deploy/position.so \
--bpf-program 6LHhFVwif6N9Po3jHtSmMVtPjF6zRfL3xMosSzcrQAS8 target/deploy/system_apply_velocity.so \
--bpf-program HT2YawJjkNmqWcLNfPAMvNsLdWwPvvvbKA5bpMw4eUpq target/deploy/system_fly.so \
--bpf-program FSa6qoJXFBR3a7ThQkTAMrC15p6NkchPEjBdd4n6dXxA target/deploy/system_simple_movement.so \
--bpf-program CbHEFbSQdRN4Wnoby9r16umnJ1zWbULBHg4yqzGQonU1 target/deploy/velocity.so \
--account EEmsg7GbxEAw5f9hGfZRmJRJ27HK8KeGDp7ViW9X2mYa tests/fixtures/commit_record.json \
--account 7nQvHcfEqtFmY2q6hiQbidu8BCNdqegnEFfH7HkByFn5 tests/fixtures/committed_state.json \
> /dev/null 2>&1 &

VALIDATOR_PID=$!

cleanup() {
if ps -p $VALIDATOR_PID > /dev/null; then
kill $VALIDATOR_PID
wait $VALIDATOR_PID 2>/dev/null || true
fi
}
trap cleanup EXIT

sleep 3

if ! solana airdrop -u http://localhost:8899 100000 ./tests/fixtures/provider.json; then
echo "Error: Failed to airdrop SOL to provider account"
exit 1
fi

anchor test --skip-build --skip-deploy --skip-local-validator

Loading