Skip to content

Commit 187fc06

Browse files
committed
Merge branch 'develop'
2 parents 555e67a + 14eaf75 commit 187fc06

File tree

1 file changed

+47
-3
lines changed

1 file changed

+47
-3
lines changed

.github/workflows/linuxpackage.yml

Lines changed: 47 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,34 +31,78 @@ jobs:
3131
gem install --no-document fpm
3232
fpm --version
3333
34-
make bor
34+
make all
3535
3636
cat > bor.service <<- "EOF"
3737
[Unit]
3838
Description=bor
3939
[Service]
4040
WorkingDirectory=/etc/bor/
4141
EnvironmentFile=/etc/bor/metadata
42-
ExecStart=/bin/bash -c "/usr/bin/bor --datadir /etc/bor/dataDir --port '30303' --rpc --rpcaddr '0.0.0.0' --rpcvhosts '*' --rpccorsdomain '*' --rpcport '8545' --ipcpath /etc/bor/bor.ipc --rpcapi 'db,eth,net,web3,txpool,bor' --networkid ${NETWORK_ID} --miner.gaslimit '20000000' --txpool.nolocals --txpool.accountslots '128' --txpool.globalslots '20000' --txpool.lifetime '0h16m0s' --keystore /etc/bor/dataDir/keystore --unlock ${VALIDATOR_ADDRESS} --password /etc/bor/dataDir/password.txt --allow-insecure-unlock --maxpeers 150 --mine"
42+
ExecStartPre=/bin/chmod +x /etc/bor/start.sh
43+
ExecStart=/bin/bash /etc/bor/start.sh ${NETWORK_ID} ${VALIDATOR_ADDRESS} ${NODE_TYPE}
4344
Type=simple
4445
User=root
4546
EOF
4647
4748
cat > after_install.sh <<- "EOF"
4849
#!/bin/bash
4950
touch /etc/bor/metadata
51+
touch /etc/bor/start.sh
5052
EOF
5153
5254
cat > metadata <<- "EOF"
5355
NETWORK_ID=
5456
VALIDATOR_ADDRESS=
57+
NODE_TYPE=sentry
58+
EOF
59+
60+
cat > start.sh <<- "EOF"
61+
#!/usr/bin/env sh
62+
63+
NETWORK_ID=$1
64+
VALIDATOR_ADDRESS=$2
65+
NODE_TYPE=$3
66+
67+
DATA_DIR=/etc/bor/dataDir
68+
69+
args="/usr/bin/bor --datadir $DATA_DIR --port '30303' --rpc --rpcaddr '0.0.0.0' --rpcvhosts '*' --rpccorsdomain '*' --rpcport '8545' --ipcpath /etc/bor/bor.ipc --rpcapi 'db,eth,net,web3,txpool,bor' --networkid $NETWORK_ID --miner.gaslimit '200000000' --miner.gastarget '20000000' --txpool.nolocals --txpool.accountslots '128' --txpool.globalslots '20000' --txpool.lifetime '0h16m0s' "
70+
71+
if [[ $NODE_TYPE == 'validator' ]]; then
72+
args+="--keystore $DATA_DIR/keystore \
73+
--unlock $VALIDATOR_ADDRESS \
74+
--password $DATA_DIR/password.txt \
75+
--allow-insecure-unlock \
76+
--nodiscover --maxpeers 1 \
77+
--mine
78+
"
79+
fi
80+
81+
if [[ $NODE_TYPE == 'sentry' ]]; then
82+
args+="--maxpeers 200
83+
"
84+
fi
85+
86+
if [[ $NODE_TYPE == 'validator-without-sentry' ]]; then
87+
args+="--keystore $DATA_DIR/keystore \
88+
--unlock $VALIDATOR_ADDRESS \
89+
--password $DATA_DIR/password.txt \
90+
--allow-insecure-unlock \
91+
--maxpeers 200 \
92+
--mine
93+
"
94+
fi
95+
96+
eval $args
5597
EOF
5698
5799
fpm -s dir -t deb --deb-user root --deb-group root -n matic-bor -v ${{ env.RELEASE_VERSION }} \
58100
--after-install after_install.sh \
59101
bor.service=/etc/systemd/system/ \
60102
build/bin/bor=/usr/bin/ \
61-
metadata=/etc/bor/
103+
build/bin/bootnode=/usr/bin/ \
104+
metadata=/etc/bor/ \
105+
start.sh=/etc/bor/
62106
63107
mkdir packages-v${{ env.RELEASE_VERSION }}
64108

0 commit comments

Comments
 (0)