diff --git a/README.md b/README.md index f4e7bda..95f89f2 100644 --- a/README.md +++ b/README.md @@ -8,11 +8,11 @@ If you find any system errors or you have better suggestions, please submit an i ## πŸ“’ Announcement **CESS test network rpc endpoints** ``` -wss://testnet-rpc.cess.cloud/ws/ +wss://testnet-rpc.cess.network/ws/ ``` **CESS test network bootstrap node** ``` -_dnsaddr.boot-miner-testnet.cess.cloud +_dnsaddr.boot-miner-testnet.cess.network ``` ## 🚰 CESS test network faucet @@ -31,14 +31,14 @@ The following commands are executed with root privileges, if the prompt `Permiss For the Debian and ubuntu families of linux systems: -```shell -apt install git curl wget vim util-linux -y +```bash +# apt install git curl wget vim util-linux -y ``` For the Fedora, RedHat and CentOS families of linux systems: -```shell -yum install git curl wget vim util-linux -y +```bash +# yum install git curl wget vim util-linux -y ``` ### Firewall configuration @@ -46,22 +46,22 @@ By default, cess-miner uses port `4001` to listen for incoming connections, if y #### ufw For hosts with ufw enabled (Debian, Ubuntu, etc.), you can use the ufw command to allow traffic to flow to specific ports. Use the following command to allow access to a port: -``` -ufw allow 4001 +```bash +# ufw allow 4001 ``` #### firewall-cmd For hosts with firewall-cmd enabled (CentOS), you can use the firewall-cmd command to allow traffic on specific ports. Use the following command to allow access to a port: -``` -firewall-cmd --get-active-zones +```bash +# firewall-cmd --get-active-zones ``` This command gets the active zone(s). Now, apply port rules to the relevant zones returned above. For example if the zone is public, use -``` -firewall-cmd --zone=public --add-port=4001/tcp --permanent +```bash +# firewall-cmd --zone=public --add-port=4001/tcp --permanent ``` Note that permanent makes sure the rules are persistent across firewall start, restart or reload. Finally reload the firewall for changes to take effect. -``` -firewall-cmd --reload +```bash +# firewall-cmd --reload ``` #### iptables @@ -103,8 +103,8 @@ If you are using the test network, Please join the [CESS discord](https://discor ## πŸ— Get the binary program ### Method one Download the latest release of the binary application directly at: -``` -wget https://github.com/CESSProject/cess-miner/releases/download/v0.7.11/bucket0.7.11.linux-amd64.tar.gz +```bash +# wget https://github.com/CESSProject/cess-miner/releases/download/v0.7.11/bucket0.7.11.linux-amd64.tar.gz ``` ### Method two Compile the binary program from the storage node source code and follow the process as follows: @@ -113,32 +113,32 @@ Compile the binary program from the storage node source code and follow the proc CESS-Bucket requires [Go 1.21](https://golang.org/dl/), See the [official Golang installation instructions](https://golang.org/doc/install). Open gomod mode: -``` -go env -w GO111MODULE="on" +```bash +# go env -w GO111MODULE="on" ``` Users in China can add go proxy to speed up the download: -``` -go env -w GOPROXY="https://goproxy.cn,direct" +```bash +# go env -w GOPROXY="https://goproxy.cn,direct" ``` **2) clone code** -```shell -git clone https://github.com/CESSProject/cess-miner.git +```bash +# git clone https://github.com/CESSProject/cess-miner.git ``` **3) compile code** -```shell -cd cess-miner/ -go build -o miner cmd/main.go +```bash +# cd cess-miner/ +# go build -o miner cmd/main.go ``` **4) Grant execute permission** -```shell -chmod +x miner +```bash +# chmod +x miner ``` **5) View miner features (optional)** @@ -177,26 +177,26 @@ The `miner` has many functions, you can use `./miner -h` or `./miner --help` to The miner program has two running modes: foreground and background. > :warning: If you are not running the `miner` program with root privileges, make sure that the user you are currently logged in to has all permissions for the workspace directory you have configured. If you are logged in as `user`, the configured directory is `/cess`, and your signature account is `cXfyomKDABfehLkvARFE854wgDJFMbsxwAJEHezRb6mfcAi2y`, execute the following command to grant permissions: -``` -chown -R user:user /cess/cXfyomKDABfehLkvARFE854wgDJFMbsxwAJEHezRb6mfcAi2y/ +```bash +# chown -R user:user /cess/cXfyomKDABfehLkvARFE854wgDJFMbsxwAJEHezRb6mfcAi2y/ ``` ### Foreground operation mode The foreground operation mode requires the terminal window to be kept all the time, and the window cannot be closed. You can use the screen command to create a window for the miner and ensure that the window always exists. Create and enter the miner window command: -``` -screen -S miner +```bash +# screen -S miner ``` Press `ctrl + A + D` to exit the miner window without closing it. View window list command: -``` -screen -ls +```bash +# screen -ls ``` Re-enter the miner window command: -``` -screen -r miner +```bash +# screen -r miner ``` @@ -204,10 +204,10 @@ screen -r miner Enter the `miner run` command to run directly, and enter the information according to the prompt to complete the startup: -``` +```bash # ./miner run >> Please enter the rpc address of the chain, multiple addresses are separated by spaces: -wss://testnet-rpc0.cess.cloud/ws/ wss://testnet-rpc1.cess.cloud/ws/ wss://testnet-rpc2.cess.cloud/ws/ +wss://testnet-rpc.cess.network/ws/ >> Please enter the workspace, press enter to use / by default workspace: / >> Please enter your earnings account, if you are already registered and do not want to update, please press enter to skip: @@ -222,8 +222,8 @@ cXfyomKDABfehLkvARFE854wgDJFMbsxwAJEHezRb6mfcAi2y **method two** -``` -# ./miner run --rpc wss://testnet-rpc0.cess.cloud/ws/ wss://testnet-rpc1.cess.cloud/ws/ wss://testnet-rpc2.cess.cloud/ws/ --ws / --earnings cXfyomKDABfehLkvARFE854wgDJFMbsxwAJEHezRb6mfcAi2y --port 4001 --space 2000 +```bash +# ./miner run --rpc wss://testnet-rpc.cess.network/ws/ --ws / --earnings cXfyomKDABfehLkvARFE854wgDJFMbsxwAJEHezRb6mfcAi2y --port 4001 --space 2000 >> Please enter the mnemonic of the staking account: ******************************************************************************* ``` @@ -231,24 +231,24 @@ cXfyomKDABfehLkvARFE854wgDJFMbsxwAJEHezRb6mfcAi2y ### Background operation mode Generate configuration file: -``` -./miner config +```bash +# ./miner config OK /root/miner/conf.yaml ``` Edit the configuration file and fill in the correct information, then run: -``` -nohup ./miner run -c /root/miner/conf.yaml & +```bash +# nohup ./miner run -c /root/miner/conf.yaml & ``` If the configuration file is named conf.yaml and is located in the same directory as the miner program, you can specify without -c: -``` -nohup ./miner run & +```bash +# nohup ./miner run & ``` ## πŸ’‘ Other commands - stat -```shell -./miner stat --rpc wss://testnet-rpc.cess.cloud/ws/ +```bash +# ./miner stat --rpc wss://testnet-rpc.cess.network/ws/ >> Please enter the mnemonic of the staking account: ******************************************************************************* +-------------------+------------------------------------------------------+ @@ -269,24 +269,24 @@ nohup ./miner run & ``` - increase staking -```shell -./miner increase staking 1000000000000000000000 --rpc wss://testnet-rpc.cess.cloud/ws/ +```bash +# ./miner increase staking 1000000000000000000000 --rpc wss://testnet-rpc.cess.network/ws/ >> Please enter the mnemonic of the staking account: ******************************************************************************* OK 0xe098179a4a668690f28947d20083014e5a510b8907aac918e7b96efe1845e053 ``` - increase space -```shell -./miner increase space 10 --rpc wss://testnet-rpc.cess.cloud/ws/ +```bash +# ./miner increase space 10 --rpc wss://testnet-rpc.cess.network/ws/ >> Please enter the mnemonic of the staking account: ******************************************************************************* OK 0xe098179a4a668690f28947d20083014e5a510b8907aac918e7b96efe1845e053 ``` - update earnings -```shell -./miner update earnings cXgDBpxj2vHhR9qP8wTkZ5ZST9YMu6WznFsEAZi3SZPD4b4qw --rpc wss://testnet-rpc.cess.cloud/ws/ +```bash +# ./miner update earnings cXgDBpxj2vHhR9qP8wTkZ5ZST9YMu6WznFsEAZi3SZPD4b4qw --rpc wss://testnet-rpc.cess.network/ws/ >> Please enter the mnemonic of the staking account: ******************************************************************************* OK 0x0fa67b89d9f8ff134b45e4e507ccda00c0923d43c3b8166a2d75d3f42e5a269a @@ -299,32 +299,32 @@ miner v0.7.11 ``` - exit -```shell -./miner exit --rpc wss://testnet-rpc.cess.cloud/ws/ +```bash +# ./miner exit --rpc wss://testnet-rpc.cess.network/ws/ >> Please enter the mnemonic of the staking account: ******************************************************************************* OK 0xf6e9573ba53a90c4bbd8c3784ef97bbf74bdb1cf8c01df697310a64c2a7d4513 ``` - withdraw -```shell -./miner withdraw --rpc wss://testnet-rpc.cess.cloud/ws/ +```bash +# ./miner withdraw --rpc wss://testnet-rpc.cess.network/ws/ >> Please enter the mnemonic of the staking account: ******************************************************************************* OK 0xfbcc77c072f88668a83f2dd3ea00f3ba2e5806aae8265cfba1582346d6ada3f1 ``` - claim -```shell -./miner claim --rpc wss://testnet-rpc.cess.cloud/ws/ +```bash +# ./miner claim --rpc wss://testnet-rpc.cess.network/ws/ >> Please enter the mnemonic of the staking account: ******************************************************************************* OK 0x59096fd095b66665c838f89ae4f1384ab31255cdc9c80003b05b50124cfdcfee ``` - reward -```shell -./miner reward --rpc wss://testnet-rpc.cess.cloud/ws/ +```bash +# ./miner reward --rpc wss://testnet-rpc.cess.network/ws/ >> Please enter the mnemonic of the staking account: ******************************************************************************* +------------------+---------------------------+ diff --git a/cmd/console/run.go b/cmd/console/run.go index b1237e8..ec85eb8 100644 --- a/cmd/console/run.go +++ b/cmd/console/run.go @@ -926,28 +926,42 @@ func checkNetworkEnv(cli *chain.ChainClient, netenv string) error { chain := cli.GetNetworkEnv() if strings.Contains(chain, configs.DevNet) { if !strings.Contains(netenv, configs.DevNet) { - return errors.New("chain and p2p are not in the same network") + return fmt.Errorf("chain and storage are not on the same network, chain: %s storage: %s", chain, netenv) } } else if strings.Contains(chain, configs.TestNet) { if !strings.Contains(netenv, configs.TestNet) { - return errors.New("chain and p2p are not in the same network") + return fmt.Errorf("chain and storage are not on the same network, chain: %s storage: %s", chain, netenv) } } else if strings.Contains(chain, configs.MainNet) { if !strings.Contains(netenv, configs.MainNet) { - return errors.New("chain and p2p are not in the same network") + return fmt.Errorf("chain and storage are not on the same network, chain: %s storage: %s", chain, netenv) } } else { - return errors.New("unknown chain network") + return fmt.Errorf("unknown chain network: %s", chain) } chainVersion, err := cli.SystemVersion() if err != nil { - return errors.New("Failed to read chain version: network connection is down") + return errors.New("failed to query the chain version: rpc connection is down") } if strings.Contains(chain, configs.TestNet) { - if !strings.Contains(chainVersion, configs.ChainVersion) { - return fmt.Errorf("The chain version you are using is not %s, please check your rpc service", configs.ChainVersion) + tmps := strings.Split(chainVersion, "-") + for _, v := range tmps { + if strings.Contains(v, ".") { + values := strings.Split(v, ".") + if len(values) == 3 { + if values[0] != configs.ChainVersionStr[0] || values[1] != configs.ChainVersionStr[1] { + return fmt.Errorf("chain version number is not v%d.%d, please check your rpc service", configs.ChainVersionInt[0], configs.ChainVersionInt[1]) + } + versionI, err := strconv.Atoi(values[2]) + if err == nil { + if versionI < configs.ChainVersionInt[2] { + return fmt.Errorf("chain version number is lower than v%d.%d.%d, please check your rpc service", configs.ChainVersionInt[0], configs.ChainVersionInt[1], configs.ChainVersionInt[2]) + } + } + } + } } } diff --git a/configs/system.go b/configs/system.go index 78715b0..b5898f0 100644 --- a/configs/system.go +++ b/configs/system.go @@ -27,10 +27,12 @@ const ( Description = "Storage miner implementation in CESS networks" // NameSpace is the cached namespace NameSpaces = Name - // Chain version - ChainVersion = "0.7.7" ) +// Chain version +var ChainVersionStr = [3]string{"0", "7", "7"} +var ChainVersionInt = [3]int{0, 7, 7} + var cp *x509.CertPool // system init diff --git a/go.mod b/go.mod index 87beecb..5fdbb7c 100644 --- a/go.mod +++ b/go.mod @@ -109,7 +109,6 @@ require ( github.com/libp2p/go-netroute v0.2.1 // indirect github.com/libp2p/go-reuseport v0.4.0 // indirect github.com/libp2p/go-yamux/v4 v4.0.1 // indirect - github.com/libp2p/zeroconf/v2 v2.2.0 // indirect github.com/magiconair/properties v1.8.7 // indirect github.com/marten-seemann/tcp v0.0.0-20210406111302-dfbc87cc63fd // indirect github.com/mattn/go-isatty v0.0.20 // indirect diff --git a/go.sum b/go.sum index 5c73fd8..4002ff1 100644 --- a/go.sum +++ b/go.sum @@ -340,8 +340,6 @@ github.com/libp2p/go-reuseport v0.4.0 h1:nR5KU7hD0WxXCJbmw7r2rhRYruNRl2koHw8fQsc github.com/libp2p/go-reuseport v0.4.0/go.mod h1:ZtI03j/wO5hZVDFo2jKywN6bYKWLOy8Se6DrI2E1cLU= github.com/libp2p/go-yamux/v4 v4.0.1 h1:FfDR4S1wj6Bw2Pqbc8Uz7pCxeRBPbwsBbEdfwiCypkQ= github.com/libp2p/go-yamux/v4 v4.0.1/go.mod h1:NWjl8ZTLOGlozrXSOZ/HlfG++39iKNnM5wwmtQP1YB4= -github.com/libp2p/zeroconf/v2 v2.2.0 h1:Cup06Jv6u81HLhIj1KasuNM/RHHrJ8T7wOTS4+Tv53Q= -github.com/libp2p/zeroconf/v2 v2.2.0/go.mod h1:fuJqLnUwZTshS3U/bMRJ3+ow/v9oid1n0DmyYyNO1Xs= github.com/lunixbochs/vtclean v1.0.0/go.mod h1:pHhQNgMf3btfWnGBVipUOjRYhoOsdGqdm/+2c2E2WMI= github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= @@ -356,7 +354,6 @@ github.com/mattn/go-runewidth v0.0.15/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/microcosm-cc/bluemonday v1.0.1/go.mod h1:hsXNsILzKxV+sX77C5b8FSuKF00vh2OMYv+xgHpAMF4= github.com/miekg/dns v1.1.41/go.mod h1:p6aan82bvRIyn+zDIv9xYNUpwa73JcSh9BKwknJysuI= -github.com/miekg/dns v1.1.43/go.mod h1:+evo5L0630/F6ca/Z9+GAqzhjGyn8/c+TBaOyfEl0V4= github.com/miekg/dns v1.1.58 h1:ca2Hdkz+cDg/7eNF6V56jjzuZ4aCAE+DbVkILdQWG/4= github.com/miekg/dns v1.1.58/go.mod h1:Ypv+3b/KadlvW9vJfXOTf300O4UqaHFzFCuHz+rPkBY= github.com/mikioh/tcp v0.0.0-20190314235350-803a9b46060c h1:bzE/A84HN25pxAuk9Eej1Kz9OUelF97nAc82bDquQI8= @@ -676,7 +673,6 @@ golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= -golang.org/x/net v0.0.0-20210423184538-5f58ad60dda6/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= @@ -722,7 +718,6 @@ golang.org/x/sys v0.0.0-20210315160823-c6e025ad8005/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210316164454-77fc1eacc6aa/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210426080607-c94f62235c83/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= diff --git a/node/attestation_idle.go b/node/attestation_idle.go index e132678..eec36eb 100644 --- a/node/attestation_idle.go +++ b/node/attestation_idle.go @@ -176,7 +176,7 @@ func attestation_idle(cli *chain.ChainClient, peernode *core.PeerNode, p *Pois, return errors.Wrapf(err, "[ProveCommitAndAcc]") } - if err == nil && commitProofs == nil && accProof == nil { + if commitProofs == nil && accProof == nil { p.Prover.AccRollback(false) return errors.New("other programs are updating the data of the prover object") } diff --git a/node/calculate_tag.go b/node/calculate_tag.go index 91ac681..034cd91 100644 --- a/node/calculate_tag.go +++ b/node/calculate_tag.go @@ -211,7 +211,7 @@ func calc_tag(cli *chain.ChainClient, cace cache.Cache, l logger.Logger, teeReco func calcTheFragmentTag(l logger.Logger, teeRecord *TeeRecord, signPublicKey []byte, fid, fragmentFile string, maxIndex uint16, lastSign []byte, digest []*pb.DigestInfo) (bool, error) { var err error var isReportTag bool - var teeSign chain.TeeSig + //var teeSign chain.TeeSig var genTag pb.GenTagMsg var teePubkey string var fragmentHash = filepath.Base(fragmentFile) @@ -228,9 +228,9 @@ func calcTheFragmentTag(l logger.Logger, teeRecord *TeeRecord, signPublicKey []b if len(genTag.Signature) != chain.TeeSigLen { return false, fmt.Errorf("invalid Tag.Signature length: %d", len(genTag.Signature)) } - for k := 0; k < chain.TeeSigLen; k++ { - teeSign[k] = types.U8(genTag.Signature[k]) - } + // for k := 0; k < chain.TeeSigLen; k++ { + // teeSign[k] = types.U8(genTag.Signature[k]) + // } var tfile = &TagfileType{ Tag: genTag.Tag, diff --git a/node/report_file.go b/node/report_file.go index 3352e3c..8bfe4c0 100644 --- a/node/report_file.go +++ b/node/report_file.go @@ -58,7 +58,7 @@ func ReportFiles(ch chan<- bool, cli *chain.ChainClient, r *RunningState, l *log } else { r.SetReportFileFlag(true) l.Report("info", fmt.Sprintf("[%s] prepare to report the file", fid)) - err = report_file(cli, l, file, fileDir, tmpDir) + err = report_file(cli, l, file, tmpDir) if err != nil { l.Report("err", fmt.Sprintf("[%s] report file err: %v", fid, err)) } @@ -145,7 +145,7 @@ func check_file(cli *chain.ChainClient, l logger.Logger, f string, fileDir, tmpD return nil } -func report_file(cli *chain.ChainClient, l logger.Logger, f string, fileDir, tmpDir string) error { +func report_file(cli *chain.ChainClient, l logger.Logger, f string, tmpDir string) error { fid := filepath.Base(f) storageorder, err := cli.QueryDealMap(fid, -1) if err != nil { diff --git a/node/discover.go b/node/subscribe.go similarity index 56% rename from node/discover.go rename to node/subscribe.go index 2a26e1e..4780629 100644 --- a/node/discover.go +++ b/node/subscribe.go @@ -18,7 +18,6 @@ import ( pubsub "github.com/libp2p/go-libp2p-pubsub" "github.com/libp2p/go-libp2p/core/host" "github.com/libp2p/go-libp2p/core/peer" - "github.com/libp2p/go-libp2p/p2p/discovery/mdns" ) func Subscribe(ctx context.Context, h host.Host, minerRecord MinerRecord, bootnode string) { @@ -40,11 +39,6 @@ func Subscribe(ctx context.Context, h host.Host, minerRecord MinerRecord, bootno room = core.NetworkRoom } - // setup local mDNS discovery - if err := setupDiscovery(h); err != nil { - return - } - // join the pubsub topic called librum topic, err := gossipSub.Join(room) if err != nil { @@ -57,7 +51,7 @@ func Subscribe(ctx context.Context, h host.Host, minerRecord MinerRecord, bootno return } - out.Ok(fmt.Sprintf("subscribe to a room: %s", room)) + out.Ok(fmt.Sprintf("subscribe to a bootnode: %s", room)) for { msg, err := subscriber.Next(ctx) @@ -78,27 +72,3 @@ func Subscribe(ctx context.Context, h host.Host, minerRecord MinerRecord, bootno minerRecord.SavePeer(findpeer) } } - -// discoveryNotifee gets notified when we find a new peer via mDNS discovery -type discoveryNotifee struct { - h host.Host -} - -// HandlePeerFound connects to peers discovered via mDNS. Once they're connected, -// the PubSub system will automatically start interacting with them if they also -// support PubSub. -func (n *discoveryNotifee) HandlePeerFound(pi peer.AddrInfo) { - fmt.Printf("discovered new peer %s\n", pi.ID.String()) - err := n.h.Connect(context.TODO(), pi) - if err != nil { - fmt.Printf("error connecting to peer %s: %s\n", pi.ID.String(), err) - } -} - -// setupDiscovery creates an mDNS discovery service and attaches it to the libp2p Host. -// This lets us automatically discover peers on the same LAN and connect to them. -func setupDiscovery(h host.Host) error { - // setup mDNS discovery to find local peers - s := mdns.NewMdnsService(h, "", &discoveryNotifee{h: h}) - return s.Start() -}