func (c *Client) Get(transactionTime uint64) (protocol.Version, error) {
	logger.Debugf("available protocols: %s", c.protocols)
	for i := len(c.protocols) - 1; i >= 0; i-- {
		pv := c.protocols[i]
		p := pv.Protocol()
		logger.Debugf("Checking protocol for transaction time %d: %+v", transactionTime, p)
		if transactionTime >= p.GenesisTime {
			logger.Debugf("Found protocol for transaction time %d: %+v", transactionTime, p)
			return pv, nil
		}
	}
	return nil, fmt.Errorf("protocol parameters are not defined for blockchain time: %d", transactionTime)
}
Get gets protocol version based on blockchain(transaction) time
package protocol
import (
	"fmt"
	"sort"
	"github.com/hyperledger/fabric-protos-go/common"
	"github.com/hyperledger/fabric/common/flogging"
	"github.com/trustbloc/sidetree-core-go/pkg/api/protocol"
)
var logger = flogging.MustGetLogger("protocol_client")
type blockchainInfoProvider interface {
	GetBlockchainInfo() (*common.BlockchainInfo, error)
}
type Client struct {
	protocols      []protocol.Version
	bcInfoProvider blockchainInfoProvider
}
func New(protocolVersions []protocol.Version, bcInfoProvider blockchainInfoProvider) *Client {
	var protocols []protocol.Version
	protocols = append(protocols, protocolVersions...)
	sort.SliceStable(protocols, func(i, j int) bool {
		return protocols[j].Protocol().GenesisTime > protocols[i].Protocol().GenesisTime
	})
	return &Client{
		protocols:      protocols,
		bcInfoProvider: bcInfoProvider,
	}
}
func (c *Client) Current() (protocol.Version, error) {
	bcInfo, err := c.bcInfoProvider.GetBlockchainInfo()
	if err != nil {
		return nil, err
	}
	return c.Get(bcInfo.Height - 1)
}