Amin Moghaddam 9dba9d01d5 fix(fortuna): remove wss related code (#2648) há 6 meses atrás
..
src 9dba9d01d5 fix(fortuna): remove wss related code (#2648) há 6 meses atrás
.gitignore cf90bff236 feat(fortuna): support multiple hashchains (#1509) há 1 ano atrás
Cargo.lock 735acc71a0 feat(fortuna): Improve startup flow (#2638) há 6 meses atrás
Cargo.toml b587b8769d feat(fortuna): add current commitment sequence number metric (#2639) há 6 meses atrás
Dockerfile ed0f273dcb chore: switch to stable rust versions (#2093) há 1 ano atrás
README.md 8887a0908c [fortuna] Fix config and CLI args (#1605) há 1 ano atrás
config.sample.yaml de934f524b feat: Delayed block processing for Fortuna (#2307) há 9 meses atrás
rust-toolchain ed0f273dcb chore: switch to stable rust versions (#2093) há 1 ano atrás

README.md

Fortuna

Fortuna is a webservice that serves random numbers according to the Entropy protocol. The webservice generates a hash chain of random numbers and reveals them to callers when permitted by the protocol. The hash chain is generated from a secret key that is provided to the server on startup. The service also operates a keeper task that performs callback transactions for user requests.

A single instance of this service can simultaneously serve random numbers for several different blockchains. Each blockchain is configured in config.yaml.

Build & Test

Fortuna uses Cargo for building and dependency management. Simply run cargo build and cargo test to build and test the project.

Command-Line Interface

The Fortuna binary has a command-line interface to perform useful operations on the contract, such as registering a new randomness provider, or drawing a random value. To see the available commands, simply run cargo run.

Local Development

To start an instance of the webserver for local testing, you first need to perform a few setup steps:

  1. Create a config.yaml file to point to the desired blockchains and Entropy contracts. Copy the content in config.sample.yaml and follow the directions inside to generate the necessary private keys and secrets.
  2. Make sure the wallets you have generated in step (1) contain some gas tokens for the configured networks.
  3. Run cargo run -- setup-provider to register a randomness provider for this service. This command will update the on-chain contracts such that the configured provider key is a randomness provider, and its on-chain configuration matches config.yaml.

Once you've completed the setup, simply run the following command to start the service:

RUST_LOG=INFO cargo run -- run

This command will start the webservice on localhost:34000.