Commit Graph

2500 Commits

Author SHA1 Message Date
Michael Bradley, Jr d4940a339a
proxy -- canonicalHost, defaultHost 2018-10-23 09:37:24 +02:00
Michael Bradley, Jr fc27e710fc
blockchain -- defaultHost, dockerHostSwap 2018-10-23 09:37:24 +02:00
Michael Bradley, Jr a29d78cc5a
simulator -- defaultHost, dockerHostSwap 2018-10-23 09:37:24 +02:00
Jonathan Rainville 931f56db7d
only enabble register in dev 2018-10-23 09:37:24 +02:00
Jonathan Rainville 5488961a1e
small cleanups 2018-10-23 09:37:06 +02:00
Jonathan Rainville 81557258ce
pre-dploy using the same function as register 2018-10-23 09:07:19 +02:00
Jonathan Rainville 2cd11715bb
if no register config, dont register anything 2018-10-23 09:05:00 +02:00
Anthony Laibe 424d375f87
Remove code dependencies to underscore 2018-10-23 09:03:32 +02:00
Michael Bradley, Jr 0629f757a9
rm commented code and extra whitespace 2018-10-23 09:03:31 +02:00
Jonathan Rainville 3dcee19002
fix the indexOf instead by simulating what solc does 2018-10-23 09:03:31 +02:00
Jonathan Rainville 31162882c7
fix duplicate dependencies and warn correctly for length 2018-10-23 09:03:31 +02:00
Michael Bradley, Jr 15159e4ef3
Embark's own ganache-cli will always be found 2018-10-23 09:03:31 +02:00
Andre Medeiros 00410b7057
Fix failing test on blockchain 2018-10-23 09:03:30 +02:00
Jonathan Rainville 7e16691aa6
fix webserver errors 2018-10-23 09:02:41 +02:00
Iuri Matias 62c46063b3
refactor install template code 2018-10-23 09:02:41 +02:00
Iuri Matias aebc2a9b28
add support to download a template 2018-10-23 09:02:40 +02:00
Jonathan Rainville 3ca70d6e21
remove provider-engine as it has been creating lots of issues 2018-10-23 09:02:40 +02:00
Jonathan Rainville da82c2eba2
wip fixes 2018-10-23 09:02:15 +02:00
Jonathan Rainville 8572019957
fix when using mining script 2018-10-23 09:01:14 +02:00
Jonathan Rainville 91a7cc1a44
only put isDev when specifically set 2018-10-23 09:01:14 +02:00
Jonathan Rainville cb80b984d0
revert caca code 2018-10-23 09:01:14 +02:00
Jonathan Rainville 966252be97
conflict in package json 2018-10-23 09:01:13 +02:00
emizzle 3a145d4204
Removed p-iteration from embark altogether.
Replaced usage in storage module (on dapp side) with async.js `detectSeries`
2018-10-23 09:01:13 +02:00
emizzle c83b6dde60
Handle geth process exit via crash/kill and also via killing `embark blockchain`
First case - run `embark run` which starts a blockchain node, then manually kill the `geth` process. Would throw `{ [Error: connect ECONNREFUSED 127.0.0.1:8543] message: 'connect ECONNREFUSED 127.0.0.1:8543', code: -32603 }` error and ruins the dashboard.

Second case, 1) run `embark blockchain` 2) run `embark run` 3) kill `embark blockchain` throws the error `{ [Error: connect ECONNREFUSED 127.0.0.1:8543] message: 'connect ECONNREFUSED 127.0.0.1:8543', code: -32603 }` and ruins the dashboard.

The first case was solved by having the child blockchain process that spawns geth listen for geth exit, then kill itself.

The second case required updating of `eth-block-tracker` to v4.0.1 inside of the `embark-web3-provider-engine`. v4.0.1 was a major version update and introduced breaking changes. Those changes were handled inside of `embark-web3-provider-engine`, covered in **blocker** PR https://github.com/jrainville/provider-engine/pull/1.
2018-10-23 09:01:13 +02:00
Jonathan Rainville 8db33705c2
hotfix: rename event to blockchain:ready 2018-10-22 20:50:58 +02:00
Jonathan Rainville b6d89d9001
hotfix: fix empty assets array 2018-10-22 20:26:01 +02:00
emizzle 559c7152f7
Return early when error 2018-10-22 19:54:50 +02:00
emizzle 178115de18
Removed `mineWhenNeeded` condition
Removed a condition that detects if `mineWhenNeeded === true`. While reaslistically, the `defaultAccount` will only be populated when `mineWhenNeeded` is set, there is no need to check for this when falling back to the blockchain account.
2018-10-22 19:54:50 +02:00
emizzle 294e14446f
Auto set swarm account to account controlled by the node
When there is no account/password specified for swarm, there was an error shown in the logs (asking for address/password), and the swarm process would quit.

