|
|
1 жил өмнө | |
|---|---|---|
| .. | ||
| src | 1e692e1de2 Deny clippy warnings in CI properly (#2109) | 1 жил өмнө |
| .gitignore | cf90bff236 feat(fortuna): support multiple hashchains (#1509) | 1 жил өмнө |
| Cargo.lock | 0a0257e2fe fix(rust): update cargo.lock files after pythnet sdk release (#2111) | 1 жил өмнө |
| Cargo.toml | e2ef7a4a6b fix: timeout for tx confirmation (#2098) | 1 жил өмнө |
| Dockerfile | ed0f273dcb chore: switch to stable rust versions (#2093) | 1 жил өмнө |
| README.md | 8887a0908c [fortuna] Fix config and CLI args (#1605) | 1 жил өмнө |
| config.sample.yaml | 1a181cc13c [fortuna] Automated fee adjustment based on gas prices (#1708) | 1 жил өмнө |
| rust-toolchain | ed0f273dcb chore: switch to stable rust versions (#2093) | 1 жил өмнө |
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.
Fortuna uses Cargo for building and dependency management.
Simply run cargo build and cargo test to build and test the project.
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.
To start an instance of the webserver for local testing, you first need to perform a few setup steps:
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.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.