From ac31ccc0807a2f9cdb090a9aafb99a86ab5a12a1 Mon Sep 17 00:00:00 2001 From: andrey Date: Wed, 26 Jan 2022 12:45:04 +0100 Subject: [PATCH] enable ens service by default --- appdatabase/node_config_test.go | 1 - node/status_node_services.go | 2 +- nodecfg/node_config.go | 10 ++++------ params/config.go | 8 -------- 4 files changed, 5 insertions(+), 16 deletions(-) diff --git a/appdatabase/node_config_test.go b/appdatabase/node_config_test.go index aae7e9de8..98ee331b5 100644 --- a/appdatabase/node_config_test.go +++ b/appdatabase/node_config_test.go @@ -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()}, diff --git a/node/status_node_services.go b/node/status_node_services.go index d0132701d..6186500ee 100644 --- a/node/status_node_services.go +++ b/node/status_node_services.go @@ -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()) diff --git a/nodecfg/node_config.go b/nodecfg/node_config.go index 9f1327076..4876c006f 100644 --- a/nodecfg/node_config.go +++ b/nodecfg/node_config.go @@ -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 diff --git a/params/config.go b/params/config.go index 975ac9c8f..3743613d9 100644 --- a/params/config.go +++ b/params/config.go @@ -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