func newLocal(key ed25519.PrivateKey, ip net.IP, serviceRecord *service.Record, db *DB) *Local {
	id := identity.New(key.Public())
	return &Local{
		Peer:          NewPeer(id, ip, serviceRecord),
		identity:      identity.NewLocalIdentityWithIdentity(id, key),
		db:            db,
		serviceRecord: serviceRecord,
	}
}
newLocal creates a new local peer.
package peer
import (
	"net"
	"sync"
	"github.com/iotaledger/hive.go/autopeering/peer/service"
	"github.com/iotaledger/hive.go/autopeering/salt"
	"github.com/iotaledger/hive.go/crypto/ed25519"
	"github.com/iotaledger/hive.go/identity"
)
type Local struct {
	*Peer
	identity *identity.LocalIdentity
	db       *DB
	mu            sync.RWMutex
	serviceRecord *service.Record
	publicSalt    *salt.Salt
	privateSalt   *salt.Salt
}