postgres migration and test script fix

This commit is contained in:
aniketfuryrocks 2023-04-15 02:40:25 +05:30
parent 4156abc708
commit 2699a676c4
No known key found for this signature in database
GPG Key ID: 1B75EA596D89FF06
2 changed files with 11 additions and 2 deletions

View File

@ -16,9 +16,9 @@ CREATE TABLE lite_rpc.Txs (
CREATE TABLE lite_rpc.Blocks (
slot BIGINT NOT NULL PRIMARY KEY,
leader_id BIGINT NOT NULL,
parent_slot BIGINT NOT NULL
parent_slot BIGINT NOT NULL,
cluster_time TIMESTAMP WITH TIME ZONE NOT NULL,
local_time TIMESTAMP WITH TIME ZONE,
local_time TIMESTAMP WITH TIME ZONE
);
CREATE TABLE lite_rpc.AccountAddrs (

View File

@ -1,5 +1,8 @@
#!/bin/sh
# kill background jobs on exit/failure
trap 'kill $(jobs -pr)' SIGINT SIGTERM EXIT
# env variables
export PGPASSWORD="password"
export PG_CONFIG="host=localhost dbname=postgres user=postgres password=password sslmode=disable"
@ -16,6 +19,12 @@ docker start test-postgres
echo "Clearing database"
pg_run -f ../migrations/rm.sql
pg_run -f ../migrations/create.sql
echo "Starting the test validator"
solana-test-validator > /dev/null &
echo "Waiting 8 seconds for solana-test-validator to start"
sleep 8
echo "Starting lite-rpc"
cargo run --release -- -p &