Run a Transactor
The dev storage protocol uses local disk files for storage. You will need to configure a transactor.properties file. Copy config/samples/dev-transactor-templates.properties somewhere locally and edit it with the text editor of your choice. You will need to paste in the license key from the email sent to you via My Datomic:
You can start a local transactor with dev storage from your system shell as follows:
This script will print a few lines of output, including the base URI you will use to connect, e.g.
To create a connection string, simply replace <DB-NAME> with a database name of your choice, e.g. "hello":
You can repeat the connection/creation steps from the transaction example with:
import datomic.Peer uri = "datomic:dev://localhost:4334/hello" Peer.createDatabase(uri) conn = Peer.connect(uri)
(require '[datomic.api :as d]) (def db-uri "datomic:dev://localhost:4334/hello") (d/create-database db-uri) (def conn (d/connect db-uri))
Doing this will connect you to the transactor. Any transactions submitted to the connection will be persisted to your local file system.
Now that you have configured a project to use Datomic and experimented with some basic database operations, you are ready to work through the training course for a thorough introduction to Datomic's fundamentals.