-
Notifications
You must be signed in to change notification settings - Fork 0
Dev docs #146
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
Merged
Dev docs #146
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
e90226a
feat: add dag-indexer target to Makefile for building DAG Indexer
clostao 5d5d837
feat: add profiles for subspace-node and object-mapping-app in docker…
clostao f992054
docs: add detailed setup instructions for launching files gateway com…
clostao 07179c3
feat: add production profile to subspace-node in docker-compose
clostao 7dc5373
docs: add 'Getting Started' section with local development guide to R…
clostao File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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,83 @@ | ||
| # How to launch files gateway? | ||
|
|
||
| As is detailed on [docs](https://github.com/autonomys/auto-files-gateway/), files gateway is a three component system and should be launched in this order: | ||
|
|
||
| ## 1. Subspace Node | ||
|
|
||
| Not essential you can optionally connect a remote RPC though you will have to wait for your published IPLD nodes to be archived. | ||
|
|
||
| ## 2. Database | ||
|
|
||
| Both DAG indexer and object mapping indexer needs a database for storing some data. There you can launch a postgres at: `psql://postgres:postgres@localhost:5432/postgres` by executing the command `docker compose -f docker/object-mapping-indexer/docker-compose.yml --profile development up -d db` | ||
|
|
||
| ## 3. DAG indexer | ||
|
|
||
| This will store the IPLD nodes metadata on a database which enables features like partial file retrieval and speeds up retrieval by not retrieving `Inlink` nodes. | ||
|
|
||
| You will have to setup the following `.env` at the root of the repo | ||
|
|
||
| ```bash | ||
| # subquery params | ||
| RPC_ENDPOINTS=wss://rpc-0.mainnet.autonomys.xyz/ws # or your local | ||
| CHAIN_ID=0x66455a580aabff303720aa83adbe6c44502922251c03ba73686d5245da9e21bd | ||
| START_BLOCK=0 # this might fail if node is not in archival mode | ||
|
|
||
| # database | ||
| DB_USER=postgres | ||
| DB_PASSWORD=postgres | ||
| DB_DATABASE=postgres | ||
| DB_HOST=127.0.0.1 | ||
| DB_PORT=5432 | ||
| ``` | ||
|
|
||
| And launch it with: | ||
|
|
||
| ```bash | ||
| make dag-indexer | ||
| yarn dag-indexer start | ||
| ``` | ||
|
|
||
| ## 4. Object Mapping Indexer | ||
|
|
||
| For setting up the object mapping indexer, you will need to provide the following config at `services/object-mapping-indexer/.env` | ||
|
|
||
| ```bash | ||
| NODE_RPC_URL=wss://rpc-0.mainnet.autonomys.xyz/ws # or your local | ||
| DATABASE_URL=postgres://postgres:postgres@localhost:5432/postgres | ||
| ``` | ||
|
|
||
| And, for launch it: | ||
|
|
||
| ```bash | ||
| make indexer | ||
| yarn indexer start | ||
| ``` | ||
|
|
||
| ## 5. File Retriever | ||
|
|
||
| Finally, the last piece of the files gateway is the file retriever which has the following config at `services/file-retriever/.env` | ||
|
|
||
| ```bash | ||
| SUBSPACE_GATEWAY_URLS=http://localhost:9955 | ||
| OBJECT_MAPPING_INDEXER_URL=http://localhost:3000 | ||
| VICTORIA_ACTIVE=false | ||
| VICTORIA_ENDPOINT=<victoria-endpoint> | ||
| VICTORIA_USERNAME=<victoria-username> | ||
| VICTORIA_PASSWORD=<victoria-password> | ||
| API_SECRET=random-secret # the apikey needed for file retrieval | ||
| CORS_ORIGIN=* | ||
| MAX_SIMULTANEOUS_FETCHES=10 # optional | ||
| CACHE_DIR=./.cache # optional | ||
| CACHE_MAX_SIZE=1024000000 # optional | ||
| CACHE_TTL=86400000 # optional | ||
|
|
||
| ``` | ||
|
|
||
| And, for launch it: | ||
|
|
||
| ```bash | ||
| make file-retriever | ||
| yarn file-retriever start | ||
| ``` | ||
|
|
||
| And with that files gateway would be fully deployed locally |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Profile Dependency Blocks Service Start
The
object-mapping-appservice, in theproductionprofile, depends onsubspace-node, which is in thenodeprofile. This cross-profile dependency meansobject-mapping-appwon't start when only theproductionprofile is active, as its dependency isn't available.