mirror of
https://github.com/libp2p/go-libp2p.git
synced 2025-10-05 08:07:18 +08:00
remove the context from the libp2p and from the Host contructor
This commit is contained in:
@@ -30,7 +30,7 @@ const Protocol = "/proxy-example/0.0.1"
|
||||
// makeRandomHost creates a libp2p host with a randomly generated identity.
|
||||
// This step is described in depth in other tutorials.
|
||||
func makeRandomHost(port int) host.Host {
|
||||
host, err := libp2p.New(context.Background(), libp2p.ListenAddrStrings(fmt.Sprintf("/ip4/127.0.0.1/tcp/%d", port)))
|
||||
host, err := libp2p.New(libp2p.ListenAddrStrings(fmt.Sprintf("/ip4/127.0.0.1/tcp/%d", port)))
|
||||
if err != nil {
|
||||
log.Fatalln(err)
|
||||
}
|
||||
|
Reference in New Issue
Block a user