Skip to content

Commit 548b2b2

Browse files
committed
support QA deploy
1 parent 52b0349 commit 548b2b2

File tree

12 files changed

+250
-18
lines changed

12 files changed

+250
-18
lines changed

.env

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ KEYPASS="0123456789"
55
INIT_HOLDER="0x04d63aBCd2b9b1baa327f2Dda0f873F197ccd186"
66
INIT_HOLDER_PRV="59ba8068eb256d520179e903f43dacf6d8d57d72bd306e1bd603fdb8c8da10e8"
77
RPC_URL="http://127.0.0.1:8545"
8-
PASSED_FORK_DELAY=40
9-
LAST_FORK_MORE_DELAY=10
8+
PASSED_FORK_DELAY=100
9+
LAST_FORK_MORE_DELAY=300
1010
FullImmutabilityThreshold=512
1111
MinBlocksForBlobRequests=576
1212
DefaultExtraReserveForBlobRequests=32

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@
66

77
.local/
88

9-
.idea/
9+
.idea/

config.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,5 +67,5 @@ IdleTimeout = 120000000000
6767
[Node.LogConfig]
6868
FilePath = "bsc.log"
6969
MaxBytesSize = 10485760
70-
Level = "info"
70+
Level = "debug"
7171
FileRoot = ""

qa-env-resource/bsc.service

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
[Unit]
2+
Description=bsc
3+
After=network.target
4+
5+
[Service]
6+
Type=simple
7+
User=root
8+
Group=root
9+
ExecStart=/server/validator/chaind.sh -start
10+
ExecReload=/server/validator/chaind.sh -restart
11+
ExecStop=/server/validator/chaind.sh -stop
12+
PrivateTmp=true
13+
Restart=always
14+
LimitNOFILE=10000
15+
RestartSec=5
16+
StartLimitInterval=0
17+
18+
[Install]
19+
WantedBy=multi-user.target

qa-env-resource/chaind.sh

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
#!/bin/bash
2+
3+
export GOGC=200
4+
# default values
5+
FullImmutabilityThreshold=90000
6+
MinBlocksForBlobRequests=524288
7+
DefaultExtraReserveForBlobRequests=28800
8+
BreatheBlockInterval=600
9+
FixedTurnLength=1
10+
LAST_FORK_MORE_DELAY=1800
11+
12+
function startChaind() {
13+
workspace=/server/validator
14+
15+
PassedForkTime=`cat ${workspace}/hardforkTime.txt|grep passedHardforkTime|awk -F" " '{print $NF}'`
16+
LastHardforkTime=$(expr ${PassedForkTime} + ${LAST_FORK_MORE_DELAY})
17+
initLog=${workspace}/init.log
18+
rialtoHash=`cat ${initLog}|grep "database=lightchaindata"|awk -F"=" '{print $NF}'|awk -F'"' '{print $1}'`
19+
20+
ip=`ifconfig eth0|grep inet|grep -v inet6 |awk '{ print $2 }'`
21+
sed -i -e "s?FileRoot = \"\"?FileRoot = \"/mnt/efs/validator/${ip}/\"?g" /server/validator/config.toml
22+
mkdir -p /mnt/efs/validator/${ip}
23+
${workspace}/bsc --config ${workspace}/config.toml \
24+
--datadir ${workspace} \
25+
--password ${workspace}/password.txt \
26+
--blspassword ${workspace}/password.txt \
27+
--unlock {{validatorAddr}} --miner.etherbase {{validatorAddr}} --rpc.allow-unprotected-txs --allow-insecure-unlock \
28+
--ws --ws.port 8545 --ws.addr ${ip} --http.addr 0.0.0.0 --http.corsdomain "*" \
29+
--metrics --metrics.addr 0.0.0.0 \
30+
--pprof --pprof.port 6061 \
31+
--syncmode snap --mine --vote --monitor.maliciousvote \
32+
--cache 10480 --light.serve 50 \
33+
--rialtohash ${rialtoHash} --override.passedforktime ${PassedForkTime} --override.bohr ${LastHardforkTime} \
34+
--override.immutabilitythreshold ${FullImmutabilityThreshold} --override.breatheblockinterval ${BreatheBlockInterval} \
35+
--override.minforblobrequest ${MinBlocksForBlobRequests} --override.defaultextrareserve ${DefaultExtraReserveForBlobRequests} \
36+
`# --override.fixedturnlength ${FixedTurnLength}` \
37+
>> /mnt/efs/validator/${ip}/bscnode.log 2>&1
38+
}
39+
40+
function stopChaind() {
41+
pid=`ps -ef | grep /server/validator/bsc | grep -v grep | awk '{print $2}'`
42+
if [ -n "$pid" ]; then
43+
for((i=1;i<=4;i++));
44+
do
45+
kill $pid
46+
sleep 5
47+
pid=`ps -ef | grep /server/validator/bsc | grep -v grep | awk '{print $2}'`
48+
if [ -z "$pid" ]; then
49+
break
50+
elif [ $i -eq 4 ]; then
51+
kill -9 $kid
52+
fi
53+
done
54+
fi
55+
}
56+
57+
CMD=$1
58+
59+
case $CMD in
60+
-start)
61+
echo "start"
62+
startChaind
63+
;;
64+
-stop)
65+
echo "stop"
66+
stopChaind
67+
;;
68+
-restart)
69+
stopChaind
70+
sleep 3
71+
startChaind
72+
;;
73+
*)
74+
echo "Usage: chaind.sh -start | -stop | -restart .Or use systemctl start | stop | restart bsc.service "
75+
;;
76+
esac

