Skip to content

Commit

Permalink
Merge pull request #796 from econia-labs/ECO-2086
Browse files Browse the repository at this point in the history
[ECO-2086] Add last_transaction_timestamp to data_status endpoint
  • Loading branch information
CRBl69 authored Aug 19, 2024
2 parents 7ce7e6a + d7fd77a commit 549d6ee
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 1 deletion.
4 changes: 3 additions & 1 deletion doc/doc-site/docs/off-chain/dss/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,12 @@ Stable DSS builds are tracked on the [`dss-stable`] branch with tags like [`dss-
1. Merge `main` into `dss-stable`.
1. Push annotated tag to head of `dss-stable`.

## [v2.4.0-rc.1][dss-v2.4.0-rc.1] (in progress)
## [v2.4.0-rc.2][dss-v2.4.0-rc.2] (in progress)

### Added

- Transaction version field inside levels MQTT events ([#792]).
- Timestamp of last processed transaction in `/data_status` endpoint ([#796]).

### Fixed

Expand Down Expand Up @@ -290,6 +291,7 @@ Stable DSS builds are tracked on the [`dss-stable`] branch with tags like [`dss-
[#788]: https://github.com/econia-labs/econia/pull/788
[#792]: https://github.com/econia-labs/econia/pull/792
[#793]: https://github.com/econia-labs/econia/pull/793
[#796]: https://github.com/econia-labs/econia/pull/796
[docs site readme]: https://github.com/econia-labs/econia/blob/main/doc/doc-site/README.md
[dss-v2.1.0-rc.1]: https://github.com/econia-labs/econia/releases/tag/dss-v2.1.0-rc.1
[dss-v2.2.1-rc.1]: https://github.com/econia-labs/econia/releases/tag/dss-v2.2.1-rc.1
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
-- This file should undo anything in `up.sql`
DROP VIEW api.data_status;

CREATE VIEW api.data_status AS
SELECT
CURRENT_TIMESTAMP AS current_time,
processor_status.last_success_version AS processor_last_txn_version_processed,
user_history_last_indexed_txn.txn_version AS aggregator_user_history_last_txn_version_processed,
array_agg(ARRAY[resolution, candlesticks_last_indexed_txn.txn_version]) AS aggregator_candlesticks_last_txn_version_processed
FROM
processor_status,
aggregator.user_history_last_indexed_txn,
aggregator.candlesticks_last_indexed_txn
WHERE
processor_status.processor = 'econia_processor'
GROUP BY
user_history_last_indexed_txn.txn_version,
processor_status.last_success_version;


GRANT
SELECT
ON api.data_status TO web_anon;
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
-- Your SQL goes here
DROP VIEW api.data_status;

CREATE VIEW api.data_status AS
SELECT
CURRENT_TIMESTAMP AS current_time,
processor_status.last_transaction_timestamp AS processor_last_txn_timestamp_processed,
processor_status.last_success_version AS processor_last_txn_version_processed,
user_history_last_indexed_txn.txn_version AS aggregator_user_history_last_txn_version_processed,
array_agg(ARRAY[resolution, candlesticks_last_indexed_txn.txn_version]) AS aggregator_candlesticks_last_txn_version_processed
FROM
processor_status,
aggregator.user_history_last_indexed_txn,
aggregator.candlesticks_last_indexed_txn
WHERE
processor_status.processor = 'econia_processor'
GROUP BY
user_history_last_indexed_txn.txn_version,
processor_status.last_success_version,
processor_status.last_transaction_timestamp;


GRANT
SELECT
ON api.data_status TO web_anon;

0 comments on commit 549d6ee

Please sign in to comment.