This repository contains the KILT driver source code for the DIF Universal Resolver. For the official KILT DID specification, please visit the relative section.
The driver is meant to be run as a driver for the DIF Universal Resolver. Nevertheless, it can also be run locally either as an HTTP server or a Docker container.
Install the dependencies with yarn
, then start the HTTP server with either yarn start
to connect the driver to the official Spiritnet network or yarn start:testnet
to connect it to the Peregrine testnet.
By default, the server will listen on port 8080.
To build and run the driver as a Docker container:
docker build -t kiltprotocol/kilt-did-driver .
# Map the container port 8080 to the host port 49160
docker run -p 49160:8080 --name kiltprotocol-did-driver -d kiltprotocol/kilt-did-driver:latest
# See the logs for the container
docker logs -f kiltprotocol-did-driver
To pull the Docker image from DockerHub, run:
# Pull the image
docker pull kiltprotocol/kilt-did-driver:latest
# Run the image, as in the previous section
docker run -p 49160:8080 --name kiltprotocol-did-driver -d kiltprotocol/kilt-did-driver:latest
# See the logs for the container
docker logs -f kiltprotocol-did-driver
An example command to resolve a KILT DID via the driver running on port 8080 is the following:
curl -X GET http://localhost:8080/1.0/identifiers/did:kilt:4rNTX3ihuxyWkB7wG3oLgUWSBLa2gva1NBKJsBFm7jJZUYfc
Expected output:
{
"didResolutionMetadata": {
"pattern": "^(did:kilt:.+)$",
"driverUrl": "http://kilt-did-driver:8080/1.0/identifiers/",
"duration": 292,
"did": {
"didString": "did:kilt:4rNTX3ihuxyWkB7wG3oLgUWSBLa2gva1NBKJsBFm7jJZUYfc",
"methodSpecificId": "4rNTX3ihuxyWkB7wG3oLgUWSBLa2gva1NBKJsBFm7jJZUYfc",
"method": "kilt"
},
"contentType": "application/did+ld+json",
"convertedFrom": "application/did+json",
"convertedTo": "application/did+ld+json"
},
"didDocument": {
"id": "did:kilt:4rNTX3ihuxyWkB7wG3oLgUWSBLa2gva1NBKJsBFm7jJZUYfc",
"verificationMethod": [
{
"id": "did:kilt:4rNTX3ihuxyWkB7wG3oLgUWSBLa2gva1NBKJsBFm7jJZUYfc#0x1c1dcca1a29abc3538294e2d746853349bc43d781de4fa013b6cef473e196dff",
"controller": "did:kilt:4rNTX3ihuxyWkB7wG3oLgUWSBLa2gva1NBKJsBFm7jJZUYfc",
"type": "Ed25519VerificationKey2018",
"publicKeyBase58": "BHbmtWMReQ1rDMZryWKYSwjgtMo7WYnTWKJKdgNWDUYa"
}
],
"authentication": [
"did:kilt:4rNTX3ihuxyWkB7wG3oLgUWSBLa2gva1NBKJsBFm7jJZUYfc#0x1c1dcca1a29abc3538294e2d746853349bc43d781de4fa013b6cef473e196dff"
]
},
"didDocumentMetadata": {
"deactivated": false
}
}