Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"npm run deploy:hello-zksync" results in "Error: socket hang up" #796

Closed
h4xhor opened this issue Dec 1, 2024 · 5 comments
Closed

"npm run deploy:hello-zksync" results in "Error: socket hang up" #796

h4xhor opened this issue Dec 1, 2024 · 5 comments

Comments

@h4xhor
Copy link

h4xhor commented Dec 1, 2024

Hi I'm following the guide on ZKsync and I'm up to here https://docs.zksync.io/build/start-coding/zksync-101/hello-zksync.

When I run this command:

npm run deploy:hello-zksync

I get this error:

> [email protected] deploy:hello-zksync
> hardhat deploy-zksync --script 1-hello-zksync/deploy.ts


Starting deployment process of "CrowdfundingCampaign"...
Error: socket hang up
    at Socket.socketOnEnd (node:_http_client:530:25)
    at Socket.emit (node:events:530:35)
    at Socket.emit (node:domain:489:12)
    at endReadableNT (node:internal/streams/readable:1698:12)
    at processTicksAndRejections (node:internal/process/task_queues:90:21)

I am on Debian 12 and have installed Docker Desktop.

I am using:

  • nodejs 22.11.0
  • npm 10.9.0
  • npx 10.9.0
  • pnpm 9.14.4

I confirmed with nmap that the port 8011 on Docker is open.

Any suggestions on what else to try greatly appreciated. Thank you.

@bxpana
Copy link
Contributor

bxpana commented Dec 3, 2024

Thanks for reaching out, I was able to replicate a similar issue to what you got and will look into it. Just to check, does it work if you switch to zkSyncSepoliaTestnet?

@h4xhor
Copy link
Author

h4xhor commented Dec 3, 2024

Hi @bxpana,

Thanks for your help. Yes it works fine if I use zkSyncSepoliaTestnet. After updating .env to use my Sepolia Testnet account I ran:

npx hardhat deploy-zksync --network zkSyncSepoliaTestnet --script 1-hello-zksync/deploy.ts

and got the output:

Starting deployment process of "CrowdfundingCampaign"...
Estimated deployment cost: 0.00001201235 ETH

"CrowdfundingCampaign" was successfully deployed:
 - Contract address: 0x668a74ea3eADad5b712543c158Fe791b453dC3f5
 - Contract source: contracts/1-hello-zksync/CrowdfundingCampaign.sol:CrowdfundingCampaign
 - Encoded constructor arguments: 0x00000000000000000000000000000000000000000000000000470de4df820000

Requesting contract verification...
[WARNING] Since Etherscan is disabled or the API key is missing, verification will default to the ZKSync block explorer.
Your verification ID is: 32641
Error in plugin @matterlabs/hardhat-zksync-verify: Failed to send contract verification request
 Reason: ZkSyncVerifyPluginError: Compilation errorParserError: Expected ';' but got identifier
  --> contracts/1-hello-zksync/CrowdfundingCampaign.sol:17:9:
   |
17 |         owner = msg.sender;
   |         ^^^^^



For more info run Hardhat with --show-stack-traces

I confirmed that reads from the contract also works:

$ zksync-cli contract read \
--chain zksync-sepolia \
--contract 0x668a74ea3eADad5b712543c158Fe791b453dC3f5 \
--abi artifacts-zk/contracts/1-hello-zksync/CrowdfundingCampaign.sol/CrowdfundingCampaign.json
Using provided ABI file
? Contract method to call getFundingGoal() view returns (uint256)

✔ Method response (raw): 0x00000000000000000000000000000000000000000000000000470de4df820000
✔ Decoded method response: 20000000000000000

Run this directly: npx zksync-cli contract read --chain "zksync-sepolia" --contract "0x668a74ea3eADad5b712543c158Fe791b453dC3f5" --method "getFundingGoal()" --output "uint256" --abi "artifacts-zk/contracts/1-hello-zksync/CrowdfundingCampaign.sol/CrowdfundingCampaign.json"

@bxpana
Copy link
Contributor

bxpana commented Dec 5, 2024

Thanks for the confirmation. I am running into a similar connection issue to the in-memory node but able to deploy on ZKsync Sepolia too. I went ahead and opened an issue for the zksync-cli to have the team look into fixing that matter-labs/zksync-cli#179

@bxpana
Copy link
Contributor

bxpana commented Dec 6, 2024

@h4xhor the issue was closed and a fix was released. You can upgrade with zksync-cli dev update zkcli-in-memory-node

Thanks again for the heads up and let us know if you run into anything else.

@bxpana bxpana closed this as completed Dec 6, 2024
@h4xhor
Copy link
Author

h4xhor commented Dec 7, 2024

Thank you @bxpana. It works perfectly!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants