Create a Database

Cedalio offers two methods for creating a database: through the studio interface or via our API (useful for the case of one database per user). In either case, a Wallet is required to serve as the owner of the database. The Wallet has exclusive privileges to modify the smart contract responsible for managing access control to the data. This wallet becomes essential for subsequent tasks such as signing up and obtaining a valid JWT necessary for executing operations against the schema.
Similarly, when accessing the explorer, you will have to authenticate using the same wallet that was employed during the creation of the database.

Create a database from the Studio

Once the project is created, you have to deploy a new database based on the provided GraphQL schema. Cedalio automatically creates all the resolvers and everything needed to start operating right away.

Create a database from Cedalio's API

For users opting for the user owned data strategy, deploying a new database is a part of the signup process for each new user. To accomplish this, the user must generate a valid JWT, which serves as the authorization token for database operations.
curl -H 'Authorization: Bearer $CEDALIO_JWT' "https://$PROJECT_ID.gtw.cedalio.io/deploy"
PROJECT_ID can be obtained from the project overview inside the Studio.
The response of this endpoint is immediate, while the background process of deploying the database and Smart Contract begins. To receive updates of deployment process, users have the option to subscribe to the Pusher channel using the corresponding DEPLOYMENT_ID.
By subscribing to the channel, users can stay up to date with incoming events DEPLOYMENT_STATUS_UPDATE, specifically the READY or FAILED messages, which indicate the progress and status of the Smart Contract deployment.
Pusher event example
"channel": "c497772d-1e37-43f2-be80-03bcccd1ae9c"