zksync-era icon indicating copy to clipboard operation
zksync-era copied to clipboard

zk init error

Open oneforalone opened this issue 1 year ago • 1 comments

I'm trying to build the server from the source code on Ubuntu 20.04, but got an error while running zk init:

$ zk init

-------------------------
> Creating docker volumes
✔ Creating docker volumes done (13ms)

----------------
> Pulling images
Pulling geth     ... done
Pulling postgres ... done
✔ Pulling images done (9700ms)

----------------------
> Checking environment
✔ Checking environment done (46ms)

--------------------
> Checking git hooks
✔ Checking git hooks done (2ms)

-----------------------
> Setting up containers
zksync-era_postgres_1 is up-to-date
zksync-era_geth_1 is up-to-date
✔ Setting up containers done (386ms)

-------------------------------------
> Checkout system-contracts submodule
✔ Checkout system-contracts submodule done (25ms)

-----------------------
> Compiling JS packages
yarn install v1.22.19
[1/4] Resolving packages...
success Already up-to-date.
Done in 0.40s.
yarn run v1.22.19
$ yarn npm-run-all --parallel build:*
$ /lotus/zksync/zksync-era/node_modules/.bin/npm-run-all --parallel 'build:*'
$ yarn web3 build
$ yarn reading-tool build
$ yarn workspace zksync-web3 build
$ yarn workspace reading-tool build
$ tsc && cp -f typechain/*.d.ts build/typechain
$ tsc
Done in 5.19s.
✔ Compiling JS packages done (5944ms)

----------------------
> Compile l2 contracts
yarn run v1.22.19
$ /lotus/zksync/zksync-era/node_modules/.bin/hardhat compile
Nothing to compile
Done in 0.47s.
yarn install v1.22.19
[1/4] Resolving packages...
success Already up-to-date.
Done in 0.40s.
yarn run v1.22.19
$ /lotus/zksync/zksync-era/node_modules/.bin/hardhat compile
Nothing to compile
Done in 0.24s.
yarn run v1.22.19
error Command "preprocess" not found.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Error: Child process exited with code 1

I tried install preprocess via yarn, but the output remains the same. How can i fix it?

oneforalone avatar Mar 24 '23 06:03 oneforalone

I am facing same issue

MadaraAlive avatar Mar 26 '23 07:03 MadaraAlive

Have you run yarn yet? and build zksync-sdk-web3, reading-tool? I think the sub module about smart contract not working

Niet-Pham avatar Mar 29 '23 01:03 Niet-Pham

I got the same error! is there any solution?

pwnforce avatar Apr 04 '23 22:04 pwnforce

Hey! Thanks for the questions! zk init should init the git submodules, but perhaps it didn't work for you for some reason. Please try to verify that the systems contract submodule was brought in correctly, and if not init it manually.

shahar4 avatar Apr 05 '23 14:04 shahar4

The problem is that in the scripts section of the package.json file, it seems that there's no "preprocess" script defined. Could you please let me know what the preprocess script is supposed to do exactly? then we can run it manually.

pwnforce avatar Apr 05 '23 14:04 pwnforce

try this. "preprocess": "rm -rf ./bootloader/build && yarn ts-node scripts/process.ts",

oday0311 avatar Apr 26 '23 08:04 oday0311

also ,you can try run, git submodule init , git submodule update, first . then after pull the submodules, the problem fix.

oday0311 avatar Apr 26 '23 09:04 oday0311