diff --git a/site/source/docs/naming_configuration.md b/site/source/docs/naming_configuration.md index e6bf1617d9..2643c3bac1 100644 --- a/site/source/docs/naming_configuration.md +++ b/site/source/docs/naming_configuration.md @@ -8,9 +8,11 @@ We can configure different naming systems in Embark. In this guide we'll explore Embark checks our configuration in `config/namesystem.js` by default. A naming system configuration isn't crucial to run Embark, so this only needs to be enabled when planing to use a naming system. -When using ENS as our provider, we can set the `register` section to pre-register sub-domains. This feature is only available in the development environment: +When using ENS as our provider, we can set the `register` section to pre-register sub-domains. -``` +This feature is only available in the development environment: + +```javascript module.exports = { default: { enabled: true, @@ -28,3 +30,34 @@ module.exports = { } }; ``` + +### Parameters + +- `rootDomain`: The ENS domain. It gets registered using your default account +- `subdomains`: Object were the key is the subdomain name and the value is the address to set to it + +## Special configurations + +### $Contracts + +For subdomains, you can set the address as one of your contracts address using it's name prefixed by a dollar sign (`$`). + +``` +subdomains: { + 'contract': '$MyContract' +} +``` + +Now, assuming your `rootDomain` is `embark.eth`, `contract.embark.eth` will resolve to the deployed address of MyContract. + +### $accounts + +Similarly to `$Contract`, using `$accounts` let's you set the subdomain address to one of your accounts address. + +``` +subdomains: { + 'account': '$accounts[0]' +} +``` + +Now, assuming your `rootDomain` is `embark.eth`, `account.embark.eth` will resolve to address of your first (index 0) account (aka `defaultAccount`).