caerus

command module
v0.0.0-...-545bd39 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 28, 2023 License: Apache-2.0 Imports: 17 Imported by: 0

README

Caerus

In Greek mythology, Caerus /ˈsɪərəs, ˈsiːrəs/ (Greek: Καιρός, Kairos, the same as kairos) was the personification of opportunity, luck and favorable moments. (Wikipedia)

Caerus, the Greek God of Opportunity

What is Caerus?

Caerus is a centralized server designed to gather various useful features for developers creating applications on Desmos. These features include:

  • Requesting fee grants for onboarding new users.
  • Sending notifications to end clients.
  • Uploading files to IPFS and creating associated placeholders using BlurHash.
  • Generating deep links supported by official applications (e.g., DPM).

The code in this repository serves two main purposes:

  1. Maintaining Your Own Caerus Instance: If you want full control over the features available to your clients, you can build and run the binary or use the provided Dockerfile to maintain your Caerus instance.

  2. Using the Official Caerus Server: If you prefer not to manage your Caerus instance, you can register as an application within the official server. Upon registration, you'll receive an authentication token to make calls to the server. This approach is suitable if you're already developing a centralized server or an end-user client and want to leverage Caerus's features without reimplementation. To create your client implementation, you can utilize a Protobuf Compiler and reference the files in the proto folder.

Official Caerus Server

If you prefer not to maintain your own Caerus server instance, you can use our official one. It's available at the following address:

https://grpc-caerus.mainnet.desmos.network:443
Registering as an application

If you want to use the official Caerus instance, your application needs to be registered on our server. To get started, just reach out to our team at development@desmos.network. Let us know that you're interested in becoming a registered developer. We'll handle the process of setting up an account for you and giving you an authorization token. This token will allow you to make requests to our server seamlessly.

Running an instance

If you want to run your own Caerus instance, you can do so by running the Docker image or building the binary yourself. In both cases, you are required to set some environment variables.

Environment variables
Analytics
Name Description Required Default
ANALYTICS_ENABLED Enables or disables the analytics No false
ANALYTICS_POSTHOG_API_KEY The API key of the PostHog instance to use for analytics Yes
ANALYTICS_POSTHOG_HOST The host of the PostHog instance to use for analytics Yes
Name Description Required
BRANCH_KEY The Branch.io key to use for generating deep links Yes
Chain
Name Description Required Default
CHAIN_ACCOUNT_RECOVERY_PHRASE The BIP39 recovery phrase of the account to use to perform on-chain transactions Yes
CHAIN_BECH32_PREFIX The Bech32 prefix of the chain to use No desmos
CHAIN_ACCOUNT_DERIVATION_PATH The derivation path of the account to use to perform on-chain transactions No m/44'/852'/0'/0/0
CHAIN_RPC_URL The address of the RPC endpoint to use No https://rpc.morpheus.desmos.network:443
CHAIN_GRPC_URL The address of the gRPC endpoint to use No https://grpc.morpheus.desmos.network:443
CHAIN_GAS_PRICE The gas price to use for on-chain transactions No 0.01udaric
Database
Name Description Required Default
DATABASE_URI The PostgreSQL connection URI used to connect to the database to be used Yes
Notifications
Name Description Required Default
FIREBASE_CREDENTIALS_FILE_PATH The path to the Firebase credentials file to use for sending notifications Yes
Logging
Name Description Required Default
LOG_LEVEL The log level to use No info
File storing
Name Description Required Default
FILE_STORAGE_BASE_FOLDER The base folder where to store temporary files uploaded by the users No User home directory
FILE_STORAGE_TYPE The type of storage to use for storing files No IPFS
FILE_STORAGE_IPFS_ENDPOINT The endpoint of the IPFS node to use for storing files No https://ipfs.desmos.network
Server
Name Description Required Default
SERVER_ADDRESS The address where the server should listen for incoming connections No 0.0.0.0
SERVER_PORT The port where the server should listen for incoming connections No 3000

Development

While developing Caerus we use some external tools and libraries to make our life easier.

Tests
Mocks

Some tests require mocks to properly work in order to isolate the behavior from external factors. To generate such mocks we use gomock. After installing it, you can run the following commands to generate the stubs:

mockgen -source routes/notifications/expected_interfaces.go -destination routes/notifications/testutils/expected_interfaces.mock.go -package testutils
mockgen -source routes/links/expected_interfaces.go -destination routes/links/testutils/expected_interfaces.mock.go -package testutils
mockgen -source scheduler/expected_interfaces.go -destination scheduler/testutils/expected_interfaces.mock.go -package testutils

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
routes
links/testutils
Package testutils is a generated GoMock package.
Package testutils is a generated GoMock package.
notifications/testutils
Package testutils is a generated GoMock package.
Package testutils is a generated GoMock package.
testutils
Code generated by MockGen.
Code generated by MockGen.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL