Commit Graph

27 Commits

Author SHA1 Message Date
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
emizzle 7b784b9618
Missing pieces for adding log limit 2018-10-23 10:59:18 +02:00
emizzle 145f376000
Add LOG_LIMIT to limit max log response size
Re-adds the log limit feature that limits the log size coming back from embark

Also adds the log limit to other process logs (ie blockchain).
2018-10-23 10:59:18 +02:00
Anthony Laibe de009db74f
Use process log ids 2018-10-23 10:57:05 +02:00
Anthony Laibe 41176f0f70
Add id to process logs 2018-10-23 10:50:41 +02:00
Anthony Laibe 0e4248cca8
Stop and limit fetch process logs 2018-10-23 10:50:38 +02:00
Andre Medeiros 31476cf2b8
Address feedback 2018-10-23 10:48:36 +02:00
Andre Medeiros 3b45128f20
Fix the way messages are appended in logs 2018-10-23 10:47:25 +02:00
Anthony Laibe 572cd20482
Fix backend tab request cached:
- Add no cache via helmet
- Fix linting (no-return-else)
- Rebase Fix: Use option.name for process log to avoid endpoint being called
blockchainProcess.js
- Rebase Fix: use option when compiling solidity
2018-10-23 10:47:24 +02:00
Jonathan Rainville 56d541fb8d
fix most rebase issues 2018-10-23 10:36:57 +02:00
Iuri Matias 7532562e28
rebase fixes 2018-10-23 10:34:46 +02:00
Anthony Laibe 1bd5174f61
Adding new reducer and selector 2018-10-23 10:27:42 +02:00
Jonathan Rainville 1ec5ee533c
conflict in actions and saga 2018-10-23 10:25:14 +02:00
Jonathan Rainville 640ec0b761
change route name 2018-10-23 10:23:44 +02:00
Jonathan Rainville 459d0cc2d6
small conflicts 2018-10-23 10:23:43 +02:00
Iuri Matias 3a532a05e8
move processes into core 2018-10-23 10:15:29 +02:00
Michael Bradley, Jr 0fdedf093c
env options property doesn't need to be passed to ProcessLauncher 2018-10-23 10:08:00 +02:00
Michael Bradley, Jr 54cb69f3db
propagate env 2018-10-23 10:05:25 +02:00
Iuri Matias f873a26caf
fixes due to bad rebase 2018-10-23 09:57:47 +02:00
Iuri Matias 663dac6009
move processes into core 2018-10-23 09:56:18 +02:00
Iuri Matias c4ea6abc4b
fixes due to bad rebase 2018-10-23 09:42:59 +02:00
Iuri Matias 6d0f4b67ae
move processes into core 2018-10-23 09:41:26 +02:00
Anthony Laibe 23f7ec396a Allow zero config in blockchain 2018-08-27 10:06:37 +01:00
Anthony Laibe ecf7bfad76 Do not exit 2018-08-21 16:11:07 -04:00
Anthony Laibe b3ed3d0379 Do not hang if process crash 2018-08-21 16:11:07 -04:00
Iuri Matias 29b0d01f22 move processes into core 2018-08-21 16:04:22 -04:00