Commit 38725252 authored by Janoš Guljaš's avatar Janoš Guljaš Committed by GitHub

remove unused arguments and options from node.NewBee (#981)

parent 15e1b509
...@@ -99,10 +99,9 @@ Welcome to the Swarm.... Bzzz Bzzzz Bzzzz ...@@ -99,10 +99,9 @@ Welcome to the Swarm.... Bzzz Bzzzz Bzzzz
return err return err
} }
b, err := node.NewBee(c.config.GetString(optionNameP2PAddr), signerConfig.address, *signerConfig.publicKey, signerConfig.keystore, signerConfig.signer, c.config.GetUint64(optionNameNetworkID), logger, signerConfig.libp2pPrivateKey, signerConfig.pssPrivateKey, node.Options{ b, err := node.NewBee(c.config.GetString(optionNameP2PAddr), signerConfig.address, *signerConfig.publicKey, signerConfig.signer, c.config.GetUint64(optionNameNetworkID), logger, signerConfig.libp2pPrivateKey, signerConfig.pssPrivateKey, node.Options{
DataDir: c.config.GetString(optionNameDataDir), DataDir: c.config.GetString(optionNameDataDir),
DBCapacity: c.config.GetUint64(optionNameDBCapacity), DBCapacity: c.config.GetUint64(optionNameDBCapacity),
Password: signerConfig.password,
APIAddr: c.config.GetString(optionNameAPIAddr), APIAddr: c.config.GetString(optionNameAPIAddr),
DebugAPIAddr: debugAPIAddr, DebugAPIAddr: debugAPIAddr,
Addr: c.config.GetString(optionNameP2PAddr), Addr: c.config.GetString(optionNameP2PAddr),
...@@ -177,13 +176,11 @@ Welcome to the Swarm.... Bzzz Bzzzz Bzzzz ...@@ -177,13 +176,11 @@ Welcome to the Swarm.... Bzzz Bzzzz Bzzzz
} }
type signerConfig struct { type signerConfig struct {
keystore keystore.Service
signer crypto.Signer signer crypto.Signer
address swarm.Address address swarm.Address
publicKey *ecdsa.PublicKey publicKey *ecdsa.PublicKey
libp2pPrivateKey *ecdsa.PrivateKey libp2pPrivateKey *ecdsa.PrivateKey
pssPrivateKey *ecdsa.PrivateKey pssPrivateKey *ecdsa.PrivateKey
password string
} }
func (c *command) configureSigner(cmd *cobra.Command, logger logging.Logger) (config *signerConfig, err error) { func (c *command) configureSigner(cmd *cobra.Command, logger logging.Logger) (config *signerConfig, err error) {
...@@ -314,12 +311,10 @@ func (c *command) configureSigner(cmd *cobra.Command, logger logging.Logger) (co ...@@ -314,12 +311,10 @@ func (c *command) configureSigner(cmd *cobra.Command, logger logging.Logger) (co
logger.Infof("using ethereum address %x", overlayEthAddress) logger.Infof("using ethereum address %x", overlayEthAddress)
return &signerConfig{ return &signerConfig{
keystore: keystore,
signer: signer, signer: signer,
address: address, address: address,
publicKey: publicKey, publicKey: publicKey,
libp2pPrivateKey: libp2pPrivateKey, libp2pPrivateKey: libp2pPrivateKey,
pssPrivateKey: pssPrivateKey, pssPrivateKey: pssPrivateKey,
password: password,
}, nil }, nil
} }
...@@ -26,7 +26,6 @@ import ( ...@@ -26,7 +26,6 @@ import (
"github.com/ethersphere/bee/pkg/debugapi" "github.com/ethersphere/bee/pkg/debugapi"
"github.com/ethersphere/bee/pkg/hive" "github.com/ethersphere/bee/pkg/hive"
"github.com/ethersphere/bee/pkg/kademlia" "github.com/ethersphere/bee/pkg/kademlia"
"github.com/ethersphere/bee/pkg/keystore"
"github.com/ethersphere/bee/pkg/localstore" "github.com/ethersphere/bee/pkg/localstore"
"github.com/ethersphere/bee/pkg/logging" "github.com/ethersphere/bee/pkg/logging"
"github.com/ethersphere/bee/pkg/metrics" "github.com/ethersphere/bee/pkg/metrics"
...@@ -85,7 +84,6 @@ type Bee struct { ...@@ -85,7 +84,6 @@ type Bee struct {
type Options struct { type Options struct {
DataDir string DataDir string
DBCapacity uint64 DBCapacity uint64
Password string
APIAddr string APIAddr string
DebugAPIAddr string DebugAPIAddr string
Addr string Addr string
...@@ -112,7 +110,7 @@ type Options struct { ...@@ -112,7 +110,7 @@ type Options struct {
SwapEnable bool SwapEnable bool
} }
func NewBee(addr string, swarmAddress swarm.Address, publicKey ecdsa.PublicKey, keystore keystore.Service, signer crypto.Signer, networkID uint64, logger logging.Logger, libp2pPrivateKey, pssPrivateKey *ecdsa.PrivateKey, o Options) (*Bee, error) { func NewBee(addr string, swarmAddress swarm.Address, publicKey ecdsa.PublicKey, signer crypto.Signer, networkID uint64, logger logging.Logger, libp2pPrivateKey, pssPrivateKey *ecdsa.PrivateKey, o Options) (*Bee, error) {
tracer, tracerCloser, err := tracing.NewTracer(&tracing.Options{ tracer, tracerCloser, err := tracing.NewTracer(&tracing.Options{
Enabled: o.TracingEnabled, Enabled: o.TracingEnabled,
Endpoint: o.TracingEndpoint, Endpoint: o.TracingEndpoint,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment