Commit Graph

9 Commits

Author SHA1 Message Date
emizzle f9ad486edb fix(@embark/proxy): Fix contract event subscriptions
Fix the proxy’s handling of WebSocket connections when subscribing to contract events and node data using the `eth_subscribe` RPC request.

Previously, the client connection that the subscription data was sent to was often in a closed state. It was determined that this connection was the wrong connection to forward the data in the first place. The connection was in fact generally the connection created for the Ethereum service check which was then (correctly and subsequently) closed after it had finished its operation.

The flow of a proxy request handling a WebSocket “eth_subscribe” RPC request is now as follows:
1. A WebSocket RPC request `”eth_subscribe”` is sent from a client to the proxy.
2. Proxy forwards the request to the node by way of a new instance of `RequestManager`.
3. When the node receives an event matching the subscription, it sends the event data back to same socket connection it received the request on (ie the specific instance of `RequestManager`).
4. The `RequestManager` fires the `”data”` event containing the subscription data, and this event is picked up in the proxy.
5. The proxy then forwards the subscription data on to the originating WS client connection.

All other requests (ie non-WS or WS RPC requests that are not `eth_subscribe`) will be serviced to/from the node using a single `RequestManager` instance.

Co-authored-by: Pascal Precht <pascal.precht@gmail.com>
2019-10-30 12:19:24 -05:00
Michael Bradley, Jr 85235f88b2 chore(release): 5.0.0-alpha.0 2019-10-28 16:05:13 -05:00
Iuri Matias 867a55c98a
Revert "fix(@embark/proxy): Fix contract event subscriptions" (#2005)
* Revert "fix(@embark/core): set loglevel back to info"

This reverts commit a03ffd56e5.

* Revert "fix(@embark/proxy): Fix contract event subscriptions"

This reverts commit 173d53de2f.
2019-10-28 16:20:14 -04:00
emizzle 173d53de2f fix(@embark/proxy): Fix contract event subscriptions
Fix the proxy’s handling of WebSocket connections when subscribing to contract events and node data using the `eth_subscribe` RPC request.

Previously, the client connection that the subscription data was sent to was often in a closed state. It was determined that this connection was the wrong connection to forward the data in the first place. The connection was in fact generally the connection created for the Ethereum service check which was then (correctly and subsequently) closed after it had finished its operation.

The flow of a proxy request handling a WebSocket “eth_subscribe” RPC request is now as follows:
1. A WebSocket RPC request `”eth_subscribe”` is sent from a client to the proxy.
2. Proxy forwards the request to the node by way of a new instance of `RequestManager`.
3. When the node receives an event matching the subscription, it sends the event data back to same socket connection it received the request on (ie the specific instance of `RequestManager`).
4. The `RequestManager` fires the `”data”` event containing the subscription data, and this event is picked up in the proxy.
5. The proxy then forwards the subscription data on to the originating WS client connection.

All other requests (ie non-WS or WS RPC requests that are not `eth_subscribe`) will be serviced to/from the node using a single `RequestManager` instance.

Co-authored-by: Pascal Precht <pascal.precht@gmail.com>
2019-10-28 13:00:18 -05:00
Michael Bradley ed02cc849f build: bump all packages' engines settings (#1985)
BREAKING CHANGE:

node: >=10.17.0 <12.0.0
npm: >=6.11.3
yarn: >=1.19.1

node v10.17.0 is the latest in the 10.x series and is still in the Active LTS
lifecycle. Embark is still not compatible with node's 12.x and 13.x
series (because of some dependencies), otherwise it would probably make sense
to bump our minimum supported node version all the way to the most recent 12.x
release.

npm v6.11.3 is the version that's bundled with node v10.17.0.

yarn v1.19.1 is the most recent version as of the time node v10.17.0 was
released.
2019-10-24 09:52:05 -04:00
Michael Bradley, Jr 17ccd5c1bd build: tidy up the monorepo in prep for v5.0.0-alpha.0 2019-10-01 13:29:53 -05:00
Michael Bradley, Jr 3b649fa455 build: phase 1 of introducing embark-collective 2019-10-01 13:28:13 -05:00
Michael Bradley 043ccc0a24 feat(@embark/compiler): support :before and :after hooks on event compiler:contracts:compile (#1878)
* feat(@embark/compiler): support :before and :after hooks on event compiler:contracts:compile

* style: keep root package.json sorted cleanly

* style: formatting with prettier where print-width is 200

Per the suggestion of @iurimatias

* WIP: PR review

* WIP: PR review

* WIP: refactor to check if file.path is within dappPath() or os.tmpdir()

* WIP: PR review

* WIP: use native async functions (and related JS lang constructs) instead of the async library

* WIP: async.eachObject is no longer a dependency
2019-09-11 13:08:52 -04:00
Iuri Matias c46c52ff5c
move embarkjs packages & remove embark- prefix from some folders (#1879)
* chore(@embark/): move embarkjs packages to their own folder

* chore(@embark/): rename embark-ui folder to cockpit

* chore(@embark/): rename packages already in logical folders to remove embark- prefix

chore(@embark/): rename packages already in logical folders to remove embark- prefix

update package.json files to use correct eslint config

remove core/* from package.json workspaces
2019-09-06 18:26:08 -04:00