improve the nim-cli documentation

This commit is contained in:
Balazs Komuves 2023-12-15 22:33:41 +01:00
parent 93608690cc
commit 78dcaaa396
No known key found for this signature in database
GPG Key ID: F63B7AEF18435562
3 changed files with 16 additions and 9 deletions

View File

@ -13,19 +13,21 @@ use real data.
$ ./cli [options] --output=proof_input.json --circom=proof_main.circom
available options:
-h, --help : print this help
-v, --verbose : verbose output (print the actual parameters)
-d, --depth = <maxdepth> : maximum depth of the slot tree (eg. 32)
-N, --maxslots = <maxslots> : maximum number of slots (eg. 256)
-c, --cellSize = <cellSize> : cell size in bytes (eg. 2048)
-b, --blockSize = <blockSize> : block size in bytes (eg. 65536)
-c, --cellsize = <cellSize> : cell size in bytes (eg. 2048)
-b, --blocksize = <blockSize> : block size in bytes (eg. 65536)
-s, --nslots = <nslots> : number of slots in the dataset (eg. 13)
-n, --nsamples = <nsamples> : number of samples we prove (eg. 100)
-e, --entropy = <entropy> : external randomness (eg. 1234567)
-S, --seed = <seed> : seed to generate the fake data (eg. 12345)
-f, --file = <datafile.bin> : slot data file
-f, --file = <datafile> : slot data file, base name (eg. "slotdata" would mean "slotdata5.dat" for slot index = 5)
-i, --index = <slotIndex> : index of the slot (within the dataset) we prove
-k, --log2ncells = <log2(ncells)> : log2 of the number of cells inside this slot (eg. 10)
-K, --ncells = <ncells> : number of cells inside this slot (eg. 1024; must be a power of two)
-o, --output = <inupt.json> : the JSON file into which we write the proof input
-o, --output = <input.json> : the JSON file into which we write the proof input
-C, --circom = <main.circom> : the circom main component to create with these parameters
You can generate only the `.json` or only the `.circom` file, or both at the same
@ -33,3 +35,8 @@ time.
There are some default values for all the rest of the parameters.
NOTE: When using actual files for the slot data (which is untested :), you will
need _all_ slots to be able to compute the dataset root. The convention used is
that you specify the base name of the file, say `"slotdata"`; and the individual
slots file names are derived from this to be for example `"slotdata5.dat"` for
the slot with index 5 (note: indexing starts from 0).

View File

@ -64,6 +64,8 @@ proc printHelp() =
echo "$ ./cli [options] --output=proof_input.json --circom=proof_main.circom"
echo ""
echo "available options:"
echo " -h, --help : print this help"
echo " -v, --verbose : verbose output (print the actual parameters)"
echo " -d, --depth = <maxdepth> : maximum depth of the slot tree (eg. 32)"
echo " -N, --maxslots = <maxslots> : maximum number of slots (eg. 256)"
echo " -c, --cellsize = <cellSize> : cell size in bytes (eg. 2048)"
@ -72,7 +74,7 @@ proc printHelp() =
echo " -n, --nsamples = <nsamples> : number of samples we prove (eg. 100)"
echo " -e, --entropy = <entropy> : external randomness (eg. 1234567)"
echo " -S, --seed = <seed> : seed to generate the fake data (eg. 12345)"
echo " -f, --file = <datafile.bin> : slot data file"
echo " -f, --file = <datafile> : slot data file, base name (eg. \"slotdata\" would mean \"slotdata5.dat\" for slot index = 5)"
echo " -i, --index = <slotIndex> : index of the slot (within the dataset) we prove"
echo " -k, --log2ncells = <log2(ncells)> : log2 of the number of cells inside this slot (eg. 10)"
echo " -K, --ncells = <ncells> : number of cells inside this slot (eg. 1024; must be a power of two)"

View File

@ -12,15 +12,13 @@ import types
#
const exSlotCfg =
SlotConfig( nCells: 256 # 1024
, nSamples: 5 # 20
SlotConfig( nCells: 256
, nSamples: 5
, dataSrc: DataSource(kind: FakeData, seed: 12345)
)
#-------------------------------------------------------------------------------
# (10852671575406741732, 3735945064, 2557891771)
{.overflowChecks: off.}
proc genFakeCell(globcfg: GlobalConfig, cfg: SlotConfig, seed: Seed, idx: CellIdx): Cell =
let seed1 : uint64 = uint64(seed) + 0xdeadcafe'u64