Commit Graph

398 Commits

Author SHA1 Message Date
Michael Bradley, Jr 3416b051d0 build(deps): remove unused tar package 2019-11-26 15:16:40 -06:00
Michael Bradley, Jr 8ede518bd2 build(deps): bump core-js from 3.3.5 to 3.4.3 2019-11-26 15:16:29 -06:00
Michael Bradley, Jr da7ceb8c54 build(deps/-dev): update babel and babel-related deps and devDeps to latest versions 2019-11-26 13:22:13 -06:00
emizzle 4a10476e85 refactor(@embark/whisper): Remove unneeded whisper layer
1. get rid of the whisper layer and handle everything in the communication layer
2. Create a gethWhisper and a parityWhisper plugin that has the same files as packages/embark/src/lib/modules/geth, except with a whisperClient instead of gethClient, and will include most of https://github.com/embark-framework/embark/blob/master/packages/plugins/whisper/src/index.js.
3. Get rid of any whisper registration in geth.
4. In the whisperGeth and whisperParity plugins, modify the request for communication:node:register, to end up calling `startWhisperNode`
2019-11-26 12:22:05 +01:00
dependabot-preview[bot] 6695ab9d23 build(deps): bump mocha from 6.2.0 to 6.2.2
Bumps [mocha](https://github.com/mochajs/mocha) from 6.2.0 to 6.2.2.
- [Release notes](https://github.com/mochajs/mocha/releases)
- [Changelog](https://github.com/mochajs/mocha/blob/master/CHANGELOG.md)
- [Commits](https://github.com/mochajs/mocha/compare/v6.2.0...v6.2.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-11-22 09:50:51 -06:00
emizzle dba5f771f2 fix(@embark/simulator): fix port used in simulator
When using websockets, the simulator was starting on port `8545` instead of `8546`, so the blockchain check was failing.

Update the simulator port to be websockets port from the config when using websockets.
2019-11-22 11:25:02 +01:00
Michael Bradley, Jr b28054530d refactor(@embark/cmd_controller): remove logger call in initConfig 2019-11-19 13:56:25 -06:00
emizzle c7ec49a38f feat(@embark/embark-rpc-manager): Add support for `eth_signTypedData_v3`
This PR adds support for EIP-712 (https://github.com/ethereum/EIPs/blob/master/EIPS/eip-712.md), by allowing the signing of typed data transactions using the `eth_signTypeData_v3` or `eth_signTypedData` request.

Add a module called `embark-rpc-manager` to handle all RPC transaction modifications.

The internal events management module extracted to `embark-core`. This allows other modules (ie plugins) to use a private instance of Embark’s event API.

Remove transaction modifications in `embark-accounts-manager` and leave only the functionality in this module that handle account management (ie funding of accounts). Other functionality was moved to `embark-rpc-manager`.

- Transactions should now reflect when a new node account is added via `personal_newAccount` or via the node itself (and once `eth_accounts` is requested).
- In the proxy, errors are handled for all cases and are now JSON-RPC spec-compliant.
- Always register `eth_signTypedData` RPC response and display error message if account cannot be found.

NOTE: Updated yarn.lock due to conflict after rebase.

Avoid race condition with rpc modifications

Refactor proxy to make request handling asynchronous, and to allow circumvention of forwarding requests to the node in cases where it is not needed.

Move loading of plugins to after core and stack components (in cmd_controller).

We should load custom plugins LAST (ie after all core and stack components, and after all Embark plugins). To do this, we disable automatic loading of plugins in the config, and allow them to be loading explicitly in cmd_controller.

Create a system that allows registration of custom plugins. Each plugin is generated in EmbarkJS by instantiating the registered class. For example, we can register a Plasma plugin and it will be generated in to EmbarkJS.Plasma with an instantiation of `embarkjs-plasma`. The DApp itself can then do what it wants with `EmbarkJS.Plasma` (ie call `EmbarkJS.Plasma.init()`.

NOTE: loading of custom plugins needs to be applied to all other commands in `cmd_controller`. This PR only loads custom plugins for the `run` command.

NOTE: This PR is based on branch fix/ws-eth-subscribe (#1850). I will rebase this PR when (and if) #1850 is merged.
2019-11-18 13:36:37 -06:00
Michael Bradley, Jr 978e17daa1 build(deps): bump deprecated ipfs-api@17.2.4 to ipfs-http-client@39.0.2
BREAKING CHANGE:

Related to #1985. Prior to Embark's minimum supported version of Node.js being
bumped to to 10.17.0, Embark was incompatible with any relatively recent
release of the `ipfs-http-client` package.

While *internal* changes are needed re: ipfs's `Buffer` export for
e.g. `embark_demo` to function correctly *(and this PR makes those changes)*,
Embark otherwise runs/tests okay.

Keep in mind #2033.

However, if a dApp author were to explicitly `require('ifps-api')` in the
front-end that wouldn't work as before; and swapping `"ipfs-http-client"` for
`"ipfs-api"` might also not be enough — there are API changes that dApp authors
would need to consider, regardless of Embark presently supplying the dependency
and EmbarkJS wrapping around it.

Closes #1994.
2019-11-18 09:41:24 -06:00
Michael Bradley, Jr 5d61faa550 build(deps): bump ora from 2.1.0 to 4.0.3 2019-11-13 11:18:45 -06:00
Jonathan Rainville aecb99d428 feat(@embark/tests): enable comms and storage in tests
But only enabled at the start and not changed per test
2019-11-12 09:31:05 -05:00
Jonathan Rainville de9e667794 feat(@embark/ens): enable changing namesystem config per test
Adds back the feature to change ENS config per test
Fixes ENS not working in the console because EmbarkJS was not ready
2019-11-12 09:31:05 -05:00
Pascal Precht d2556af8ba refactor(@embark/core): move Engine into embark-core 2019-11-11 17:00:01 +01:00
Michael Bradley, Jr 2543acad75 refactor(@embark/library-manager): restrict versionable packages to only solc
BREAKING CHANGE:

Remove support for specifying the versions of `web3` and `ipfs-api` in a
project's `embark.json`.
2019-11-08 11:27:20 -06:00
Jonathan Rainville 776db1b7f7 feat(@embark/plugin): add priority to regsiterActionForEvents 2019-11-08 08:46:32 -05:00
Michael Bradley, Jr fccda21623 chore(release): 5.0.0-alpha.1 2019-11-05 14:55:06 -06:00
Michael Bradley, Jr c320dcfbb5 refactor(@embark/core/console): silence errors when autocomplete is attempted on bad reference
Previously, in the embark cli dashboard/console, if you were to type `Foo.` and
hit tab for autocomplete then (assuming you hadn't defined `Foo`) there would
be unhandled errors and the console could even become unusable.

Refactor `packages/core/console` and related code so that nothing happens when
you attempt to autocomplete a bad reference (the same behavior as Node's own
REPL).
2019-11-05 11:01:43 -06:00
Iuri Matias dc64b99779
Remove unnecessary messages/traces from logs when not debugging (#1986)
* bugfix(@embark/stack/blockchain): fix issue with calling wrong callback variable

* chore(@embark/): remove unnecessary messages/warnings when not in debug mode

* refactor(@embark/core/events): add debugEventsEnabled method
2019-11-05 10:35:37 -05:00
Iuri Matias 830e91de7f
bugfix(@embark): fix upload and graph command (#1993)
bugfix(@embark): fix upload command

bugfix(@embark): fix graph command

update graph cmd

update upload cmd
2019-11-05 10:34:33 -05:00
Pascal Precht b0e71d9427 fix(@embark/console): ensure Cockpit is only started in non-secondary mode (#2026)
`embark console` registers and tries to spin up `Cockpit`, even when there's already
a Cockpit instance running and thefore exits with an error that a certain port is already
in use.

This commit ensures that Cockpit is only bootstrapped when `embark console` is
executed as a non-secondary process, meaning that there's no other `embark run`
process active that might occupy Cockpit's default port.
2019-11-05 10:22:11 -05:00
dependabot-preview[bot] d0f4236aff build(deps): bump core-js from 3.3.4 to 3.3.5
Bumps [core-js](https://github.com/zloirock/core-js) from 3.3.4 to 3.3.5.
- [Release notes](https://github.com/zloirock/core-js/releases)
- [Changelog](https://github.com/zloirock/core-js/blob/master/CHANGELOG.md)
- [Commits](https://github.com/zloirock/core-js/compare/v3.3.4...v3.3.5)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-11-01 12:21:12 -05:00
Jonathan Rainville fe3e604fec fix(@embark/test-runner): fix test contracts being tracked 2019-10-30 12:39:21 -05:00
Iuri Matias b8f7ec20d4 fix(@embark/core): set loglevel back to info 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
Michael Bradley, Jr 6ee2ca2b8d refactor(@embark/cmd): exit with error when command is unknown
Example: `embark rest && embark run`

The command/s following `&&` shouldn't run after the first one fails and prints
an "unknown command" message.
2019-10-28 13:00:50 -05:00
Iuri Matias a03ffd56e5 fix(@embark/core): set loglevel back to info 2019-10-28 13:00:18 -05:00
Pascal Precht 8fee0b8ccc fix(@embark/core): make blockchain command work again
Running embark's `blockchain` command resulted in a runtime error where the `blockchain`
module couldn't be found. This is a bug introduced in ed0d3afb4f where
we forgot to update `blockchainStackComponents` in Embark's engine accordingly.

Fixing this results in `embark blockchain` hanging. This is because there's a similar bug
in `blockchainStackCopmnonents` introduced in 3b8f8f9ea7.

This commit fixes both bugs by ensuring `embark-blockchain` and `embark-blockchain-client`
packages are loaded using the correct APIs.
2019-10-28 11:55:09 -05:00
Michael Bradley, Jr db66f0e197 refactor(@embark/template_generator): account for prerelease in embark version
If the version in the embark package's own `package.json` has a prerelease
identifier then appending `.x` to the major version isn't viable for resolving
the latest version of the template package that's in the same prerelease line;
a more complex semver range must be used:

```
"${pkg}@^${major}.${minor}.${patch}- <${major}.${minor}.${patch}"
```
2019-10-28 11:43:00 -05:00
Michael Bradley, Jr 1225cb14e8 build(deps): add core-js@3 as a dep to all pkgs that have @babel/runtime-corejs3 dep
When making use of the `useBuiltIns: 'usage'` option for @babel/preset-env
(which is the case for all transpiled packages in Embark's monorepo) a package
needs to have both @babel/runtime-corejs3 and core-js@3 specified as
dependencies.
2019-10-28 11:40:48 -05:00
Michael Bradley d22cd58db3 reorg some deps from packages/embark to the packages that actually depend on them (#1990)
* build(deps): move @types/os-locale from packages/embark to packages/core/i18n

* build(deps) move @types/globule from packages/embark to packages/plugins/coverage

* build(deps): refactor stack/{api,proxy,webserver} deps relative to packages/embark

* build(deps): remove unneeded @types/async dep from packages/stack/test-runner

* build(deps): remove unneeded deps from packages/embark
2019-10-25 13:04:51 -04:00
Michael Bradley, Jr 0af6e13779 build(deps): move deps needed by embark-basic-pipeline from packages/embark
Introduce additional refactors to ensure the packages can be resolved by the
basic pipeline's webpack child process.
2019-10-25 11:13:49 -05:00
Michael Bradley d17fe33339 build: update babel and webpack dependencies (#1987)
Includes a switch from core-js@2 to core-js@3
2019-10-24 17:41:28 -04: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 183d9a05b5 Fix/solo spawn (#1981)
* build(@embark/stack/blockchain-client): remove unneeded typescript related scripts and deps

In addition to being unneeded their presence is causing build errors.

* build(embark): remove unneeded typescript related scripts and deps

In addition to being unneeded their presence is causing build errors.

* build(@embark/plugins/ethereum-blockchain-client): remove unneeded typescript related scripts, deps

In addition to being unneeded their presence is causing build errors.

* build(@embark/plugins/ganache): remove unneeded typescript related scripts and deps

In addition to being unneeded their presence is causing build errors.

* build(@embark/plugins/geth): remove unneeded typescript related scripts and deps

In addition to being unneeded their presence is causing build errors.

* fix(@embark/plugins/transaction-logger): require 'web3' not 'Web3'

* fix(@embark/utils/solo): spawn npm(.cmd) instead of npx(.cmd)

* test(@embark/plugins/basic-pipeline): add test stub

* test(@embark/stack/blockchain): add test stub
2019-10-22 09:27:28 -04:00
Jonathan Rainville 2193d82399 fix(test-app): make test app test all pass (#1980)
Fix a lot of bugs and reenable a couple of modules
Some tests were kept disabled, mostly the ENS and EmbarkJS tests
Those need to add back a fairly significant feature to work
Add back missing solidity contracts
2019-10-22 09:27:22 -04:00
Eric Mastro 9b57a912cf refactor(@embark/ethereum-blockchain-client): move module into own package (#1956) 2019-10-16 10:02:05 -04:00
Eric Mastro 3b8f8f9ea7 refactor(@embark/blockchain-client): move module into own package (#1955)
refactor(@embark/blockchain-client): move module into own package

update package.json
2019-10-16 09:41:17 -04:00
Eric Mastro e2efbbd846 refactor(@embark/parity): move module into own package (#1951)
Contains bug fixes to get parity to work as a blockchain client.

**NOTE:** Please merge https://github.com/embark-framework/embark/pull/1950 first before merging this PR, as this PR contains removal of dependencies from `packages/embark` that are needed for geth. So if this is merged first, and the geth PR (https://github.com/embark-framework/embark/pull/1950) is not merged, then geth will not have some of the dependencies it needs.
2019-10-16 09:35:26 -04:00
Eric Mastro ed0d3afb4f refactor(@embark/blockchain): move module into own package (#1942) 2019-10-16 09:30:14 -04:00
dependabot-preview[bot] 85be192879 build(deps-dev): bump @types/request from 2.48.1 to 2.48.3 (#1957)
Bumps [@types/request](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/request) from 2.48.1 to 2.48.3.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/request)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-10-16 09:11:53 -04:00
Eric Mastro 908064f4e1 refactor(@embark/ganache): move module into own package (#1952)
**NOTE:** Running a dapp with `client: “vm”` does not work, however I am not sure if that is intentional in v5 or not.

**NOTE:** Running `embark test` in the demo DApp does work, although there is an error that I am assuming does actually pertain to this PR:
```
made request without listener: whisper:node:register
Trace:
    at EmbarkEmitter.trace [as request] (/Users/emizzle/Code/__Github/embk-fw/embark/packages/embark/src/lib/core/events.js:142:13)
    at new request (/Users/emizzle/Code/__Github/embk-fw/embark/packages/embark/src/lib/modules/geth/index.js:49:17)
    at Plugin.loadInternalPlugin (/Users/emizzle/Code/__Github/embk-fw/embark/packages/embark/src/lib/core/plugin.js:117:10)
    at Plugins.loadInternalPlugin (/Users/emizzle/Code/__Github/embk-fw/embark/packages/embark/src/lib/core/plugins.js:96:40)
    at Engine.loadInternalPlugin [as registerModule] (/Users/emizzle/Code/__Github/embk-fw/embark/packages/embark/src/lib/core/engine.js:69:18)
    at Engine.registerModule [as blockchainComponents] (/Users/emizzle/Code/__Github/embk-fw/embark/packages/embark/src/lib/core/engine.js:183:10)
    at Engine.apply [as registerModuleGroup] (/Users/emizzle/Code/__Github/embk-fw/embark/packages/embark/src/lib/core/engine.js:104:18)
    at registerModuleGroup (/Users/emizzle/Code/__Github/embk-fw/embark/packages/embark/src/cmd/cmd_controller.js:740:16)
    at nextTask (/Users/emizzle/Code/__Github/embk-fw/embark/node_modules/async/dist/async.js:5324:14)
    at next (/Users/emizzle/Code/__Github/embk-fw/embark/node_modules/async/dist/async.js:5331:9)
    at /Users/emizzle/Code/__Github/embk-fw/embark/node_modules/async/dist/async.js:969:16
    at callback (/Users/emizzle/Code/__Github/embk-fw/embark/packages/embark/src/lib/core/engine.js:47:9)
    at Client.done (/Users/emizzle/Code/__Github/embk-fw/embark/packages/core/core/src/ipc.js:46:11)
    at Client.emit (/Users/emizzle/Code/__Github/embk-fw/embark/node_modules/event-pubsub/es5.js:74:21)
    at Socket.connectionClosed (/Users/emizzle/Code/__Github/embk-fw/embark/node_modules/node-ipc/dao/client.js:201:20)
    at Socket.emit (events.js:198:13)
```
2019-10-14 16:28:54 +09:00
Eric Mastro 8aa6496f93 refactor(@embark/geth): move module into own package (#1950) 2019-10-14 16:14:07 +09:00
Eric Mastro e03ae120fe refactor(@embark/embarkjs): move module into own package (#1943) 2019-10-14 16:08:21 +09:00
Eric Mastro 3f7842cf24 refactor(@embark/embarkjs): move module into own package (#1945)
**TODO:** The `embark eject-webpack` command needs to be updated. @michaelsbradleyjr - do you have suggestions as to how we could port this over? We could **assume** that the `basic-pipeline` plugin will be installed, and then read the embark config and overrides from the file system, however this feels like we are sort adding a dependency to a plugin, which is not right. Any suggestions?
2019-10-14 16:05:17 +09:00
Eric Mastro 5dbc1c791a fix(@embark/basic-pipeline): Remove `_1_` from pipeline output (#1941) 2019-10-14 16:01:18 +09:00
Jonathan Rainville 915b9493ef feat(@embark/cmd_controller): add back embark simulator (#1965) 2019-10-14 15:59:37 +09:00
Jonathan Rainville 918a00c24c fix: add back log command for modules (#1969) 2019-10-14 10:58:57 +09:00
Jonathan Rainville af3c0f0bcb Fix whisper callback and start (#1968)
* fix(@embark/geth/whisper): add ipcdisable for whisper geth client

* fix(@embarkjs/whisper): fix callback not used in send
2019-10-14 10:55:37 +09:00
Jonathan Rainville 4b947bb5c2 fix: fix error logs in the cockpit due from negative blocks numbers (#1967) 2019-10-14 10:53:14 +09:00