func (self *ENSLiteClient) Stop() {
	self.node.Stop()
}
Stop the SPV node
package ens
import (
	"encoding/json"
	"fmt"
	"github.com/ethereum/go-ethereum"
	"github.com/ethereum/go-ethereum/common"
	"github.com/ethereum/go-ethereum/eth"
	"github.com/ethereum/go-ethereum/eth/downloader"
	"github.com/ethereum/go-ethereum/ethclient"
	"github.com/ethereum/go-ethereum/ethstats"
	"github.com/ethereum/go-ethereum/les"
	"github.com/ethereum/go-ethereum/mobile"
	"github.com/ethereum/go-ethereum/p2p"
	"github.com/ethereum/go-ethereum/p2p/discv5"
	"path/filepath"
	ens "github.com/Arachnid/ensdns/ens"
	"context"
	"errors"
	"github.com/ethereum/go-ethereum/accounts/abi/bind"
	"github.com/ethereum/go-ethereum/core"
	"github.com/ethereum/go-ethereum/node"
	"github.com/ethereum/go-ethereum/p2p/nat"
	"github.com/ethereum/go-ethereum/params"
	ens2 "github.com/ethereum/go-ethereum/contracts/ens"
	"github.com/miekg/dns"
)
var ErrorBlockchainSyncing error = errors.New("Cannot resolve names while the chain is syncing")
var ErrorNodeInitializing error = errors.New("Node is still initializing")
var ErrorNoRecords error = errors.New("No DNS records found")
type ENSLiteClient struct {
	node        *node.Node
	dnsService  *ens.Registry
	addrService *ens2.ENS
}
func NewENSLiteClient(dataDir string) (*ENSLiteClient, error) {
	config := geth.NewNodeConfig()
	config.MaxPeers = 25
	config.BootstrapNodes = geth.FoundationBootnodes()
	v5Nodes := make([]*discv5.Node, len(params.DiscoveryV5Bootnodes))
	for i, url := range params.DiscoveryV5Bootnodes {
		v5Nodes[i] = discv5.MustParseNode(url)
	}
	nodeConf := &node.Config{
		Name:        "ens-lite",
		Version:     params.Version,
		DataDir:     dataDir,
		KeyStoreDir: filepath.Join(dataDir, "keystore"),  
		P2P: p2p.Config{
			NoDiscovery:      true,
			DiscoveryV5:      true,
			DiscoveryV5Addr:  ":0",
			BootstrapNodesV5: v5Nodes,
			ListenAddr:       ":0",
			NAT:              nat.Any(),
			MaxPeers:         config.MaxPeers,
		},
	}
	rawStack, err := node.New(nodeConf)
	if err != nil {
		return nil, err
	}
	var genesis *core.Genesis
	enc, err := json.Marshal(core.DefaultTestnetGenesisBlock())
	if err != nil {
		return nil, err
	}
	if config.EthereumGenesis != "" {
		genesis = new(core.Genesis)
		if err := json.Unmarshal([]byte(config.EthereumGenesis), genesis); err != nil {
			return nil, fmt.Errorf("invalid genesis spec: %v", err)
		}
		if config.EthereumGenesis == string(enc) {
			genesis.Config = params.TestnetChainConfig
			if config.EthereumNetworkID == 1 {
				config.EthereumNetworkID = 3
			}
		}
	}
	if config.EthereumEnabled {
		ethConf := eth.DefaultConfig
		ethConf.Genesis = genesis
		ethConf.SyncMode = downloader.LightSync
		ethConf.NetworkId = uint64(config.EthereumNetworkID)
		ethConf.DatabaseCache = config.EthereumDatabaseCache
		if err := rawStack.Register(func(ctx *node.ServiceContext) (node.Service, error) {
			return les.New(ctx, &ethConf)
		}); err != nil {
			return nil, fmt.Errorf("ethereum init: %v", err)
		}
		if config.EthereumNetStats != "" {
			if err := rawStack.Register(func(ctx *node.ServiceContext) (node.Service, error) {
				var lesServ *les.LightEthereum
				ctx.Service(&lesServ)
				return ethstats.New(config.EthereumNetStats, nil, lesServ)
			}); err != nil {
				return nil, fmt.Errorf("netstats init: %v", err)
			}
		}
	}
	return &ENSLiteClient{rawStack, nil, nil}, nil
}
func (self *ENSLiteClient) Start() {
	self.node.Start()
}