RedenCore / Reden

MIT License
9 stars 15 forks source link

Add snap package configuration #29

Closed cimm closed 6 years ago

cimm commented 6 years ago

This pull request adds the necessary configuration file (the snapcraft.yml) and logo (a cropped version of the Reden splash image needed to create a snap package.

This should make it easier to get Reden running on Linux distros. I mainly tested the Qt wallet but it also includes the CLI tools so it could also be an easier way to get a masternode up and running.

What is a snap?

Snaps are containerised software packages that are simple to create and install. They auto-update and are safe to run. And because they bundle their dependencies, they work on all major Linux systems without modification.

Release management

Snaps also auto update. If configured it will automatically build a new snap each time someone commits to the master branch of this repository. People using the "edge" version will automatically get the latest version and as such will always run on the repo's HEAD version. Snaps also have release management so you as Reden maintainers can choose to release the "edge" version to "beta", "candidate" or "release".

Building

Build farm

Snaps can be build on your machine but Ubuntu offers a build infrastructure you can use. Use the GitHub login of the RedenCore account to start building the Reden snap, ping me if you need any help. Once build (takes a good 15 minutes or so) you should be able to test the snap on any snap supported Linux distro.

$ snap install reden --edge
$ reden.reden-qt

Ask the community to test the snap and promote the snap "beta", "candidate" or "release" if there are no blockers. Once released you obviously no longer need the --edge flag to download the snap unless you want to run the latest greatest (I would advise against this if you are storing any real Reden in this wallet). Browse around in the Snapcraft website to get a feel of what's possible.

Local builds

Snaps can be build locally on your computer in a "cleanbuild" LXD container to make sure the build instructions are not polluted by random libraries installed on my system. It's slower (no caching) but makes sure you don't forget to include packages you might have on your system but are not available by default on an Ubuntu 16.04 system. You'll need to have LXD installed for this.

From the root directory of this repository run:

$ snapcraft cleanbuild
$ snap install reden-cimm_0.1_amd64.snap --dangerous

You can use snapcraft cleanbuild --debug to be dropped in the container's shell if the build fails.

Running

Once installed you can run Reden Core as you normally would via your application launcher or via the command line by running reden.reden-qt, see what's possible by running snap info reden.

Removing

Snaps are contained packages meaning they don't pollute your filesystem. The blockchain will be downloaded in your ~/snaps/reden/common directory. When you remove a snap it removes ALL THE THINGS. This is great since the snap can't see/steal/copy data on your computer but this also means you loose your private keys if you delete the snap. Take backups!

CLI tools

The snap also packages all the CLI tools redend, reden-tx and reden-cli. These can be started from the terminal via eg. reden.reden-tx.

There, I hope this helps someone getting started with Reden and makes it easier for the Reden team to get their wallet on Linux distros!

RedenCore commented 6 years ago

Thanks for ur contribution