-
Notifications
You must be signed in to change notification settings - Fork 550
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into feature/fix-logic-for-rosetta-integration…
…-test
- Loading branch information
Showing
112 changed files
with
2,768 additions
and
4,459 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
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 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,82 @@ | ||
#!/bin/bash | ||
|
||
set -eo pipefail | ||
|
||
if [[ $# -ne 4 ]]; then | ||
echo "Usage: $0 '<mina-debian-network>''<testnet-name>' '<wait-between-polling-graphql>''<wait-after-final-check>' " | ||
exit 1 | ||
fi | ||
|
||
MINA_DEBIAN_NETWORK=$1 | ||
NETWORK_NAME=$2 | ||
WAIT_BETWEEN_POLLING_GRAPHQL=$3 | ||
WAIT_AFTER_FINAL_CHECK=$4 | ||
|
||
# Don't prompt for answers during apt-get install | ||
export DEBIAN_FRONTEND=noninteractive | ||
|
||
sudo apt-get update | ||
sudo apt-get install -y git apt-transport-https ca-certificates tzdata curl | ||
|
||
git config --global --add safe.directory /workdir | ||
|
||
source buildkite/scripts/export-git-env-vars.sh | ||
|
||
source buildkite/scripts/debian/install.sh "mina-${MINA_DEBIAN_NETWORK}" 1 | ||
|
||
# Remove lockfile if present | ||
rm /home/opam/.mina-config/.mina-lock ||: | ||
|
||
mkdir -p /home/opam/libp2p-keys/ | ||
# Pre-generated random password for this quick test | ||
export MINA_LIBP2P_PASS=eithohShieshichoh8uaJ5iefo1reiRudaekohG7AeCeib4XuneDet2uGhu7lahf | ||
mina libp2p generate-keypair --privkey-path /home/opam/libp2p-keys/key | ||
# Set permissions on the keypair so the daemon doesn't complain | ||
chmod -R 0700 /home/opam/libp2p-keys/ | ||
|
||
# Restart in the background | ||
mina daemon \ | ||
--peer-list-url "https://storage.googleapis.com/seed-lists/${NETWORK_NAME}_seeds.txt" \ | ||
--libp2p-keypair "/home/opam/libp2p-keys/key" \ | ||
& # -background | ||
|
||
# Attempt to connect to the GraphQL client every 10s for up to 8 minutes | ||
num_status_retries=24 | ||
for ((i=1;i<=$num_status_retries;i++)); do | ||
sleep $WAIT_BETWEEN_POLLING_GRAPHQL | ||
set +e | ||
sudo mina client status | ||
status_exit_code=$? | ||
set -e | ||
if [ $status_exit_code -eq 0 ]; then | ||
break | ||
elif [ $i -eq $num_status_retries ]; then | ||
exit $status_exit_code | ||
fi | ||
done | ||
|
||
# Check that the daemon has connected to peers and is still up after 2 mins | ||
sleep "$WAIT_AFTER_FINAL_CHECK" | ||
mina client status | ||
if [ "$(mina advanced get-peers | wc -l)" -gt 0 ]; then | ||
echo "Found some peers" | ||
else | ||
echo "No peers found" | ||
exit 1 | ||
fi | ||
|
||
# Check network id | ||
NETWORK_ID=$(curl 'http://localhost:3085/graphql' \ | ||
-H 'accept: application/json' \ | ||
-H 'content-type: application/json' \ | ||
--data-raw '{"query":"query MyQuery {\n networkID\n}\n","variables":null,"operationName":"MyQuery"}' \ | ||
| jq -r .data.networkID) | ||
|
||
EXPECTED_NETWORK=mina:$NETWORK_NAME | ||
|
||
if [[ "$NETWORK_ID" == "$EXPECTED_NETWORK" ]]; then | ||
echo "Network id correct ($NETWORK_ID)" | ||
else | ||
echo "Network id incorrect (expected: $EXPECTED_NETWORK got: $NETWORK_ID)" | ||
exit 1 | ||
fi |
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
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
Oops, something went wrong.