vegaprotocol / topgun-service

Leaderboard API service for Fairground incentives (code name TOPGUN)
0 stars 0 forks source link

Leaderboard API service for Fairground incentives (code name TOPGUN)

API service that provides a sorted leaderboard for incentives/games/Mainnet Sims operating on the Fairground testnet.

The leaderboard is filtered to include ONLY participants that are found on a verified 'allow-list' provided by an external API service. On which each user will verify their public key using Twitter. This service is known internally as Social Media Verification or "Twitter Registration". An optional blacklist can be configured to exclude users from the main public leaderboard, this feature is useful for team members or known bots/scammers.

When running an incentive/game the configuration file for the topgun-service can be configured with the appropriate 'algorithm' to serve up a list of participants on a leaderboard. The choices of algorithm currently includes:

The service is written in Go and more recent algorithms use MongoDB as a persistence layer.

How to run the service

Example:

./topgun-service -config custom-config-file.yaml

To build - you can run go build -v -o bin/topgun-service ./cmd/topgun-service Then to run from the bin directory you can use ./bin/topgun-service -config config.yaml

The application requires a custom configuration file passed in the argument named -config, an example can be found here. Details of the config variables are detailed below:

Config:

MongoDB:

Optionally, algorithms can make use of persisting and sharing data collections stored in MongoDB, useful to preserve state of incentives throughout resets and other events like restarts. Currently only the ByAssetDepositWithdrawal algorithm makes use of mongodb, other algos should set these fields to the value NA or similar as shown in the example config file.

Queries:

Verified socials

A mapping of public key to social handle (Twitter) is provided by an external service, please see the file verified_example.txt for an example of the format returned. An attempt to update this list from the 3rd party server happens on each reload of the data from Vega, see vegapoll time parameter above. This service is operated by Vega and is known internally as Social Media Verification or "Twitter Registration".

How to file an issue or report a problem

Please use the Issues tab in the topgun-service repository in GitHub.