Creates a new DID document entry for a given DID in the Knox Registry Management Service.
rpc Create
Create
registry_api.v1.Create
registry_api.v1.Create
Creates a new DID document entry for a given DID in the Knox Registry Management Service.
requests CreateRequest
CreateRequest
registry_api.v1.CreateRequest
registry_api.v1.CreateRequest
Field | Type | Description |
---|---|---|
did | string | W3C Decentralized Identifier (DID) of the wallet. |
document | string | A set of data containing mechanisms to verify the DID and discover related services. |
resp, _ := registryService.Create(ctx, &v1.CreateRequest{
Did: "did:method-name:zDIDMultibase58Encoded",
Document: "DOCUMENT",
})
fmt.Println(resp)
const createrequest = new CreateRequest();
createrequest.setDid("did:method-name:zDIDMultibase58Encoded");
createrequest.setDocument("DOCUMENT");
service.create(createrequest, (err, value:CreateResponse|null) => {
const resp = JSON.stringify(err ? err : value);
console.log("received ", resp);
})
using System;
using Grpc.Core;
using RegistryApi.V1;
namespace main
{
class Program
{
static void Main(string[] args)
{
Channel channel = new Channel("reg.YOUR_SANDBOX_ID.knoxnetworks.io:443", ChannelCredentials.Insecure);
var client = new RegistryService.RegistryServiceClient(channel);
var headers = new Metadata();
var createRequest = new CreateRequest{
Did = "did:method-name:zDIDMultibase58Encoded",
Document = "DOCUMENT",
};
var reply = client.Create(createRequest, headers);
Console.WriteLine("Response: " + reply);
channel.ShutdownAsync().Wait();
}
}
}
package demo;
import io.grpc.Channel;
import io.grpc.ManagedChannel;
import io.grpc.ManagedChannelBuilder;
import registry_api.v1.Registry.CreateRequest;
import registry_api.v1.Registry.CreateResponse;
import registry_api.v1.RegistryServiceGrpc;
public class App {
public static void main(String[] args) {
ManagedChannel channel = ManagedChannelBuilder
.forAddress("reg.YOUR_SANDBOX_ID.knoxnetworks.io", 443)
.usePlaintext()
.build();
RegistryServiceGrpc.RegistryServiceBlockingStub blockStub =
RegistryServiceGrpc.newBlockingStub(channel);
CreateRequest req_CreateRequest =
CreateRequest.newBuilder()
.setDid("did:method-name:zDIDMultibase58Encoded")
.setDocument("DOCUMENT")
.build();
CreateResponse resp = blockStub.create(req_CreateRequest);
System.out.println(resp);
channel.shutdown();
}
}
const createrequest = new CreateRequest();
createrequest.setDid("did:method-name:zDIDMultibase58Encoded");
createrequest.setDocument("DOCUMENT");
service.create(createrequest, (err, value) => {
const resp = JSON.stringify(err ? err : value);
console.log("received ", resp);
})
extern crate grpc-sdks;
use tonic::transport::Channel;
use grpc-sdks::registry_api::v1::registry_service_client::RegistryServiceClient;
use grpc-sdks::registry_api::v1::CreateRequest;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let channel = Channel::from_static("reg.YOUR_SANDBOX_ID.knoxnetworks.io")
.connect()
.await?;
let mut client = RegistryServiceClient::new(channel);
let request = tonic::Request::new(
CreateRequest{
did: String::from("did:method-name:zDIDMultibase58Encoded"),
document: String::from("DOCUMENT")
});
// sending request and waiting for response
let response = client.create(request).await?.into_inner();
println!("RESPONSE={:?}", response);
Ok(())
}
package app
import io.grpc.ManagedChannelBuilder
import registry_api.v1.Registry.CreateRequest
import registry_api.v1.Registry.CreateResponse
import registry_api.v1.RegistryServiceGrpc
fun main() {
val channel = ManagedChannelBuilder
.forAddress("reg.YOUR_SANDBOX_ID.knoxnetworks.io", 443)
.usePlaintext()
.build()
var blockStub = RegistryServiceGrpc.newBlockingStub(channel)
val req_CreateRequest = CreateRequest.newBuilder()
.setDid("did:method-name:zDIDMultibase58Encoded")
.setDocument("DOCUMENT")
.build()
val resp = blockStub.create(req_CreateRequest)
println(resp)
channel.shutdown()
}
returns CreateResponse
CreateResponse
registry_api.v1.CreateResponse
registry_api.v1.CreateResponse
{}