Commit Graph

992 Commits

Author SHA1 Message Date
Iuri Matias 9f6f7af3f7
Merge pull request #171 from status-im/global_vars
display globals in the debugger; display vars found in failing line
2018-10-27 21:33:00 +02:00
Iuri Matias 40ed7b960f display globals in the debugger; display vars found in failing line 2018-10-27 21:31:13 +02:00
Jonathan Rainville ef2b4ea570 fix error message that print undefined 2018-10-25 15:20:29 -04:00
emizzle efa21a1915
Fix process logs not returning
The API endpoint listening for a dump of process logs was not returning logs properly for two reasons:
1. The `id` field was being appended to each log. This had been moved to the `handleLog` function of the `LogHandler`.
2. The slice needed to grab logs from the end, so the `limit` was made negative on the `.slice()`.
2018-10-25 13:04:33 +02:00
emizzle dcdcfb5b32
Minor fixes for rebase 2018-10-25 13:04:33 +02:00
emizzle 9a830c3423
Remove default behavior of logging to file
Default behavior of logging to file is no longer needed now that Embark log history can be properly served using the `ProcessLogsApi` and `LogHandler` classes.

# Conflicts:
#	lib/core/logger.js
#	lib/modules/blockchain_process/blockchain.js
2018-10-25 13:04:33 +02:00
emizzle f5c77b1416
Process logs API refactor
There are three separate instances of process log APIs: embark logs, blockchain logs (when in standalone mode), and child process logs (storage, communication, blockchain, etc). Each one was repeating the implementation of creating a process log API endpoint. This commit centralises the API declaration by using the class `ProcessLogsApi`.

`ProcessLogsApi` is started for all three components mentioned above: blockchain (in standalone) in the `BlockchainListener` module, embark in the `EmbarkListener` module, and for all child processes in the `ProcessLauncher`.

These listeners have two functions:
1. Create the process logs API endpoints for `get` and `ws`, and
2. Ensure that all logs are logged through the `LogHandler`, which normalises the output of the log and ensures each log has a timestamp and id (used in the cockpit for log ordering).

Also, this commit moved the pipeline in to a module, so that the `embark` object could be passed to the `ProcessLogsApi` (to be used for registering API endpoints).
2018-10-25 13:04:28 +02:00
emizzle 728713a183
Embark blockchain logs when running standalone
When running `embark blockchain` followed by `embark run` previously, logs generated in the standalone `embark blockchain` process were black boxed and not accessible to the main Embark process.

This is fixed by creating a client IPC connection in the `embark blockchain` process that connects to the IPC server connection running in `embark run`. The connection is made by way of polling `ipc.connect` and continues polling even after a connection is made in case `embark run` is killed and restarted without restarting `embark blockchain`.

`LogHandler` was introduced to extrapolate functionality used in `ProcessLauncher` that needed to also be used in the standalone blockchain process. It also caps the number of logs that are stored in memory per process by a constant value defined in `constants.json`.

A `blockchain_listener` was module was created (and run inside of `embark run`) that listens for logs emitted by the `embark blockchain` client IPC and runs them through the `LogHandler`. Additionally, this module registers the API endpoints needed to handle requests for blockchain process logs in the cockpit (which were 404’ing before).

# Conflicts:
#	lib/modules/blockchain_process/blockchain.js
2018-10-25 12:51:43 +02:00
Iuri Matias 1d6da99e8f display last error found
display last line on tx

fix debugger call

listen to source event only after jumping to the end

keep track of last tx; add minimal debug feature; fix ast issue

initial debugger apis & ui integration

prevent crash when step is out of bounds; send all all available data in websocket

add debugger commands

fix line number tracking in editor; toggle breakpoints

replace timeouts with callbacks

add debugger manager & refactor

refactor debugger api

refactor cmd line debugger

reduce debugger decoupling

reduce debugger decoupling

fix debug buttons

trigger source update so api triggers ws event to update source location

move locals and contracts vars to a json view

improve debugger icons

simplify debugger data

update debug package

add command handler to get a contract given a tx; update debugger so it can get a contract by its tx instead of tracking latest txs only

