To get started with Akash Console, follow these steps:
git clone git@github.com:akash-network/console.git ./akash-console
cd akash-console
npm run dc:up:dev -- deploy-web
This will start the deploy-web service in development mode with all the necessary dependencies (API, indexer, PostgreSQL). It will also import a backup of the sandbox database by default to speed up the process.
All services are Node.js applications written in TypeScript and deployed using Docker. Both databases are PostgreSQL.
This document provides instructions on how to set up and run the application, including steps for manual database restoration and using Docker Compose for ease of setup.
This project's service are deployed using Docker and Docker Compose. The following sections provide instructions for setting up and running the application using Docker Compose. All the Dockerfiles are using multi-stage builds to optimize the image build processes. Same files are used to build both development and production images.
There are 3 docker-compose files:
Some commands are added to package.json for convenience.
npm run dc:build # Build the production images
npm run dc:up:prod # Run the services in production mode
npm run dc:up:dev # Run the services in development mode
npm run dc:down # Stop the services referencing any possible service
Note: you may pass any docker compose
related arguments to the above commands. E.g. to only start deploy-web
service in development mode:
npm run dc:up:dev -- deploy-web
This would also properly spin up all the dependencies like the api
.
Another way to run apps in dev mode is using turbo repo setup. Some available commands are:
npm run console:dev # run console ui in dev mode with dependencies
npm run stats:dev # run stats ui in dev mode with dependencies
npm run api:dev # run api in dev mode with dependencies
npm run indexer:dev # run indexer in dev mode with dependencies
Note the above commands still depend on docker to run postgres database. If you need to run them without db you can use the following commands:
npm run console:dev:no-db # run console ui in dev mode with dependencies but without postgres in docker
npm run stats:dev:no-db # run stats ui in dev mode with dependencies but without postgres in docker
Due to the extensive time required to index Akash from block #1, it's recommended to initialize your database using an existing backup for efficiency. This approach is particularly beneficial for development purposes.
psql
. Ensure PostgreSQL tools are installed on your system.For a .sql.gz file:
gunzip -c /path/to/console-akash-sandbox.sql.gz | psql --host "localhost" --port "5432" --username "postgres" --dbname "console-akash"
After restoring the database, you can proceed with the specific project's README instructions for further setup and running the application.
This project is structured as a monorepo, allowing us to manage multiple related applications and shared packages in a single repository.
We utilize a /packages
folder to define reusable packages that can be shared between applications. This approach promotes code reuse, maintainability, and consistency across our services. Some examples of shared packages include:
By leveraging this monorepo structure with shared packages, we can efficiently manage dependencies, streamline development workflows, and ensure consistency across our various applications.
For more information on how to use or contribute to shared packages, please refer to the code within each package in the /packages
directory.
If you'd like to contribute to the development of Akash Console, please refer to the guidelines outlined in the CONTRIBUTING.md file.
This project is licensed under the Apache License 2.0.