@ -27,6 +27,7 @@ import (
|
||||
"github.com/ethereum/go-ethereum/contracts/chequebook"
|
||||
"github.com/ethereum/go-ethereum/contracts/ens"
|
||||
"github.com/ethereum/go-ethereum/crypto"
|
||||
"github.com/ethereum/go-ethereum/ethclient"
|
||||
"github.com/ethereum/go-ethereum/log"
|
||||
"github.com/ethereum/go-ethereum/node"
|
||||
"github.com/ethereum/go-ethereum/p2p"
|
||||
@ -134,9 +135,13 @@ func NewSwarm(ctx *node.ServiceContext, backend chequebook.Backend, config *api.
|
||||
// set up high level api
|
||||
transactOpts := bind.NewKeyedTransactor(self.privateKey)
|
||||
|
||||
self.dns, err = ens.NewENS(transactOpts, config.EnsRoot, self.backend)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
if backend == (*ethclient.Client)(nil) {
|
||||
log.Warn("No ENS, please specify non-empty --ethapi to use domain name resolution")
|
||||
} else {
|
||||
self.dns, err = ens.NewENS(transactOpts, config.EnsRoot, self.backend)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
log.Debug(fmt.Sprintf("-> Swarm Domain Name Registrar @ address %v", config.EnsRoot.Hex()))
|
||||
|
||||
|
Reference in New Issue
Block a user