Skip to content
This repository has been archived by the owner on May 26, 2022. It is now read-only.

Commit

Permalink
emit the EvtPeerConnectednessChanged event
Browse files Browse the repository at this point in the history
  • Loading branch information
marten-seemann committed Nov 28, 2021
1 parent fb0e5f2 commit 6126d7a
Show file tree
Hide file tree
Showing 6 changed files with 836 additions and 34 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ go-libp2p-blankhost
[![Discourse posts](https://img.shields.io/discourse/https/discuss.libp2p.io/posts.svg)](https://discuss.libp2p.io)


> A very thin implementation of go-libp2p-host. Does not contain any identify, relay, or NAT traversal code.
A very thin implementation of go-libp2p-host. Does not contain any identify, relay, or NAT traversal code.


## Table of Contents
Expand Down
5 changes: 5 additions & 0 deletions blank.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,11 @@ func NewBlankHost(n network.Network, options ...Option) *BlankHost {
if bh.emitters.evtLocalProtocolsUpdated, err = bh.eventbus.Emitter(&event.EvtLocalProtocolsUpdated{}); err != nil {
return nil
}
evtPeerConnectednessChanged, err := bh.eventbus.Emitter(&event.EvtPeerConnectednessChanged{})
if err != nil {
return nil
}
n.Notify(newPeerConnectWatcher(evtPeerConnectednessChanged))

n.SetStreamHandler(bh.newStreamHandler)

Expand Down
10 changes: 6 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@ module github.com/libp2p/go-libp2p-blankhost
go 1.16

require (
github.com/ipfs/go-log v1.0.4
github.com/ipfs/go-log v1.0.5
github.com/libp2p/go-eventbus v0.2.1
github.com/libp2p/go-libp2p-core v0.6.0
github.com/multiformats/go-multiaddr v0.2.2
github.com/multiformats/go-multistream v0.1.1
github.com/libp2p/go-libp2p-core v0.11.0
github.com/libp2p/go-libp2p-swarm v0.8.0
github.com/multiformats/go-multiaddr v0.4.0
github.com/multiformats/go-multistream v0.2.1
github.com/stretchr/testify v1.7.0
)
Loading

0 comments on commit 6126d7a

Please sign in to comment.