func NewLedgerRequestHandler(db bcdb.DB, logger *logger.SugarLogger) http.Handler {
	handler := &ledgerRequestHandler{
		db:          db,
		sigVerifier: cryptoservice.NewVerifier(db, logger),
		router:      mux.NewRouter(),
		logger:      logger,
	}
	handler.router.HandleFunc(constants.GetBlockHeader, handler.blockQuery).Methods(http.MethodGet)
	handler.router.HandleFunc(constants.GetLastBlockHeader, handler.lastBlockQuery).Methods(http.MethodGet)
	handler.router.HandleFunc(constants.GetPath, handler.pathQuery).Methods(http.MethodGet).Queries("start", "{startId:[0-9]+}", "end", "{endId:[0-9]+}")
	handler.router.HandleFunc(constants.GetTxProof, handler.txProof).Methods(http.MethodGet).Queries("idx", "{idx:[0-9]+}")
	handler.router.HandleFunc(constants.GetDataProof, handler.dataProof).Methods(http.MethodGet).Queries("block", "{blockId:[0-9]+}", "deleted", "{deleted:true|false}")
	handler.router.HandleFunc(constants.GetDataProof, handler.dataProof).Methods(http.MethodGet).Queries("block", "{blockId:[0-9]+}")
	handler.router.HandleFunc(constants.GetTxReceipt, handler.txReceipt).Methods(http.MethodGet)
	handler.router.HandleFunc(constants.GetPath, handler.invalidPathQuery).Methods(http.MethodGet)
	handler.router.HandleFunc(constants.GetTxProofPrefix, handler.invalidTxProof).Methods(http.MethodGet)
	handler.router.HandleFunc(constants.GetTxProof, handler.invalidTxProof).Methods(http.MethodGet)
	handler.router.HandleFunc(constants.GetDataProofPrefix, handler.invalidDataProof).Methods(http.MethodGet)
	handler.router.HandleFunc(constants.GetDataProofPrefix+"/{dbname}", handler.invalidDataProof).Methods(http.MethodGet)
	handler.router.HandleFunc(constants.GetDataProofPrefix+"/{dbname}/{key}", handler.invalidDataProof).Methods(http.MethodGet)
	return handler
}
NewLedgerRequestHandler creates users request handler
package httphandler
import (
	"net/http"
	"github.com/gorilla/mux"
	"github.com/hyperledger-labs/orion-server/internal/bcdb"
	"github.com/hyperledger-labs/orion-server/internal/errors"
	"github.com/hyperledger-labs/orion-server/internal/httputils"
	"github.com/hyperledger-labs/orion-server/pkg/constants"
	"github.com/hyperledger-labs/orion-server/pkg/cryptoservice"
	"github.com/hyperledger-labs/orion-server/pkg/logger"
	"github.com/hyperledger-labs/orion-server/pkg/types"
)
type ledgerRequestHandler struct {
	db          bcdb.DB
	sigVerifier *cryptoservice.SignatureVerifier
	router      *mux.Router
	logger      *logger.SugarLogger
}