-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tests/truffle: adapt changes in bsc-genesis-contracts
- Loading branch information
Showing
10 changed files
with
150 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,7 +14,6 @@ | |
*/**/*tx_database* | ||
*/**/*dapps* | ||
build/_vendor/pkg | ||
/tests/truffle/storage | ||
|
||
#* | ||
.#* | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,26 +7,29 @@ function prepare() { | |
echo "geth do not exist!" | ||
exit 1 | ||
fi | ||
rm -rf ${workspace}/storage/* | ||
cd ${workspace}/genesis | ||
rm -rf validators.conf | ||
cp ${workspace}/storage/genesis.json ${workspace}/genesis/genesis.json | ||
} | ||
|
||
function init_validator() { | ||
node_id=$1 | ||
rm -rf ${workspace}/storage/${node_id} | ||
mkdir -p ${workspace}/storage/${node_id} | ||
geth --datadir ${workspace}/storage/${node_id} account new --password /dev/null > ${workspace}/storage/${node_id}Info | ||
validatorAddr=`cat ${workspace}/storage/${node_id}Info|grep 'Public address of the key'|awk '{print $6}'` | ||
echo "${validatorAddr},${validatorAddr},${validatorAddr},0x0000000010000000" >> ${workspace}/genesis/validators.conf | ||
echo ${validatorAddr} > ${workspace}/storage/${node_id}/address | ||
cp -r ${workspace}/storage/keystore ${workspace}/storage/${node_id}/ | ||
cp ${workspace}/storage/address ${workspace}/storage/${node_id}/address | ||
} | ||
|
||
function generate_genesis() { | ||
cd ${workspace}/genesis/scripts/ | ||
node generate-validator.js | ||
INIT_HOLDER_ADDRESSES=$(ls ${workspace}/init-holders | tr '\n' ',') | ||
INIT_HOLDER_ADDRESSES=${INIT_HOLDER_ADDRESSES/%,/} | ||
node generate-initHolders.js --initHolders ${INIT_HOLDER_ADDRESSES} | ||
node generate-genesis.js --chainid ${BSC_CHAIN_ID} | ||
|
||
cd ${workspace}/genesis | ||
#source /root/.profile && foundryup | ||
#forge install --no-git --no-commit foundry-rs/[email protected] | ||
bash ${workspace}/genesis/scripts/generate.sh local | ||
} | ||
|
||
function init_genesis_data() { | ||
|
@@ -43,8 +46,8 @@ function init_genesis_data() { | |
|
||
function prepareBLSWallet(){ | ||
node_id=$1 | ||
echo "123456" > ${workspace}/storage/${node_id}/blspassword.txt | ||
expect ${workspace}/scripts/create_bls_key.sh ${workspace}/storage/${node_id} | ||
echo "1234567890" > ${workspace}/storage/${node_id}/blspassword.txt | ||
geth bls account new --datadir ${workspace}/storage/${node_id} --blspassword ${workspace}/storage/${node_id}/blspassword.txt | ||
|
||
sed -i -e 's/DataDir/BLSPasswordFile = \"{{BLSPasswordFile}}\"\nBLSWalletDir = \"{{BLSWalletDir}}\"\nDataDir/g' ${workspace}/storage/${node_id}/config.toml | ||
PassWordPath="/root/.ethereum/blspassword.txt" | ||
|
@@ -54,14 +57,14 @@ function prepareBLSWallet(){ | |
} | ||
|
||
prepare | ||
|
||
NUMS_OF_VALIDATOR=1 | ||
# Step 1, generate config for each validator | ||
for((i=1;i<=${NUMS_OF_VALIDATOR};i++)); do | ||
init_validator "bsc-validator${i}" | ||
done | ||
|
||
# Step 2, use validator configs to generate genesis file | ||
generate_genesis | ||
#generate_genesis | ||
|
||
# Step 3, use genesis file to init cluster data | ||
init_genesis_data bsc-rpc bsc-rpc | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
0x03735c2ED70a56CD221e0024eB4bF90243C9d6E9 |
Large diffs are not rendered by default.
Oops, something went wrong.
1 change: 1 addition & 0 deletions
1
...ge/keystore/UTC--2023-12-07T03-21-00.035782000Z--03735c2ed70a56cd221e0024eb4bf90243c9d6e9
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"address":"03735c2ed70a56cd221e0024eb4bf90243c9d6e9","crypto":{"cipher":"aes-128-ctr","ciphertext":"b66550ef67345005ead82c9e2835d311fb0e8787191af3696119977064f6120e","cipherparams":{"iv":"5b8f4ed6026ab6c733857e3bed90a869"},"kdf":"scrypt","kdfparams":{"dklen":32,"n":262144,"p":1,"r":8,"salt":"68fc3d0829122badcf8c6efd40c6f2e086a5167db489bed099e3d2b97c1be496"},"mac":"71fd9f23862f7252ca88a6ea2c29fd0ab3527c5b9f5d1f827856263247c92f46"},"id":"7f75b57a-a4ba-4877-a42b-652f966d8aa6","version":3} |
6c788d7
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Possible sensitive data exposed in this commit:
1.tests/truffle/storage/keystore/UTC--2023-12-07T03-21-00.035782000Z--03735c2ed70a56cd221e0024eb4bf90243c9d6e9
2.tests/truffle/.env