// Create returns a 1.0 client version.
Create returns a 1.0 client version.
// Create returns a 1 . 0 client version .
func (v *Factory) Create(version string, casClient common.CASReader,
	sidetreeCfg *config.Sidetree) (protocol.Version, error) {
	p := protocolcfg.GetProtocolConfig()
	var parserOpts []operationparser.Option
	parserOpts = append(parserOpts, operationparser.WithAnchorTimeValidator(anchortime.New(p.MaxOperationTimeDelta)))
	if len(sidetreeCfg.AnchorOrigins) > 0 {
		operationparser.WithAnchorOriginValidator(anchororigin.New(sidetreeCfg.AnchorOrigins))
	}
	opParser := operationparser.New(p, parserOpts...)
	orbParser := orboperationparser.New(opParser)
	cp := compression.New(compression.WithDefaultAlgorithms())
	dc := doccomposer.New()
	oa := operationapplier.New(p, opParser, dc)
	dv := didvalidator.New()
	dt := didtransformer.New(
		didtransformer.WithMethodContext(sidetreeCfg.MethodContext),
		didtransformer.WithBase(sidetreeCfg.EnableBase),
		didtransformer.WithIncludePublishedOperations(sidetreeCfg.IncludePublishedOperations),
		didtransformer.WithIncludeUnpublishedOperations(sidetreeCfg.IncludeUnpublishedOperations))
	op := txnprovider.NewOperationProvider(p, opParser, casClient, cp)
	return &vcommon.ProtocolVersion{
		VersionStr:     version,
		P:              p,
		OpProvider:     op,
		OpParser:       orbParser,
		OpApplier:      oa,
		DocComposer:    dc,
		DocValidator:   dv,
		DocTransformer: dt,
	}, nil
}
func ( v * Factory ) Create ( version string , casClient common . CASReader , sidetreeCfg * config . Sidetree ) ( protocol . Version , error ) { p := protocolcfg . GetProtocolConfig ( ) var parserOpts [ ] operationparser . Option parserOpts = append ( parserOpts , operationparser . WithAnchorTimeValidator ( anchortime . New ( p . MaxOperationTimeDelta ) ) ) if len ( sidetreeCfg . AnchorOrigins ) > 0 { operationparser . WithAnchorOriginValidator ( anchororigin . New ( sidetreeCfg . AnchorOrigins ) ) } opParser := operationparser . New ( p , parserOpts ... ) orbParser := orboperationparser . New ( opParser ) cp := compression . New ( compression . WithDefaultAlgorithms ( ) ) dc := doccomposer . New ( ) oa := operationapplier . New ( p , opParser , dc ) dv := didvalidator . New ( ) dt := didtransformer . New ( didtransformer . WithMethodContext ( sidetreeCfg . MethodContext ) , didtransformer . WithBase ( sidetreeCfg . EnableBase ) , didtransformer . WithIncludePublishedOperations ( sidetreeCfg . IncludePublishedOperations ) , didtransformer . WithIncludeUnpublishedOperations ( sidetreeCfg . IncludeUnpublishedOperations ) ) op := txnprovider . NewOperationProvider ( p , opParser , casClient , cp ) return & vcommon . ProtocolVersion { VersionStr : version , P : p , OpProvider : op , OpParser : orbParser , OpApplier : oa , DocComposer : dc , DocValidator : dv , DocTransformer : dt , } , nil }
Create returns a 1.0 client version.
Create returns a 1 . 0 client version .