Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bradenkeith/528901a7067645a65bf3f16aefed0126 to your computer and use it in GitHub Desktop.
Save bradenkeith/528901a7067645a65bf3f16aefed0126 to your computer and use it in GitHub Desktop.
Deploying Entropy on Google Cloud Platform

Deploying Entropy Keeper on Google Cloud Platform

https://forum.friktion.fi/t/more-keepers-for-entropy/73

Server Creation

Create a new Compute Engine instance

  1. Series: N1
  2. Machine Type: f1-micro

Screen Shot 2022-04-22 at 09 34 03

  1. Change Boot Disk to Ubuntu 20.04 LTS

Screen Shot 2022-04-22 at 09 33 52

Run as Root

We'll run all these commands as a super user

sudo su

Setup GIT

eval "$(ssh-agent -s)"
ssh-keygen -t rsa
ssh-add
ssh-add -l -E sha256

Follow this guide to add your SSH key to Github https://docs.github.com/en/authentication/troubleshooting-ssh/error-permission-denied-publickey#verify-the-public-key-is-attached-to-your-account

On step 6, you can easily get your key by running:

tail /root/.ssh/id_rsa.pub

Install Yarn & NPM

apt update
apt remove cmdtest
apt remove yarn
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list
apt-get update && apt-get install yarn
apt install node-typescript
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"  # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"  # This loads nvm bash_completion
nvm install node
npm install -g ts-node

Clone Entropy

cd /home/ubuntu
git clone git@github.com:Friktion-Labs/entropy-client.git
cd /home/ubuntu/entropy-client
yarn
cd /home/ubuntu

Install Solana CLI

https://docs.solana.com/cli/install-solana-cli-tools

sh -c "$(curl -sSfL https://release.solana.com/stable/install)"
export PATH="/root/.local/share/solana/install/active_release/bin:$PATH"
solana --version

Add Phantom Wallet into Solana CLI

Ensure a SOL funded private keypair is in this file location:

solana-keygen recover 'prompt:?key=0/0' --outfile ~/.config/solana/entropy-mainnet-authority.json

Running the keeper as a Daemon

You'll want it running in the background on boot

nano /usr/local/bin/keeper.sh

Paste:

#!/bin/bash

echo "running keeper"
cd /home/ubuntu/entropy-client
yarn keeper
nano /etc/systemd/system/keeper.service

Paste:

[Unit]
Description=keeper
After=network.target
StartLimitIntervalSec=20
[Service]
Type=simple
Restart=always
RestartSec=1
User=root
ExecStart=/usr/local/bin/keeper.sh

[Install]
WantedBy=multi-user.target
chmod 744 /usr/local/bin/keeper.sh 
chmod 644 /etc/systemd/system/keeper.service
systemctl enable keeper.service

Reboot

reboot

Verify Service is running

sudo journalctl -u keeper.service -f

Troubleshooting

If you are seeing an error like

 Error: 403 Forbidden:  {"jsonrpc":"2.0","error":{"code": 403, "message":"Access forbidden, contact your app develo
per or support@rpcpool.com."}, "id": "02c4ab56-0e92-41bc-a1b0-c7db054e7aa2" }```

You need to update your RPC endpoint by doing the following:

sudo nano /home/ubuntu/entropy-client/src/ids.json

Then update cluster_urls.mainnet to:

      "mainnet": "https://friktion.rpcpool.com/8236ce58a8cc909af597734efe5f",
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment