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
JWTnecessary for executing operations against the schema.
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.
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"
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
By subscribing to the channel, users can stay up to date with incoming events
DEPLOYMENT_STATUS_UPDATE, specifically the
FAILEDmessages, which indicate the progress and status of the Smart Contract deployment.
Pusher event example