Skip to content

Commit 017b526

Browse files
committed
support QA deploy
1 parent 592cf11 commit 017b526

14 files changed

Lines changed: 264 additions & 35 deletions

.env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ KEYPASS="0123456789"
55
#private key 59ba8068eb256d520179e903f43dacf6d8d57d72bd306e1bd603fdb8c8da10e8
66
INIT_HOLDER="0x04d63aBCd2b9b1baa327f2Dda0f873F197ccd186"
77
INIT_HOLDER_PRV="59ba8068eb256d520179e903f43dacf6d8d57d72bd306e1bd603fdb8c8da10e8"
8-
HARD_FORK_DELAY=40
8+
HARD_FORK_DELAY=200
99
FullImmutabilityThreshold=512
1010
MinBlocksForBlobRequests=576
1111
DefaultExtraReserveForBlobRequests=32

.gitignore

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

77
.local/
88

9-
.idea/
9+
.idea/
10+
11+
/qa-env-resource/machines_meta.sh

.gitmodules

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[submodule "genesis"]
22
path = genesis
3-
url = ../bsc-genesis-contract.git
3+
url = https://github.com/bnb-chain/bsc-genesis-contract.git
44
branch = master
55
ignore = dirty

bin/.gitkeep

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Ignore everything in this directory
2+
*
3+
# Except geth

bin/getInitConsensusState

Lines changed: 0 additions & 9 deletions
This file was deleted.

bin/getInitConsensusState_linux

-25.4 MB
Binary file not shown.

bin/getInitConsensusState_macos

-29 MB
Binary file not shown.

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

0 commit comments

Comments
 (0)