forked from solana-labs/tour-de-sol
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bench-tps.sh
executable file
·48 lines (39 loc) · 1.07 KB
/
bench-tps.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/usr/bin/env bash
set -ex
cd "$(dirname "$0")"
host=$1
if [[ -z $host ]]; then
host=tds.solana.com
fi
txCount=$2
if [[ -z $txCount ]]; then
txCount=1000
fi
threadBatchSleepMs=$3
if [[ -z $threadBatchSleepMs ]]; then
threadBatchSleepMs=250
fi
remote=$4
if [[ -n $remote ]]; then
exec > ~/solana/client-$txCount.log
exec 2>&1
PATH=$PATH:~/.cargo/bin/
killall solana-bench-tps || true
if [[ $txCount = 0 ]]; then
exit 0
fi
else
scp -o "ConnectTimeout=20" -o "BatchMode=yes" \
-o "StrictHostKeyChecking=no" -o "UserKnownHostsFile=/dev/null" \
solana@$host:solana/config/mint-keypair.json .
fi
solana -u http://$host:8899 -k mint-keypair.json balance --lamports
if [[ ! -f bench-tps.json ]]; then
solana-keygen new -o bench-tps.json
fi
solana -u http://$host:8899 -k mint-keypair.json \
pay "$(solana-keygen pubkey bench-tps.json)" 10000 SOL
solana -u http://$host:8899 -k bench-tps.json balance
export RUST_LOG=solana=info
solana-bench-tps -i bench-tps.json --tx_count=$txCount \
-n $host:8001 -N 2 --sustained --thread-batch-sleep-ms=$threadBatchSleepMs