Closed jag-lotus closed 2 years ago
Thanks for reporting this issue. It's caused by the way localhost
(used by starknet-devnet
) is targeted on macOS when using your own virtual environment (which as I see is specified by venv: "active"
).
I know how to fix this, but until then, I think the temporary solution is to use the Docker version of the plugin (so instead of venv: "active"
, you should specify version: "0.6.1"
).
And also, it is expected that if starknet-devnet
has an issue that nile
will also have it, because internally, nile
relies on starknet-devnet
.
I'll use this fix for now, it's working fine.
Thanks, I look forward to being able to use venv in the future
This has been fixed since plugin v0.3.6.
I cannot connect to devnet.
Here my hardhat.config.ts:
const config: HardhatUserConfig = {
starknet: {
venv: "active",
network: "devnet",
},
networks: {
devnet: {
url: "http://localhost:5000/"
}
},
};
When I run 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 (746ms)
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:130: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.
Any idea why?
@ccarnino Can you post this as a separate issue? Also, if you could provide your OS, your plugin and devnet version.
I will do it now
Hi,
When trying to run mocha tests on a local devnet (i.e.
http://localhost:5000
), Hardhat cannot connect to the networkYou can see my hardhat.config.ts file here
I tried using both
nile node
andstarknet-devnet
and both fail.I really like the ability to use Hardhat for Cairo development as well and keep Cairo and Solidity in the same project. Fixing this issue would really help in a major Cairo/StarkNet integration.
Setup: macOS 12.0.1 python 3.8.9 cairo-lang 0.6.1