Example server and development test client for Linearized Matrix
  • TypeScript 99.6%
  • JavaScript 0.3%
  • Shell 0.1%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Travis Ralston 34447feef6
Merge pull request #40 from matrix-org/clokep/validity
Check validity of events as a participating server.
2023-08-08 13:48:05 -06:00
.husky Template repo 2023-03-28 13:52:29 -06:00
.run Implement name resolution and TLS 2023-07-20 16:47:58 -06:00
src Remove ts-ignore. 2023-07-26 14:27:59 -04:00
test/server Restructure repo 2023-03-30 17:50:37 -06:00
.gitignore LM: Implement key server interface 2023-03-28 21:53:18 -06:00
.prettierrc Template repo 2023-03-28 13:52:29 -06:00
jest.config.js Stub out tests for now 2023-03-28 16:30:27 -06:00
LICENSE Give it a license 2023-03-29 16:56:36 -06:00
package.json Support linked list ordering 2023-04-10 17:46:29 -06:00
README.md Support backspace in the client 2023-04-10 18:31:14 -06:00
tsconfig.build.json Template repo 2023-03-28 13:52:29 -06:00
tsconfig.json Wire up the client-server mock API to the new room version stuff 2023-03-29 15:55:21 -06:00
yarn.lock Support linked list ordering 2023-04-10 17:46:29 -06:00

eigen-server

Example server for a Linearized Matrix hub & participant. Note that the included client is awful and only for demonstrative purposes: a proper implementation of Linearized Matrix would be bringing an existing, more useful, client.

Specifications:

  • MSC3995: Linearized Matrix - Covers everything in the Linearized Matrix stack, including DAG interoperability.
  • I-D.ralston-mimi-linearized-matrix - Covers just the bits which pertain to non-DAG consumers. Note that the I-D lags behind the MSC in terms of accuracy and latest thinking at the moment.

Do not use this in production. It's just not meant to scale, and likely never will.

Development

Requires NodeJS 18.x and yarn.

  1. Clone repo
  2. yarn install

To start the awful demo client: yarn dev:client

To start the demo server: yarn dev:server

Client environment variables:

  • ES_CREATE_ROOM: When true, the client will create a new room on startup.
  • ES_SEND_INVITE: When set to a string, the client will auto-invite that user ID to the first room it joins/creates.
  • ES_LOCALPART: The desired localpart for the client. If already picked then the server will return a random localpart.

Setting up a demo

  1. ES_PORT=3000 ES_SIGNING_KEY_PATH=./p3000.signing.key yarn dev:server to start the server. This will block until killed.
  2. ES_PORT=3001 ES_SIGNING_KEY_PATH=./p3001.signing.key yarn dev:server to start the second server in a new terminal window.
  3. In a new terminal window, ES_PORT=3000 yarn dev:client:nobuild. This will also block until killed.
  4. In a fourth terminal window, ES_PORT=3001 yarn dev:client:nobuild to start the second client.
  5. Grab the auto-assigned user ID from the fourth terminal and put it on your clipboard.
  6. In the third terminal window (first client), type /createRoom and press Enter.
  7. You should now have a room that you're chatting in.
  8. Type /invite <the other user ID> and press Enter.
  9. In the fourth terminal (second client), follow the instructions to accept the invite.
  10. Send whatever text you like in either client and it should be received on the other end. This will be going over local federation.

Some additional notes:

  • All rooms and users are held in memory for now.

Synapse demo

You will need a Synapse running the clokep/lm branch.

  1. Create the room on the eigen-server hub.
  2. Invite your Synapse user.
  3. Success! (probably)