Skip to content

Commit

Permalink
doc(@embark/ens): document $accounts for ENS configuration
Browse files Browse the repository at this point in the history
Adds docs for $accounts in subdomain registers and improve the docs
  • Loading branch information
jrainville committed Feb 5, 2020
1 parent 61488c3 commit 6eb2c3c
Showing 1 changed file with 35 additions and 2 deletions.
37 changes: 35 additions & 2 deletions site/source/docs/naming_configuration.md
Expand Up @@ -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,
Expand All @@ -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`).

0 comments on commit 6eb2c3c

Please sign in to comment.