Skip to content

multiversx/mx-governance-service

GraphQl service to provide backend environment for xExchange

Dependencies

  1. Node.js > @18.x.x is required to be installed docs
  2. Redis Server is required to be installed docs.
  3. RabbitMQ Server is required to be installed docs.
  4. MongoDB Server is required to be installed docs.

You can use docker-compose up in a separate terminal to use a local docker container for all these dependencies.

After running the sample, you can stop the Docker container with docker-compose down

Available Scripts

This is an MultiversX project built on Nest.js framework.

npm run start

Runs the app in the production mode. Make requests to http://localhost:3005/graphql.

Running the app

  1. At the root folder run (make sure you have node v16.x.x)
$ npm install
  1. Proper config .env.example based on desired configuration

  2. Start the app

# development debug mode
$ npm run start:debug
# development mode
$ npm run start:dev
# production mode
$ npm run start

It depends on the following external systems:

A service instance can be started with the following behavior:

  • public API: provides graphQL queries for the consumers
  • private API: used to report prometheus metrics & health checks
  • rabbitMQ: used to fetch events in real time and create analytics data
  • cache warmer: used to proactively fetch data & pushes it to cache, to improve performance & scalability

It depends on the following optional external systems:

  • events notifier rabbitmq: queue that pushes logs & events which are handled internally e.g. to store token prices
  • AWS Timestream: used to store time based metrics such as prices, volumes, fees

It uses the following optional internal systems:

  • mongo database: used to store configs and addresses

Generating root hashes, merkle tree-proofs and their corresponding voting powers from snapshots

Place the snapshot file, which will serve as the basis for generating root hashes, merkle-tree proofs, and voting powers, into the /src/snapshots directory of the cloned project. This file should be renamed utk-snapshot.json. The gen-merkle-tree.ts script, located at src/utils/merkle-tree/gen-merkle-tree.ts, allows for configuration of the number of merkle-tree proofs to be generated. This can be adjusted by modifying the max_proofs_to_generate constant on line 5.

Once the snapshot is in place and any desired configurations are made, execute the script by running

$ npx ts-node src/utils/merkle-tree/gen-merkle-tree.ts

from the project's root directory.

This will initiate the generation process for the root hash, merkle-proofs, and individual voting powers.

About

No description, website, or topics provided.

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 9

Languages