func NewService(
	pinStorage storage.Storer,
	rhStorage storage.StateStorer,
	traverser traversal.Traverser,
) *Service {
	return &Service{
		pinStorage: pinStorage,
		rhStorage:  rhStorage,
		traverser:  traverser,
	}
}
NewService is a convenient constructor for Service.
package pinning
import (
	"context"
	"encoding/json"
	"errors"
	"fmt"
	"github.com/ethsana/sana/pkg/storage"
	"github.com/ethsana/sana/pkg/swarm"
	"github.com/ethsana/sana/pkg/traversal"
	"github.com/hashicorp/go-multierror"
)
var ErrTraversal = errors.New("traversal iteration failed")
type Interface interface {
	CreatePin(context.Context, swarm.Address, bool) error
	DeletePin(context.Context, swarm.Address) error
	HasPin(swarm.Address) (bool, error)
	Pins() ([]swarm.Address, error)
}
const storePrefix = "root-pin"
func rootPinKey(ref swarm.Address) string {
	return fmt.Sprintf("%s-%s", storePrefix, ref)
}