-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Devops: Update docker compose + add CI (#2)
* devops: Fix docker-compose * devops: Add basic Rust CI github actions * docs: Add CLI section to README * style: Cargo fmt * fix: Fix test * docs: Fix docstrings * docs: Fix docstrings #2 * test: Disable some tests requiring running neo4j instance
- Loading branch information
Showing
11 changed files
with
281 additions
and
197 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
target/ | ||
data/ | ||
ipfs-cache/ | ||
docker/ | ||
**/target/ | ||
**/data/ | ||
**/ipfs-cache/ | ||
**/docker/ |
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,90 @@ | ||
# Inspired by https://github.com/joshka/github-workflows/blob/main/.github/workflows/rust-check.yml | ||
name: Lint & Test | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
workflow_call: | ||
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
|
||
# ensure that the workflow is only triggered once per PR, subsequent pushes to the PR will cancel | ||
# and restart the workflow. See https://docs.github.com/en/actions/using-jobs/using-concurrency | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
fmt: | ||
name: stable / fmt | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install Rust stable | ||
uses: actions-rust-lang/setup-rust-toolchain@v1 | ||
with: | ||
components: rustfmt | ||
|
||
- name: Run cargo fmt | ||
run: cargo fmt -- --check | ||
|
||
clippy: | ||
name: stable / clippy | ||
runs-on: ubuntu-latest | ||
permissions: | ||
checks: write | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install Rust stable | ||
uses: actions-rust-lang/setup-rust-toolchain@v1 | ||
with: | ||
components: clippy | ||
|
||
- name: Run clippy action | ||
uses: clechasseur/rs-clippy-check@v3 | ||
with: | ||
args: --all-features | ||
|
||
test: | ||
name: stable / test | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install Rust stable | ||
uses: actions-rust-lang/setup-rust-toolchain@v1 | ||
|
||
- name: Install nextest | ||
uses: taiki-e/install-action@v2 | ||
with: | ||
tool: nextest | ||
|
||
- name: Test with latest nextest release | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: nextest | ||
args: run --all-features | ||
|
||
doc: | ||
name: stable / doc | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install Rust stable | ||
uses: actions-rust-lang/setup-rust-toolchain@v1 | ||
with: | ||
components: rust-docs | ||
|
||
- name: Run cargo doc | ||
run: cargo doc --no-deps --all-features | ||
env: | ||
RUSTDOCFLAGS: -D warnings |
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 |
---|---|---|
@@ -1,4 +1,5 @@ | ||
**/target | ||
**/ipfs-cache | ||
**/data | ||
*.json | ||
*.json | ||
.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 |
---|---|---|
@@ -1,53 +1,35 @@ | ||
## Setup | ||
# GRC20 Neo4j Indexer | ||
This repo contains a GRC20 indexer that uses Neo4j to store triple data. | ||
|
||
## Running the indexer | ||
❗Important: Both methods require the `SUBSTREAMS_ENDPOINT_URL` (and optionally `SUBSTREAMS_API_TOKEN` if using a substreams provider with authentication) environment variables to be set. | ||
|
||
### With `docker-compose` | ||
```bash | ||
cd docker/ | ||
docker compose up | ||
``` | ||
|
||
### Without docker | ||
### 1. Start Neo4j | ||
```bash | ||
docker run \ | ||
--publish=7474:7474 --publish=7687:7687 \ | ||
--volume=data:/data \ | ||
--volume=./data:/data \ | ||
--env=NEO4J_AUTH=none \ | ||
neo4j | ||
``` | ||
|
||
### 2. Download root dump | ||
### 2. Compile and run the indexer | ||
In a separate terminal, run the following command: | ||
```bash | ||
wget https://gateway.lighthouse.storage/ipfs/bafkreif4acly7y46hx7optzfxtehxotizgqjz5h5vszo7vtmzsnm4ktxjy | ||
``` | ||
|
||
## Run | ||
Import | ||
```bash | ||
cargo run --bin import -- --reset-db --rollup \ | ||
--neo4j-uri neo4j://localhost:7687 \ | ||
--neo4j-user neo4j \ | ||
--neo4j-pass neo4j | ||
``` | ||
|
||
Indexer node | ||
```bash | ||
cargo run --bin kg-node -- --rollup --reset-db \ | ||
cargo run --bin kg-node -- \ | ||
--rollup \ | ||
--reset-db \ | ||
--neo4j-uri neo4j://localhost:7687 \ | ||
--neo4j-user neo4j \ | ||
--neo4j-pass neo4j | ||
``` | ||
|
||
Codegen | ||
```bash | ||
cargo run --package kg-cli -- \ | ||
--neo4j-uri neo4j://localhost:7687 \ | ||
--neo4j-user neo4j \ | ||
--neo4j-pass neo4j \ | ||
codegen | ||
``` | ||
|
||
## Docker compose | ||
### 1. Start neo4j | ||
```bash | ||
cd docker/ | ||
docker compose up neo4j | ||
``` | ||
|
||
### 2. Start kg-node | ||
```bash | ||
cd docker/ | ||
docker compose up kg-node | ||
``` | ||
## GRC20 CLI | ||
Coming soon™️ |
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
File renamed without changes.
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
Oops, something went wrong.