|
@@ -1,17 +1,21 @@
|
1
|
|
-[](https://github.com/Relayz-io/client/actions/workflows/ci.yml)
|
2
|
|
-
|
3
|
1
|
# Client
|
4
|
2
|
|
|
3
|
+[](https://github.com/Relayz-io/client/actions/workflows/ci.yml)
|
|
4
|
+
|
5
|
5
|
## Common-API 🦆
|
6
|
|
-Library that is used among other repositories. Implements [```Borsh```](https://borsh.io/) implementation for structures and enums. Also contain Diffie-Hellman and Ed25519 **API**
|
7
|
6
|
|
8
|
|
-## Near-Client 🗿
|
9
|
|
-Client library for **Near RPC**
|
|
7
|
+Commonly used **API** among different dependencies. For example **key-exchange-server**
|
10
|
8
|
|
11
|
9
|
## Web-Client 🦘
|
12
|
|
-Client library for communication from browser and *Near blockchain*. It's a high-level API. User doesn't need to understand how blockchain works.
|
|
10
|
+
|
|
11
|
+Client library for communication from browser and *Near blockchain*. It's a high-level **API**. User doesn't need to understand how blockchain works.
|
|
12
|
+
|
|
13
|
+### Usage of web-client library:
|
|
14
|
+
|
|
15
|
+Please follow the [official instructions](https://docs.github.com/en/enterprise-server@3.4/packages/working-with-a-github-packages-registry/working-with-the-npm-registry#installing-a-package) to use the latest package.
|
13
|
16
|
|
14
|
17
|
### Build
|
|
18
|
+
|
15
|
19
|
```sh
|
16
|
20
|
wasm-pack build web-client --target bundler --out-dir ../pkg
|
17
|
21
|
```
|
|
@@ -30,46 +34,3 @@ Deploy their docker instances:
|
30
|
34
|
Then:
|
31
|
35
|
|
32
|
36
|
`docker-compose up`
|
33
|
|
-
|
34
|
|
-## Diagrams
|
35
|
|
-```mermaid
|
36
|
|
-sequenceDiagram
|
37
|
|
- participant Initiator
|
38
|
|
- participant Alice
|
39
|
|
- participant Bob
|
40
|
|
-
|
41
|
|
- Initiator->>Blockchain: create meeting with id
|
42
|
|
- Initiator-->>Internet: share meeting Id
|
43
|
|
- loop
|
44
|
|
- Initiator->>Blockchain: wait for pub. key for Alice and Bob
|
45
|
|
- activate Blockchain
|
46
|
|
- Blockchain--)Initiator: receive pub key [Alice, Bob]
|
47
|
|
- deactivate Blockchain
|
48
|
|
- end
|
49
|
|
- par
|
50
|
|
- Bob->>Internet: get meeting id
|
51
|
|
- activate Internet
|
52
|
|
- Internet--)Bob: receive meeting id
|
53
|
|
- deactivate Internet
|
54
|
|
- and
|
55
|
|
- Alice->>Internet: get meeting id
|
56
|
|
- activate Internet
|
57
|
|
- Internet--)Alice: receive meeting id
|
58
|
|
- deactivate Internet
|
59
|
|
- end
|
60
|
|
- par
|
61
|
|
- Bob->>Blockchain: put temp public key for Bob
|
62
|
|
- activate Blockchain
|
63
|
|
- Blockchain--)Bob: Initiator public key
|
64
|
|
- deactivate Blockchain
|
65
|
|
- and
|
66
|
|
- Alice->>Blockchain: put temp public key for Alice
|
67
|
|
- activate Blockchain
|
68
|
|
- Blockchain--)Alice: Initiator public key
|
69
|
|
- deactivate Blockchain
|
70
|
|
- end
|
71
|
|
- Initiator-->>RelayServer: Olm message(symetric key) by Bob pub key
|
72
|
|
- RelayServer-->>Bob: Olm message(symetric key) by Bob pub key
|
73
|
|
- Initiator-->>RelayServer: Olm message(symetric key) by Alice pub key
|
74
|
|
- RelayServer-->>Alice: Olm message(symetric key) by Alice pub key
|
75
|
|
-```
|