Comments (16)
I've opened some prs for it which could wait until another breaking change comes along.
More importantly perhaps starknet-devnet should check the port is free and fail early, I can look into that later.
from starknet-devnet.
Can you use the --port
option (as documented here)?
E.g.
starknet-devnet --port 5001
or
starknet-devnet -p 5001
Or is it just a matter of convenience?
from starknet-devnet.
I do use it personally.
But while integrating with ArgentX we also needed to set some default port for localhost we want the network to be on, and I just feel like 5000 is too often used (many devs use macOS). In that case the developer would need to spin up the local dev testate with the -p
port option AND also change the port inside ArgentX. I think choosing a less frequently used port could resolve this
from starknet-devnet.
@janek26 I don't understand. Does your program run starknet-devnet
in the background?
from starknet-devnet.
@FabijanC Macos has a system service called ControlCe that uses port 5000 but the devnet doesn't error out properly when it uses that port. I don't know how this works - it looks like it's running fine but only handles a subset of the requests. It would be nice if the default port wasn't one used by Macos and that it would fail gracefully in this condition. For now just moving the port would save a lot of frustration, it took me a while to realise what was going on.
from starknet-devnet.
@JorikSchellekens
I agree that this should be done. The fact is, this is the only breaking change in the project backlog, and I don't want to release v0.2.0 just to change the default port. So, it should either be argued why the port change is sufficient for a new major version, or suggest another breaking change 😃 .
from starknet-devnet.
@FabijanC
Considering that starknet-devnet doesn't work on a major os without any clear error messages as to why I'd say 0.1.0 is already broken.
from starknet-devnet.
@ccarnino You said you'd like to be pinged on MacOS issues, did you also experience this issue with an occupied port? I'm asking because I'm not sure if all mac users are experiencing this. E.g. the CI/CD pipeline starknet-hardhat-plugin
includes some integration tests that run Devnet on a mac virtual machine, and it works fine with the default settings.
from starknet-devnet.
I personally have not experienced this problem, unless I was trying to run another devnet in another terminal by mistake.
@JorikSchellekens @janek26 what kind of issues or how do you realise that devnet is failing behind the scenes because of this issue?
from starknet-devnet.
@ccarnino this is a monterey specific issue
https://developer.apple.com/forums/thread/682332
from starknet-devnet.
None of the tests on https://github.com/Shard-Labs/starknet-hardhat-example would run. The following is the result of running the tests:
yarn test [7d3h10m] ✖ ✹ ✭
yarn run v1.22.17
$ npx hardhat --network localhost test
Starknet plugin using dockerized environment (shardlabs/cairo-cli:0.7.1)
Using network devnet at http://localhost:5000
Starknet
Started deployment
HardhatPluginError: Got ClientConnectorError
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/aiohttp/connector.py", line 986, in _wrap_create_connection
return await self._loop.create_connection(*args, **kwargs) # type: ignore[return-value] # noqa
File "/usr/local/lib/python3.7/asyncio/base_events.py", line 962, in create_connection
raise exceptions[0]
File "/usr/local/lib/python3.7/asyncio/base_events.py", line 949, in create_connection
await self.sock_connect(sock, address)
File "/usr/local/lib/python3.7/asyncio/selector_events.py", line 473, in sock_connect
return await fut
File "/usr/local/lib/python3.7/asyncio/selector_events.py", line 503, in _sock_connect_cb
raise OSError(err, f'Connect call failed {address}')
ConnectionRefusedError: [Errno 111] Connect call failed ('127.0.0.1', 5000)
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/services/external_api/base_client.py", line 112, in _send_request
method=send_method, url=url, data=data
File "/usr/local/lib/python3.7/site-packages/aiohttp/client.py", line 1138, in __aenter__
self._resp = await self._coro
File "/usr/local/lib/python3.7/site-packages/aiohttp/client.py", line 536, in _request
req, traces=traces, timeout=real_timeout
File "/usr/local/lib/python3.7/site-packages/aiohttp/connector.py", line 542, in connect
proto = await self._create_connection(req, traces, timeout)
File "/usr/local/lib/python3.7/site-packages/aiohttp/connector.py", line 907, in _create_connection
_, proto = await self._create_direct_connection(req, traces, timeout)
File "/usr/local/lib/python3.7/site-packages/aiohttp/connector.py", line 1206, in _create_direct_connection
raise last_exc
File "/usr/local/lib/python3.7/site-packages/aiohttp/connector.py", line 1187, in _create_direct_connection
client_error=client_error,
File "/usr/local/lib/python3.7/site-packages/aiohttp/connector.py", line 992, in _wrap_create_connection
raise client_error(req.connection_key, exc) from exc
aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host localhost:5000 ssl:default [Connect call failed ('127.0.0.1', 5000)]
Error: ClientConnectorError: Cannot connect to host localhost:5000 ssl:default [Connect call failed ('127.0.0.1', 5000)]
at /Users/jorik/dev/nethermind/starknet-hardhat-example/node_modules/@shardlabs/starknet-hardhat-plugin/src/types.ts:110:15
at Generator.next (<anonymous>)
at fulfilled (/Users/jorik/dev/nethermind/starknet-hardhat-example/node_modules/@shardlabs/starknet-hardhat-plugin/dist/types.js:24:58)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
Retrying transaction status check...
HardhatPluginError: Got ClientConnectorError
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/aiohttp/connector.py", line 986, in _wrap_create_connection
return await self._loop.create_connection(*args, **kwargs) # type: ignore[return-value] # noqa
File "/usr/local/lib/python3.7/asyncio/base_events.py", line 962, in create_connection
raise exceptions[0]
File "/usr/local/lib/python3.7/asyncio/base_events.py", line 949, in create_connection
await self.sock_connect(sock, address)
File "/usr/local/lib/python3.7/asyncio/selector_events.py", line 473, in sock_connect
return await fut
File "/usr/local/lib/python3.7/asyncio/selector_events.py", line 503, in _sock_connect_cb
raise OSError(err, f'Connect call failed {address}')
ConnectionRefusedError: [Errno 111] Connect call failed ('127.0.0.1', 5000)
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/services/external_api/base_client.py", line 112, in _send_request
method=send_method, url=url, data=data
File "/usr/local/lib/python3.7/site-packages/aiohttp/client.py", line 1138, in __aenter__
self._resp = await self._coro
File "/usr/local/lib/python3.7/site-packages/aiohttp/client.py", line 536, in _request
req, traces=traces, timeout=real_timeout
File "/usr/local/lib/python3.7/site-packages/aiohttp/connector.py", line 542, in connect
proto = await self._create_connection(req, traces, timeout)
File "/usr/local/lib/python3.7/site-packages/aiohttp/connector.py", line 907, in _create_connection
_, proto = await self._create_direct_connection(req, traces, timeout)
File "/usr/local/lib/python3.7/site-packages/aiohttp/connector.py", line 1206, in _create_direct_connection
raise last_exc
File "/usr/local/lib/python3.7/site-packages/aiohttp/connector.py", line 1187, in _create_direct_connection
client_error=client_error,
File "/usr/local/lib/python3.7/site-packages/aiohttp/connector.py", line 992, in _wrap_create_connection
raise client_error(req.connection_key, exc) from exc
aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host localhost:5000 ssl:default [Connect call failed ('127.0.0.1', 5000)]
Error: ClientConnectorError: Cannot connect to host localhost:5000 ssl:default [Connect call failed ('127.0.0.1', 5000)]
at /Users/jorik/dev/nethermind/starknet-hardhat-example/node_modules/@shardlabs/starknet-hardhat-plugin/src/types.ts:110:15
at Generator.next (<anonymous>)
at fulfilled (/Users/jorik/dev/nethermind/starknet-hardhat-example/node_modules/@shardlabs/starknet-hardhat-plugin/dist/types.js:24:58)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
Retrying transaction status check...
Meanwhile the server reports a single successful post:
starknet-devnet [2h32m]
* Running on http://localhost:5000/ (Press CTRL+C to quit)
127.0.0.1 - - [10/Mar/2022 16:07:51] "POST /gateway/add_transaction HTTP/1.1" 200 -
from starknet-devnet.
I am on Monterey too. And I have the Airplay Receiver
option On. I am running starknet-devnet from console, not from docker.
And no my test don't throw that error.
from starknet-devnet.
Try to use python 3.9. I had problems with 3.7
from starknet-devnet.
This is the guide I use to startup my dev environment https://github.com/ccarnino/starknet-hardhat-typescript-example
from starknet-devnet.
me and my colleagues at argent had this issue aswell.
thanks for pushing on it @JorikSchellekens
from starknet-devnet.
More importantly perhaps starknet-devnet should check the port is free and fail early, I can look into that later.
@JorikSchellekens Update us when you can, from what I've seen this should be fairly simple in Python with resources being a part of the standard library.
from starknet-devnet.
Related Issues (20)
- starknet-devnet 0.5.2 fails to execute starknet-sierra-compile when using poetry HOT 2
- Refactor recompiler selection to improve error reporting
- JSON-RPC API trace methods are missing HOT 4
- `estimate_fee` transaction gets rejected with `Declare`
- ValueError when calling postman flush HOT 1
- Adapt to cairo-lang/Starknet 0.11.2
- FELT pattern from starknet-spec could allow value > prime HOT 1
- Add `estimateMessageFee` endpoint to the JSON-RPC API. HOT 1
- Mainnet & Devnet differences, sequencer method `get_full_contract` & `get_class_by_hash` should return abi property of type string HOT 2
- Fix calculate_traces_and_fees
- Make cairo compiler flags customizable
- Incorrect format of `FunctionInvocation` in `starknet_simulateTransaction` response HOT 2
- Forked devnet incompatible with Cairo 1 contracts deployed on origin HOT 12
- Debug printing in Cairo 1 should be documented
- Support Starknet / cairo-lang 0.12
- In blocks-on-demand mode, all transactions have transaction_index 0
- Unable to fork alpha-goerli on devnet HOT 14
- Adaptation to 0.12.2
- JSON-RPC: starknet_simulateTransactions should be supported
- Testnet 2 functionality can be removed
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-devnet.