Composites deployment
Valid composites can be deployed to any supporting Ceramic node, by ensuring the model streams described in the composite are available on the node, and that the node is configured to index theses models.
Models deployment
- Using the CLI
- Using the API
Make sure you have the composedb
packages installed, before running the code below.
import { CeramicClient } from '@ceramicnetwork/http-client'
import { readEncodedComposite } from '@composedb/devtools-node'
// Replace by the URL of the Ceramic node you want to deploy the models to
const ceramic = new CeramicClient('http://localhost:7007')
// Replace by the path to the local encoded composite file
const composite = await readEncodedComposite(ceramic, 'my-composite.json')
console.log('Model IDs to set in configuration:', composite.modelIDs)
First, we need to ensure the model streams are available on the target Ceramic node:
composedb composite:deploy my-composite.json --ceramic-url=http://localhost:7007
Then, we need to get the list of models that need to be set for indexing in the Ceramic node configuration:
composedb composite:models my-composite.json
Ceramic node configuration
The local Ceramic node then needs to be configured to index documents using the models listed in the previous step.
This can be done by editing Ceramic's config file, which defaults to ~/.ceramic/daemon.config.json
on Linux, macOS and WSL (Windows Subsystem for Linux), adding the necessary model stream IDs to the indexing.models
array:
{
...
"indexing": {
...
"models": ["..."]
}
}