Skip to content

Commit

Permalink
merging rfq indexer into monorepo [SLT-164] [SLT-176] (#3136)
Browse files Browse the repository at this point in the history
* merging rfq indexer into monorepo

* nuke .env

* fix commands

* fix package name

* test coverage script

* rough pass at docs and some linting and fixes yarn

* Upgrades wagmi & rainbowkit

* indxer

* Adds invisible but used packages

* +recent-invalid-fills [SLT-188]

* Moves wagmi to root

* new endpoints and clean up linting

---------

Co-authored-by: Trajan0x <[email protected]>
Co-authored-by: abtestingalpha <[email protected]>
Co-authored-by: parodime <[email protected]>
  • Loading branch information
4 people authored Sep 19, 2024
1 parent d4d1c5a commit bf22448
Show file tree
Hide file tree
Showing 40 changed files with 7,509 additions and 5,276 deletions.
1 change: 1 addition & 0 deletions lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"useWorkspaces": true,
"packages": [
"packages/*",
"packages/rfq-indexer/*",
"docs/*"
],
"version": "independent"
Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"workspaces": {
"packages": [
"packages/*",
"packages/rfq-indexer/*",
"docs/*"
],
"nohoist": [
Expand Down Expand Up @@ -73,7 +74,8 @@
"ts-mocha": "^10.0.0",
"typedoc": "^0.23.24",
"typedoc-plugin-markdown": "^3.14.0",
"typescript": "^5.0.4"
"typescript": "^5.0.4",
"wagmi": "^2.12.12"
},
"dependencies": {
"@changesets/cli": "2.22.0",
Expand Down
25 changes: 25 additions & 0 deletions packages/rfq-indexer/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# RFQ Indexer

## Overview

The RFQ (Request for Quote) Indexer is a system designed to index and track bridge events across multiple blockchain networks. It consists of two main parts: the indexer and the API.

1. What does the rfq-indexer do?
The rfq-indexer captures and stores bridge events from various blockchain networks, including Ethereum, Optimism, Arbitrum, Base, Blast, Scroll, Linea, and BNB Chain. It indexes events such as bridge requests, relays, proofs, refunds, and claims.

2. Parts of the indexer and their users:
- Indexer: Used by developers and system administrators to collect and store blockchain data.
- API: Used by front-end applications, other services, or developers to query the indexed data.

## Directory Structure
rfq-indexer/
├── api/ # API service
│ ├── src/ # API source code
│ ├── package.json # API dependencies and scripts
│ └── README.md # API documentation
├── indexer/ # Indexer service
│ ├── src/ # Indexer source code
│ ├── abis/ # Contract ABIs
│ ├── package.json # Indexer dependencies and scripts
│ └── README.md # Indexer documentation
└── README.md # This file
3 changes: 3 additions & 0 deletions packages/rfq-indexer/api/..prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
...require('../../../.prettierrc.js'),
}
3 changes: 3 additions & 0 deletions packages/rfq-indexer/api/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
extends: '../../../.eslintrc.js',
}
4 changes: 4 additions & 0 deletions packages/rfq-indexer/api/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
node_modules
.env

.env.*
40 changes: 40 additions & 0 deletions packages/rfq-indexer/api/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# RFQ Indexer API

This API provides access to the indexed bridge event data.

## API Calls

1. GET /api/hello
- Description: A simple hello world endpoint
- Example: `curl http://localhost:3001/api/hello`

2. GET /api/pending-transactions-missing-relay
- Description: Retrieves pending transactions that are missing relay events
- Example:
```
curl http://localhost:3001/api/pending-transactions-missing-relay
```
3. GET /api/pending-transactions-missing-proof
- Description: Retrieves pending transactions that are missing proof events
- Example:
```
curl http://localhost:3001/api/pending-transactions-missing-proof
```
4. GET /api/pending-transactions-missing-claim
- Description: Retrieves pending transactions that are missing claim events
- Example:
```
curl http://localhost:3001/api/pending-transactions-missing-claim
```
5. GraphQL endpoint: /graphql
- Description: Provides a GraphQL interface for querying indexed data, the user is surfaced an interface to query the data via GraphiQL
## Important Scripts
- `yarn dev:local`: Runs the API in development mode using local environment variables
- `yarn dev:prod`: Runs the API in development mode using production environment variables
- `yarn start`: Starts the API in production mode
4 changes: 4 additions & 0 deletions packages/rfq-indexer/api/nixpacks.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
providers = ["node"]

[phases.install]
cmds = ["npm install -g corepack", "corepack enable", "corepack prepare [email protected] --activate", "pnpm install"]
53 changes: 53 additions & 0 deletions packages/rfq-indexer/api/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
{
"name": "@synapsecns/rfq-indexer-api",
"private": true,
"version": "1.0.1",
"description": "",
"main": "index.js",
"scripts": {
"check-env": "dotenv -e .env.local -- printenv | grep DATABASE_URL",
"dev:local": "dotenv -e .env.local -- tsx watch src/index.ts",
"dev:prod": "dotenv -e .env.production -- tsx watch src/index.ts",
"start": "tsx src/index.ts",
"start:local": "dotenv -e .env -- tsx src/index.ts",
"dev": "dotenv -e .env -- tsx watch src/index.ts",
"lint:check": " ",
"ci:lint": " ",
"build:go": " ",
"build": " ",
"build:slither": " ",
"test:coverage": "echo 'No tests defined.'"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"@graphql-tools/load-files": "^7.0.0",
"@graphql-tools/merge": "^9.0.7",
"@graphql-tools/schema": "^10.0.6",
"@types/express": "^4.17.21",
"@types/node": "^22.5.4",
"dotenv-cli": "^7.4.2",
"express": "^4.21.0",
"graphql": "^16.9.0",
"graphql-yoga": "^5.7.0",
"kysely": "^0.27.4",
"pg": "^8.12.0",
"ts-node": "^10.9.2",
"tsx": "^4.19.1",
"typescript": "^5.6.2",
"viem": "^2.21.6"
},
"engines": {
"node": ">=18.17"
},
"devDependencies": {
"@types/pg": "^8.11.9",
"dotenv": "^16.4.5"
},
"repository": {
"type": "git",
"url": "git+https://github.com/synapsecns/sanguine",
"directory": "packages/rfq-indexer/api"
}
}
Loading

0 comments on commit bf22448

Please sign in to comment.