ceremonyclient/go-libp2p/examples/ipfs-camp-2019/02-Multiaddrs/main.go
2023-08-20 23:07:43 -05:00

27 lines
565 B
Go

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()
}