forked from keep-starknet-strange/madara
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #124 from Trantorian1/feat/scripts
feat(script): 🔨 Added new CI scrips
- Loading branch information
Showing
14 changed files
with
334 additions
and
51 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 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
#!/bin/bash | ||
|
||
if [ "$#" -lt 1 ]; then | ||
echo "Usage: $0 [start|reset|reboot|lint|help] [KEY for start/reboot]" | ||
exit 1 | ||
fi | ||
|
||
start_deoxys(){ | ||
local key=$1 | ||
echo "🚀 start deoxys..." | ||
cargo run \ | ||
--release \ | ||
-- \ | ||
--deoxys \ | ||
--rpc-port 9944 \ | ||
--network main \ | ||
--rpc-cors all \ | ||
--pruning archive \ | ||
--cache \ | ||
--l1-endpoint="$key" | ||
} | ||
|
||
clear_db(){ | ||
echo "🛠️ clear end rebuild DB..." | ||
read -p "Are you sure? [y/N] " -n 1 -r | ||
if [[ ! $REPLY =~ ^[Yy]$ ]] | ||
then | ||
exit 1 | ||
fi | ||
rm -rf /tmp/deoxys | ||
} | ||
|
||
lint(){ | ||
echo "📝 Running linters..." | ||
read -p "Are you sure? [y/N] " -n 1 -r | ||
if [[ ! $REPLY =~ ^[Yy]$ ]] | ||
then | ||
exit 1 | ||
fi | ||
npx @taplo/[email protected] fmt --config ./taplo/taplo.toml | ||
npx prettier --write . | ||
} | ||
|
||
ACTION=$1 | ||
|
||
case $ACTION in | ||
start) | ||
if [ "$#" -ne 2 ]; then | ||
echo "Usage for start: $0 start [KEY]" | ||
exit 1 | ||
fi | ||
start_deoxys "$2" | ||
;; | ||
reset) | ||
if [ "$#" -ne 1 ]; then | ||
echo "Usage for reset: $0 reset" | ||
exit 1 | ||
fi | ||
clear_db | ||
;; | ||
reboot) | ||
if [ "$#" -ne 2 ]; then | ||
echo "Usage for reboot: $0 reboot [KEY]" | ||
exit 1 | ||
fi | ||
clear_db | ||
start_deoxys "$2" | ||
;; | ||
lint) | ||
lint | ||
;; | ||
help) | ||
echo "Usage: $0 [start|reset|reboot|lint|help] [KEY for start/reboot]" | ||
echo "start: start deoxys with KEY" | ||
echo "reset: clear and rebuild DB" | ||
echo "reboot: clear and rebuild DB, then start deoxys with KEY" | ||
echo "lint: run CI linter on project" | ||
;; | ||
*) | ||
echo "Invalid argument: $ACTION" | ||
exit 1 | ||
;; | ||
esac | ||
|
||
exit 0 |
Oops, something went wrong.