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 = 'http://ngl-dual-101.testnet.symboldev.network:3000';
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 symbol_sdk_1.NamespaceId('foo');
// replace with node endpoint
const nodeUrl = 'http://ngl-dual-101.testnet.symboldev.network:3000';
const repositoryFactory = new symbol_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(
            "http://ngl-dual-101.testnet.symboldev.network:3000")) {
            // 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

symbol-cli namespace info --namespace-name foo

Did you find what you were looking for? Give us your feedback.