Not able to create deliver client for event
Shweta-hlf opened this issue · 0 comments
Shweta-hlf commented
Hi team,
can any one help me to create new deliver client code for event read from block number functionality.
I am using following snippet code.trying to create fabcontext client that needs signning identtiy and provider.
signing identity i am getting but how i can get provider.
ctxProvider := sdk.Context()
ctx, err := ctxProvider()
fmt.Println("userIdentity=================", userIdentity)
identityresp, err := mspClient.GetAllIdentities()
fmt.Println("userIdentity=================", identityresp)
ctxchProvider := sdk.ChannelContext("mychannel", fabsdk.WithUser("admin"), fabsdk.WithOrg("Org1"))
//provider := &contextImpl.Provider{}
discoveryService, err := ctx.LocalDiscoveryProvider().CreateLocalDiscoveryService("Org1MSP")
fabctx := contextImpl.Client{
Providers: &contextImpl.Provider{localDiscoveryProvider: discoveryService, channelProvider: ctxchProvider},
SigningIdentity: userIdentity,
}
fmt.Println("fabctx======================", fabctx)
//fabctx.EndpointConfig().ChannelConfig("mychannel")
chconfig := chconfig.NewChannelCfg("mychannel")
discoveryServicefab := fabctx.LocalDiscoveryProvider()
dc, err := deliverclient.New(fabctx, chconfig, discoveryServicefab)
fmt.Println("dc============================", dc)
return dc
//discoveryService, err := fab.LocalDiscoveryProvider.CreateLocalDiscoveryService("Org1Msp")
}
=========================================