Generate Developer Account
Create your developer account
Now, that you have installed everything successfully and are able to run the node, let's create a developer account. You can stop the node for now by using the keyboard combination Control+C.
Generate your private key
You will need a private key for authorizing ComposeDB CLI commands in the later stages of development. You can generate it using the command below:
composedb did:generate-private-keyYou should see the output similar to the one below. Keep in mind that the key generated for your will be unique and will different from the example shown below:
✔ Generating random private key... Done!
5c7d2fa8ebc488f2fe008e5ed1db7f1f95c203434bbcbeb703491c405f6f31f0Copy and save this key securely for later use.
Note*
Store your private key securely - the key allows changes to be made to your app. In addition, you will need it throughout the app development process.
Generate your account
Indexing is one of the key features of ComposeDB. In order to notify the Ceramic node which models have to be indexed, the ComposeDB tools have to interact with the restricted Admin API. Calling the API requires an authenticated Decentralized Identifier (DID) to be provided in the node configuration file. Create a DID by running the following command, using the private key generated previously instead of the placeholder variable your-private-key:
composedb did:from-private-key your-private-keyYou should see the output similar to the one below. Here again, the DID created for you will be unique and will differ from the one shown below:
✔ Creating DID... Done!
did:key:z6MkoDgemAx51v8w692aZRLPdwP6UPKj3EgUhBTvbL7hCwLuThis key will be used to configure your node in the later steps of this guide.
The very first time you spin up a Ceramic node, a node configuration file is automatically created for you where you can configure how your node is operated. Here you have to provide the DID key which is authorised to interact with the Admin API. The Ceramic node configuration file will be created inside of the automatically created directory ./ceramic in your home directory (usually /home/USERNAME/ on Linux or /Users/USERNAME/ on Mac). This directory can be accessed using the following command:
cd ~/.ceramicInside of this directory you should find the following files:
daemon.config.json- your Ceramic node configuration filestatestore- a local directory for persisting the data
Open the daemon.config.json file using your preferred code editor and provide the authenticated DID, generated in the generate your account step of this guide, in the admin-dids section of the file as shown in the example below:
{
...
"http-api": {
...
"admin-dids": ["did:key:z6MkoDgemAx51v8w692aZRLPdwP6UPKj3EgUhBTvbL7hCwLu"]
},
"indexing": {
...
"allow-queries-before-historical-sync": true
}
}Save this file and start your Ceramic node again by following the steps in the Confirmation section of this guide.
As a final test, spin up the Ceramic local node:
ceramic daemon --network=testnet-clayOnce again, you should see your local Ceramic node up and running as follows:
IMPORTANT: Ceramic API running on 0.0.0.0:7007By this point you should have your development environment and all configurations in place to get started working on your application.
Last updated