Skip to content

Instantly share code, notes, and snippets.

@olton
Last active March 7, 2022 01:18
Show Gist options
  • Save olton/054cc519c73d3a3e637cad490529ebd6 to your computer and use it in GitHub Desktop.
Save olton/054cc519c73d3a3e637cad490529ebd6 to your computer and use it in GitHub Desktop.
Install Mina on Ubuntu 20.04
# Create user
sudo adduser minauser
sudo usermod -aG sudo,adm,systemd-journal minauser
# Install required libs and enviroment
# Libs for Mina
cd
mkdir libs
cd libs
wget http://mirrors.kernel.org/ubuntu/pool/main/libf/libffi/libffi6_3.2.1-8_amd64.deb
wget http://mirrors.edge.kernel.org/ubuntu/pool/universe/j/jemalloc/libjemalloc1_3.6.0-11_amd64.deb
wget http://mirrors.edge.kernel.org/ubuntu/pool/main/p/procps/libprocps6_3.3.12-3ubuntu1_amd64.deb
sudo dpkg -i *.deb
cd
rm -rf libs
# NodeJS
sudo apt update
curl -sL https://deb.nodesource.com/setup_14.x | sudo bash -
sudo apt -y install nodejs
# Setup Firewall
sudo ufw allow 22
sudo ufw allow 8302
sudo ufw allow 8303
sudo ufw allow 3085
yes | sudo ufw enable
# Mina
# Delete previous version
sudo apt-get remove -y coda-testnet-postake-medium-curves
# Create folders and files
cd ~
mkdir .mina-config
mkdir keys
# Install Mina
sudo apt-get remove -y mina-testnet-postake-medium-curves
echo "deb [trusted=yes] http://packages.o1test.net release main" | sudo tee /etc/apt/sources.list.d/mina.list
sudo apt-get update
sudo apt-get install -y curl unzip mina-mainnet=1.1.5-a42bdee
# First run and Ctrl+C
mina daemon --generate-genesis-proof true --peer-list-url https://storage.googleapis.com/mina-seed-lists/mainnet_seeds.txt
# Create peers file
curl https://storage.googleapis.com/mina-seed-lists/mainnet_seeds.txt > ~/peers.txt
# Create mina env file
touch .mina-env
# Insert into .mina-env
CODA_PRIVKEY_PASS="your_private_key_pass"
EXTRA_FLAGS=" -file-log-level Debug --limited-graphql-port 3095 "
# End of inserts
# Copy your key into keys folder
# ~/keys/my-wallet
# ~/keys/my-wallet.pub
# Set files permissions
cd ~
chmod 700 ~/keys
chmod 600 ~/keys/my-wallet
# Start Mina service
systemctl --user daemon-reload
systemctl --user start mina
systemctl --user enable mina
sudo loginctl enable-linger
# Install sidecar
sudo apt-get install -y mina-bp-stats-sidecar=1.1.5-a42bdee
# Update /etc/mina-sidecar.json for
: '
{
"uploadURL": "https://us-central1-mina-mainnet-303900.cloudfunctions.net/block-producer-stats-ingest/?token=72941420a9595e1f4006e2f3565881b5",
"nodeURL": "http://127.0.0.1:3095"
}
'
# Enable sidecar service and run
sudo systemctl enable mina-bp-stats-sidecar
sudo service mina-bp-stats-sidecar start
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment