mirror of
https://github.com/ipfs/kubo.git
synced 2025-06-28 17:03:58 +08:00
core: Show error when config identity is not set
This commit is contained in:
@ -118,6 +118,10 @@ func NewIpfsNode(cfg *config.Config, online bool) (*IpfsNode, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func initIdentity(cfg *config.Config) (*peer.Peer, error) {
|
func initIdentity(cfg *config.Config) (*peer.Peer, error) {
|
||||||
|
if cfg.Identity == nil {
|
||||||
|
return nil, errors.New("Identity was not set in config (was ipfs init run?)")
|
||||||
|
}
|
||||||
|
|
||||||
if len(cfg.Identity.PeerID) == 0 {
|
if len(cfg.Identity.PeerID) == 0 {
|
||||||
return nil, errors.New("No peer ID in config! (was ipfs init run?)")
|
return nil, errors.New("No peer ID in config! (was ipfs init run?)")
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user