Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(eventindexer): Event indexer #13439

Merged
merged 31 commits into from
Mar 27, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
9c526db
eventindexer for blockproven / potentially other events, API for stat…
cyberhorsey Mar 23, 2023
813dfd5
add status page indicator
cyberhorsey Mar 23, 2023
cacc966
home
cyberhorsey Mar 23, 2023
02c147a
pr title + readme
cyberhorsey Mar 23, 2023
5a7cc98
Merge branch 'main' into event_indexer
cyberhorsey Mar 23, 2023
199ff00
rm depth 1
cyberhorsey Mar 23, 2023
65f9875
add details model
cyberhorsey Mar 23, 2023
1b2cdf1
error
cyberhorsey Mar 23, 2023
e3812ac
Merge branch 'main' into event_indexer
davidtaikocha Mar 24, 2023
2bd4255
Merge branch 'main' into event_indexer
cyberhorsey Mar 24, 2023
64a01d4
fixes
cyberhorsey Mar 24, 2023
66ddf7d
Merge branch 'event_indexer' of github.com:taikoxyz/taiko-mono into e…
cyberhorsey Mar 24, 2023
555a082
Merge branch 'main' into event_indexer
cyberhorsey Mar 24, 2023
8848d96
Merge branch 'event_indexer' of github.com:taikoxyz/taiko-mono into e…
cyberhorsey Mar 24, 2023
db4f416
Merge branch 'main' into event_indexer
dionysuzx Mar 27, 2023
f62f2a5
Merge branch 'main' into event_indexer
cyberhorsey Mar 27, 2023
626617c
Merge branch 'event_indexer' of github.com:taikoxyz/taiko-mono into e…
cyberhorsey Mar 27, 2023
279ab5d
.
cyberhorsey Mar 27, 2023
a150b62
.
cyberhorsey Mar 27, 2023
2886a68
use one dockerfile in root for all go apps
cyberhorsey Mar 27, 2023
92137c7
rm ls
cyberhorsey Mar 27, 2023
9b771a7
Update README.md
cyberhorsey Mar 27, 2023
a932d03
Update packages/eventindexer/.golangci.yml
cyberhorsey Mar 27, 2023
0580f62
Update packages/eventindexer/package.json
cyberhorsey Mar 27, 2023
53f447b
Update packages/eventindexer/package.json
cyberhorsey Mar 27, 2023
e26cc1e
rm changelog
cyberhorsey Mar 27, 2023
bdd4ddb
Merge branch 'event_indexer' of github.com:taikoxyz/taiko-mono into e…
cyberhorsey Mar 27, 2023
6374965
.env defaults
cyberhorsey Mar 27, 2023
31a9170
Update packages/status-page/src/pages/home/Home.svelte
cyberhorsey Mar 27, 2023
a89bba5
rm unecessary field on block
cyberhorsey Mar 27, 2023
2f17c0d
Merge branch 'event_indexer' of github.com:taikoxyz/taiko-mono into e…
cyberhorsey Mar 27, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add status page indicator
  • Loading branch information
cyberhorsey committed Mar 23, 2023
commit 813dfd54fb73a213f06aac7e15ff4530ec632e11
3 changes: 2 additions & 1 deletion packages/status-page/.default.env
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ VITE_TAIKO_L1_ADDRESS="0x7B3AF414448ba906f02a1CA307C56c4ADFF27ce7"
VITE_L1_EXPLORER_URL="https://l1explorer.a1.taiko.xyz"
VITE_L2_EXPLORER_URL="https://l2explorer.a1.taiko.xyz"
VITE_FEE_TOKEN_SYMBOL="TKO";
VITE_ORACLE_PROVER_ADDRESS="0x1567CDAb5F7a69154e61A16D8Ff5eE6A3e991b39"
VITE_ORACLE_PROVER_ADDRESS="0x1567CDAb5F7a69154e61A16D8Ff5eE6A3e991b39"
VITE_EVENT_INDEXER_API_URL="http://localhost:4100"
1 change: 1 addition & 0 deletions packages/status-page/src/App.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
oracleProverAddress:
import.meta.env.ORACLE_PROVER_ADDRESS ||
"0x1567CDAb5F7a69154e61A16D8Ff5eE6A3e991b39",
eventIndexerApiUrl: import.meta.env.VITE_EVENT_INDEXER_API_URL,
},
userData: {},
}),
Expand Down
18 changes: 18 additions & 0 deletions packages/status-page/src/pages/home/Home.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import { getStateVariables } from "../../utils/getStateVariables";
import { truncateString } from "../../utils/truncateString";
import TaikoL1 from "../../constants/abi/TaikoL1";
import { getNumProvers } from "../../utils/getNumProvers";

export let l1Provider: ethers.providers.JsonRpcProvider;
export let l1TaikoAddress: string;
Expand All @@ -26,8 +27,25 @@
export let l2ExplorerUrl: string;
export let feeTokenSymbol: string;
export let oracleProverAddress: string;
export let eventIndexerApiUrl: string;

let statusIndicators: StatusIndicatorProp[] = [
{
statusFunc: async (
provider: ethers.providers.JsonRpcProvider,
address: string
) => (await getNumProvers(eventIndexerApiUrl)).uniqueProvers,
watchStatusFunc: watchHeaderSynced,
provider: l1Provider,
contractAddress: l1TaikoAddress,
header: "Unique Provers",
intervalInMs: 0,
colorFunc: (value: Status) => {
return "green";
},
tooltip:
"The numbe of unique provers who successfully submitted a proof to the TaikoL1 smart contract.",
cyberhorsey marked this conversation as resolved.
Show resolved Hide resolved
},
{
statusFunc: getLatestSyncedHeader,
watchStatusFunc: watchHeaderSynced,
Expand Down
18 changes: 18 additions & 0 deletions packages/status-page/src/utils/getNumProvers.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import axios from "axios";

export type UniqueProver = {
address: string;
count: number;
};
export type UniqueProverResponse = {
uniqueProvers: number;
provers: UniqueProver[];
};
export const getNumProvers = async (
eventIndexerApiUrl: string
): Promise<UniqueProverResponse> => {
const resp = await axios.get<UniqueProverResponse>(
`${eventIndexerApiUrl}/uniqueProvers`
);
return resp.data;
};