Comments (7)
So no, that does not return anything.
Then I remembered that in the last macOS they enabled IPv6 by default (or something similar) so pointing to "localhost" does not work anymore for node. Pointing to "127.0.0.1" does. So `curl 127.0.0.1:5000/is_alive" works.
Therefore changing the hardhat.config.ts file to
devnet: {
url: "http://127.0.0.1:5000/"
}
Solves the problem! If I run the tests now it finds the devnet correctly.
Maybe it's work update the example settings to help other fellow macOS devs.
Thanks for the assistance!
from starknet-hardhat-plugin.
- How are you running starknet-devnet?
- What's your node version? Have you tried using using different Node versions?
from starknet-hardhat-plugin.
I start the Devnet with the following command:
> starknet-devnet
* Running on http://localhost:5000/ (Press CTRL+C to quit)
I tried on node v17.3.1
, v17.5.0
and v16.14.0
.
Then on a second terminal:
❯ yarn hardhat test
yarn run v1.22.17
$ /Users/claudio/Dev/web3/starknet-hardhat-example-alt/node_modules/.bin/hardhat test
Starknet plugin using the active environment.
Starknet
Started deployment
1) should work for a fresh deployment
0 passing (744ms)
1 failing
1) Starknet
should work for a fresh deployment:
HardhatPluginError: Could not deploy contract. Check the network url in config. Is it responsive?
at StarknetContractFactory.<anonymous> (node_modules/@shardlabs/starknet-hardhat-plugin/src/types.ts:259:19)
at Generator.next (<anonymous>)
at fulfilled (node_modules/@shardlabs/starknet-hardhat-plugin/dist/types.js:24:58)
An unexpected error occurred:
Error: error:0308010C:digital envelope routines::unsupported
at new Hash (node:internal/crypto/hash:67:19)
at Object.createHash (node:crypto:135:10)
at hash160 (/Users/claudio/Dev/web3/starknet-hardhat-example-alt/node_modules/ethereum-cryptography/vendor/hdkey-without-crypto.js:249:21)
at HDKey.set (/Users/claudio/Dev/web3/starknet-hardhat-example-alt/node_modules/ethereum-cryptography/vendor/hdkey-without-crypto.js:50:24)
at Function.HDKey.fromMasterSeed (/Users/claudio/Dev/web3/starknet-hardhat-example-alt/node_modules/ethereum-cryptography/vendor/hdkey-without-crypto.js:194:20)
at deriveKeyFromMnemonicAndPath (/Users/claudio/Dev/web3/starknet-hardhat-example-alt/node_modules/hardhat/src/internal/util/keys-derivation.ts:21:27)
at derivePrivateKeys (/Users/claudio/Dev/web3/starknet-hardhat-example-alt/node_modules/hardhat/src/internal/core/providers/util.ts:29:52)
at normalizeHardhatNetworkAccountsConfig (/Users/claudio/Dev/web3/starknet-hardhat-example-alt/node_modules/hardhat/src/internal/core/providers/util.ts:56:10)
at createProvider (/Users/claudio/Dev/web3/starknet-hardhat-example-alt/node_modules/hardhat/src/internal/core/providers/construction.ts:78:59)
at /Users/claudio/Dev/web3/starknet-hardhat-example-alt/node_modules/hardhat/src/internal/core/runtime-environment.ts:80:28 {
opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
library: 'digital envelope routines',
reason: 'unsupported',
code: 'ERR_OSSL_EVP_UNSUPPORTED'
}
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
If I set the version of the devnet AND the second terminal to LTS (16.4.0) I get "less errors":
> yarn hardhat test
yarn run v1.22.17
$ /Users/claudio/Dev/web3/starknet-hardhat-example-alt/node_modules/.bin/hardhat test
Starknet plugin using the active environment.
Starknet
Started deployment
1) should work for a fresh deployment
0 passing (730ms)
1 failing
1) Starknet
should work for a fresh deployment:
HardhatPluginError: Could not deploy contract. Check the network url in config. Is it responsive?
at StarknetContractFactory.<anonymous> (node_modules/@shardlabs/starknet-hardhat-plugin/src/types.ts:259:19)
at Generator.next (<anonymous>)
at fulfilled (node_modules/@shardlabs/starknet-hardhat-plugin/dist/types.js:24:58)
If I stop the devnet in the first terminal and I run yarn hardhat test
in the second terminal, I get the same output error.
from starknet-hardhat-plugin.
Have you tried combining older Node versions with running this in your terminal:
export NODE_OPTIONS=--openssl-legacy-provider
Or perhaps something else from these SO posts: post1, post2?
from starknet-hardhat-plugin.
If I only use the export you wrote on the terminal where then I launch the devnet, nothing changes when I run the tests.
If I also use it in the second terminal where I launch the tests I get the following error:
❯ yarn hardhat test
node: --openssl-legacy-provider is not allowed in NODE_OPTIONS
Checking the post you sent me, they are about solving the issue Error: error:0308010C:digital envelope routines::unsupported
, which I was able to solve (described in my previous post) by setting the terminal to use Node 16, instead of 17.
But that does not solve the fact that the test command is not able to deploy the contracts, because it does not find the devnet.
I don't think this has anything to do with the issue, but I have an M1 MacBook Pro, not an Intel based.
from starknet-hardhat-plugin.
Can you make sure that devnet is reachable? With something like:
curl localhost:5000/is_alive
You should get a response saying Alive!!!
if it is.
from starknet-hardhat-plugin.
Thanks for the feedback, will update the example settings.
from starknet-hardhat-plugin.
Related Issues (20)
- Fix typos
- Cairo 1 compilation needs to be fixed HOT 1
- ContractAddress, ClassHash and EthAddress decoding HOT 1
- Improve macos testing in CI/CD HOT 1
- Cairo 1 compiler needs to be refactored
- Replace cairo installation from source with prebuilt binaries
- Support Dockerized Scarb HOT 1
- Refactor ScarbWrapper
- Add hardhat config file checking
- Support Starknet / cairo-lang 0.12 HOT 1
- Bump starknet.js to v5
- Restructure the plugin to rely on Starknet.js HOT 2
- hardhat starknet-compile does not handle single file compilation after Cairo 2.0.1 HOT 2
- Replace dockerized cairo compiler by relying on prebuilt GitHub binaries
- Update OZ contracts to v0.7.0 HOT 2
- Integrate devnet-rs
- cairo-migrate can be removed
- Update Argent account
- Integrate universal-sierra-compiler
- Support Oracles HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from starknet-hardhat-plugin.