├── LICENSE ├── README.md ├── buy-vps.md ├── create-vpn.md ├── linux-commands.md └── linux-config.md /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2024 Moei 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Linux and Node installation guide 2 | * This repo is made to help you install a linux environment to participate in node testnets or the ones that need coding 3 | * Testnet nodes are risky because it costs money & time and is hard because you will get to many issues specially if you are a beginner 4 | 5 | # This Guide Consists of: 6 | * 1- [How to Buy & Connect to VPS](https://github.com/0xmoei/Linux_Node_Guide/blob/main/buy-vps.md) 7 | * 2- [Config VPS](https://github.com/0xmoei/Linux_Node_Guide/blob/main/linux-config.md) 8 | * 3- [Linux Commands](https://github.com/0xmoei/Linux_Node_Guide/blob/main/linux-commands.md) 9 | * Optional: [Create VPN](https://github.com/0xmoei/Linux_Node_Guide/blob/main/create-vpn.md) 10 | 11 | ## Errors 12 | * The best way to find solutions for your errors is the project's discord or GPT4 & GPT Claude 13 | * One of the best choices for GPT is [MyShell](https://app.myshell.ai/invite/136650) 14 | 15 | ## Follow me 16 | * However you must have my [Github](https://github.com/0xmoei) & [Twitter](https://x.com/0xMoei) followed for new node testnet updates 17 | 18 | ## Help edit this guide 19 | * Fork this repo to keep it in front of your eyes 20 | * Please consider creating pull request if you found any issues to edit and complete this repository 21 | -------------------------------------------------------------------------------- /buy-vps.md: -------------------------------------------------------------------------------- 1 | # 1- Where to buy VPS 2 | 3 | The first thing that is needed to participate in Node Testnets is a VPS server 4 | 5 | In order to buy a VPS ( Cloud Server), I introduce several good (in my opinion) foreign & Iranian providers with and without crypto payment with brief information 6 | 7 | | Rank | Provider | Payment Method | Discription | 8 | | :-------- | :-------- | :------- | :-------------------------------- | 9 | | 1 | Hetznr | `Credit card - need KYC` | `Best Hosting , not very cheap` [auction servers](https://www.hetzner.com/sb/) (min. $30) are good | 10 | | 2 | Contabo | `Credit card - need KYC` | `Cheap but for a very few nodes we had bandwidth issues` | 11 | | 3 | [Hostbrr](https://my.hostbrr.com/order/forms/a/NTMxNw==) | `Crypto` | `Cheap to Normal pricing, good performance` | 12 | | 4 | [PQhosting](https://pq.hosting/?from=687947) | `Crypto, You might need KYC` | `Good performance and some cheap servers` | 13 | | 5 | [Aeza](https://aeza.net/?ref=392339) | `Crypto` | `Good for hourly servers, or you might findaa good server simetimes` | 14 | 15 | 16 | 17 | 18 | ### I'm not RESPONSIBLE nor AFFILATED with any of these providers. I just used them before, and I think they are good choice. You can choose wherever you think is better 19 | 20 | # 21 | 22 | # 2- What system to buy 23 | Before buying a VPS, we must consider several components to choose the required system 24 | 25 | * `CPU`: Usually, 4core to 16core 26 | * `Ram`: Usually, 4GB to 32GB 27 | * `HDD`, `SSD`: Projects always consider the hard disk of the Nodes to be higher than required. In few nodes such as `Prover` or `Validator in Active-set` maybe a lot of hard disk is needed. Minimum is better to be `60` 28 | * `Operating-system` must be `Ubuntu`, `Ubuntu 22` is usually compatible with every project 29 | * VPS must be ipv4 and must NOT be NAT 30 | 31 | # 32 | 33 | # 3- Let's Buy a VPS 34 | To understand better, let's buy a server from 2 Iranian and foreign providers 35 | 36 | This is not an advice to buy from them and I just want to show you the process 37 | 38 | ### After this guide, I'm not sure if they will get out of stock of their servers, you can consider creating a ticket to ask before proceeding to buy 39 | 40 | ## Hostbrr 41 | Let's list some of their servers orders: 42 | * The list might be outdated, I **recommend** to go find yourself. 43 | 44 | > High RAM: [Memory-Optimized VPS](https://my.hostbrr.com/order/main/packages/largeram/?group_id=23&a=NTMxNw==) 45 | > 46 | > High RAM - Better net bandwidth: [RAM-Optimized - Premium](https://my.hostbrr.com/order/main/packages/largeram/?group_id=38&a=NTMxNw==) 47 | > 48 | > Good CPU: [AMD Ryzen 9 7950XD](https://my.hostbrr.com/order/main/packages/vps7950/?group_id=14&a=NTMxNw==) 49 | > 50 | > Good CPU - Cheaper: [AMD Ryzen 9 5950X](https://my.hostbrr.com/order/main/packages/vpsgermany/?group_id=13&a=NTMxNw==) 51 | 52 | ### 1- I pick $14.99 VPS from [AMD Ryzen 9 5950X](https://my.hostbrr.com/order/main/packages/vpsgermany/?group_id=13&a=NTMxNw==) 53 | 54 | * 4 vCore ,8GB RAM, 150 GB Storage can be a good choice for me 55 | 56 | ![Screenshot_1](https://github.com/user-attachments/assets/3e1cf6a4-583a-41c6-a300-5d3e1b6d0dc2) 57 | 58 | ### 2- I register my Contact Information and pay with my metamask wallet through Coinbase Commence payment method 59 | 60 | ### 3- Install Ubuntu.22 61 | * After payment, I wait until my server to get `active` in `services` page 62 | * We must install ubuntu manually in Hostbrr when server is activated 63 | 64 | ![Screenshot_2](https://github.com/user-attachments/assets/fd9b2384-dba7-4b7b-a4a2-6d457b66ff12) 65 | 66 | ![Screenshot_106](https://github.com/user-attachments/assets/a55459d4-9520-494a-9f2a-ae76f8c6cc0d) 67 | 68 | 69 | ### VPS details 70 | They will Email your `IP` & `password` after server installed Ubuntu 71 | 72 | # 73 | 74 | # 4- How to connect to VPS 75 | ### 1- You need a client to connect to your VPS through SSH 76 | > List of Clients: 77 | > 78 | > 1- My prefer: Mobaxterm (has SFTP: you can manage your files & directories 79 | > 80 | > 2- Termius (has SFTP) 81 | > 82 | > 3- Putty (No SFTP, Just a terminal) 83 | 84 | ### 2- VPS Details 85 | You need following details to connect to your VPS through SSH 86 | * `IP`: Provider will email you after activation 87 | * `Port`: Default open port for SSH connection is always `22` 88 | * `User`: Default user is always `root` 89 | * `Password`: Provider will email you after activation 90 | 91 | ### 3- Connect via Mobaxterm 92 | > 1- Click `session` and open `SSH` tab 93 | > 94 | > 2- In `Remote host` you must fill your server IP, if you write `root@` behind it, it uses `root` as user 95 | > 96 | > 3- Default SSH port is 22 97 | > 98 | > 4- After clicking `OK`, a Terminal opens which needs your `password`, Copy it & Paste it in the reminal by clicking `Mouse Middle Scroll Wheel`, Password will be hidden in terminal 99 | > 100 | ![Screenshot_5](https://github.com/user-attachments/assets/5c63934d-df07-4287-b87a-b98c6eb31156) 101 | 102 | ### 4- Now you have a Terminal that you can write your commands in it 103 | SFTP: You can see your home: `/root/` directory & its files and folders in left side of the Mobaxterm client 104 | 105 | ![Screenshot_6](https://github.com/user-attachments/assets/1e42f11e-c621-446a-9400-2ecab6e92546) 106 | 107 | 108 | 109 | -------------------------------------------------------------------------------- /create-vpn.md: -------------------------------------------------------------------------------- 1 | # How to create an SSH VPN using our VPS 2 | * Not leaking various data from the system, such as location and IP, is the main pillar of crypto activity, especially if you are in Iran. 3 | 4 | * You solve static IP issue with a cheap VPS server and VPN connection with SSH, that's the way 5 | 6 | ## Install SSH CLient 7 | Download Netmod SSH 8 | * For Windows: from Sourceforge 9 | * For Android: from Googleplay 10 | 11 | Download NapsternetV 12 | * For IOS: from AppleStore 13 | 14 | ## Buy VPS 15 | * You are fine if you have VPS server for Node Testnets or if you want a VPS specifically for VPN, you can buy from AEZA 16 | * Aeza has hourly servers, you can buy hourly severs for a few days to test first 17 | 18 | 19 | ## Add SSH config 20 | Add you VPS server details as an SSH config & connect & enjoy your VPN 21 | 22 | ![Screenshot_116](https://github.com/user-attachments/assets/34b3f8a8-cac4-4a08-861d-e5fc09162252) 23 | 24 | ![Screenshot_117](https://github.com/user-attachments/assets/1c0a91af-c851-45f4-b6c0-a0662e18eab6) 25 | 26 | ![Screenshot_118](https://github.com/user-attachments/assets/ae4bf3e0-a04b-41c6-96bf-8f0596f34a5d) 27 | -------------------------------------------------------------------------------- /linux-commands.md: -------------------------------------------------------------------------------- 1 | # Linux Commands 2 | 3 | * [Top 50 commands](https://www.digitalocean.com/community/tutorials/linux-commands) 4 | 5 | * [Linux Commands](https://github.com/trinib/Linux-Bash-Commands) 6 | 7 | * [101 Linux Commands](https://github.com/bobbyiliev/101-linux-commands-ebook) 8 | 9 | ### ls: list directories 10 | ```console 11 | # List directories 12 | ls 13 | 14 | # List all directories + hidden directories 15 | ls -a 16 | ``` 17 | 18 | ### mkdir: Create directory 19 | ```console 20 | # Create folder - Replace 21 | mkdir 22 | 23 | # Create 2 folders 24 | mkdir 25 | 26 | # Create moei folder 27 | mkdir moei 28 | ``` 29 | 30 | ### cd: go to directories 31 | ```console 32 | # Go to home , root directory 33 | cd 34 | 35 | # Go to custom directory by replacing 36 | cd 37 | 38 | # Go to moei 39 | cd moei 40 | 41 | # Go to parent directory 42 | cd .. 43 | ``` 44 | 45 | ### mv: Move files & Directories 46 | ```console 47 | # mv 48 | ``` 49 | 50 | ### rm 51 | ```console 52 | # Remove a file 53 | rm -rf 54 | 55 | # Remove a file in a directory 56 | rm -rf 57 | ``` 58 | 59 | ### nano 60 | ```console 61 | # Open edit menu of a file / if file doesn't exist, it creates it 62 | nano 63 | 64 | # CTRL + X + Y + ENTER to save & Exit 65 | ``` 66 | 67 | ### git 68 | ```console 69 | # Transfer a github repository into linux 70 | git clone https://github.com/0xmoei/Linux_Node_Guide 71 | ``` 72 | 73 | ### Screen 74 | * Sometimes we need a process to be running in the background while we exit the terminal and VPS 75 | * We can open a screen then enter our node commands in it 76 | * if we close the screen, we can return to it later 77 | ```console 78 | # Install 79 | sudo apt install screen 80 | 81 | # Open a screen 82 | screen -S 83 | 84 | # Close screen 85 | CTRL + A + D 86 | 87 | # Screens list 88 | screen -ls 89 | 90 | # Return to screen 91 | screen -r 92 | ``` 93 | -------------------------------------------------------------------------------- /linux-config.md: -------------------------------------------------------------------------------- 1 | # Install Packages 2 | > Packages are like drivers of your linux system 3 | > 4 | > You must have specific packages installed to be able to run specific commands 5 | 6 | ## Update server packages 7 | Before any installation, you must update your packages 8 | ```console 9 | sudo apt-get update && sudo apt-get upgrade -y 10 | ``` 11 | 12 | ## Main Packages 13 | ```console 14 | sudo apt install curl iptables build-essential git wget lz4 jq make gcc nano automake autoconf tmux htop nvme-cli libgbm1 pkg-config libssl-dev libleveldb-dev tar clang bsdmainutils ncdu unzip libleveldb-dev ca-certificates -y 15 | ``` 16 | 17 | ## Python3, pip 18 | ```console 19 | ## Python 3.8 Pip, Python3 Install 20 | sudo apt install -y python3-pip 21 | sudo apt install pip 22 | sudo apt install -y build-essential libssl-dev libffi-dev python3-dev 23 | ``` 24 | 25 | ## Go 26 | ```console 27 | sudo rm -rf /usr/local/go 28 | curl -L https://go.dev/dl/go1.22.3.linux-amd64.tar.gz | sudo tar -xzf - -C /usr/local 29 | echo 'export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin' >> $HOME/.bash_profile 30 | source .bash_profile 31 | go version 32 | ``` 33 | 34 | ## NodeJS , npm, yarn 35 | ```console 36 | # Check Nodejs Version 37 | node --version 38 | # if 18, skip nodejs steps 39 | 40 | # Delete Nodejs old files 41 | sudo apt-get remove nodejs 42 | sudo apt-get purge nodejs 43 | sudo apt-get autoremove 44 | sudo rm /etc/apt/keyrings/nodesource.gpg 45 | sudo rm /etc/apt/sources.list.d/nodesource.list 46 | 47 | # Install Nodejs 18 48 | sudo apt-get update 49 | curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash - 50 | 51 | sudo apt install -y nodejs 52 | 53 | node -v 54 | npm -v 55 | 56 | # Install npm 57 | sudo apt-get install npm 58 | npm --version 59 | 60 | # Install yarn 61 | curl -sSL https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add - 62 | echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list 63 | sudo apt-get update -y 64 | sudo apt-get install yarn -y 65 | ``` 66 | 67 | ## Docker, Docker-Compose 68 | ```console 69 | sudo apt update -y && sudo apt upgrade -y 70 | for pkg in docker.io docker-doc docker-compose podman-docker containerd runc; do sudo apt-get remove $pkg; done 71 | 72 | sudo apt-get update 73 | sudo apt-get install ca-certificates curl gnupg 74 | sudo install -m 0755 -d /etc/apt/keyrings 75 | curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg 76 | sudo chmod a+r /etc/apt/keyrings/docker.gpg 77 | 78 | echo \ 79 | "deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \ 80 | "$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" | \ 81 | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null 82 | 83 | sudo apt update -y && sudo apt upgrade -y 84 | 85 | sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin 86 | 87 | # Test Docker 88 | sudo docker run hello-world 89 | ``` 90 | 91 | ## lsof, ufw 92 | ```console 93 | # ports in-use 94 | lsof -i -P -n | grep LISTEN 95 | 96 | # What process is using port 80 97 | lsof -i :80 98 | 99 | # Open ports for external usage 100 | sudo ufw allow 101 | 102 | # Example: Open port 3000 103 | sudo ufw allow 3000 104 | ``` 105 | 106 | 107 | ## htop 108 | Manage your linux components (CPU, Memory, Swap, Tasks, ..) 109 | ```console 110 | # Install 111 | sudo apt install htop 112 | 113 | # Run 114 | htop 115 | ``` 116 | ![Screenshot_115](https://github.com/user-attachments/assets/97921a17-485c-47a0-ae07-be454da80afc) 117 | --------------------------------------------------------------------------------