Найти в Дзене
SHLIF#9570

Deploying and running SUBGRAPH on a VPS Ubuntu 20.04 x64. EN

1. We rent a VPS, I used Vultr, you can use whatever is convenient for you.

2. We select the characteristics of the server, I chose 4 CPUs and 8 RAM for $ 40, you can choose for $ 20, there is not much difference. We select the Ubuntu 20.04 x64 version.

-2

3. Enter any server name (SUBGRAPH-BY-SHLIF9570) and click Deploy Now.

-3

4. To connect to VPS I use MobaXterm, a very handy tool. Download

-4

5. Go to the settings of our SUBGRAPH-BY-SHLIF9570 server.

-5

Here we need information, "IP Address" and "Password".

-6

6. Open MobaXterm. Select "Session", then SSH and enter on "IP Address", check "Specify username" and enter "root", click "OK"

-7

7. We drive our "Password" from the server, copy it in the browser, and to paste it into MobaXterm, press the SHIFT + INS key combination and then ENTER.

-8

8. Press YES.

-9

9. Hurray we are connected.

-10

10. Go to the page https://thegraph.com/explorer/dashboard, click "sign in".

-11

11. Enter "Username" and "Password" from your github, if you do not have it, then register.

-12

12. Click "Add Subgraph".

-13

13. We fill in all the data.

-14

If you are doing a test subgraph then set the HIDE slider to hide.

14. We return to MobaXterm, and then we are required to simply enter the commands sequentially, by copying CTRL + C, and paste them into MobaXterm SHIFT + INS. Along the way, slightly changing the commands for your subgraph.

15. Sequential commands to run subgraph:

sudo apt update -y
sudo apt upgrade -y
sudo apt install git -y
git config --global user.name yourUSERNAMEfrom GITHUB (in my case this is "git config --global user.name D1esel9")
git config --global user.password yourPASSWORDfrom GITHUB
git config --global user.email yourEMAIL from GITHUB
curl -sL https://deb.nodesource.com/setup_14.x | \ sudo -E bash - && \
sudo apt install -y nodejs && sudo npm install -g npm @ latest
wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.33.8/install.sh | bash
source ~ / .profile
nvm install 14.15.1
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo 'deb https://dl.yarnpkg.com/debian/ stable main' | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt-get update
sudo apt-get install yarn -y
yarn global add @ graphprotocol / graph-cli
graph init --from-example yourUSERNAMEfromGITHUB / yourSUBGRAPHname (in my case it is "graph init --from-example D1esel9 / subgraphbyshlif9570" you will be prompted to create a SUBGRAPHname folder, press ENTER)
The result of the command "graph init --from-example D1esel9 / subgraphbyshlif9570"
The result of the command "graph init --from-example D1esel9 / subgraphbyshlif9570"
yarn install
cd yourSUBGRAPGname (in my case "cd subgraphbyshlif9570"
graph deploy --access-token yourAccesstoken \
--debug \
--node https://api.thegraph.com/deploy/ \
--ipfs https://api.thegraph.com/ipfs/ \
yourUSERNAMEfromGITHUB / yourSUBGRAPHname

yourAccesstoken
yourAccesstoken

Command result:

-17

Refresh your subgraph page after a while, syncing takes a couple of minutes.

-18

Hope it was helpful to someone ^ _ ^

Video guide: https://youtu.be/R3-WogeUPKo
RU guide: Развертывание и запуск SUBGRAPH на VPS Ubuntu 20.04 x64
EN guide: Deploying and running SUBGRAPH on a VPS Ubuntu 20.04 x64
Why do we believe in The Graph? What inspires us? Why is Graph so important to Web3?
Everything about the new direction of Web3 using the blockchain stack. Why is Graph so important to Web3?
Почему мы верим в The Graph? Что нас вдохновляет? Почему вам следует познакомиться с Graph Protocol!Почему мы верим в The Graph? Что нас вдохновляет? Почему вам следует познакомиться с Graph Protocol!
Official site: https://thegraph.com/
RU community THE GRAPH:
https://vk.com/thegraphru
https://ok.ru/thegraphru
My Discord: SHLIF9570