From 5c929df9da855ff968b6374941f909e668ab8c75 Mon Sep 17 00:00:00 2001 From: urban Date: Thu, 31 Aug 2023 22:22:28 +0200 Subject: [PATCH] update logo etc --- .gitignore | 1 + Configurations/screen.screenrc | 3 +++ Messages/logo.txt | 2 +- Messages/wallet_suggestions.txt | 6 ++++++ Scripts/create_configuration.sh | 14 +++++++++++--- Scripts/global.sh | 4 +++- Scripts/start.sh | 12 ++++++++++++ Scripts/status.sh | 13 +++++++++++++ Scripts/stop.sh | 11 +++++++++++ Tools/create_worker.py | 3 ++- 10 files changed, 63 insertions(+), 6 deletions(-) create mode 100644 .gitignore create mode 100644 Configurations/screen.screenrc create mode 100644 Messages/wallet_suggestions.txt create mode 100755 Scripts/start.sh create mode 100755 Scripts/status.sh create mode 100755 Scripts/stop.sh diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c58fb6a --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +Worker/ diff --git a/Configurations/screen.screenrc b/Configurations/screen.screenrc new file mode 100644 index 0000000..df12c42 --- /dev/null +++ b/Configurations/screen.screenrc @@ -0,0 +1,3 @@ +hardstatus on +hardstatus alwayslastline +hardstatus string "%{= kR}[ShurikenPi.io press CTRL A + D to exit]" \ No newline at end of file diff --git a/Messages/logo.txt b/Messages/logo.txt index b4fcb4d..f9a7def 100644 --- a/Messages/logo.txt +++ b/Messages/logo.txt @@ -3,5 +3,5 @@ ||.. ' || .. ... ... ... .. ... || .. .... .. ... ''|||. ||' || || || ||' '' || || .' .|...|| || || . '|| || || || || || || ||'|. || || || - |'....|' .||. ||. '|..'|. .||. .||. .||. ||. '|...' .||. ||. \033[31mpi\033[0m (v 1.0) + |'....|' .||. ||. '|..'|. .||. .||. .||. ||. '|...' .||. ||. \033[31mpi.io\033[0m (v 1.0) \ No newline at end of file diff --git a/Messages/wallet_suggestions.txt b/Messages/wallet_suggestions.txt new file mode 100644 index 0000000..7a67bfc --- /dev/null +++ b/Messages/wallet_suggestions.txt @@ -0,0 +1,6 @@ + To run ShurikenPi you will need a Bitcoin wallet. Getting a Bitcoin wallet is + actually a straightforward process, much easier than many people might think. + If you do not have yet a wallet we recommend: + + * https://samouraiwallet.com/ for Android + * https://sparrowwallet.com/ for PC, Mac and Linux \ No newline at end of file diff --git a/Scripts/create_configuration.sh b/Scripts/create_configuration.sh index ddffb16..4f3c634 100755 --- a/Scripts/create_configuration.sh +++ b/Scripts/create_configuration.sh @@ -4,9 +4,11 @@ source ./global.sh source ./utils.sh msg logo.txt p "We will create a new configuration" +msg wallet_suggestions.txt +echo "" r "Your bitcoin address:" address #python3 ../Tools/address_validation.py $address - +echo "" echo -e " \033[33m?\033[0m Which mining pool would you like to use?" mining_pool=$(gum choose --cursor=  ›  public-pool.io solo.ckpool.org custom) p_user $mining_pool @@ -14,5 +16,11 @@ p_user $mining_pool if [[ $mining_pool == "custom" ]]; then r "Mining pool stratum URL:" $mining_pool fi - -echo "->" $mining_pool \ No newline at end of file +echo "" +p "Creating worker.sh" +python3 ../Tools/create_worker.py $mining_pool $address > ../Worker/worker.sh +chmod +x ../Worker/worker.sh +echo "address: $address" > ../Worker/worker.conf +echo "pool: $mining_pool" >> ../Worker/worker.conf +p "Ready to boil the oceans captain!" +echo "" \ No newline at end of file diff --git a/Scripts/global.sh b/Scripts/global.sh index 19172fa..b48beab 100644 --- a/Scripts/global.sh +++ b/Scripts/global.sh @@ -21,4 +21,6 @@ TMP_DIRECTORY=/tmp/shuriken_io rm -fr $TMP_DIRECTORY 2>&1 mkdir $TMP_DIRECTORY 2>&1 -GIT_URL=https://github.com/Urban-Hacker/shurikenpi.io/ \ No newline at end of file +GIT_URL=https://github.com/Urban-Hacker/shurikenpi.io/ + +SESSION_COUNT=$(screen -ls | grep -c "\.shurikenpi.io") diff --git a/Scripts/start.sh b/Scripts/start.sh new file mode 100755 index 0000000..956c952 --- /dev/null +++ b/Scripts/start.sh @@ -0,0 +1,12 @@ +source ./global.sh +source ./utils.sh + +if [ $SESSION_COUNT -eq 0 ]; then + p "Starting up shurikenpi.io..." + screen -d -m -c ../Configurations/screen.screenrc -S "shurikenpi.io" ../Worker/worker.sh + ./status.sh +elif [ $SESSION_COUNT -eq 1 ]; then + p "shurikenpi.io is already running" +else + ./status.sh +fi diff --git a/Scripts/status.sh b/Scripts/status.sh new file mode 100755 index 0000000..4d922c8 --- /dev/null +++ b/Scripts/status.sh @@ -0,0 +1,13 @@ +source ./global.sh +source ./utils.sh + + +if [ $SESSION_COUNT -eq 1 ]; then + p_ok "shurikenpi.io is running" +elif [ $SESSION_COUNT -gt 1 ]; then + p_warn "Only one instance of shurikenpi.io should be running" + p_warn "shurikenpi.io might have been started multiple time." + p_warn "Please force restart if this is the case." +else + p_err "shurikenpi.io is not running" +fi \ No newline at end of file diff --git a/Scripts/stop.sh b/Scripts/stop.sh new file mode 100755 index 0000000..4c5897f --- /dev/null +++ b/Scripts/stop.sh @@ -0,0 +1,11 @@ +source ./global.sh +source ./utils.sh + +if [ $SESSION_COUNT -eq 0 ]; then + ./status.sh +elif [ $SESSION_COUNT -eq 1 ]; then + p "We will stop shurikenpi.io..." + screen -X -S shurikenpi.io quit +else + ./status.sh +fi diff --git a/Tools/create_worker.py b/Tools/create_worker.py index be4123a..2820289 100644 --- a/Tools/create_worker.py +++ b/Tools/create_worker.py @@ -11,5 +11,6 @@ def get_mining_parameters(pool, address): # Special case when using custom pool return "-a sha256d -o " + pool + " -u " + address -print (get_mining_parameters(sys.argv[1], sys.argv[2])) +command = "../Bin/cpuminer " + get_mining_parameters(sys.argv[1], sys.argv[2]) +print (command) #if sys.argv[1] == "-h" or sys.argv[1] == "--help": \ No newline at end of file