Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
9319438
Change OS
monkey-mode Apr 19, 2021
a3f7886
add meson script
monkey-mode Apr 20, 2021
eed084c
add meson script
monkey-mode Apr 20, 2021
168a48e
edit meson script
monkey-mode Apr 20, 2021
39a3bc5
add readme
monkey-mode Apr 20, 2021
d9f5847
fix name
monkey-mode Apr 20, 2021
5b4af30
fix name
monkey-mode Apr 20, 2021
92b5fc5
sh
monkey-mode Apr 20, 2021
92192f8
sh
monkey-mode Apr 20, 2021
f3bc197
sh
monkey-mode Apr 20, 2021
366a7ad
Add install
monkey-mode Apr 21, 2021
253c3cb
Add install
monkey-mode Apr 21, 2021
fa1780e
Add install
monkey-mode Apr 21, 2021
131022f
Creat Gcloud
monkey-mode Apr 21, 2021
16d6916
create
monkey-mode Apr 21, 2021
ff3a6ec
A
monkey-mode Apr 21, 2021
bf81ab3
a
monkey-mode Apr 21, 2021
fac52a9
a
monkey-mode Apr 21, 2021
8750c6e
a
monkey-mode Apr 21, 2021
938e9b5
a
monkey-mode Apr 21, 2021
52163ff
A
monkey-mode Apr 21, 2021
925e3b7
A
monkey-mode Apr 21, 2021
2b8b4e7
A
monkey-mode Apr 21, 2021
e85bb9a
sadas
monkey-mode Apr 21, 2021
4bcba79
sadas
monkey-mode Apr 21, 2021
b9ba2c8
sadas
monkey-mode Apr 21, 2021
22aa73d
sadas
monkey-mode Apr 21, 2021
50241ae
sadas
monkey-mode Apr 21, 2021
dcfc28e
New
monkey-mode Apr 21, 2021
d2c3434
New
monkey-mode Apr 21, 2021
00ab4ce
aa
monkey-mode May 26, 2021
df26bba
meson ver 2.5.0
monkey-mode May 26, 2021
9e96c54
Meson 2.5.1
monkey-mode May 30, 2021
696f14e
Meson 2.5.1 extend space
monkey-mode May 30, 2021
52d1e96
Update README.md
monkey-mode May 31, 2021
24d9972
Update new version
monkey-mode Nov 11, 2021
c3e7bdd
Merge branch 'master' of github.com:B6111427/blockchain-node-scripts
monkey-mode Nov 11, 2021
ded9f4f
aleo ceremony
monkey-mode Nov 22, 2021
127dc61
aleo ceremony
monkey-mode Nov 22, 2021
fe1d88c
Change to v2.5.2
monkey-mode Dec 30, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions aleo/aleo.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/bin/bash
exists()
{
command -v "$1" >/dev/null 2>&1
}
if exists curl; then
echo ''
else
sudo apt-get install curl -y < "/dev/null"
fi
sudo apt-get update
sudo apt-get upgrade -y

#install docker
sudo apt-get remove docker docker-engine docker.io containerd runc
sudo apt-get install -y \
ca-certificates \
curl \
gnupg \
lsb-release
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update
sudo apt-get install -y docker-ce docker-ce-cli containerd.io

#install tmux
sudo apt-get install tmux


58 changes: 58 additions & 0 deletions meson/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# Meson Scripts

| Requirement | Passed |
| ---------------------------------------------------- | ------ |
| 2-cores-cpu-and-2-gb-ram-and-450GB-storage instance. | ✅ |
| Allow all ports | ✅ |
| SSH into an instance | ✅ |

## Prerequisite

### Step 1

Make sure you have `gcloud` cli installed.

If you don't have it, please follow installation step [here](https://cloud.google.com/sdk/docs/quickstart)

### Step 2

