README.adoc 2.34 KB
Newer Older
Peter Grlica's avatar
Peter Grlica committed
1
== Development setup for origin and destination nodes
2

Peter Grlica's avatar
Peter Grlica committed
3
Add the appropriate .env files
4
5
[source,bash]
----
Peter Grlica's avatar
Peter Grlica committed
6
7
$ cp .env federation/etc/.env.orig
$ cp .env federation/etc/.env.dest
8
9
----

Peter Grlica's avatar
Peter Grlica committed
10
11
12
13
14
15
16
Change the DB_DSN in each of the files
----
.env.orig: DB_DSN=corteza:rootcorteza@tcp(db_origin:3306)/corteza?collation=utf8mb4_general_ci
.env.dest: DB_DSN=corteza:rootcorteza@tcp(db_destination:3306)/corteza?collation=utf8mb4_general_ci
----

Run the nodes
17
18
[source,bash]
----
Peter Grlica's avatar
Peter Grlica committed
19
20
$ docker-compose -f federation/etc/docker-compose.yml up -d node_origin
$ docker-compose -f federation/etc/docker-compose.yml up -d node_destination
21
22
----

Peter Grlica's avatar
Peter Grlica committed
23
24
25
26
27
28
29
30
31
32
33
34
== Setup db (postgres)

Add db dsn to .env
[source,bash]
----
DB_DSN=postgres+debug://docker:docker@localhost:5432/corteza?sslmode=disable
----

Start the postgres db
[source,bash]
----
$ docker-compose up -db pg
35
36
37
38
39
40
41
42
----

== Status

=== Node pairing

=== Structure sync

43
44
45
46
47
.TODO
* [ ] Finish endpoints below
* [ ] Add structure sync service (the syncing process)
* [ ] Handle acl

48
49
50
51
52
.List of endpoints
* [x] Show exposed module
* [x] Remove exposed module
* [x] Shared module details
* [x] List of shared/exposed modules
53
* [ ] Add module as exposed - same as add module to federation
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
* [ ] Add mappings to module
* [ ] Show module mappings
* [ ] Update fields on exposed module


Show exposed module::
[source,bash]
----
$ curl -X GET "$BASE_URL/federation/nodes/$NODE_ID/modules/$MODULE_ID/exposed"
----

Remove exposed module::
[source,bash]
----
$ curl -X DELETE "$BASE_URL/federation/nodes/$NODE_ID/modules/$MODULE_ID/exposed"
----

Shared module details::
[source,bash]
----
$ curl -X GET "$BASE_URL/federation/nodes/$NODE_ID/modules/$MODULE_ID/shared"
----

List of shared/exposed modules::
[source,bash]
----
80
81
$ curl -X GET "$BASE_URL/federation/nodes/$NODE_ID/modules?exposed=1"
$ curl -X GET "$BASE_URL/federation/nodes/$NODE_ID/modules?shared=1"
82
83
----

84
Add module as exposed - same as add module to federation::
85
86
[source,bash]
----
87
curl -X PUT "$BASE_URL/federation/nodes/$NODE_ID/modules"
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
----

Add mappings to module::
[source,bash]
----
curl -X PUT "$BASE_URL/federation/nodes/$NODE_ID/modules/$MODULE_ID/mapped"
----

Show module mappings::
[source,bash]
----
curl -X GET "$BASE_URL/federation/nodes/$NODE_ID/modules/$MODULE_ID/mapped"
----

Update fields on exposed module::
[source,bash]
----
curl -X PUT "$BASE_URL/federation/nodes/$NODE_ID/modules/$MODULE_ID/exposed"
----