README.adoc 2.32 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
$ cp .env federation/etc/{.env.orig,.env.dest}
7
8
----

Peter Grlica's avatar
Peter Grlica committed
9
10
11
12
13
14
15
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
16
17
[source,bash]
----
Peter Grlica's avatar
Peter Grlica committed
18
19
$ docker-compose -f federation/etc/docker-compose.yml up -d node_origin
$ docker-compose -f federation/etc/docker-compose.yml up -d node_destination
20
21
----

Peter Grlica's avatar
Peter Grlica committed
22
23
24
25
26
27
28
29
30
31
32
33
== 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
34
35
36
37
38
39
40
41
----

== Status

=== Node pairing

=== Structure sync

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

47
48
49
50
51
.List of endpoints
* [x] Show exposed module
* [x] Remove exposed module
* [x] Shared module details
* [x] List of shared/exposed modules
52
* [ ] Add module as exposed - same as add module to federation
53
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
* [ ] 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]
----
79
80
$ curl -X GET "$BASE_URL/federation/nodes/$NODE_ID/modules?exposed=1"
$ curl -X GET "$BASE_URL/federation/nodes/$NODE_ID/modules?shared=1"
81
82
----

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

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"
----