Install and Deploy
Prerequisites
- MongoDB - We suggest MongoDB Atlas, but you may manage your own open source database instead.
- InfluxDB - We suggest InfluxDB Cloud, but you may manage your own open source database instead.
- Pulsar - We suggest StreamNative Cloud, but you may manage your own open source cluster instead.
Configuration and Deployment
Default values are configured in config.yaml
and can be overriden with environment variables. All values are well documented inside config.yaml
.
Generally any config value in config.yaml
can be overridden with an environment variable.
Nested values are separated by _
and env variables should start with APP_
to be considered.
Example:
APP_MONGO_URI=mongodb+srv://username:password@sui-testnet.7b6tqsn.mongodb.net/?retryWrites=true&w=majority
Whitelisting and Blacklisting by Sui Move Package ID
- Cost reduction and query speed can be achieved by narrowing down the number of objects you load into MongoDB via the Sui Object Indexer. For example, if you are only working with data from one or a handful of Sui Move Packages, you can configure the indexer to exclusivley load those items. This is documented in
config.yaml
. - You may alternatively blacklist package IDs rather than whitelist.
Cargo Install on Ubuntu 20.04 LTS (The Hard Way)
- Clone repo into directory of your choice.
- Configure
config.yaml
. All parameters are documented inside the file. - Ensure
pulsar-credentials.json
is located in correct directory. Default is/opt/pulsar-credentials.json
. If using StreamNative Cloud, you can generate and download this file in the web UI. - Create MongoDB user and database. These must match the parameters in
config.yaml
. This is done in the UI in MongoDB Atlas. If you are using MongoSH, there are example commands inexample-queries/mongodb/mongosh-setup-examples
. - Create InfluxDB bucket and token. This is done in the web UI whether you are using InfluxDB Cloud or a self-managed, open-source database.
- Open the port for the GraphQL web service.
sudo ufw allow 8000
- Install indexer application: Move to the
main
directory of the repo and runcargo install --path .
This will create a new executable calledindexer
. This can take a long time to build Sui dependencies. - Start indexer in background:
setsid indexer
- Install GraphQL webserver application: Move to the
server
directory of the repo and runcargo install --path .
- Start GraphQL webserver in background:
setsid
Tips for Running on Ubuntu 20.04 LTS
- If you are only running the indexer and webserver, a fairly small server will suffice (4gb RAM + 4 CPU cores). You may need a larger server to facilitate a large number of queries or aggressive indexing settings.
- If you used
setsid
to launch the apps, you can usehtop
to see the process info. - Logs are located at
/var/log/indexer.log
Fly.io running a Docker Container (The Easy Way)
- Fly is a hosting platform that automatically builds, deploys, and runs Docker containers. You can also manage secrets like API keys and databse credentials in Fly.io. We have been able to host each Rust app on Fly for around $25 / month each.
- Note that you will still need to use external services for items in the
Prerequisites
section of this document. - Each repo
main
(Indexer) andserver
(GraphQL API) contain an example Fly.io configuration file. The instance sizes and other configuration options are a great starting point for both services. You can find the most up-to-date instrucctions on the Fly.io website. https://fly.io/docs/apps/launch/