Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions cmd/bee/cmd/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -206,13 +206,13 @@ func buildBeeNode(ctx context.Context, c *command, cmd *cobra.Command, logger lo
if len(resolverEndpoints) > 0 {
resolverCfgs, err = multiresolver.ParseConnectionStrings(resolverEndpoints)
if err != nil {
return nil, err
return nil, fmt.Errorf("parse resolver endpoints: %w", err)
}
}

signerConfig, err := c.configureSigner(cmd, logger)
if err != nil {
return nil, err
return nil, fmt.Errorf("configure signer: %w", err)
}

bootNode := c.config.GetBool(optionNameBootnodeMode)
Expand Down
24 changes: 12 additions & 12 deletions pkg/node/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -264,12 +264,12 @@ func NewBee(

stateStore, stateStoreMetrics, err := InitStateStore(logger, o.DataDir, o.StatestoreCacheCapacity)
if err != nil {
return nil, err
return nil, fmt.Errorf("init state store: %w", err)
}

pubKey, err := signer.PublicKey()
if err != nil {
return nil, err
return nil, fmt.Errorf("signer public key: %w", err)
}

nonce, nonceExists, err := overlayNonceExists(stateStore)
Expand Down Expand Up @@ -501,7 +501,7 @@ func NewBee(
if o.SwapEnable {
chequebookFactory, err = InitChequebookFactory(logger, chainBackend, chainID, transactionService, o.SwapFactoryAddress)
if err != nil {
return nil, err
return nil, fmt.Errorf("init chequebook factory: %w", err)
}

erc20Address, err := chequebookFactory.ERC20Address(ctx)
Expand All @@ -526,7 +526,7 @@ func NewBee(
erc20Service,
)
if err != nil {
return nil, err
return nil, fmt.Errorf("init chequebook service: %w", err)
}
}

Expand Down Expand Up @@ -662,7 +662,7 @@ func NewBee(

bzzTokenAddress, err := postagecontract.LookupERC20Address(ctx, transactionService, postageStampContractAddress, postageStampContractABI, chainEnabled)
if err != nil {
return nil, err
return nil, fmt.Errorf("lookup erc20 postage address: %w", err)
}

postageStampContractService = postagecontract.New(
Expand All @@ -682,7 +682,7 @@ func NewBee(

batchSvc, err = batchservice.New(stateStore, batchStore, logger, eventListener, overlayEthAddress.Bytes(), post, sha3.New256, o.Resync)
if err != nil {
return nil, err
return nil, fmt.Errorf("init batch service: %w", err)
}

// Construct protocols.
Expand Down Expand Up @@ -893,7 +893,7 @@ func NewBee(
transactionService,
)
if err != nil {
return nil, err
return nil, fmt.Errorf("init swap service: %w", err)
}
b.priceOracleCloser = priceOracle

Expand Down Expand Up @@ -1033,7 +1033,7 @@ func NewBee(

stake, err := stakingContract.GetPotentialStake(ctx)
if err != nil {
return nil, err
return nil, fmt.Errorf("get potential stake: %w", err)
}

if stake.Cmp(big.NewInt(0)) > 0 {
Expand All @@ -1050,7 +1050,7 @@ func NewBee(
// make sure that the staking contract has the up to date height
tx, updated, err := stakingContract.UpdateHeight(ctx)
if err != nil {
return nil, err
return nil, fmt.Errorf("update height in staking contract: %w", err)
}
if updated {
logger.Info("updated new reserve capacity doubling height in the staking contract", "transaction", tx, "new_height", o.ReserveCapacityDoubling)
Expand Down Expand Up @@ -1214,11 +1214,11 @@ func NewBee(
}

if err := kad.Start(ctx); err != nil {
return nil, err
return nil, fmt.Errorf("start kademlia: %w", err)
}

if err := p2ps.Ready(); err != nil {
return nil, err
return nil, fmt.Errorf("p2ps ready: %w", err)
}

return b, nil
Expand Down Expand Up @@ -1355,7 +1355,7 @@ func (b *Bee) Shutdown() error {
return mErr
}

var ErrShutdownInProgress error = errors.New("shutdown in progress")
var ErrShutdownInProgress = errors.New("shutdown in progress")

func isChainEnabled(o *Options, swapEndpoint string, logger log.Logger) bool {
chainDisabled := swapEndpoint == ""
Expand Down
Loading