Hello, I wanted to start experimenting with xtdb 2 and a simple in memory node. I get a ; Execution error (BindException) at but I can't find documentation which talks about ports (I tried my luck with {:port 3440} but that didn't work).
my deps.edn:
{:deps {com.taoensso/telemere {:mvn/version "1.0.0-SNAPSHOT"}
com.github.seancorfield/next.jdbc {:mvn/version "1.3.955"}
com.github.seancorfield/honeysql {:mvn/version "2.6.1147"}
org.postgresql/postgresql {:mvn/version "42.2.10"}
com.xtdb/xtdb-jdbc {:mvn/version "2.0.0-beta4"}
com.xtdb/xtdb-core {:mvn/version "2.0.0-beta2"}
com.xtdb/xtdb-api {:mvn/version "2.0.0-beta2"}}
:aliases {:xtdb {:jvm-opts ["--add-opens=java.base/java.nio=ALL-UNNAMED"
"-Dio.netty.tryReflectionSetAccessible=true"]}}}and code
(comment
(require '[xtdb.node :as xtn]
'[xtdb.api :as xt])
(with-open [node (xtn/start-node)]
(xt/status node)))hey @dan203 it's either the default HTTP server on port 3000 or the default pgwire port on 5432 that will be causing the issue - do you happen to already have postgres running?
awesome @taylor.jeremydavid, yes, i needed to shut down a docker which still ran in the backround which ran a psql at 5432
thank you
on the off chance you're interested, I just put together this examples repo which you can boot up pretty quick with codespaces + calva https://github.com/xtdb/driver-examples/blob/main/clojure/dev/user.clj
that's cool. as a clojure user, i tried to go the route in-memory node + xtql
so my minimal example was
(defn start-in-memory-node
"needs ports 3000 and 5432"
[]
(xtn/start-node))
(defn add-person [node name email]
(xt/execute-tx node [[:put-docs :persons {:xt/id name ,
:person/email email}]]))
(defn list-persons [node]
(xt/q node '(from :persons [xt/id person/email])))(deftest add-and-retrieve-persons
(testing "add and retrieve a person"
(is
(= {:xt/id :dan
:person/email "d@et.n"}
(first (with-open [node (ds/start-in-memory-node)]
(ds/add-person node :dan "d@et.n")
(ds/list-persons node)))))))(doesn't have to be from a test could be done from a comment) just demo-ing what i personally found the most gratifying and cognitively easy example to start from
cool, glad to hear 👌