Context:
I followed the guide from this video and this docs to deploy a ceramic node on Digital Ocean.
Everything was working fine and curl http://[external_ip]:7007/api/v0/node/healthcheck
returns Alive!%.
Issues:
The issue is when I try to utilize the deployed assets following this guide, it will always return “fetch failed”.
When I tried to run composedb composite:create schema.graphql --output=composite.json
, an error “Error: An authenticated DID must be attached to the Ceramic instance” is thrown.
I tried to solve the error above by getting admin key using kubectl get secrets --namespace ceramic ceramic-admin -o json | jq -r '.data."private-key"' | base64 -d
and pass my admin key to run command composedb composite:create schema.graphql --output=composite.json --did-private-key=[my-admin-key]
It showed:
Using DID did:key:[my-admin-did]
⠋ Creating the composite…TypeError: fetch failed
Appreciate any help to enlighten me what I am overlooking, thanks!
Adding some additional info here:
[2024-05-19T19:07:56.727Z] IMPORTANT: Starting Ceramic Daemon with @ceramicnetwork/cli package version 5.12.0-rc.1, with js-ceramic repo git hash da5347580dc3853532927655dc9245793cc4acbc, and with config:
{
"anchor": {},
"http-api": {
"cors-allowed-origins": [
".*"
],
"admin-dids": [
"did:key:[my-admin-did]"
]
},
"ipfs": {
"mode": "remote",
"host": "http://ipfs:5001",
"disable-peer-data-sync": false
},
"logger": {
"log-level": 2,
"log-to-files": false
},
"metrics": {
"metrics-exporter-enabled": false
},
"network": {
"name": "testnet-clay"
},
"node": {},
"state-store": {
"mode": "fs",
"local-directory": "/ceramic-data"
},
"indexing": {
"db": "postgres://ceramic:8a78797c68eedd57a56b1e9bdc888d27f57f0a0b@postgres/ceramic",
"allow-queries-before-historical-sync": true,
"disable-composedb": false,
"enable-historical-sync": false
}
}
Hey @0xalthea. You are definitely taking the right steps of creating the admin did with the private key and providing the did key in your node configuration file. Just a few things that come to my mind at the moment:
-
Once you added your admin key to the configuration file (daemon.config.json) did you restart your node? It is necessary for the changes to take the effect.
-
Apologies if I am asking a bit obvious, but just wanted to double check how did you provide your admin did to the config file. Say, you got the following admin generated: did:key:z6MkoDgemAx51v8w692aZRLPdwP6UPKj3EgUhBTvbL7hCwLu
Can you confirm that your config file looks similar to this:
...
"http-api": {
...
"admin-dids": ["did:key:z6MkoDgemAx51v8w692aZRLPdwP6UPKj3EgUhBTvbL7hCwLu"]
},
- And very similar for providing the admin key - can you confirm that you are passing it without the brackets around it?
Hey @Justina, thanks for supporting me.
-
I didn’t manually add the admin key to the configuration file (daemon.config.json), instead I ran this command ./k8s/base/composedb/create-secrets.sh
to create the necessary secrets and kubectl apply -k k8s/base/composedb/
to apply the deployment. To answer your question, no I don’t think there was a restart step if I follow the guide.
-
Yes, I confirmed the http-api → admin-dids is an array of the admin dids in the format did:key:z6Mksomething
(the string started from z6Mk to the end contains 48 chars)
-
Yes, there is no bracket around it. I wanted to hide my admin did so I put bracket as placeholder.
Hey Justina, thanks for your help.
I re-created a cloud instance and it works nicely this time! I think one of the mistakes I made to cause the error above is I export CERAMIC_URL and DID_PRIVATE_KEY at the wrong location.
Sorry for bothering you with this stupid mistake.
1 Like
Hey @0xalthea. Amazing! I am glad it’s working. I was trying to replicate this last night, but it all seemed to work smoothly
There are no such things as stupid mistakes here! Always always reach out to us with any issues and problems you might be facing. And also, please keep us updated on your project progress, would love to know more what project you are building
2 Likes