Run Roller
Roller Environment
Following the list of environment variables that must set when running Roller:
MYSTIKO_ROLLER.HOME_PATH: roller worker path, default is `/home/mystiko-miner/roller`.
MYSTIKO_ROLLER.PRIVATE_KEY: roller rollup account private key.
MYSTIKO_ROLLER.TOKEN_PRICE_API_KEY: coinmarketcap API key to get token price.
Following the list of path environment variables that can be set when running Roller, if not set Roller will use the MYSTIKO_ROLLER.HOME_PATH:
MYSTIKO_ROLLER.CONFIG_PATH: roller config path.
MYSTIKO_ROLLER.DATA_PATH: roller data path.
MYSTIKO_ROLLER.CIRCUITS_PATH: roller circuits files path.
Roller support environment variables to set the configuration. the prefix of the environment variables is MYSTIKO_ROLLER.
Running Roller via Shell
To run Roller directly from your terminal, follow these steps:
- Open your terminal.
- Navigate to the project's root directory.
- Build the project using the following command:
cargo build --release
- Prepare the configuration file roller.json. (Refer to the Configuration section for more information.) putroller.jsonin theMYSTIKO_ROLLER.CONFIG_PATHorMYSTIKO_ROLLER.HOME_PATH/configdirectory.
- Execute the commands to start Roller.
MYSTIKO_ROLLER.HOME_PATH=$(pwd) \
MYSTIKO_ROLLER.PRIVATE_KEY=0x... \
MYSTIKO_ROLLER.TOKEN_PRICE_API_KEY=... \
./target/release/roller
- Can execute the commands to start Roller with environment variables to override roller.json config.
MYSTIKO_ROLLER.HOME_PATH=$(pwd) \
MYSTIKO_ROLLER.PRIVATE_KEY=0x... \
MYSTIKO_ROLLER.TOKEN_PRICE_API_KEY=... \
MYSTIKO_ROLLER.MEMORY_DB=false \
MYSTIKO_ROLLER.SCHEDULER.SCHEDULE_INTERVAL_MS=10 \
MYSTIKO_ROLLER.ROLLUP.MAX_ROLLUP_SIZE=64 \
./target/release/roller
Running Roller with Docker
Ensure Docker is installed and then run Roller inside a container. Use the following steps:
- Build the Docker image (if needed).
cargo build --release
docker build -t mystiko/roller -f docker/Dockerfile .
- Prepare the configuration file roller.json, putroller.jsonin the$(pwd)/configdirectory.
- Start the Docker container with the appropriate configurations.
docker run -d --name roller \
  -v "$(pwd)/config:/home/mystiko-miner/roller/config" \
  -v "$(pwd)/data:/home/mystiko-miner/roller/data" \
  -v "$(pwd)/circuits:/home/mystiko-miner/roller/circuits" \
  --env MYSTIKO_ROLLER.PRIVATE_KEY=0x... \
  --env MYSTIKO_ROLLER.TOKEN_PRICE_API_KEY=.... \
  mystikonetwork/rollup-miner