Self-host ceramic node
You can use the sandbox ceramic node provided by Meteor for testing and learning. But if you want to deploy your application in production, we suggest you to run your own ceramic node.
dapp-backend
(opens in a new tab) is a git repo we're providing to help you deploy a meteor-gated
ceramic node in an easy way. This section is for developers who want to run their own
ceramic node in production. If you just want to use Meteor for testing or learning, you can skip this section.
requirements:
Step 1: Clone this repo
git clone https://github.com/meteor-web3/dapp-backend
cd dapp-backend
Step 2: Generate private key and Admin DID
To generate and fill the private key and admin DID into .private-key.env
and daemon.config.json
automatically:
under dapp-backend/
docker run -it --rm \
-v "$PWD/.private-key.env:/data/.private-key.env" \
-v "$PWD/daemon.config.json:/data/daemon.config.json" \
meteor/dapp-backend-prerun:latest
Example Result
✔ Generating random private key... Done!
8053f2d22cb3da5f84b6f079eb40cdc49958a7da269de3610e63e8b8078f1448
✔ Creating DID... Done!
did:key:z6MkiM1beKfKoNAS5cqHTFMrWAqqHkdb7meMqMBurDDgnTRn
Keep your private key safe. You will need it to use the ceramic node.
Step 3: Configure your ceramic node
copy the config to ceramic config folder
under dapp-backend/
mkdir ~/.ceramic
cp ./daemon.config.json ~/.ceramic/daemon.config.json
Step 4: Run ceramic node
docker-compose up -d
This command will start the ceramic node on port 7007
and the dapp-backend server on 8080
. You can change the port to use by changing the port in the docker-compose.yml file.
Configure SSL certificate
To let your app connect to the ceramic node safely, you need to configure SSL certificate. You can use Let's Encrypt (opens in a new tab) to get a free SSL certificate.
[Optional] Run ceramic node on the mainnet
Verify your email address
curl --request POST \
--url https://cas.3boxlabs.com/api/v0/auth/verification \
--header 'Content-Type: application/json' \
--data '{"email": "youremailaddress"}'
Then check your email and copy the one time passcode enclosed within. It will be a string of letters and numbers similar to this: 2451cc10-5a39-494d-b8eb-1971ecd813de.
Send a revocation request
curl --request POST \
--url https://cas.3boxlabs.com/api/v0/auth/did \
--header 'Content-Type: application/json' \
--data '{
"email": "youremailaddress",
"otp": "youronetimepasscode",
"dids": [
"yourdid"
]
}'