1: Getting Started with Crux – A Tale of Time and Space
NOTICE: Crux has been renamed to XTDB. This tutorial is now available at https://nextjournal.com/xtdb-tutorial instead. Please consider the following tutorial deprecated.
Welcome to the official Crux tutorial, which complements the official documentation.
If you’re new to Crux and want to get a practical hands-on guide, you’re in the right place.
It’s the year 2115. You have been hired by an inter-planetary bank, Helios Banking Inc. Your task is to travel around the solar system completing assignments using Crux.
You have been given a company spaceship so transport won’t be a problem. Space Customs require all astronauts to complete a flight manifest for every journey. You also have a handy Crux manual with you so you can read up on some background information before you get stuck into each assignment.
You need to get Crux running before you can use it.
You are now ready for your first assignment, so you head over to the space port.
On entering your spaceship, you notice a flashing blue light on the left of your communications panel. You submit an iris scan to unlock your first message.
Before you leave you must fill in your flight manifest. To do this, you must first set up a Crux node. You want to get started as quickly as possible so you decide to use Crux’s inbuilt standalone node.
You read the Crux manual entry for the standalone node to make sure this is OK.
You decide this is fine for now, and so define your Crux node.
You take a look around your ship and check the critical levels.
You read the manual entry for putting data into Crux.
Just as you’re about to write your manifest, one of the porters passes you a secret note and asks you to deliver it to a martian named Kaarlang. They are certain you will meet Kaarlang on your travels and so you see no harm in delivering the note for them.
You put the manifest into Crux.
put, one of Crux’s four transaction operations. Check that this was successful by asking Crux to show the whole entity.
Note: You should run this code block separately otherwise you may see only
nil returned. The reason for this is covered in the await-tx tutorial.
You enter the countdown for lift off to Pluto. See you soon.