qa-env-resource/config.toml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
[Eth]
2+
NetworkId = 714
3+
SyncMode = "full"
4+
NoPruning = false
5+
NoPrefetch = false
6+
LightPeers = 100
7+
TrieTimeout = 100000000000
8+
DatabaseCache = 512
9+
DatabaseFreezer = ""
10+
TriesInMemory = 128
11+
TrieCleanCache = 256
12+
TrieDirtyCache = 256
13+
EnablePreimageRecording = false
14+
15+
[Eth.Miner]
16+
GasFloor = 500000000
17+
GasCeil = 500000000
18+
GasPrice = 1000000000
19+
Recommit = 10000000000
20+
21+
[Eth.TxPool]
22+
Locals = []
23+
NoLocals = true
24+
Journal = "transactions.rlp"
25+
Rejournal = 3600000000000
26+
PriceLimit = 1000000000
27+
PriceBump = 10
28+
AccountSlots = 512
29+
GlobalSlots = 10000
30+
AccountQueue = 256
31+
GlobalQueue = 5000
32+
Lifetime = 10800000000000
33+
34+
[Eth.GPO]
35+
Blocks = 20
36+
Percentile = 60
37+
OracleThreshold = 1000
38+
39+
[Node]
40+
IPCPath = "geth.ipc"
41+
HTTPHost = "localhost"
42+
NoUSB = true
43+
InsecureUnlockAllowed = false
44+
HTTPPort = 8545
45+
HTTPVirtualHosts = ["localhost"]
46+
HTTPModules = ["eth", "net", "web3", "txpool", "parlia", "miner"]
47+
WSPort = 8546
48+
WSModules = ["net", "web3", "eth"]
49+
50+
[Node.P2P]
51+
MaxPeers = 30
52+
NoDiscovery = false
53+
ListenAddr = ":30311"
54+
EnableMsgEvents = false
55+
56+
[Node.HTTPTimeouts]
57+
ReadTimeout = 30000000000
58+
WriteTimeout = 30000000000
59+
IdleTimeout = 120000000000
60+
61+
[Node.LogConfig]
62+
FilePath = "bsc.log"
63+
MaxBytesSize = 10485760
64+
Level = "debug"
65+
FileRoot = ""

qa-env-resource/init.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/bin/bash
2+
3+
workspace=$(cd `dirname $0`; pwd)
4+
5+
cp ${workspace}/bsc.service /usr/lib/systemd/system/
6+
chmod +x ${workspace}/start.sh ${workspace}/chaind.sh ${workspace}/bsc
7+
8+
service bsc stop
9+
rm -rf /server/validator
10+
mv ${workspace} /server/validator
11+
12+
/server/validator/start.sh

qa-env-resource/machines_meta.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env bash
2+
3+
validator_ips_comma=""
4+
declare -A ips2ids

qa-env-resource/start.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/sh
2+
systemctl daemon-reload
3+
chkconfig bsc on
4+
service bsc restart

0 commit comments

Comments
 (0)