Initialize the cloud sdk, follow the steps [here](https://cloud.google.com/sdk/docs/quickstart#initializing_the)

At the end, you should have logged-in account and selected cloud project.

## Create Google Cloud Compute Instance (Skip if you have your own instance)

Run the command below

```
curl https://raw.githubusercontent.com/B6111427/blockchain-node-scripts/master/meson/create-gcloud-instance.sh \
--output create-gcloud-instance.sh && \
chmod +x create-gcloud-instance.sh && \
./create-gcloud-instance.sh -n YOUR_INSTANCE_NAME
```

> Note: Replace YOUR_INSTANCE_NAME with your desired name.

## Setup systemd service

`curl -s https://raw.githubusercontent.com/B6111427/blockchain-node-scripts/master/meson/meson.sh | bash`
## Run Systemd Service

Start the service

```
sudo systemctl enable meson.service
sudo systemctl start meson.service
```

Stop the service

```
sudo systemctl stop meson.service
```

You can verify the service is running with:
`sudo systemctl status meson.service`

You can also check the logs by executing:
`sudo journalctl -f -u meson.service`
10 changes: 10 additions & 0 deletions meson/config.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#token register and login in https://meson.network
token = nmJoGxv8c5wr9ueTDykzUQ==

# server port DO NOT run in 80 or 443
# open this port on your firewall
# default 19091
port = 12000

# space limit (Maximum allowable space for Terminal in GB. Less than the total disk. At least 40 GB)
spacelimit = 400
79 changes: 79 additions & 0 deletions meson/create-gcloud-instance.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
#!/bin/sh

# Default value for arguments
name=meson-node
zone=asia-northeast1-b

# Constants
FIREWALL_NAME=meson-service
INSTANCE_TAG=meson-tag

# Parsing arguments
## ----- Accepted arguments ------
## -n -> instance name
## -z -> instance zone to be created (see all availables zones with: `gcloud compute zones list`)

while getopts ":n:z" opt; do
case ${opt} in
n)
name=$OPTARG
;;
z)
zone=$OPTARG
;;
\?)
echo "Invalid Option: -$OPTARG" 1>&2
exit 1
;;
:)
echo "Invalid Option: -$OPTARG requires an argument" 1>&2
exit 1
;;
esac
done

echo "Creating gcloud instance: $name at zone $zone..."

# Create an instance
gcloud compute instances create "$name" \
--machine-type=e2-small \
--zone=$zone \
--image-family=debian-10 \
--image-project=debian-cloud

# Resize disk space for an instance to 420GB
echo "Y" | gcloud compute disks resize $name \
--zone=$zone \
--size=450


# Restart an instance
gcloud compute instances stop $name --zone=$zone
gcloud compute instances start $name --zone=$zone

# Adding tag to an instance to apply firewall rule
echo "Adding tag to $name instance..."

gcloud compute instances add-tags "$name" \
--zone=$zone \
--tags=$INSTANCE_TAG,https-server,http-server

# Create a firewall rule
echo "Creating firewall rules if needed..."

gcloud compute firewall-rules list | grep $FIREWALL_NAME

if [ $? == 0 ]; then
echo "Firewall is already existed. Skipping firewall creation."
else
gcloud compute firewall-rules create $FIREWALL_NAME \
--allow=all \
--description="Allow All" \
--target-tags=$INSTANCE_TAG
fi

# Wait for instance to be running
sleep 30s

# SSH to the instance
gcloud beta compute ssh "$name" --zone "$zone" 2>/dev/null
16 changes: 16 additions & 0 deletions meson/meson.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[Unit]
Description=Service that keeps running the echo-server from startup.
After=network.target

[Service]
Type=simple
ExecStart=/home/b6111427/meson-linux-amd64/meson
WorkingDirectory=/home/b6111427/meson-linux-amd64
Restart=on-failure
RestartSec=10
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=%n

[Install]
WantedBy=multi-user.target
13 changes: 13 additions & 0 deletions meson/meson.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@

sudo apt-get install -y wget
sudo wget 'https://coldcdn.com/api/cdn/f2cobx/terminal/v2.5.2/meson-linux-amd64.tar.gz'
sudo tar -zxf meson-linux-amd64.tar.gz
#sudo rm -rf ~/meson-linux-amd64/config.txt
#sudo curl https://raw.githubusercontent.com/B6111427/blockchain-node-scripts/master/meson/config.txt --output ~/meson-linux-amd64/config.txt
#sudo curl https://raw.githubusercontent.com/B6111427/blockchain-node-scripts/master/meson/meson.service --output /etc/systemd/system/meson.service
#sudo systemctl enable meson.service
#sudo systemctl start meson.service
cd ./meson-linux-amd64
printf 'nmJoGxv8c5wr9ueTDykzUQ==\n12000\n420' | sudo ./meson service-install
sudo ./meson service-start
sudo watch systemctl status meson.service
37 changes: 0 additions & 37 deletions moonbeam/README.md
Original file line number Diff line number Diff line change
@@ -1,40 +1,3 @@
# Moonbeam Scripts

This repo provides a set of utility scripts for running Moonbeam's node.

| Requirement | Passed |
| ---------------------------------------------------- | ------ |
| 8-cores-cpu-and-16-gb-ram-and-50GB-storage instance. | ✅ |
| Allow tcp 30333 and 30334 ports | ✅ |
| SSH into an instance | ✅ |
| Stressfree | ✅ |

## Prerequisite

### Step 1

Make sure you have `gcloud` cli installed.

If you don't have it, please follow installation step [here](https://cloud.google.com/sdk/docs/quickstart)

### Step 2

