Skip to content

Commit

Permalink
#335 feat: add 24 hour txn volume to home page
Browse files Browse the repository at this point in the history
  • Loading branch information
Jaycelv committed Jul 26, 2023
1 parent d4be672 commit 6826689
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 10 deletions.
8 changes: 3 additions & 5 deletions apps/block_scout_web/assets/js/pages/chain.js
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ const elements = {
},
'[data-selector="tx_per_day"]': {
render($el, state, oldState) {
console.log('block count, today start block',state.blockCount, state.todayStartBlock)
console.log('block count, today start block', state.blockCount, state.todayStartBlock)
if ((state.blockCount && state.todayStartBlock) && (oldState.blockCount !== state.blockCount || oldState.todayStartBlock !== state.todayStartBlock)) {
const count = state.blockCount + 1 - state.todayStartBlock;
$el
Expand Down Expand Up @@ -520,13 +520,11 @@ if ($chainDetailsPage.length) {

const transactionStatsChannel = socket.channel('transactions:stats')
transactionStatsChannel.join()
transactionStatsChannel.on('update', (msg) => {
console.log('------', msg)
return store.dispatch({
transactionStatsChannel.on('update', (msg) =>
store.dispatch({
type: 'RECEIVED_UPDATED_TRANSACTION_STATS',
msg
})
}

)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ defmodule Explorer.Chain.Transaction.History.TransactionStats do
use Explorer.Schema

alias Explorer.Repo
require Logger

@derive {Jason.Encoder,
except: [
:__meta__
Expand All @@ -19,7 +19,7 @@ require Logger
field(:number_of_transactions, :integer)
field(:gas_used, :decimal)
field(:total_fee, :decimal)
field(:today_start_block, :decimal)
field(:today_start_block, :integer)
end

@typedoc """
Expand Down
6 changes: 3 additions & 3 deletions data-sync-service/src/schedule/tasks.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,10 +161,10 @@ export class TasksService {
);

//this.sync_token_price_history();
//this.updateDaBatchMissed();
this.updateDaBatchMissed();
}

/* @Interval(12000)
@Interval(12000)
async l1_sent_latest() {
// sync from latest block
let end = 0;
Expand Down Expand Up @@ -613,7 +613,7 @@ export class TasksService {
msg: `update missed eigenda batches catch error: ${e?.message}`,
});
}
} */
}

@Interval(3150)
async updateTransactionStats() {
Expand Down

0 comments on commit 6826689

Please sign in to comment.