Skip to content

Instantly share code, notes, and snippets.

@nehbit
Last active May 9, 2020 22:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nehbit/4a8c3d81d543e85c9df974f521732b1e to your computer and use it in GitHub Desktop.
Save nehbit/4a8c3d81d543e85c9df974f521732b1e to your computer and use it in GitHub Desktop.
Compile instructions for Aether P2P on a Linux host

Compiling Aether P2P on a Linux native host

This is a quick guide on how to compile Aether if you're on Linux natively. 'Native' here is used as opposed to 'cross-compile', which has been the canonical way to build for Linux so far.

This document is meant to be helpful to Linux distro maintainers that want to package Aether for their own distribution's repositories, as well as for people who want to hack on Aether.

If you just want to use Aether, you don't have to compile it from scratch. You can grab pre-compiled binaries at Aether P2P website.

The inspiration for this document comes from https://gist.github.com/nytpu/4f97df9e9c4b0b5d365a15dacabe020c. Thanks!

Prerequisites

You need all of these to be installed and functional on your system before attempting to build. If any of these are missing or non-functional, the build will fail. The dependencies not listed here will be installed by the compile process if needed.

  • git,
  • go (1.14+ only),
  • gcc, g++
  • docker,
  • node (v11 only),
  • nvm (node version manager, to be able to grab the specific v11 of node)
  • python (for compiling C dependencies of dependencies, but not used within Aether),
  • upx

Instructions

Clone the repo:

git clone git@github.com:nehbit/aether.git

Grab NVM:

wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash

Open up a new terminal window to make sure nvm is in place.

nvm install 11

nvm use 11

cd aether/backend

Verify go works by running the backend without arguments.

go run main.go

If successful, this is what you'll get:

You've attempted to run the Aether Runtime Environment without any commands. ARE requires some variables to be passed to it to be able to do what you want.

Please run "aether-backend --help" to see all available options.

If instead you get something like:

main.go:7:2: cannot find package "aether-core/aether/backend/cmd" in any of:
    /usr/lib/go-1.10/src/aether-core/aether/backend/cmd (from $GOROOT)
    /home/ubuntutesting/go/src/aether-core/aether/backend/cmd (from $GOPATH)

That means your version of Go is too old. For example, as of this writing, pulling Go grom Ubuntu's official repositories with apt-get install golang gives Go 1.10, which is too old to be able to compile Aether.

If you encounter this, go here: https://golang.org/dl/ and install the newest Go. Don't forget to remove the old Go you just installed.

cd ../client

Pull in the NPM dependencies:

npm ci

Build the client UI:

npm run wpbuild

Build the C bindings:

npm run rebuild

Confirm everything works by starting the application unbundled:

npm start

This should open the app and the inspector at the bottom should show no errors.

If you get an error message that says something like:

Uncaught Exception:
Error: App version is not a valid semver version: "+2005082100..d"

That's because you downloaded the repository as a zip file instead of cloning the repo. Clone the repo so that the builder can access the version tag number.

cd ..

Start the compiler and bundler process. This will take a while.

make linux-native

If you end up with a 'docker permission denied' error, follow this. (This is not related to Aether - the Docker instance on your OS doesn't have the right permissions.)

Once it finishes, go back to the root of the cloned repository.

cd ../..

In the folder Aether_2, you'll find a ReleaseArchive folder. Within it, there'll be the compiled Snap image. You can install this image by doing:

snap install [filename] --dangerous

The dangerous flag is because your build is unsigned, and not downloaded from the official Snap repository.

If you want to get the unpackaged version, you can get that at BundledReleases/linux-unpacked. If you want to package it further (to AppImage, Flatpak, your distro's package style of choice, etc.), this is where you would start.

Cheers!
B

@nytpu
Copy link

nytpu commented May 9, 2020

This worked great, however, you forgot to add npm ci to install dependencies before running wpbuild and rebuild, and I still needed my grpc patch to get npm rebuild to run successfully. Same error, with gettid() being the culprit. My git patch was totally unneeded this time though, which is great!

I'm thinking that the grpc error may be something with my Node installation, so I'm going to investigate that when I have the time.

@nehbit
Copy link
Author

nehbit commented May 9, 2020

Good catch! Fixed that, as well as a few other formatting issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment