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()}, WalletConfig: params.WalletConfig{Enabled: randomBool()},
LocalNotificationsConfig: params.LocalNotificationsConfig{Enabled: randomBool()}, LocalNotificationsConfig: params.LocalNotificationsConfig{Enabled: randomBool()},
BrowsersConfig: params.BrowsersConfig{Enabled: randomBool()}, BrowsersConfig: params.BrowsersConfig{Enabled: randomBool()},
ENSConfig: params.ENSConfig{Enabled: randomBool()},
PermissionsConfig: params.PermissionsConfig{Enabled: randomBool()}, PermissionsConfig: params.PermissionsConfig{Enabled: randomBool()},
MailserversConfig: params.MailserversConfig{Enabled: randomBool()}, MailserversConfig: params.MailserversConfig{Enabled: randomBool()},
Web3ProviderConfig: params.Web3ProviderConfig{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.peerService())
services = append(services, b.personalService()) services = append(services, b.personalService())
services = append(services, b.statusPublicService()) services = append(services, b.statusPublicService())
services = append(services, b.ensService())
services = appendIf(config.EnableNTPSync, services, b.timeSource()) services = appendIf(config.EnableNTPSync, services, b.timeSource())
services = appendIf(b.appDB != nil && b.multiaccountsDB != nil, services, b.accountsService(accountsFeed)) services = appendIf(b.appDB != nil && b.multiaccountsDB != nil, services, b.accountsService(accountsFeed))
services = appendIf(config.BrowsersConfig.Enabled, services, b.browsersService()) 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.PermissionsConfig.Enabled, services, b.permissionsService())
services = appendIf(config.MailserversConfig.Enabled, services, b.mailserversService()) services = appendIf(config.MailserversConfig.Enabled, services, b.mailserversService())
services = appendIf(config.Web3ProviderConfig.Enabled, services, b.providerService()) 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, max_peers, max_pending_peers, enable_status_service, enable_ntp_sync,
bridge_enabled, wallet_enabled, local_notifications_enabled, bridge_enabled, wallet_enabled, local_notifications_enabled,
browser_enabled, permissions_enabled, mailservers_enabled, browser_enabled, permissions_enabled, mailservers_enabled,
swarm_enabled, mailserver_registry_address, web3provider_enabled, swarm_enabled, mailserver_registry_address, web3provider_enabled, synthetic_id
ens_enabled, synthetic_id
) VALUES ( ) VALUES (
?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,
?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,
?, ?, ?, ?, ?, ?, 'id' ?, ?, ?, ?, ?, 'id'
)`, )`,
c.NetworkID, c.DataDir, c.KeyStoreDir, c.NodeKey, c.NoDiscovery, c.Rendezvous, c.NetworkID, c.DataDir, c.KeyStoreDir, c.NodeKey, c.NoDiscovery, c.Rendezvous,
c.ListenAddr, c.AdvertiseAddr, c.Name, c.Version, c.APIModules, 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.BridgeConfig.Enabled, c.WalletConfig.Enabled, c.LocalNotificationsConfig.Enabled,
c.BrowsersConfig.Enabled, c.PermissionsConfig.Enabled, c.MailserversConfig.Enabled, c.BrowsersConfig.Enabled, c.PermissionsConfig.Enabled, c.MailserversConfig.Enabled,
c.SwarmConfig.Enabled, c.MailServerRegistryAddress, c.Web3ProviderConfig.Enabled, c.SwarmConfig.Enabled, c.MailServerRegistryAddress, c.Web3ProviderConfig.Enabled,
c.ENSConfig.Enabled,
) )
return err 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, 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, enable_status_service, enable_ntp_sync, bridge_enabled, wallet_enabled, local_notifications_enabled,
browser_enabled, permissions_enabled, mailservers_enabled, swarm_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' WHERE synthetic_id = 'id'
`).Scan( `).Scan(
&nodecfg.NetworkID, &nodecfg.DataDir, &nodecfg.KeyStoreDir, &nodecfg.NodeKey, &nodecfg.NoDiscovery, &nodecfg.Rendezvous, &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.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.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.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 { if err != nil && err != sql.ErrNoRows {
return nil, err return nil, err

View File

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