Getting the namespace information

Get the ownership and duration for a given namespace identifier.

Prerequisites

Method #01: Using the SDK

// replace with namespace name
const namespaceId = new NamespaceId('foo');
// replace with node endpoint
const nodeUrl = 'NODE_URL';
const repositoryFactory = new RepositoryFactoryHttp(nodeUrl);
const namespaceHttp = repositoryFactory.createNamespaceRepository();

namespaceHttp.getNamespace(namespaceId).subscribe(
  (namespaceInfo) => console.log(namespaceInfo),
  (err) => console.error(err),
);
// replace with namespace name
const namespaceId = new bitxor_sdk_1.NamespaceId('foo');
// replace with node endpoint
const nodeUrl = 'NODE_URL';
const repositoryFactory = new bitxor_sdk_1.RepositoryFactoryHttp(nodeUrl);
const namespaceHttp = repositoryFactory.createNamespaceRepository();
namespaceHttp.getNamespace(namespaceId).subscribe(
  (namespaceInfo) => console.log(namespaceInfo),
  (err) => console.error(err),
);
        try (final RepositoryFactory repositoryFactory = new RepositoryFactoryVertxImpl(
            "NODE_URL")) {
            // replace with namespace name
            final NamespaceId namespaceId = NamespaceId.createFromName("foo");

            final NamespaceRepository namespaceRepository = repositoryFactory
                .createNamespaceRepository();

            final NamespaceInfo namespaceInfo = namespaceRepository.getNamespace(namespaceId)
                .toFuture()
                .get();
            final JsonHelper helper = new JsonHelperJackson2();
            System.out.println(helper.prettyPrint(namespaceInfo));
        }
    }

Method #02: Using the CLI

bitxor-cli namespace info --namespace-name foo