The Spark Engine brokers communication between the client (e.g. Vatom Wallet) and the external Spark Plugin servers. It secures the communication to authorized plugin providers and prevents end user credentials from being sent to the external system.
The Spark Engine also provides an API into the underlying Matrix server.
Install dependencies:
yarn
Copy and edit config:
cp .env.template .env
# edit `.env`
Install a postgres database and run the database scripts in /scripts. Specify the PGCONN connection string in your .env file.
yarn build
yarn start
Or, using hot reloading (recommended)...
# in two terminals
yarn build:watch
yarn start:watch
When a plugin is deployed, the Vatom platform needs to know the URL of the plugin endpoint and needs a way to secure the communication. Each plugin must be added to the spark_plugin table as follows:
- id - a unique primary key (e.g. nanoid)
- name - a friendly name for the plugin
- description - an optional description for the plugin
- comm_url - the public URL for the plugin
- comm_secret - a secret that will be used to sign the messages
Once this is done, the plugin should be associated to your Vatom business:
- business_id - the id of your Vatom business
- plugin_id - the id of the plugin in the spark_plugin table