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

merging rfq indexer into monorepo [SLT-164] [SLT-176] #3136

Merged
merged 15 commits into from
Sep 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
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"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move 'wagmi' to 'dependencies'

The package wagmi has been added to devDependencies. If wagmi is required at runtime in production code, it should be listed under dependencies to ensure it's included when the application is built.

Apply this diff to move wagmi to dependencies:

  "devDependencies": {
    ...
    "typescript": "^5.0.4"
-   "wagmi": "^2.12.12"
  },
  "dependencies": {
    "@changesets/cli": "2.22.0",
    "eslint-plugin-jsx": "^0.1.0",
+   "wagmi": "^2.12.12"
  },
  "packageManager": "yarn@1.22.19"

Committable suggestion was skipped due to low confidence.

},
"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
```
Comment on lines +14 to +16
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Specify the language for fenced code blocks.

Markdownlint recommends specifying a language identifier for fenced code blocks to improve syntax highlighting and readability.

Apply the following changes to specify the language for the code blocks:

14,21,28
- ```
+ ```bash
  curl http://localhost:3001/api/pending-transactions-missing-relay

Repeat the above change for the code blocks on lines 21-23 and 28-30.


Also applies to: 21-23, 28-30

<details>
<summary>Tools</summary>

<details>
<summary>Markdownlint</summary><blockquote>

14-14: null
Fenced code blocks should have a language specified

(MD040, fenced-code-language)

</blockquote></details>

</details>

<!-- This is an auto-generated comment by CodeRabbit -->


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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a blank line after the header to fix formatting.

There's a formatting issue due to a missing blank line after the header "## Important Scripts". Markdown requires a blank line after headers to render them properly.

Apply the following change:

35
 ## Important Scripts
+ 
37
 - `yarn dev:local`: Runs the API in development mode using local environment variables
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- `yarn dev:local`: Runs the API in development mode using local environment variables
## Important Scripts
- `yarn dev:local`: Runs the API in development mode using local environment variables
Tools
LanguageTool

[uncategorized] ~37-~37: Loose punctuation mark.
Context: ...## Important Scripts - yarn dev:local: Runs the API in development mode using ...

(UNLIKELY_OPENING_PUNCTUATION)

- `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 pnpm@9.1.0 --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
Loading