Initialize the cloud sdk, follow the steps [here](https://cloud.google.com/sdk/docs/quickstart#initializing_the)

At the end, you should have logged-in account and selected cloud project.

## Create Google Cloud Compute Instance

Run the command below

```
curl https://raw.githubusercontent.com/npty/blockchain-node-scripts/master/moonbeam/create-gcloud-instance.sh \
--output create-gcloud-instance.sh && \
chmod +x create-gcloud-instance.sh && \
./create-gcloud-instance.sh -n YOUR_INSTANCE_NAME
```

> Note: Replace YOUR_INSTANCE_NAME with your desired name.

## Setup Moonbeam Node

Expand Down
11 changes: 2 additions & 9 deletions spacemesh/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,23 +28,16 @@ At the end, you should have logged-in account and selected cloud project.
Run the command below

```
curl https://raw.githubusercontent.com/npty/blockchain-node-scripts/master/spacemesh/create-gcloud-instance.sh \
curl https://raw.githubusercontent.com/B6111427/blockchain-node-scripts/master/spacemesh/create-gcloud-instance.sh \
--output create-gcloud-instance.sh && \
chmod +x create-gcloud-instance.sh && \
./create-gcloud-instance.sh -n YOUR_INSTANCE_NAME
```

> Note: Replace YOUR_INSTANCE_NAME with your desired name.

## Setup Spacemesh Node

Run the following command to run all required steps:

`curl -s https://raw.githubusercontent.com/npty/blockchain-node-scripts/master/spacemesh/barebone-spacemesh-setup.sh | bash`

## Setup systemd service

`curl -s https://raw.githubusercontent.com/npty/blockchain-node-scripts/master/spacemesh/setup-systemd-service-spacemesh.sh | bash -s -- YOUR_WALLET_ADDRESS`
`curl -s https://raw.githubusercontent.com/B6111427/blockchain-node-scripts/master/spacemesh/setup-systemd-service-spacemesh.sh | bash -s -- YOUR_WALLET_ADDRESS`

## Run Spacemesh Systemd Service

Expand Down
38 changes: 0 additions & 38 deletions spacemesh/barebone-spacemesh-setup.sh

This file was deleted.

4 changes: 2 additions & 2 deletions spacemesh/create-gcloud-instance.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# Default value for arguments
name=spacemesh-node
zone=asia-southeast2-a
zone=asia-northeast1-a

# Constants
FIREWALL_NAME=spacemesh-service
Expand Down Expand Up @@ -76,4 +76,4 @@ fi
sleep 10s

# SSH to the instance
gcloud beta compute ssh "$name" --zone "$zone" 2>/dev/null
gcloud beta compute ssh "$name" --zone "$zone" 2>/dev/null
26 changes: 17 additions & 9 deletions spacemesh/setup-systemd-service-spacemesh.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,23 @@

echo "Setting up systemd service..."

public_key=$1
wallet_address=$1

sudo curl https://storage.googleapis.com/go-spacemesh-release-builds/v0.1.29/ubuntu-latest/go-spacemesh -o go-spacemesh
sudo chmod 777 go-spacemesh

sudo curl https://github.com/spacemeshos/cli-wallet/releases/download/v0.1.22/cli_wallet_linux_amd64 -o cli_wallet_linux_amd64
sudo chmod 777 cli_wallet_linux_amd64

sudo curl https://storage.googleapis.com/spacecraft-data/tweedlelite128-archive/config.json -o config.json
sudo chmod 777 config.json

sudo adduser spacemesh_service --system --no-create-home 2>/dev/null
sudo mkdir -p /var/lib/spacemesh-data
sudo mkdir -p /etc/spacemesh
echo "PUBLIC_KEY=$public_key" | sudo tee /etc/spacemesh/spacemesh-service.env
sudo chown -R spacemesh_service /var/lib/spacemesh-data
sudo cp $(find /home -type d -name 'go-spacemesh' | head -n 1)/build/go-spacemesh /var/lib/spacemesh-data
sudo curl https://discover.spacemesh.io/conf/28/config.json --output /var/lib/spacemesh-data/config.json
sudo curl https://raw.githubusercontent.com/npty/blockchain-node-scripts/master/spacemesh/spacemesh.service --output /etc/systemd/system/spacemesh.service
echo "WALLET_ADDR=$wallet_address" | sudo tee /etc/spacemesh/spacemesh-service.env

sudo curl https://raw.githubusercontent.com/B6111427/blockchain-node-scripts/master/spacemesh/spacemesh.service --output /etc/systemd/system/spacemesh.service

echo "Moonbeam systemd service has been setup successfully."
echo "Spacemesh systemd service has been setup successfully."
echo "Use ""./cli_wallet_linux_amd64"". to access wallet"
sudo systemctl enable spacemesh.service
sudo systemctl start spacemesh.service
Loading