Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not able to create deliver client for event #240

Open
Shweta-hlf opened this issue Jul 15, 2022 · 0 comments
Open

Not able to create deliver client for event #240

Shweta-hlf opened this issue Jul 15, 2022 · 0 comments

Comments

@Shweta-hlf
Copy link

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")

}

=========================================

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant