-
Notifications
You must be signed in to change notification settings - Fork 88
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add new indexer graphql package (L2) (#172)
Co-authored-by: LuizAsFight <[email protected]> Co-authored-by: Luiz Gomes - LuizAsFight.eth <[email protected]> Co-authored-by: luizstacio <[email protected]> Co-authored-by: Hélcio Franco <[email protected]>
- Loading branch information
1 parent
6cbc22c
commit 4daabc0
Showing
139 changed files
with
13,349 additions
and
1,496 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# This image contains the graphql server | ||
# built for the fuel-explorer | ||
FROM node:20-slim AS base | ||
|
||
# Expose the ENVs to the env of the container | ||
ENV PORT="${PORT}" | ||
ENV FUEL_PROVIDER="${FUEL_PROVIDER:-https://beta-5.fuel.network/graphql}" | ||
ENV PNPM_HOME="/pnpm" | ||
ENV PATH="$PNPM_HOME:$PATH" | ||
ENV SERVER_BUILD=true | ||
ENV SYNC_MISSING=false | ||
ENV DB_MIGRATE=false | ||
|
||
# Database config | ||
ENV DB_HOST="${DB_HOST}" | ||
ENV DB_PORT="${DB_PORT}" | ||
ENV DB_USER="${DB_USER}" | ||
ENV DB_PASS="${DB_PASS}" | ||
ENV DB_NAME="${DB_NAME}" | ||
|
||
# Enable pnpm using corepack form node.js | ||
RUN corepack enable | ||
|
||
# Install dependencies for the entire monorepo | ||
COPY . /app-explorer | ||
WORKDIR /app-explorer | ||
|
||
# Install dependencies for the entire monorepo | ||
RUN pnpm install | ||
RUN pnpm db:setup | ||
|
||
# Expose the specified port | ||
EXPOSE ${PORT} | ||
|
||
# Start GraphQL server | ||
WORKDIR /app-explorer | ||
|
||
CMD ["pnpm", "server:start"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"name": "hardhat-node", | ||
"version": "0.0.0", | ||
"scripts": { | ||
"start": "hardhat node --network hardhat" | ||
}, | ||
"license": "MIT", | ||
"dependencies": { | ||
"dotenv": "^16.4.4", | ||
"hardhat": "^2.20.1" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
node_moduels | ||
.turbo | ||
dist | ||
.env |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
FUEL_PROVIDER=http://beta-5.fuel.network/graphql | ||
SERVER_PORT=3002 | ||
DB_HOST="127.0.0.1" | ||
DB_PORT="5435" | ||
DB_USER="postgres" | ||
DB_PASS="postgres" | ||
DB_NAME="postgres" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
FUEL_PROVIDER=https://beta-5.fuel.network/graphql | ||
SERVER_PORT=3002 | ||
DB_HOST="127.0.0.1" | ||
DB_PORT="5435" | ||
DB_USER="postgres" | ||
DB_PASS="postgres" | ||
DB_NAME="postgres" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
## Mock API | ||
|
||
This is a mock api for block-explorer | ||
|
||
## Run development server | ||
|
||
```sh | ||
pnpm dev | ||
``` | ||
|
||
## Docker | ||
|
||
``` | ||
docker run \ | ||
-e FUEL_PROVIDER=http://beta-5.fuel.network/graphql \ | ||
-e SERVER_PORT=3000 \ | ||
-e SYNC_MISSING=true \ | ||
-e DB_MIGRATE=true \ | ||
-e DB_HOST=192.168.3.240 \ | ||
-e DB_PORT=5435 \ | ||
-e DB_USER=postgres \ | ||
-e DB_PASS=postgres \ | ||
-e DB_NAME=postgres \ | ||
-p 3333:3000 \ | ||
ghcr.io/fuellabs/fuel-explorer:main | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import type { CodegenConfig } from '@graphql-codegen/cli'; | ||
import dotenv from 'dotenv'; | ||
dotenv.config(); | ||
|
||
const SERVER_URL = process.env.FUEL_PROVIDER || 'http://127.0.0.1:4000/graphql'; | ||
|
||
const config: CodegenConfig = { | ||
overwrite: true, | ||
generates: { | ||
'./src/graphql/schemas/fuelcore.graphql': { | ||
schema: SERVER_URL, | ||
plugins: ['schema-ast'], | ||
config: { | ||
includeDirectives: true, | ||
}, | ||
}, | ||
}, | ||
}; | ||
export default config; |
Oops, something went wrong.