ceremonyclient/go-libp2p/examples/ipfs-camp-2019/02-Multiaddrs/main.go

27 lines
565 B
Go
Raw Normal View History

2023-08-21 03:50:38 +00:00
package main
import (
"github.com/libp2p/go-libp2p"
"github.com/libp2p/go-libp2p/p2p/transport/tcp"
"github.com/libp2p/go-libp2p/p2p/transport/websocket"
)
func main() {
transports := libp2p.ChainOptions(
libp2p.Transport(tcp.NewTCPTransport),
libp2p.Transport(websocket.New),
)
// TODO: add some listen addresses with the libp2p.ListenAddrs or
// libp2p.ListenAddrStrings configuration options.
host, err := libp2p.New(transports)
if err != nil {
panic(err)
}
// TODO: with our host made, let's connect to our bootstrap peer
host.Close()
}