diff --git a/AkashNetwork/README.md b/AkashNetwork/README.md new file mode 100644 index 000000000..2249a1b3d --- /dev/null +++ b/AkashNetwork/README.md @@ -0,0 +1,19 @@ +## Deploy Restake on Akash Network + +> [Short guides](https://github.com/DecloudNodesLab/Guides) about deploying on [Akash Network](https://akash.network/). + +Copy [deploy.yml](/AkashNetwork/deploy.yml) and insert to [Cloudmos](https://deploy.cloudmos.io/). + +#### Available variables:
+`SSH_PASS` - for activate ssh connection.
+`MNEMONIC` - passing phrase mnemonic to container explicitly, without encryption.
+`MNEMONIC_BASE64` - passing the phrase mnemonic to the container, as a BASE64 encrypted string.
+`NETWORK_JSON_LINK` - A RAW (or direct) link to your networks.json file, by default the repository's [networks.json](/src/networks.json) is used.
+`NETWORK_LOCAL_JSON_LINK` - A RAW (or direct) link to your networks.local.json file
+`CRONTAB` - the frequency of jobs in crontab, for example, to run every day at **21:00**, you should use `0 21 * * *`
+`RUN_ARG`- fill in if you want to run only selected chains, for example `"RUN_ARG=akash osmosis"`
+ +#### Example: +![image](https://github.com/Dimokus88/restake/assets/23629420/d45d290b-a4b4-496b-b43b-b04169e250c9) + +**Use Akash Network! =)** diff --git a/AkashNetwork/deploy.yml b/AkashNetwork/deploy.yml new file mode 100644 index 000000000..ed1fe5495 --- /dev/null +++ b/AkashNetwork/deploy.yml @@ -0,0 +1,46 @@ +--- +version: "2.0" +services: + app: + image: ubuntu:20.04 + env: + - "SSH_PASS=" + - "MNEMONIC=" + - "MNEMONIC_BASE64=" + - "NETWORK_JSON_LINK=" + - "NETWORK_LOCAL_JSON_LINK=" + - "CRONTAB=0 21 * * *" + - "RUN_ARG=" + command: + - "bash" + - "-c" + args: + - 'apt-get update ; + apt-get upgrade -y ; + apt-get install -y curl; curl -s https://raw.githubusercontent.com/eco-stake/restake/master/AkashNetwork/main.sh | bash ' + expose: + - port: 22 + as: 22 + to: + - global: true +profiles: + compute: + app: + resources: + cpu: + units: 1 + memory: + size: 512Mi + storage: + size: 1Gi + placement: + akash: + pricing: + app: + denom: uakt + amount: 10000 +deployment: + app: + akash: + profile: app + count: 1 diff --git a/AkashNetwork/main.sh b/AkashNetwork/main.sh new file mode 100644 index 000000000..f907b4c25 --- /dev/null +++ b/AkashNetwork/main.sh @@ -0,0 +1,27 @@ +#!/bin/bash +# Telegram @Dimokus +# Discord Dimokus_ +# 2023 +TZ=Europe/London && ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone +apt install -y nano wget build-essential git make gcc nvme-cli ssh cron +export EDITOR=nano +curl -sL https://deb.nodesource.com/setup_18.x -o /tmp/nodesource_setup.sh +chmod +x /tmp/nodesource_setup.sh +/tmp/nodesource_setup.sh +apt install nodejs -y +node --version +npm --version +if [[ -n $SSH_PASS ]] ; then apt install -y ssh; echo "PermitRootLogin yes" >> /etc/ssh/sshd_config && (echo ${SSH_PASS}; echo ${SSH_PASS}) | passwd root && service ssh restart; fi +git clone https://github.com/eco-stake/restake +cd restake +npm install +if [[ -n $MNEMONIC ]]; then echo MNEMONIC="$MNEMONIC" > .env; fi +if [[ -n $MNEMONIC_BASE64 ]]; then echo MNEMONIC=`echo "$MNEMONIC_BASE64" | base64 -d` > .env; fi +if [[ -n $NETWORK_JSON_LINK ]]; then wget -O /restake/src/networks.json $NETWORK_JSON_LINK;fi +if [[ -n $NETWORK_LOCAL_JSON_LINK ]]; then wget -O /restake/src/networks.local.json $NETWORK_LOCAL_JSON_LINK; fi +npm run autostake $RUN_ARG +crontab -l > current_cron +echo "$CRONTAB /bin/bash -c 'cd /restake && npm run autostake $RUN_ARG' > /restake/restake.log 2>&1" >> ~/current_cron +crontab -l | cat - ~/current_cron | crontab - +service cron start +sleep infinity