Skip to content

Example: Matrix

Lorenzo Mangani edited this page Oct 2, 2021 · 2 revisions

Decentralized paStash with Matrix

Matrix is an open network for secure, decentralized communication.

In this example we'll use Matrix for two paStash instances using Matrix rooms to securely connect and exchange data, with optional e2e encryption 🔒

🔧 Install

Install pastash and the required plugin on two separate systems:

npm install -g @pastash/pastash @pastash/input_matrix @pastash/output_matrix

📍 Example

Create a recipe on the sender and receiver, joining the same roomId.

📢 Sender
input {
  stdin {}
}

output {
  matrix {
    userId => "@some_account:matrix.org"
    roomId => "#some_room:matrix.org"
    token =>  "xxx_XXXXXXXXXXXXXXXXXXXXXXXXXXXX_xxxxx"
  }
}
pastash --config_file=/tmp/sender.conf
📻 Receiver
input {
  matrix {
    userId => "@some_account:matrix.org"
    roomId => "#some_room:matrix.org"
    token =>  "xxx_XXXXXXXXXXXXXXXXXXXXXXXXXXXX_xxxxx"
  }
}

output {
  stdout {}
}
pastash --config_file=/tmp/receiver.conf
🔔 Try it!

Type something in the sender console and you should see corresponding events on the receiver. Et Voila'!


Clone this wiki locally