aboutsummaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorQuentin Dufour <quentin@deuxfleurs.fr>2020-05-21 22:25:33 +0200
committerQuentin Dufour <quentin@deuxfleurs.fr>2020-05-21 22:25:33 +0200
commit8c43611eb5bbaeb42f19da8d8ed521df208bfada (patch)
treec207e950744f451424e139e97aaf852c2d8ff949 /README.md
parent4da459ce8ba49f98084a8ce32f600470ff883ec5 (diff)
downloaddiplonat-8c43611eb5bbaeb42f19da8d8ed521df208bfada.tar.gz
diplonat-8c43611eb5bbaeb42f19da8d8ed521df208bfada.zip
Broken Diplonat
Diffstat (limited to 'README.md')
-rw-r--r--README.md24
1 files changed, 24 insertions, 0 deletions
diff --git a/README.md b/README.md
index af84a5c..257278d 100644
--- a/README.md
+++ b/README.md
@@ -21,3 +21,27 @@ export DIPLONAT_CONSUL_NODE_NAME="lheureduthe"
export RUST_LOG=debug
cargo run
```
+
+## About Consul Catalog
+
+ * We query the `/v1/catalog/node/<node>` endpoint
+ * We can watch it thanks to [Blocking Queries](https://www.consul.io/api/features/blocking.html)
+
+eg:
+
+```bash
+curl -vvv http://127.0.0.1:8500/v1/catalog/node/lheureduthe
+# returns X-Consul-Index: 15
+curl -vvv http://127.0.0.1:8500/v1/catalog/node/lheureduthe?index=15
+```
+
+Each time you do the request, the whole list of services bound to the node is returned.
+
+
+To test the Consul Catalog part, you can do:
+
+```bash
+consul agent -dev #in a separate terminal, if not already running
+consul services register -name=example -port=1337
+consul services -id=example
+```