Skip to content

Latest commit

 

History

History
59 lines (39 loc) · 1.92 KB

README.md

File metadata and controls

59 lines (39 loc) · 1.92 KB

Concierge is an API to manage your Compendia Layer 2 Database. It acts as an OrbitDB node and CRUD API.

When you first run Concierge after configuring your env file, you'll get the multihash address (i.e. /orbitdb/foo/bar) that you can register in Compendia from the Tools section in the testnet web wallet.

Click here for a full guide on Compendia Databases.

API

All API requests require the configured API secret (as set in the .env file) in its URL query (e.g. http://localhost?secret=my_api_secret).

The following HTTP requests can be made to the API:

  • GET: Return an entry by ID. Requires id in url query.
  • POST: Create a new entry (entry must be stringified JSON object & pass the database's schema validation).
  • DELETE: Deletes an entry by ID. Requires id in url query.

Installation

  1. Register a database in your Compendia Wallet (Tools tab).

  2. Git clone this repository into your relay node and open it:

git clone https://github.com/compendia/concierge.git && cd concierge
  1. Copy .env.example to .env:
cp .env.example .env
  1. Edit your .env file. Set up the port, the database schema, and your validator passphrase:
nano .env
  1. Install dependencies:
sudo apt install build-essential
npm install -g node-gyp
npm install
npm install --save [email protected]
  1. Start the server with pm2 so it stays online consistently (change name to something recognizable):
npm install -g pm2
pm2 start index.js --name concierge

If you want to set up a Concierge API for another database on the same server, simply clone the repository into a new directory and make sure to use a different port and pm2 process name.