Commit Graph

5512 Commits

Author SHA1 Message Date
Jonathan Rainville a4f68cb0ee fix(embark/simulator): fix account object empty when no mnemonic 2019-04-16 17:30:38 -04:00
Jonathan Rainville bfebb3ce41 fix(embark/compiler): fix errors and bugs with solc 0.4.18 2019-04-16 14:25:59 -04:00
Michael Bradley, Jr eb9de680d3 fix(@cockpit/services): send only process names to embark-api-client
`webSocketProcess` function in `embark-api-client` expects only a process name,
but cockpit was calling it with name-strings prepended with `/process-logs/`
resulting in bad URLs. Revise cockpit's `services/api` module to call
`webSocketProcess` with process names only.
2019-04-16 14:25:35 -04:00
Michael Bradley, Jr a39c2c82d7 refactor(@embark/api): in dev use cockpit redirect instead of proxy
Embark API server's development proxy from port 55555 to 3000 was attempting to
inappropriately forward an `/embark-api/` endpoint for the blockchain process
logs to Create React App's development server. Why it was only happening for
the one endpoint is not known but probably has to do with timing around
registration of the API server's express routes.

The problem can be fixed with a one-line `filter:` function in the options for
`express-http-proxy`. However, it was realized that to fix an unrelated
problem, whereby the proxy doesn't forward websockets to CRA such that hot
reload doesn't work when accessing `embark-ui` in development on port 55555, a
switch to `http-proxy-middleware` would be required. That was quickly
attempted (easy switch) but there are outstanding [difficulties][bug] with
`webpack-dev-server` and `node-http-proxy` that cause CRA to crash.

Switch strategies and refactor the API module to serve a page on port 55555 (in
development only) that alerts the developer `embark-ui` should be accessed on
port 3000. The page redirects (client-side) after 10 seconds, with URL query
params and/or hash preserved. A future version could instead do client-side
polling of port 3000 with `fetch` and then redirect only once it's
available. The reason for not redirecting immediately is that the intermediate
page makes it more obvious what needs to be done, e.g. CRA dev server may need
to be started with `yarn start`.

[bug]: https://github.com/webpack/webpack-dev-server/issues/1642
2019-04-16 14:25:35 -04:00
Pascal Precht 3988fb4c8a uiux(@embark/embark-reset): output files that reset command removes 2019-04-12 14:59:48 -04:00
Pascal Precht 1aeb6fd83b feat(@embark/embark-specialconfigs): introduce new beforeDeploy hooks
This commit enables new `beforeDeploy` deployment hooks. With this change
it's possible to add `beforeDeploy` to either `contracts: {}` within the contracts
configuration, or an individual contract.

For example:

```
contracts: {
  SimpleStorage: {
    beforeDeploy: async (context) => {

    }
  }
}
```

Runs the hook before `SimpleStorage` will be deployed. Whereas

