How to install grin on Ubuntu Server from scratch

Say you have a fresh new install of Ubuntu Server, the regular edition not core, what are all the commands you run to prepare for and install a precompiled binary from the main Mimblewimble Releases section on github?

This is a dupe thread of a previous on I made but I’m still stuck on this digging through old notes and guides that I thought should still work.

So new brainstorming thread. At a bare minimum to say that there is still a pulse in this community we have got to be able to at least figure this out.

I’ll be back with what I have from the old notes.

@Yeastplume @tromp notifying you just in case you’ve done this any time recently.

wget grin node bin, then create separate user (grin in my case) to create systemd service
sudo nano /etc/systemd/system/grin-main.service:

[Unit]
Description=Grin Mainnet node
After=network.target

[Service]
WorkingDirectory=/home/grin
User=grin
Group=users
#PrivateDevices=yes
#Type=simple
ExecReload="/bin/kill -HUP $MAINPID"
KillMode=mixed
KillSignal=SIGTERM
TimeoutStopSec=60
ExecStart=/home/grin/grin server run
Restart=on-failure
RestartSec=30

[Install]
WantedBy=multi-user.target
Alias=grin-main.service

then start and enable service to launch it on system boot:
sudo service grin-main start/enable

3 Likes

How to run grin as a service information can also be found in the docs/wiki:

1 Like

For a fresh linux server it is pretty simple - you do not need any extra packages for pre-compiled grin-node and wallet. Just download sources from grin.mw github Repo:

wget https://github.com/mimblewimble/grin/releases/latest/download/grin-$VERSION-linux-amd64.tar.gz
wget https://github.com/mimblewimble/grin-wallet/releases/latest/download/grin-wallet-$VERSION-linux-amd64.tar.gz

Then extract bin:

sudo tar -C /usr/local/bin -xzf grin-$VERSION-linux-amd64.tar.gz --strip-components=1
sudo tar -C /usr/local/bin -xzf grin-wallet-$VERSION-linux-amd64.tar.gz --strip-components=1

Note if you have downloaded it in the root folder you do not need the strip-components arguments.

Then just run the node and wait 3-4 hours for sync:

grin

Meanwhile you can init your wallet:

grin-wallet init

Then open the ports for wallet listener grin-node, startum and API:

ufw allow 3413
ufw allow 3414
ufw allow 3415
ufw allow 3416

If you want to mine go into folder ./grin/main. Open server config-File:

nano grin-server.toml

There you can enalbe stratum server. Note for mining you have also to enable the grin-wallet listener:

grin-wallet listen

For better xp on linux server start grin and the wallet listener with screen. Then the process does not terminate when you close ssh-session.

Have fun mate.

3 Likes

While we’re showering you with options, here is another. A simple ansible playbook. Just pop in your host/group and the SHA-512 hash of your desired password for the grin user and it’ll land grin and grin-wallet in the home folder. I monitor my solo mining so I run a mix of tmux and screen to keep my nodes quick to pull up and monitor.

1 Like