parviz-mv / go-libp2p-pubSub-stream

go libp2p

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

go-libp2p-pubSub-stream

Installation

Before start you need to clone this repository.

Clone the go-libp2p-pubSub-stream repository:

git clone git@github.com:Parviz-Makhkamov/go-libp2p-pubSub-stream.git

Usage

For start pubSub, in the root directory of the cloned repository:

From Alice side:

cd ./pubSub/alice-side
go run .  // started pubSub with default topic name and port number
or
go run . -topicName=myTopic, -listenAddrs=/ip4/0.0.0.0/tcp/PortNumber

From Bob side:

cd ./pubSub/bob-side
go run .  // started pubSub with default topic name and port number
or
go run . -topicName=myTopic, -listenAddrs=/ip4/0.0.0.0/tcp/PortNumber // with special topic name and port number

For start stream, in the root directory of the cloned repository:

From Alice side:

cd ./stream/alice-side
go run .  // started stream with default port number
or
go run . -l= PortNumber // started stream with special PortNumber

From Bob side:

cd ./stream/bob-side
go run . -l  PortNumber+AnyNumber -d /ip4/0.0.0.0/tcp/PortNumber/p2p/QmRXhXyCApoYTi8esQv28awPV5MUyK7pW7AiPMGjcFNKq1

About

go libp2p


Languages

Language:Go 100.0%