|
1 | 1 | ## Configure prover DB |
2 | 2 |
|
3 | | -Edit `~/zkevm/mainnet/db/scripts/init_prover_db.sql` to set up the node databases. |
| 3 | +1. Copy/paste the following script into `~/zkevm/mainnet/db/scripts/init_prover_db.sql` to replace what's there. |
4 | 4 |
|
5 | | -```sql |
6 | | -CREATE DATABASE prover_db; |
7 | | -\connect prover_db; |
| 5 | + ```sql |
| 6 | + CREATE DATABASE prover_db; |
| 7 | + \connect prover_db; |
8 | 8 |
|
9 | | -CREATE SCHEMA state; |
| 9 | + CREATE SCHEMA state; |
10 | 10 |
|
11 | | -CREATE TABLE state.nodes (hash BYTEA PRIMARY KEY, data BYTEA NOT NULL); |
12 | | -CREATE TABLE state.program (hash BYTEA PRIMARY KEY, data BYTEA NOT NULL); |
| 11 | + CREATE TABLE state.nodes (hash BYTEA PRIMARY KEY, data BYTEA NOT NULL); |
| 12 | + CREATE TABLE state.program (hash BYTEA PRIMARY KEY, data BYTEA NOT NULL); |
13 | 13 |
|
14 | | -CREATE USER prover_user with password 'prover_pass'; |
15 | | -GRANT CONNECT ON DATABASE prover_db TO prover_user; |
16 | | -ALTER USER prover_user SET SEARCH_PATH=state; |
17 | | -GRANT ALL PRIVILEGES ON SCHEMA state TO prover_user; |
18 | | -GRANT ALL PRIVILEGES ON TABLE state.nodes TO prover_user; |
19 | | -GRANT ALL PRIVILEGES ON TABLE state.program TO prover_user; |
20 | | -``` |
| 14 | + CREATE USER prover_user with password 'prover_pass'; |
| 15 | + GRANT CONNECT ON DATABASE prover_db TO prover_user; |
| 16 | + ALTER USER prover_user SET SEARCH_PATH=state; |
| 17 | + GRANT ALL PRIVILEGES ON SCHEMA state TO prover_user; |
| 18 | + GRANT ALL PRIVILEGES ON TABLE state.nodes TO prover_user; |
| 19 | + GRANT ALL PRIVILEGES ON TABLE state.program TO prover_user; |
| 20 | + ``` |
21 | 21 |
|
22 | | -Save and exit the file. |
| 22 | +2. Save and exit the file. |
23 | 23 |
|
24 | 24 | ## Configure the prover |
25 | 25 |
|
26 | | -Create the `~/zkevm/config.json` and paste the configs below. |
| 26 | +1. Create a file called `config.json` and copy/paste the mock prover configuration from here: https://github.com/0xPolygonHermez/zkevm-node/blob/develop/test/config/test.prover.config.json. |
27 | 27 |
|
28 | | -!!! info |
29 | | - `aggregatorClientHost` only required when running the full prover. |
30 | | - |
31 | | -??? "Click to expand the <code>config.json</code> file" |
32 | | - ```json |
33 | | - { |
34 | | - "runExecutorServer": false, |
35 | | - "runExecutorClient": false, |
36 | | - "runExecutorClientMultithread": false, |
37 | | - |
38 | | - "runStateDBServer": false, |
39 | | - "runStateDBTest": false, |
40 | | - |
41 | | - "runAggregatorServer": false, |
42 | | - "runAggregatorClient": true, |
43 | | - "proverName": "static_prover", |
44 | | - |
45 | | - "runFileGenBatchProof": false, |
46 | | - "runFileGenAggregatedProof": false, |
47 | | - "runFileGenFinalProof": false, |
48 | | - "runFileProcessBatch": false, |
49 | | - "runFileProcessBatchMultithread": false, |
50 | | - "runFileExecutor": false, |
51 | | - |
52 | | - "runKeccakScriptGenerator": false, |
53 | | - "runKeccakTest": false, |
54 | | - "runStorageSMTest": false, |
55 | | - "runBinarySMTest": false, |
56 | | - "runMemAlignSMTest": false, |
57 | | - "runSHA256Test": false, |
58 | | - "runBlakeTest": false, |
59 | | - |
60 | | - "executeInParallel": true, |
61 | | - "useMainExecGenerated": true, |
62 | | - "useProcessBatchCache": true, |
63 | | - "saveRequestToFile": false, |
64 | | - "saveInputToFile": true, |
65 | | - "saveDbReadsToFile": true, |
66 | | - "saveDbReadsToFileOnChange": false, |
67 | | - "saveOutputToFile": true, |
68 | | - "saveFilesInSubfolders": false, |
69 | | - "saveProofToFile": true, |
70 | | - "saveResponseToFile": false, |
71 | | - "loadDBToMemCache": true, |
72 | | - "loadDBToMemCacheInParallel": false, |
73 | | - "dbMTCacheSize": 16384, |
74 | | - "dbProgramCacheSize": 16384, |
75 | | - "dbMultiWrite": true, |
76 | | - "dbFlushInParallel": true, |
77 | | - |
78 | | - "opcodeTracer": false, |
79 | | - "logRemoteDbReads": false, |
80 | | - "logExecutorServerResponses": false, |
81 | | - |
82 | | - "executorServerPort": 50071, |
83 | | - "executorROMLineTraces": false, |
84 | | - "executorClientPort": 50071, |
85 | | - "executorClientHost": "127.0.0.1", |
86 | | - |
87 | | - "stateDBServerPort": 5432, |
88 | | - "stateDBURL": "local", |
89 | | - |
90 | | - "aggregatorServerPort": 50081, |
91 | | - "aggregatorClientPort": 50081, |
92 | | - "aggregatorClientHost": "", // YOUR PUBLIC IP ADDRESS |
93 | | - "aggregatorClientMockTimeout": 10000000, |
94 | | - |
95 | | - "mapConstPolsFile": false, |
96 | | - "mapConstantsTreeFile": false, |
97 | | - |
98 | | - "inputFile": "testvectors/aggregatedProof/recursive1.zkin.proof_0.json", |
99 | | - "inputFile2": "testvectors/aggregatedProof/recursive1.zkin.proof_1.json", |
100 | | - |
101 | | - "outputPath": "/output/", |
102 | | - "configPath": "/mnt/prover/config/", |
103 | | - "zkevmCmPols_disabled": "/mnt/prover/runtime/zkevm.commit", |
104 | | - "c12aCmPols": "runtime/c12a.commit", |
105 | | - "recursive1CmPols_disabled": "runtime/recursive1.commit", |
106 | | - "recursive2CmPols_disabled": "runtime/recursive2.commit", |
107 | | - "recursivefCmPols_disabled": "runtime/recursivef.commit", |
108 | | - "finalCmPols_disabled": "runtime/final.commit", |
109 | | - |
110 | | - "publicsOutput": "public.json", |
111 | | - "proofFile": "proof.json", |
112 | | - |
113 | | - "databaseURL": "postgresql://prover_user:prover_pass@zkevm-state-db:5432/prover_db", |
114 | | - "databaseURL_disabled": "local", |
115 | | - "dbNodesTableName": "state.nodes", |
116 | | - "dbProgramTableName": "state.program", |
117 | | - "dbConnectionsPool": true, |
118 | | - "cleanerPollingPeriod": 600, |
119 | | - "requestsPersistence": 3600, |
120 | | - "maxExecutorThreads": 20, |
121 | | - "maxProverThreads": 8, |
122 | | - "maxStateDBThreads": 8 |
123 | | - } |
124 | | - ``` |
| 28 | +2. Save it to the `~/zkevm/` directory. |
0 commit comments