1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-06-29 01:12:24 +08:00

core: Show error when config identity is not set

This commit is contained in:
Matt Bell
2014-09-11 17:50:05 -07:00
parent b63e10f3b5
commit 3ae37b29bd

View File

@ -118,6 +118,10 @@ func NewIpfsNode(cfg *config.Config, online bool) (*IpfsNode, 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 {
return nil, errors.New("No peer ID in config! (was ipfs init run?)")
}