update debugger package
2018-10-23 18:27:40 -04:00
Jonathan Rainville f30803946c fix ENS API 2018-10-23 14:20:42 -04:00
Jonathan Rainville c201b6e491 fix ens with no registration 2018-10-23 11:59:43 -04:00
Jonathan Rainville f40cf609a8 fix embark ens and embark demo 2018-10-23 11:39:14 -04:00
Jonathan Rainville 73668afd2e fix missing blockchainConfig pass to StorageLauncher in swarm index 2018-10-23 11:19:15 -04:00
Jonathan Rainville 5eaaa63216 fix duplicated event for all contracts 2018-10-23 11:08:39 -04:00
Jonathan Rainville ccd7a7c3c7 fix reset 2018-10-23 11:01:07 -04:00
Jonathan Rainville e62a5503a9 fix undefined `connection` in provider 2018-10-23 10:42:14 -04:00
Anthony Laibe 81c62b1006 Fix provider connection check 2018-10-23 13:18:43 +01:00
Pascal Precht 853ab2d855
fix: make code compile again after rebase 2018-10-23 11:26:15 +02:00
Anthony Laibe 6a97930ceb
Only fetch transactions from last 100th blocks 2018-10-23 11:13:21 +02:00
Pascal Precht 137fbf6b52
Revert "fix(modules/pipeline): ensure REST file API parses query parameters"
This reverts commit 043697bddc.
2018-10-23 11:12:53 +02:00
Pascal Precht 064b2da5a4
fix(modules/pipeline): ensure REST file API parses query parameters
Data send from the client with GET parameters are serialized in the
request body's `params` property. As express doesn't seem to parse
those, we have to do it manually to perform object property traversals.
2018-10-23 11:12:49 +02:00
Pascal Precht b654fdecd8
fix(modules/authenticator): ensure request hash doesn't include query params
The authenticators request hash algorithm produced different hashes than
on the client, because client-side hash-request don't include the query
parameters of a URL.

This causes authentication issues when sending any requests with query
parameters. This commit ensures we ignore them on the server as well.
2018-10-23 11:12:49 +02:00
Jonathan Rainville 479b79eeaf
add better message at the end 2018-10-23 11:12:49 +02:00
Jonathan Rainville 551d1e209b
fix array display and setting 2018-10-23 11:12:49 +02:00
Jonathan Rainville 88c610208c
start to fix for arrays 2018-10-23 11:11:57 +02:00
Jonathan Rainville 529edaa058
rename templates in .hbs 2018-10-23 11:11:15 +02:00
Jonathan Rainville cc88b846aa
use embark config to get contracts dir 2018-10-23 11:11:14 +02:00
Pascal Precht a20bf63835
feat(modules/blockchain_connector): introduce APIs for signing/verifying messages 2018-10-23 11:11:14 +02:00
Jonathan Rainville bae21133bc
add error if framework is not supported 2018-10-23 11:11:13 +02:00
Jonathan Rainville 9ac2dde3eb
return contract filepath after build so that we add it to the manager 2018-10-23 11:11:13 +02:00
Iuri Matias 02ad9b314a
fix for undefined cmds 2018-10-23 11:11:13 +02:00
Jonathan Rainville 2205a26236
fix indentation 2018-10-23 11:11:13 +02:00
Andre Medeiros e229688508
Don't send empty body on authentication 2018-10-23 11:08:23 +02:00
Andre Medeiros 53bc4d945a
Change back how auth works for websockets.
As it turns out, a websocket request doesn't contain some of the
hashable properties in order to be validated. Because of that, we'll
still use tokens here until we find a better way to do it.
2018-10-23 11:08:22 +02:00
Anthony Laibe 6e24b0eb85
Remove uneeded handler 2018-10-23 11:04:00 +02:00
Anthony Laibe 2d287c43f3
Ignore badly formatted message 2018-10-23 11:03:59 +02:00
Anthony Laibe 6ce78dfce3
Add endpoint 2018-10-23 11:03:59 +02:00
Anthony Laibe 4c27d34e0c
Listen to contract events 2018-10-23 11:03:29 +02:00
Anthony Laibe 5fa118ae2e
Event function filt 2018-10-23 11:02:54 +02:00
Andre Medeiros 428f591330
Don't send token in request body.
Instead, we want to hash a header to sign a request with a client nonce,
http method and URL. This is a first step towards protecting the backend
against eavesdropping.

Please note that this will still be susceptible to replay attacks.
2018-10-23 11:01:11 +02:00
Iuri Matias 70b62bdc16
rename command_suggestions to commandSuggestions 2018-10-23 11:00:28 +02:00
Iuri Matias 0379f6bc35
use fuzzy to do search; but still do sorting 2018-10-23 11:00:28 +02:00
Iuri Matias 2453d686eb
use existing api instead of creating a new plugin 2018-10-23 11:00:27 +02:00
Iuri Matias f787e6be3c
fix identation issues 2018-10-23 11:00:27 +02:00
Iuri Matias 6f0be96243
add more commands to suggestions & improve sorting 2018-10-23 11:00:26 +02:00
Iuri Matias 1906b17c5d
fix options update; add sorting 2018-10-23 11:00:26 +02:00
Iuri Matias ce19fd96c4
intiial code to get suggestions from embark 2018-10-23 11:00:26 +02:00
Richard Ramos 60bb3b5b4a
Capitalizing contract filename 2018-10-23 10:59:19 +02:00
Anthony Laibe 695b2980e6
Feature conflict
Information where missing in contract show
2018-10-23 10:59:18 +02:00
Iuri Matias 1c59701045
fix wording 2018-10-23 10:59:17 +02:00