Sign inSign up

juxt/crux-standalone

By juxt

Updated about 6 years ago

A basic docker image of a standalone Crux node with a HTTP server

Image
3

6.8K

juxt/crux-standalone repository overview

A 'batteries included' docker image for a standalone Crux node (using an in-memory kv-store, and running a HTTP server).

Use the following command to start the node on port 3000:

docker run -d -p 3000:3000 juxt/crux-standalone:20.02-1.7.0-alpha

You can submit a document to the standalone node:

curl -X POST \
	     -H "Content-Type: application/edn" \
	     -d '[[:crux.tx/put {:crux.db/id :ivan, :first-name "Ivan" :last-name "Petrov"}]]' \
	     localhost:3000/tx-log

This puts an EDN map with the id ivan, a first name of "Ivan" and a last name of "Petrov". (See further information/usages of EDN here). It returns another EDN map with an associated transaction ID and transaction time (e.g: {:crux.tx/tx-id 1614349099226113, :crux.tx/tx-time #inst "2019-12-16T16:13:12.213-00:00"})

You can then get the entity, ivan, back by querying the /entity endpoint:

curl -X POST \
	     -H "Content-Type: application/edn" \
	     -d '{:eid :ivan}' \
	     localhost:3000/entity

(Returning {:crux.db/id :ivan, :first-name "Ivan", :last-name "Petrov"})

For a full set of REST commands for the node, check out the HTTP section in the Crux docs (https://opencrux.com/reference/http.html).

Tag summary

Content type

Image

Digest

Size

351.2 MB

Last updated

about 6 years ago

docker pull juxt/crux-standalone:20.09-1.11.0