```
contracts: {
  ...
  beforeDeploy: async () => {

  }
}

will be executed before *all* Smart Contracts will be deployed.
2019-04-12 14:54:16 -04:00
Pascal Precht f0aed55319 uiux: improve logging of deployment hooks by adding logger dependency
This will allow users to generated deploy hook specific output using the supplied `logger` within deployment hooks.

The logger will generate an output a la:

```
ContractName > deploymentHook > Output
```

and

```
afterDeploy > Output
```

respectively.

E.g. an `onDeploy` hook config like this:

```
contracts: {
  SimpleStorage: {
    fromIndex: 0,
    args: [100],
    onDeploy: (context) => {
      context.logger.log('Hello from on deploy');
    }
  }
}
```

Will output:

```
SimpleStorage > onDeploy > Hello from on deploy
```
2019-04-12 14:51:00 -04:00
Michael Bradley 85c3bb6319 Update packages/embark/package.json
Co-Authored-By: iurimatias <iuri.matias@gmail.com>
2019-04-12 14:48:33 -04:00
emizzle 447f6f8973 fix(@embark/pipeline): Support embarkjs-whisper with external pipeline
Support embarkjs-whisper with external pipeline.

`embarkjs-whisper` is required by code that is through the VM, and therefore the `embark` package needs to be able to resolve `embarkjs-whisper`.
2019-04-12 14:48:33 -04:00
emizzle 36be50e5dc feat(@embark/proxy): Add dev tx to proxy when request fails to get response
Create a dev tx (a 0-value tx that is sent from the —dev account to itself) when a request goes through the proxy, but does not get a response after 5 seconds.

Log requests to disk (when log level is trace - enabled with the embark option `—loglevel trace`) that have not received a response and for which a dev tx has been sent.

Add logging to a `proxyLogs.json` log file as well, so that this information can be gleaned later for debugging purposes.

This particular PR Is meant to workaround an issue with running geth with the `—dev` option, as some transactions appear to get stuck, which then builds up further txs in a queue. Only when another tx is sent is the queue then purged as expected.

The remaining issue is that even though a dev tx is sent to relieve the queued txs, the originally offending tx still never receives a response from the node. This was the motivation behind creating a proxy log, so that a dev can inspect the txs that are essentially dropped.

**NOTE:** the base branch of this branch is `refactor/devfunds`. Please merge that branch first.
2019-04-12 14:48:07 -04:00
emizzle 0c98af7977 refactor(@embark/blockchain_process): Refactor dev_funds
Change name “DevFunds” to “DevTxs”.

Remove unused functions in dev_funds (create accounts, unlock accounts, fund accounts).

Add console command `sendtx` to send a one-off dev transaction.

Modify the dev tx to send a 0-value tx to itself (ie the `web3.eth.defaultAccount` which is the `—dev` account).

Deprecate the command `regularTxs on/off` in favour of `devtxs on/off` (notice the casing).

Strip regulartxs from cockpit and modify the browser warning to instruct users to run a console command.
2019-04-12 14:48:07 -04:00
Iuri Matias 4d2ffb9f28 [CHERRY PICKED] chore(release): 4.0.1
This commit has been originally cherry-picked from d0d89fc5ae and
slightly modified to update all packages, as meanwhile, new packages have been added to `master`.

The reason this commit is cherry-picked from `4.0.x` branch is because
it wasn't created from `master`.

Purpose is mainly to update `CHANGELOG` and get the package versions in sync again.
2019-04-10 12:18:35 +02:00
Iuri Matias 04f187cfb9 refactor (@embark/embark-utils): move soliditySha3 to embark-utils 2019-04-09 15:16:11 -04:00
Iuri Matias 7511e3c113 refactor (@embark/embark-utils): move hashTo32ByteHexStrin to embark-utils 2019-04-09 10:40:30 -04:00
Pascal Precht 47ba899c85 chore(@embark/embark): update handlebars dependency
Fixes: #1339
2019-04-09 10:45:16 +02:00
Andre Medeiros d5eff731f2 feature: generate lcov report on contract coverage 2019-04-08 13:39:24 -05:00
Iuri Matias f6c14d9f22 feature(@embark/embarkjs-swarm): make embarkjs swarm plugin to its own module 2019-04-05 16:28:42 -04:00
Andre Medeiros 776cb140d2 feature: stop debugging button 2019-04-04 14:47:26 -04:00
Iuri Matias c87284f72a feature(@embark/embarkjs-ipfs: make embarkjs ipfs plugin a module on its own 2019-04-04 14:45:28 -04:00
Michael Bradley, Jr d71352b781 feat(@cockpit): implement pagination for contracts
Display five contracts per page in the dashboard. Display ten contracts per
page in the contracts explorer and deployment page.

Sort contracts by name. In the future we can implement an option to sort by
block number and index within a block by calculating and including that
information as part of the server-side api response (based on a contract's
txhash).

Remove unnecessary contract filtering in the components since the containers
take care of it.

Make use of `listenToContracts` / `stopContracts` in DeploymentContainer.
2019-04-04 13:14:53 -05:00
Iuri Matias 07b2ecc448 feature(@embark/embarkjs-whisper: make embarkjs whisper plugin a module on its own
feature(@embark/embarkjs-whisper: make embarkjs whisper plugin a module on its own

feature(@embark/embarkjs-whisper: make embarkjs whisper plugin a module on its own
2019-04-04 13:29:55 -04:00
Iuri Matias b792b3fc78 refactor(@embark/embark-webserver): move webserver module 2019-04-04 13:09:37 -04:00
Andre Medeiros 542809cd9f fix: run geth and parity in archival mode for dev nodes
This will only be enabled for test networks in order to be able to debug
transactions that have occurred in the past.
2019-04-04 13:02:34 -04:00
Michael Bradley, Jr 250cb07dd2 docs: update header image for root README 2019-04-04 12:59:24 -04:00
Michael Bradley, Jr b751b9c559 refactor(@cockpit/explorer): show pagination when num pages > 1
During work on PRs #1492 and #1494 it became evident that it's not desirable to
show pagination controls unless the number of pages is greater than one.
2019-04-04 12:59:12 -04:00
Jonathan Rainville 75af5c4ed9 fix(pipeline): build contracts even when pipeline is disabled 2019-04-04 12:49:48 -04:00
Michael Bradley, Jr 6b2dc95fad feat(@cockpit/explorer): display truncated account balances
Display a truncated account balance if the balance is greater than 20
characters in length. This keeps the "Balance", "Tx Count", and "Index" fields
well-aligned in lists of accounts.

In the account details page continue to show the full balance.
2019-04-04 12:49:17 -04:00
Michael Bradley, Jr 745edafee4 feat(@cockpit/explorer): implement pagination for accounts explorer
Display two accounts per page in the explorer overview. Display ten accounts
per page in the accounts explorer page.

Sort accounts by their api-supplied index numbers with the lowest index coming
first.

Change the `initBlockHeader` saga so that it triggers a re-fetch of accounts
and therefore the "Tx Count" numbers of displayed accounts will reflect
increased counts.
2019-04-04 12:49:17 -04:00
emizzle 5a502b379a fix(@embark/debugger): Add error handling for missing line
During deploy with a failing transaction, embark was crashing due to the variable `line` being passed in as undefined.

Add better error handling to catch this error and prevent embark from crashing.
2019-04-04 12:47:34 -04:00
emizzle f27cde9261 feat(@cockpit/editor): Make tabs draggable
Make tabs draggable so they can be arranged how the user would like.

The dragging functionality locks the tabs to the parent container.

Support for multiple rows of tabs.

Styling updates for selected tabs.
2019-04-04 12:46:47 -04:00
emizzle c23316351e fix(@cockpit/deployment): Check if contracts deployed when connected to metamask
When connected to metamask, and “Injected Web3” is selected on the Deployment page of Cockpit, check to see if contracts have already been deployed or not.

For contracts that have not been deployed, or set to an address in the config, these should now all be re-deployable.

Supports libraries (that have bytecode with `0x73<address><bytecode>`).
2019-04-04 12:45:34 -04:00
Pascal Precht 4c3ec26fff uiux(@cockpit/explorer): render timestamp of transactions 2019-04-04 12:45:00 -04:00
Michael Bradley, Jr 2c948b2729 build: remove appveyor config and README badge
With PRs #1474 an #1480 merged, the migration to Azure Pipelines is complete.
2019-04-01 11:56:21 -05:00
Andre Medeiros 49f195be30 feature: azure pipelines for windows 2019-04-01 11:45:39 -05:00
Michael Bradley, Jr 4b1e126b60 fix(@embark/solidity): handle absolute paths correctly
Detect absolute paths and handle them differently from paths that have not been
resolved.
2019-04-01 11:42:53 -05:00
Michael Bradley, Jr 9e4204a492 fix(@embark/contracts_manager): compare correct property
Compare a contract's `originalFilename` property to a contract file's
normalized `originalPath` property instead of `filename`. The `filename`
property seems to have been removed.
2019-04-01 11:42:53 -05:00
Iuri Matias bb55ae120e refactor(@embark/embark-utils): move findNextPort to embark-utils
refactor(@embark/embark-utils): move findNextPort to embark-utils

refactor(@embark/embark-utils): move findNextPort to embark-utils

refactor(@embark/embark-utils): move findNextPort to embark-utils

fix linting issue

fix lint

fix lint
2019-03-28 15:50:56 -04:00
Iuri Matias 246715cd6b refactor(@embark/embark-utils): move checkIsAvailable to embark-utils 2019-03-28 15:50:56 -04:00
Iuri Matias a46ea71dbd refactor(@embark/embark-whisper): move whisper module to its own package
refactor(@embark/embark-whisper): move whisper module to its own package

add eslint to dependencies

register whisper module
2019-03-28 14:33:10 -04:00
Iuri Matias 9b493ae7e3 bugfix(@embark/embark-utils): fix import of dockerHostSwap
bugfix(@embark/embark-utils): fix import of dockerHostSwap

bugfix(@embark/embark-utils): fix ts npm call

add ts declartion for embark-utils

add ts declartion for embark-utils
2019-03-28 12:02:54 -04:00
Andre Medeiros 1107138cf5 feature: migrate to azure pipelines 2019-03-27 14:51:27 -04:00
Iuri Matias 3b396cf0c0 refactor(@embark/embark-utils): move host utils to embark-utils 2019-03-27 14:32:32 -04:00
Michael Bradley 5a5d0a69a8 Update packages/embark-utils/README.md
Co-Authored-By: iurimatias <iuri.matias@gmail.com>
2019-03-27 14:14:29 -04:00
Iuri Matias c8475da144 refactor(@embark/embark-utils): move joinPath to embark-utils 2019-03-27 14:14:29 -04:00
Iuri Matias c65a4a7f55 refactor(@embark/specialconfigs): move specialconfigs module 2019-03-27 14:11:03 -04:00
Iuri Matias 0f1a58730e gst 2019-03-27 14:09:26 -04:00
Iuri Matias 6cb14d90f6 refactor(@embark/embark-profiler): move profiler module 2019-03-27 14:09:26 -04:00
Iuri Matias 573237dc81 feature(@embark/embark-ui): add gwei and pwei units to unit converter 2019-03-27 12:35:20 -04:00
Pascal Precht 74683fdc73 uiux(@cockpit): use new Embark logo 2019-03-26 17:40:40 -04:00
Iuri Matias c1bbdbf345 move embark api client code into its own package
move embark api client code into its own package

move embark api client code into its own package

remove unused dependencies

fix linting
2019-03-26 17:36:26 -04:00