OrbisDB connects you to the GraphQL system that manages your Web3 data using the Ceramic network.
- Available Scripts
- Development Workflow
- Getting Started
- Docker-Based Development
- Prerequisites
- Build and Run Instructions
- Ceramic Installation
- Exposed Ports
- Starting the Server
- Connecting to the Ceramic Network
{
"build": "cd client && next build",
"start": "cross-env NODE_ENV=production node index.js",
"dev": "node index.js",
"clean": "rm -rf client/.next",
"clear-port": ".bin/clear_ports.sh",
"publish:npm": "npm publish --access public",
"publish:docker": "docker buildx build --platform linux/arm64,linux/amd64 -t orbisdb-fileconnector:latest . && docker push orbisdb-fileconnector:latest",
"lint": "eslint .",
"clean:all": "rm -rf client/.next client/node_modules",
"publish": "npm run build && npm run docker:restart",
"test": "echo \"Error: no test specified\" && exit 1",
"dev:docker": "npm run docker:start && node index.js",
"dev:debug": "cross-env LOG_LEVEL=debug node index.js",
"dev:watch": "nodemon --ignore '*.json' index.js",
"format": "prettier . --write",
"docker:start": "docker start orbisdb-pgvector || docker run -d --name orbisdb-pgvector -e POSTGRES_PASSWORD=postgres -p 5432:5431 pgvector/pgvector:0.7.4-pg16",
"docker:stop": "docker stop orbisdb-pgvector",
"docker:restart": "npm run docker:stop && npm run docker:start || npm run docker:start",
"docker:remove": "docker rm orbisdb-pgvector || docker stop orbisdb-pgvector && docker rm orbisdb-pgvector",
"docker:status": "docker ps"
}build: Builds the Next.js client applicationstart: Runs the application in production modedev: Starts the development serverclean: Removes the Next.js build cacheclear-port: Executes a script to free up ports used by the applicationpublish:npm: Publishes the package to npm with public accesspublish:docker: Builds and publishes a multi-architecture Docker imagelint: Runs ESLint to check code qualityclean:all: Removes both the Next.js build cache and node_modulespublish: Builds the application and restarts the Docker containertest: Placeholder for running tests (currently not implemented)dev:docker: Starts the Docker container and runs the development serverdev:debug: Runs the development server with debug logging enableddev:watch: Runs the development server with file watching (auto-restart)format: Formats code using Prettierdocker:start: Starts the pgvector Docker container or creates it if it doesn't existdocker:stop: Stops the pgvector Docker containerdocker:restart: Restarts the pgvector Docker containerdocker:remove: Removes the pgvector Docker containerdocker:status: Shows the status of Docker containers
cd server
./wheelThis command executes the wheel script which is a utility for setting up and managing a Ceramic-based application.
When running the setup script, you'll be prompted to confirm several configuration settings:
- Project Name: Confirm or change the default project name (default: "ceramic-app")
- Project Directory: Confirm if the directory exists or create it
- Network: Choose whether to use the
InMemorynetwork for testing - Ceramic Integration: Confirm if Ceramic should be included in the setup
- ComposeDB Integration: Confirm if ComposeDB should be included
- Sample Application: Choose whether to include a ComposeDB sample application
- DID Secret Key Path: Provide a path to save the DID secret key
- Configuration Review: Final confirmation of all settings
The script verifies the connection to the SQLite database:
Verifying database connection using connection string sqlite:///path/to/project/ceramic-app/ceramic-indexing/ceramic.dbConfiguration files are saved to your project directory:
Saving config to /path/to/project/ceramic-app/ceramic.json
Saving daemon file to /path/to/project/ceramic-app/daemon_config.jsonThe script installs required dependencies:
+ Installing dependencies for @ceramicnetwork/cliAfter installation, you can run Ceramic with:
./ceramic daemon --config /path/to/project/ceramic-app/daemon_config.jsonRun this from the project directory (e.g., /path/to/project/ceramic-app).
cd server
./wheelThis command executes the wheel script which is a utility for setting up and managing a Ceramic-based application.
When running the setup script, you'll be prompted to confirm several configuration settings:
- Project Name: Confirm or change the default project name (default: "ceramic-app")
- Project Directory: Confirm if the directory exists or create it
- Network: Choose whether to use the
InMemorynetwork for testing - Ceramic Integration: Confirm if Ceramic should be included in the setup
- ComposeDB Integration: Confirm if ComposeDB should be included
- Sample Application: Choose whether to include a ComposeDB sample application
- DID Secret Key Path: Provide a path to save the DID secret key
- Configuration Review: Final confirmation of all settings
The script verifies the connection to the SQLite database:
Verifying database connection using connection string sqlite:///path/to/project/ceramic-app/ceramic-indexing/ceramic.dbConfiguration files are saved to your project directory:
Saving config to /path/to/project/ceramic-app/ceramic.json
Saving daemon file to /path/to/project/ceramic-app/daemon_config.jsonThe script installs required dependencies:
+ Installing dependencies for @ceramicnetwork/cliAfter installation, you can run Ceramic with:
./ceramic daemon --config /path/to/project/ceramic-app/daemon_config.jsonRun this from the project directory (e.g., /path/to/project/ceramic-app).
The OrbisDB project uses Next.js for the client application and supports various development workflows.
-
Standard development:
npm run dev
This starts the server in development mode.
-
Development with auto-restart:
npm run dev:watch
This uses nodemon to watch for file changes and restart the server automatically.
-
Debug mode:
npm run dev:debug
This enables detailed logging for troubleshooting.
-
Build the client application:
npm run build
-
Start in production mode:
npm run start
-
Publish to npm:
npm run publish:npm
-
Build and publish Docker image:
npm run publish:docker
This builds a multi-architecture Docker image (arm64 and amd64) and pushes it to your Docker repository.
-
Clean Next.js build cache:
npm run clean
-
Clean all build artifacts and dependencies:
npm run clean:all
-
Format code:
npm run format
-
Lint code:
npm run lint
-
Clear ports:
npm run clear-port
This runs a script to free up ports that might be in use.
Set the following in a .env file or export in your shell:
POSTGRES_USER: Database username (default:user)POSTGRES_PASSWORD: Database password (default:password)
Ensure you have installed:
- Docker version 20.10 or later
- Docker Compose version 1.29 or later
- Node.js version 18.0.0 or later
- Windows 10/11 with WSL2 (Windows Subsystem for Linux) enabled
- Docker Desktop for Windows with WSL2 backend
- Git Bash or PowerShell for running commands
-
Clone the repository and navigate to the project directory:
Linux/MacOS:
git clone https://github.com/your-repo/project.git cd projectWindows (PowerShell):
git clone https://github.com/your-repo/project.git cd project
Windows (Command Prompt):
git clone https://github.com/your-repo/project.git cd project
brew install ceramicnetwork/tap/ceramic-one
ceramic-one daemon --network in-memory-
Install Node.js and npm: Download and install from Node.js official website (version 18.0.0 or later)
-
Install Ceramic CLI:
npm install -g @ceramicnetwork/cli
-
Generate a DID (Decentralized Identifier):
ceramic did:generate
-
Start the Ceramic daemon:
ceramic daemon --network inmemory
For persistent storage, configure a state store:
ceramic daemon --network mainnet --state-store=<path-to-state-store>
- Application:
7008 - Database: Not externally exposed
Navigate to the project directory and run:
cd docker/core/
docker-compose up -dThis starts the services in detached mode.
[INFO] Starting ceramic-one daemon...
[INFO] Ceramic Node started: /path/to/project/ceramic/node-12700
[INFO] Listening for incoming connections on port 3001...Access the Ceramic container shell:
cd docker/core/
docker-compose exec -it ceramic-one /bin/bash-
Install
ceramic-cli: Follow the installation instructions -
Generate a Ceramic ID:
Linux/MacOS:
ceramic id
Windows:
ceramic id
-
Initialize OrbisDB:
Linux/MacOS:
pnpm run init --ceramic-id <ceramic-id>
Windows:
pnpm run init --ceramic-id <ceramic-id>
If you don't have pnpm installed, you can install it first:
npm install -g pnpm -
Start the Application: Follow the server startup instructions above
-
Path Issues: If you encounter "command not found" errors, ensure the installation directory is in your PATH environment variable.
-
Permission Errors: Run PowerShell or Command Prompt as Administrator if you encounter permission issues.
-
WSL Integration: For optimal performance on Windows, consider running Ceramic within WSL2:
wsl cd /path/to/project ceramic daemon --network inmemory -
Docker Connection Issues: Ensure Docker Desktop is running with WSL2 integration enabled in settings.