Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

HyperLeger Fabric SDK Development (5)-- event

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/03 Report--

HyperLeger Fabric SDK development (5)-- event 1, introduction to event 1, introduction to event

The event package supports access to channel events on the Fabric network. The event client can receive block events, filter block events, chain code events and transaction status events.

Official documents:

Https://godoc.org/github.com/hyperledger/fabric-sdk-go/pkg/client/event

2. The basic process of using event

The basic process for using event is as follows:

A. prepare the channel client context

B. Create an event client

C, registration event

D, handling events (or timeouts)

E, logout event

Examples of use:

Ec, err: = New (mockChannelProvider ("mychannel") if err! = nil {fmt.Println ("failed to create client")} registration, notifier, err: = ec.RegisterChaincodeEvent ("examplecc", "event123") if err! = nil {fmt.Println ("failed to register chaincode event")} defer ec.Unregister (registration) select {case ccEvent: =

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report