Create a unique name to identify your assets.
symbol.xym
to pay for transaction fees.3. Enter the information for your new namespace. Click “Send”. Verify the information on the popup and enter your wallet password. Click “Confirm”.
Note
The name must be unique in the network, and may have a maximum length of 64 characters, and the allowed characters are a, b, c, …, z, 0, 1, 2, …, 9, _ , -.
4. You can check that the namespace has been created by going back to the “Owned namespaces” tab. If you don’t see your namespace, try clicking on the update icon.
Note
To keep the ownership of your namespace, you will have to extend its duration before it expires.
When the transaction is confirmed, you can register a subnamespace following the next guide.
symbol-cli namespace info --namespace-name foo
// replace with namespace name
const namespaceName = 'foo';
// replace with duration (in blocks)
const duration = UInt64.fromUint(172800);
// replace with network type
const networkType = NetworkType.TEST_NET;
const namespaceRegistrationTransaction = NamespaceRegistrationTransaction.createRootNamespace(
Deadline.create(),
namespaceName,
duration,
networkType,
UInt64.fromUint(2000000));
// replace with private key
const privateKey = '1111111111111111111111111111111111111111111111111111111111111111';
const account = Account.createFromPrivateKey(privateKey, networkType);
// replace with meta.networkGenerationHash (nodeUrl + '/node/info')
const networkGenerationHash = '1DFB2FAA9E7F054168B0C5FCB84F4DEB62CC2B4D317D861F3168D161F54EA78B';
const signedTransaction = account.sign(namespaceRegistrationTransaction, networkGenerationHash);
// replace with node endpoint
const nodeUrl = 'http://api-01.us-east-1.096x.symboldev.network:3000';
const repositoryFactory = new RepositoryFactoryHttp(nodeUrl);
const transactionHttp = repositoryFactory.createTransactionRepository();
transactionHttp
.announce(signedTransaction)
.subscribe((x) => console.log(x), (err) => console.error(err));
// replace with namespace name
const namespaceName = 'foo';
// replace with duration (in blocks)
const duration = symbol_sdk_1.UInt64.fromUint(172800);
// replace with network type
const networkType = symbol_sdk_1.NetworkType.TEST_NET;
const namespaceRegistrationTransaction = symbol_sdk_1.NamespaceRegistrationTransaction.createRootNamespace(symbol_sdk_1.Deadline.create(), namespaceName, duration, networkType, symbol_sdk_1.UInt64.fromUint(2000000));
// replace with private key
const privateKey = '1111111111111111111111111111111111111111111111111111111111111111';
const account = symbol_sdk_1.Account.createFromPrivateKey(privateKey, networkType);
// replace with meta.networkGenerationHash (nodeUrl + '/node/info')
const networkGenerationHash = '1DFB2FAA9E7F054168B0C5FCB84F4DEB62CC2B4D317D861F3168D161F54EA78B';
const signedTransaction = account.sign(namespaceRegistrationTransaction, networkGenerationHash);
// replace with node endpoint
const nodeUrl = 'http://api-01.us-east-1.096x.symboldev.network:3000';
const repositoryFactory = new symbol_sdk_1.RepositoryFactoryHttp(nodeUrl);
const transactionHttp = repositoryFactory.createTransactionRepository();
transactionHttp
.announce(signedTransaction)
.subscribe((x) => console.log(x), (err) => console.error(err));
Note
To keep the ownership of your namespace, you will have to extend its duration before it expires.
To create a new namespace, open a terminal window and run the following command.
Replace foo
with the chosen namespace name and 172800
with the namespace duration expressed in blocks.
symbol-cli transaction namespace --name foo --rootnamespace --duration 172800
Did you find what you were looking for? Give us your feedback.