31 lines
851 B
Bash
31 lines
851 B
Bash
#!/bin/bash
|
|
export HOME=/var/lib/solana
|
|
export PATH="$PATH:/usr/local/bin"
|
|
|
|
ASN="chpst -u nobody:nogroup"
|
|
|
|
cd $HOME
|
|
|
|
$ASN solana config set --url $NETWORK_URL
|
|
|
|
if [[ ! -e $HOME/validator-keypair.json ]]; then
|
|
$ASN solana-keygen new -o $HOME/validator-keypair.json
|
|
fi
|
|
$ASN solana-keygen pubkey ~/validator-keypair.json
|
|
|
|
if [[ ! -d $HOME/validator-ledger ]]; then
|
|
$ASN mkdir $HOME/validator-ledger
|
|
fi
|
|
|
|
exec $ASN \
|
|
solana-validator \
|
|
--identity $HOME/validator-keypair.json \
|
|
--trusted-validator dv1LfzJvDF7S1fBKpFgKoKXK5yoSosmkAdfbxBo1GqJ \
|
|
--no-untrusted-rpc \
|
|
--ledger $HOME/validator-ledger \
|
|
--rpc-port 8899 \
|
|
--entrypoint entrypoint.devnet.solana.com:8001 \
|
|
--expected-genesis-hash Ap36zrBt2jLWpwUjaF48hRULVgmvSE3ViFxiQgjZX2XC \
|
|
--log - \
|
|
--limit-ledger-size 2>&1
|