enable ens service by default

This commit is contained in:
andrey 2022-01-26 12:45:04 +01:00 committed by flexsurfer
parent fbbcb022f0
commit ac31ccc080
4 changed files with 5 additions and 16 deletions

View File

@ -206,7 +206,6 @@ func randomNodeConfig() *params.NodeConfig {
WalletConfig: params.WalletConfig{Enabled: randomBool()},
LocalNotificationsConfig: params.LocalNotificationsConfig{Enabled: randomBool()},
BrowsersConfig: params.BrowsersConfig{Enabled: randomBool()},
ENSConfig: params.ENSConfig{Enabled: randomBool()},
PermissionsConfig: params.PermissionsConfig{Enabled: randomBool()},
MailserversConfig: params.MailserversConfig{Enabled: randomBool()},
Web3ProviderConfig: params.Web3ProviderConfig{Enabled: randomBool()},

View File

@ -64,10 +64,10 @@ func (b *StatusNode) initServices(config *params.NodeConfig) error {
services = append(services, b.peerService())
services = append(services, b.personalService())
services = append(services, b.statusPublicService())
services = append(services, b.ensService())
services = appendIf(config.EnableNTPSync, services, b.timeSource())
services = appendIf(b.appDB != nil && b.multiaccountsDB != nil, services, b.accountsService(accountsFeed))
services = appendIf(config.BrowsersConfig.Enabled, services, b.browsersService())
services = appendIf(config.ENSConfig.Enabled, services, b.ensService())
services = appendIf(config.PermissionsConfig.Enabled, services, b.permissionsService())
services = appendIf(config.MailserversConfig.Enabled, services, b.mailserversService())
services = appendIf(config.Web3ProviderConfig.Enabled, services, b.providerService())

View File

@ -43,12 +43,11 @@ func insertNodeConfig(tx *sql.Tx, c *params.NodeConfig) error {
max_peers, max_pending_peers, enable_status_service, enable_ntp_sync,
bridge_enabled, wallet_enabled, local_notifications_enabled,
browser_enabled, permissions_enabled, mailservers_enabled,
swarm_enabled, mailserver_registry_address, web3provider_enabled,
ens_enabled, synthetic_id
swarm_enabled, mailserver_registry_address, web3provider_enabled, synthetic_id
) VALUES (
?, ?, ?, ?, ?, ?, ?, ?, ?, ?,
?, ?, ?, ?, ?, ?, ?, ?, ?, ?,
?, ?, ?, ?, ?, ?, 'id'
?, ?, ?, ?, ?, 'id'
)`,
c.NetworkID, c.DataDir, c.KeyStoreDir, c.NodeKey, c.NoDiscovery, c.Rendezvous,
c.ListenAddr, c.AdvertiseAddr, c.Name, c.Version, c.APIModules,
@ -57,7 +56,6 @@ func insertNodeConfig(tx *sql.Tx, c *params.NodeConfig) error {
c.BridgeConfig.Enabled, c.WalletConfig.Enabled, c.LocalNotificationsConfig.Enabled,
c.BrowsersConfig.Enabled, c.PermissionsConfig.Enabled, c.MailserversConfig.Enabled,
c.SwarmConfig.Enabled, c.MailServerRegistryAddress, c.Web3ProviderConfig.Enabled,
c.ENSConfig.Enabled,
)
return err
}
@ -396,14 +394,14 @@ func loadNodeConfig(tx *sql.Tx) (*params.NodeConfig, error) {
listen_addr, advertise_addr, name, version, api_modules, tls_enabled, max_peers, max_pending_peers,
enable_status_service, enable_ntp_sync, bridge_enabled, wallet_enabled, local_notifications_enabled,
browser_enabled, permissions_enabled, mailservers_enabled, swarm_enabled,
mailserver_registry_address, web3provider_enabled, ens_enabled FROM node_config
mailserver_registry_address, web3provider_enabled FROM node_config
WHERE synthetic_id = 'id'
`).Scan(
&nodecfg.NetworkID, &nodecfg.DataDir, &nodecfg.KeyStoreDir, &nodecfg.NodeKey, &nodecfg.NoDiscovery, &nodecfg.Rendezvous,
&nodecfg.ListenAddr, &nodecfg.AdvertiseAddr, &nodecfg.Name, &nodecfg.Version, &nodecfg.APIModules, &nodecfg.TLSEnabled, &nodecfg.MaxPeers, &nodecfg.MaxPendingPeers,
&nodecfg.EnableStatusService, &nodecfg.EnableNTPSync, &nodecfg.BridgeConfig.Enabled, &nodecfg.WalletConfig.Enabled, &nodecfg.LocalNotificationsConfig.Enabled,
&nodecfg.BrowsersConfig.Enabled, &nodecfg.PermissionsConfig.Enabled, &nodecfg.MailserversConfig.Enabled, &nodecfg.SwarmConfig.Enabled,
&nodecfg.MailServerRegistryAddress, &nodecfg.Web3ProviderConfig.Enabled, &nodecfg.ENSConfig.Enabled,
&nodecfg.MailServerRegistryAddress, &nodecfg.Web3ProviderConfig.Enabled,
)
if err != nil && err != sql.ErrNoRows {
return nil, err

View File

@ -458,9 +458,6 @@ type NodeConfig struct {
// BrowsersConfig extra configuration for browsers.Service.
BrowsersConfig BrowsersConfig
// ENSConfig extra configuration for ens.Service.
ENSConfig ENSConfig `json:"EnsConfig" validate:"structonly"`
// PermissionsConfig extra configuration for permissions.Service.
PermissionsConfig PermissionsConfig
@ -519,11 +516,6 @@ type BrowsersConfig struct {
Enabled bool
}
// ENSConfig extra configuration for ens.Service.
type ENSConfig struct {
Enabled bool
}
// PermissionsConfig extra configuration for permissions.Service.
type PermissionsConfig struct {
Enabled bool