Skip to main content

Compiling your own Actyx

tip

This guide is the starting point to deploying your own Actyx swarm to production. We start by showing you how to compile Actyx enabling you to fully control which applications run on your swarm.

If you're still testing Actyx or developing your application, set the node licensing to development in the node settings.

"licensing": {
"node": "development"
}

When running in production, Actyx provides you with authentication and authorization mechanisms, these mechanisms allow you to:

  • Sign application manifests, ensuring the authenticity of the running application.
  • License applications, ensuring the applications running on a given node are authorized to do so.

To enable this, Actyx makes use of assymetric cryptography, more precisely Ed25519 keys. When running your own Actyx deployment, you will need to generate these key pairs and compile Actyx from source.

Download Actyx's source

To simplify the rest of the tutorial, ensure you have downloaded Actyx's source code:

git clone [email protected]:Actyx/Actyx.git

Generate your own Actyx key pair

As discussed, to roll your own Actyx deployment, you will need to generate your own key pair, so, without further ado, let's start.

tip

In upcoming tutorials, a "developer key pair" will be mentioned, the generation process for said key is the same as for the Actyx key (i.e. you can come back and read this section).

  1. Navigate to rust/actyx.
cd rust/actyx
  1. Using the Actyx CLI (ax), generate your Actyx key pair. The CLI will ask you where to store the key pair (you can use the default directory or select your own, in either case, just make sure you do not lose the key pair — you will need it).
cargo run --bin ax users keygen
Generating public/private key pair ..
Enter path in which to save the key (/Users/jmgd/Library/Application Support/actyx/keys/users/id):
Your private key has been saved at /Users/jmgd/Library/Application Support/actyx/keys/users/id
Your public key has been saved at /Users/jmgd/Library/Application Support/actyx/keys/users/id.pub
Example keys

If you are just trying out the process and do not want to generate a key pair, you can use the following example keys (these are for demonstration purposes only).

ActyxDeveloper
Public075i62XGQJuXjv6nnLQyJzECZhF29acYvYeEOJ3kc5M8=0nz1YdHu/JDmS6CImcZgOj9Y960sJOPrbZHAJO107qW0=
Private0WBFFicIHbivRZXAlO7tPs7rCX6s7u2OIMJ2mx9nwg0w=08lUw93C+xzdxBcsYOoPVjzn8IHPJtnJW9Y/WyEu4v64=

Compile Actyx

If you followed the previous section, you will already be halfway there. You should have downloaded the Actyx source code and be in the rust/actyx repository.

Don't forget the dependencies!
Actyx depends on `protoc` and compilation will fail if it isn't installed on your system. Open to learn how to install it on your system.

Using Chocolatey:

choco install protoc
  1. Compile Actyx, using your public key.
export AX_PUBLIC_KEY="$(cat <public_key>)"
cargo build --bin actyx --release --locked

Where public_key is the path to the public key you generated in the previous section.

  1. (Optional) Double check that your public key is, in fact, embedded in the Actyx binary:
strings target/release/actyx | grep $AX_PUBLIC_KEY