Commit Graph

2847 Commits

Author SHA1 Message Date
Iuri Matias 3007c109e7
Merge pull request #170 from status-im/bugfix/send-gas-with-function
bug: send gas when calling a function via API
2018-10-27 21:38:13 +02:00
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
Anthony Laibe d6f7c652f9 bug: send gas when calling a function via API 2018-10-27 11:51:03 +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 043697bddccf2b5f47e649eb885b2ece53a1d825.
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
Iuri Matias d5cd0b0ff7
address code review 2018-10-23 11:12:00 +02:00
Iuri Matias b06d224883
fix services & processes; improve UI 2018-10-23 11:11:58 +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
Andre Medeiros a65bbabd15
Fix FS to include Embark 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 4678359ce0
Remove another attack vector 2018-10-23 11:11:12 +02:00
Andre Medeiros 1ffbda8eb4
Avoid unnecessary allocations 2018-10-23 11:11:12 +02:00
Andre Medeiros 26ff48bb15
Blacklist anything outside dapp or tmp root. 2018-10-23 11:11:12 +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
Jonathan Rainville 12b3411ee2
change colors and add command to process scss 2018-10-23 11:01:11 +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