trufflesuite / ganache

:warning: The Truffle Suite is being sunset. For information on ongoing support, migration options and FAQs, visit the Consensys blog. Thank you for all the support over the years.
https://consensys.io/blog/consensys-announces-the-sunset-of-truffle-and-ganache-and-new-hardhat?utm_source=github&utm_medium=referral&utm_campaign=2023_Sep_truffle-sunset-2023_announcement_
MIT License
2.62k stars 680 forks source link

Support WebSockets #11

Closed onbjerg closed 6 years ago

onbjerg commented 7 years ago

Since Web3 1.0.0 the HTTP provider no longer supports subscriptions (e.g listening for events).

Instead it is expected that developers use the new WebSocket provider or the IPC provider. Neither of these are supported by Ganache, and thus they are not supported in testrpc either.

Expected Behavior

Current Behavior

Context

It is impossible to use testrpc with Web3 1.0.0. Instead developers are forced to use Parity or geth.

ewingrj commented 7 years ago

I have implemented basic support for websockets as well as a few pubsub types (logs and newPendingTransactions) in my fork (https://github.com/perissology/ganache-core)

There are not any websocket tests currently, and websocket have not been thoroughly tested yet. If someone would like to help with that, go ahead. If not, I hope to have time to finish the websocket integration withing the next month or so.

After I have a chance to write tests, I'll make a PR here.

17Damon commented 7 years ago

yes, $geth --datadir data --networkid 31415926 --ws --wsport 8546 --wsorigins "" --rpc --rpcport 8545 --rpccorsdomain "" --nodiscover console it works!!!

onbjerg commented 7 years ago

I'm not sure what you mean, that's geth, not testrpc.

17Damon commented 7 years ago

I switched to geth,and it's work,It maybe provide some help,cheers.

pplam commented 6 years ago

@miss61008596 Hey guy, you know that you are talking about geth?

onbjerg commented 6 years ago

@miss61008596 I don't want to use geth for tests. testrpc is more lightweight and setup is easier.

benjamincburns commented 6 years ago

I hate to close this ticket, but I'm cleaning up issues today as part of our team process, and we tend to track issues for the ganache suite of repos over on trufflesuite/ganache-cli. In this case, this ticket duplicates trufflesuite/ganache-cli#257. As such, lets move this conversation over there.

froid1911 commented 6 years ago

ok, so no ws support at all.

benjamincburns commented 6 years ago

@froid1911 please reread my last comment more carefully.