This PR changes the behaviour so that if a swarm address/password are not specified in the config, it attempts to use the blockchain address/password specified in `config/blockchain > account`. If `config/blockchain > account > address` doesn’t exist, the first account controlled by the node is used (provided by `web3.eth.getAccounts`, along with the password from `config/blockchain > account > password`.
2018-10-22 19:54:50 +02:00
emizzle 3437f80a89
Return early if no modified assets 2018-10-22 19:54:50 +02:00
Jonathan Rainville 5b1a226885
Update null check for `modifiedAssets` array.
Co-Authored-By: emizzle <ericmastro@status.im>
2018-10-22 19:54:49 +02:00
emizzle 7c9d90090a
Replaced async.queue with async.cargo
Cargo in fact, bundles up subsequent tasks in to an array, so any tasks that are not immediately run get bundled in to another run later. This helps when lots of changes have been made in a short period of time.
2018-10-22 19:54:49 +02:00
emizzle e788b7d3d4
Reduce async.queue concurrency to 3
Due to a process being spawned for every pipeline run, concurrency should remain around 3 to keep number of child processes from running away and allowing the CPU to stay on top.
2018-10-22 19:54:49 +02:00
Michael Bradley, Jr 6eae7a9a31
use a customized require/.resolve instead of relying on NODE_PATH
# Conflicts:
#	cmd/cmd.js
2018-10-22 19:54:49 +02:00
emizzle 64fdc691c4
Clean up 2018-10-22 19:54:49 +02:00
emizzle 91e5e9c990
Do not run webpack for file changes that do not need webpack
For file changes that do not require a webpack run, ie HTML, the assets will still be copied to the output directory, but webpack will not run (as it’s too slow).
2018-10-22 19:54:48 +02:00
emizzle 7e75b1eee7
Add support for ES6 plugins 2018-10-22 19:54:48 +02:00
emizzle 2d19d12e39
Support for embark-status plugin
Added request to update cors from a plugin (affects blockchain client and storage client).
2018-10-22 19:54:48 +02:00
hodlbank 870d9a814a
[f] Fixes #965 - "Console doesnt have contract objects for contracts with pre-defined addresses configured".
[f] Fix for sometimes incorrect empty code detection in contract_deployer.js ("0x" vs "0x0").
2018-10-22 19:54:48 +02:00
Jonathan Rainville 985358b088
fix web3 being reseted every test and fix ens failing on web3 reset 2018-10-22 19:54:48 +02:00
Jonathan Rainville ce3f9bdf25
fix a couple of bugs caused by bounties 2018-10-22 19:54:48 +02:00
Jonathan Rainville 7a70f5df26
use constants instead of magic numbers 2018-10-22 19:54:47 +02:00
Jonathan Rainville fe0b84349a
update noserver and nobrowser and fix noserver 2018-10-22 19:54:47 +02:00
Jonathan Rainville 75d9998c57
refactor to not use the blockchain_connector directly 2018-10-22 19:54:47 +02:00
Jonathan Rainville e450c0484a
fix error in solc-tests 2018-10-22 19:54:46 +02:00
Jonathan Rainville c6aa19a772
use this instead of self 2018-10-22 19:54:46 +02:00
Jonathan Rainville ac9dbdd1d6
conflict in test 2018-10-22 19:54:46 +02:00
Jonathan Rainville ac155ddb86
conflict in specialconfigs 2018-10-22 19:54:46 +02:00
Jonathan Rainville f4d7636b7a
make code coverage work with refactored tests 2018-10-22 19:54:45 +02:00
Jonathan Rainville 7516bad619
use blockchain_connector's provider for nodes 2018-10-22 19:54:45 +02:00
Jonathan Rainville 5a5485d447
get rid of dependency on web3 2018-10-22 19:54:45 +02:00
Jonathan Rainville ddc8b36329
make tests work by using events 2018-10-22 19:54:45 +02:00
Jonathan Rainville ca3aea7923
BROKEN: solc doesnt load 2018-10-22 19:54:45 +02:00
Jonathan Rainville 3c0bcb18b8
rename events to use a tests prefix 2018-10-22 19:54:44 +02:00
Jonathan Rainville e8574f33eb
conflict in run_tests 2018-10-22 19:54:44 +02:00
Jonathan Rainville e6cad1675a
move test files to a module folder 2018-10-22 19:54:44 +02:00
Andre Medeiros 7104c18b83
Only disable optimizations with coverage.
This means that any test runs without coverage will run optimized
Solidity code instead.
2018-10-22 19:54:44 +02:00
Anthony Laibe 27973461b1
In case of ws, use the connected attribute
Instead of relying on non reliable source, directly
check the ws status
2018-10-22 19:54:44 +02:00
Cryptomental 47dcb1552c
console, dashboard: Add persistent, automatically loaded history.
Add persistent automatically loaded history file for repl console
and Embark dashboard.

Default location of the history file is stored in DEFAULT_CMD_HISTORY_PATH
pointing to DAPP_PATH/.embark/cmd_history.

The history is automatically saved and loaded on startup.

test/console: Pass Embark object to constructor.

Update console test to pass Embark object to constructor.

Refs: https://github.com/embark-framework/embark/issues/939
2018-10-22 19:54:43 +02:00
emizzle 5fe746df51
Add message warning user a password is needed to unlock
When `mineWhenNeeded` is true (occurs in zero-config) and an account on the node exists, a password is required to be specified `config/blockchain.js > account > password` so that the existing account can be unlocked by geth (the `—unlock` cli option).
2018-10-22 19:54:43 +02:00
Dan Lipert 898ecfe293
Accept standard Ether units and update/add tests 2018-10-22 19:54:43 +02:00
Michael Bradley, Jr 4812a0d1a2
additional warning re: potential version incompatibility 2018-10-22 19:53:50 +02:00
Subramanian Venkatesan f686fec74a
ens resolve 2018-10-22 19:53:50 +02:00
Michael Bradley, Jr 0f6e84bca3
return in the catch branch so the control flow is more clear 2018-10-22 19:53:49 +02:00
Michael Bradley, Jr b9e592ae2e
color retry message yellow 2018-10-22 19:53:49 +02:00
Michael Bradley, Jr 1f47b163e4
auto-retry download with master branch
a fallback download of the master branch is attempted only for unqualified
template names
2018-10-22 19:53:49 +02:00
Giuseppe Bertone 81e798c89c
Add support for Parity
Addons
 - New chain initialization and genesis management
 - Option to choose client to use
 - Option to "ping forever" for Geth
 - Creation and unlock of accounts at client's start
 - Utility to fund accounts with ethers
 - Miner settings inside the ethereum client
 - Workaround to CORS problem: origin is now http://embark
 - Several double callback's checks

Updates
 - Boilerplate, templates, configuration files and demo stuff
 - Messages and i18n strings
 - Tests

Fixes
 - Geth client now uses miner.gastarget instead of the deprecated targetGasLimit
 - Workaround for shh_version with Parity

Reworks of other PRs into the new code
 - Included delayed proxy
 - Send ready only when the proxy is started
 - Start HTTP and WS proxies individually
 - Async setupProxy
 - Fixed datadir for GethMiner
2018-10-22 19:53:49 +02:00
Michael Bradley, Jr cc08a16ae3
calc a <major>.<minor> branch for unqualified template names
doesn't calc a branch if a url/shortcut is supplied that hostedGitInfo knows
how to parse

only does this for unqualified names if a committish isn't supplied, i.e.
doesn't override '#develop' in 'typescript#develop'
2018-10-22 19:43:16 +02:00
Jonathan Rainville d7cd3a72c9
add message at the end of the first ouput 2018-10-22 19:43:15 +02:00
Jonathan Rainville 9c0bff4515
remove console dir that I forgot to remove 2018-10-22 19:40:52 +02:00
Pascal Precht 80c80e9beb
fix(commands/build): don't start blockchain node when `--contracts` is used
Prior to this commit `$ embark build --contracts` spinned up a blockchain node
which is not necessary as `--contracts` can be seen as a "compile only" option.

This commit ensures we don't start any web3 services with `--contracts` is used.
2018-10-22 19:40:52 +02:00
Michael Bradley, Jr fd856f8163
PKG_PATH, pkgPath 2018-10-22 19:39:26 +02:00
hodlbank f41bcd55d6
[f] Fix for #971 - "Fatal error when Ethereum node going offline".
[a] Added .once() into Events.
2018-10-22 19:39:26 +02:00
Moksh Jain 08c140b035
added webserver logging 2018-10-22 19:39:25 +02:00
Moksh Jain 51b2cce0ea
adds dashboard logging for: geth, ipfs, swarm 2018-10-22 19:39:25 +02:00
Subramanian Venkatesan ee77ac7f7f
Adds solc option to tests. Runs smart contract tests using remix-tests
Ref: #817
2018-10-22 19:39:24 +02:00
Jonathan Rainville f71c158164
change 70000 for a constant 2018-10-22 19:35:59 +02:00
Pascal Precht d34428a129
refactor(modules/pipeline/webpackProcess): load pipeline config in Config class
to configure pipeline specific options like TypeScript support.

At the time this has been added, `core/config` didn't handle the loading
of configuration files for pipeline related tasks yet.

This commit ensures a dapp's `pipeline.json` will be loaded and used to
configure Embark's webpack process as part of Embark's `Config` initialization.
2018-10-22 19:35:59 +02:00
Pascal Precht 71e92358a8
feat(modules/watcher): introduce watcher plugin module
As part of a bigger refactoring to make Embark's build pipeline pluggable,
this commit moves the watcher into its own plugin module so it can be
consumed via Embark's event bus.

It also introduces new command handlers for all watcher related APIs respectively:

- watcher:start
- watcher:stop
- watcher:restart
2018-10-22 19:35:58 +02:00
Pascal Precht 081b7eee89
chore(blockchainProcess): improve error message when blockchain client exits early
In cases a blockchain client exits before Embark is done doing its work,
the current error message doesn't provide any pointers to why this
happened.

Running `$ embark blockchain` separately could yield more information by
the underlying process.
2018-10-22 19:35:58 +02:00
Jonathan Rainville 5f8ad923c7
use an event to get web3 instead of global 2018-10-22 19:35:58 +02:00
Pascal Precht a0ef234fea
feat(modules/pipeline): move pipeline into its own module plugin
This is the first step of refactoring Embark's pipeline abstraction into
dedicated plugin modules that take advantage of Embark's event system.

With this commit we're moving `Pipeline` into `lib/modules/pipeline` and
introduce a new command handler `pipeline:build`. Embark's engine now
requests builds via this command handler.

Notice that `Watch` still lives in `lib/pipeline` as this is a step-by-step
refactoring to reduce chances of introducing regressions.
2018-10-22 19:35:58 +02:00
Jonathan Rainville 6b4321874b
add helpful messages when ens register is rejected 2018-10-22 19:35:58 +02:00
Jonathan Rainville 623bdc50ae
make on deploy manual 2018-10-22 19:35:57 +02:00
Cryptomental bcc1711061
contract_deployer: Redeploy if track field is set to false.
Always deploy the contract regardless if already deployed
when 'track' field in the contract configuration is specified
and set to false.

In line with #938 requirements:

* If a contract has the track field set to false, that contract
  will always deploy.
* If the track field is set to true, then the existing deployment
  tracking mechanism will be active for that contract.
* If the field is not set, it should be assumed to true by default

Refs: https://github.com/embark-framework/embark/issues/938
2018-10-22 19:35:57 +02:00
Michael Bradley, Jr 115bf1387d
fix chunking problem related to dynamic import and bug re: umd 2018-10-22 19:35:57 +02:00
Michael Bradley, Jr 0c60d2e1b4
per latest babel-preset-react-app exclue transform-typeof-symbol 2018-10-22 19:35:57 +02:00
Michael Bradley, Jr b971f5bcec
in comments provide links to relevant tag not a commit 2018-10-22 19:35:57 +02:00
Michael Bradley, Jr e7aa9de8f3
TODO comment re: pipeline config 2018-10-22 19:35:56 +02:00
Michael Bradley, Jr a898bbdf18
don't waste time gzip'ing contents of babel-loader's cache 2018-10-22 19:35:56 +02:00
Michael Bradley, Jr 09734d7879
call path.basename w/ extension name to avoid e.g. `.js.1.js` 2018-10-22 19:35:56 +02:00
Michael Bradley, Jr 882271dc60
rev file name to better reflect its purpose 2018-10-22 19:35:56 +02:00
Michael Bradley, Jr ae878fd7c8
extract copy/preserve logic into a helper in lib/core/fs
preserved files should end with <number>.<ext> vs. <ext>.<number>
2018-10-22 19:35:55 +02:00
Michael Bradley, Jr 67347ae08e
babel-loader should process .ts, .tsx files when typescript is enabled 2018-10-22 19:35:55 +02:00
Michael Bradley, Jr 059635979d
pipeline.js dapp config to allow easy toggling of typescript 2018-10-22 19:35:55 +02:00
Michael Bradley, Jr 6534c30200
rev comment to provide more context/clarity 2018-10-22 19:35:55 +02:00
Michael Bradley, Jr 7e7b050ae7
raise exception if both Flow and TypeScript are enabled 2018-10-22 19:35:54 +02:00
Michael Bradley, Jr 4aedeeee9b
TypeScript support -- disabled by default 2018-10-22 19:35:54 +02:00
Michael Bradley, Jr 8c6b26f311
babel plugins, presets and their configs per babel-preset-react-app 2018-10-22 19:35:54 +02:00
Michael Bradley, Jr 6986d33da9
don't need quotes 2018-10-22 19:35:54 +02:00