Bootstrap CLI

This is a CLI to bootstrap the oracle pool. The CLI has 5 modules (5 main classes) for each of the following tasks:

  1. ergo.oraclepool.GeneratePoolToken to generate a singleton pool token
  2. ergo.oraclepool.GenerateOracleTokens to generate multiple oracle tokens
  3. ergo.oraclepool.GetAddresses Getting the addresses using the tokens generated
  4. ergo.oraclepool.BootstrapPool Bootstrapping the epoch preparation box using the address and tokens
  5. ergo.oraclepool.BootstrapOracle Bootstrapping the oracle boxes using the address and tokens

Step 1: Configure options

Edit the file ergo/oraclepool/package.scala and update following parameters as desired:

val oracleReward = 2500000L // NanoErgs
val minBoxValue = 1500000L // NanoErgs
val errorMargin = 50 // percent
val numOracles = 14
val epochPeriod = 30 // blocks
val livePeriod = 20 // blocks
val buffer = 5 // blocks

Edit the file ergo/api/ErgoAPI.scala and update following parameters as desired:

private var apiKey = "hello"
var baseUrl = "http://192.168.0.200:9053/"
private val defaultFee = 2000000

Step 2: Compile the Jar

Use the command:

sbt assembly

The jar will be stored as target/scala-2.12/oracle-pool-bootstrap.jar. Copy the jar to some desired location.

Step 3: Issue tokens

Usage:

java -cp oracle-pool-bootstrap.jar ergo.oraclepool.GeneratePoolToken <address_to_store_tokens_in>
java -cp oracle-pool-bootstrap.jar ergo.oraclepool.GenerateOracleTokens <address_to_store_tokens_in> <num_tokens>

Example:

java -cp oracle-pool-bootstrap.jar ergo.oraclepool.GeneratePoolToken 9fcrXXaJgrGKC8iu98Y2spstDDxNccXSR9QjbfTvtuv7vJ3NQLk
java -cp oracle-pool-bootstrap.jar ergo.oraclepool.GenerateOracleTokens 9fcrXXaJgrGKC8iu98Y2spstDDxNccXSR9QjbfTvtuv7vJ3NQLk 20

Step 4: Get addresses

Usage:

java -cp oracle-pool-bootstrap.jar ergo.oraclepool.GetAddresses <oracleTokenId> <poolTokenId>

Example:

java -cp oracle-pool-bootstrap.jar ergo.oraclepool.GetAddresses 12caaacb51c89646fac9a3786eb98d0113bd57d68223ccc11754a4f67281daed b662db51cf2dc39f110a021c2a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