Skip to content
This repository has been archived by the owner on Sep 5, 2024. It is now read-only.

Commit

Permalink
docs: deprecate relay v1
Browse files Browse the repository at this point in the history
this adds clear messaging that V1 is no more,
refusing to run for users who are still using this project
to provide RelayV1. The goal here is to inform them they use deprecated
protocol that is no longer supported by the swarm.
  • Loading branch information
lidel committed Sep 5, 2024
1 parent 4119058 commit 593569a
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 10 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
> [!WARNING]
> # No longer maintained. No longer relevant.
>
> This project is no longer maintained, was used in transitional period when ecosystem was switching from V1 to V2.
> `go-libp2p` >= `v0.26.0` [no longer supports Relay V1](https://github.com/libp2p/go-libp2p/issues/2075), making this project outdated.
>
> Modern deployments should implement their own relay setups built with Relay V2, supported via [go-lib2p2](https://github.com/libp2p/go-libp2p) and `libp2p.EnableRelayService`
# libp2p-relay-daemon

> A standalone daemon that provides libp2p circuit relay services,
Expand Down
19 changes: 10 additions & 9 deletions cmd/libp2p-relay-daemon/main.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package main

import (
"errors"
"flag"
"fmt"
"net/http"
Expand Down Expand Up @@ -108,16 +109,16 @@ func main() {
panic(err)
}

if cfg.RelayV2.Enabled {
fmt.Printf("Starting RelayV2...\n")
_, err = relayv2.New(host,
relayv2.WithResources(cfg.RelayV2.Resources),
relayv2.WithACL(acl))
if err != nil {
panic(err)
}
fmt.Printf("RelayV2 is running!\n")
if !cfg.RelayV2.Enabled {
panic(errors.New("RelayV2.Enabled=false is no longer supported. V2 is the only supported version now (https://github.com/libp2p/go-libp2p/issues/2075)"))

Check warning on line 113 in cmd/libp2p-relay-daemon/main.go

View check run for this annotation

Codecov / codecov/patch

cmd/libp2p-relay-daemon/main.go#L112-L113

Added lines #L112 - L113 were not covered by tests
}
_, err = relayv2.New(host,
relayv2.WithResources(cfg.RelayV2.Resources),
relayv2.WithACL(acl))
if err != nil {
panic(err)

Check warning on line 119 in cmd/libp2p-relay-daemon/main.go

View check run for this annotation

Codecov / codecov/patch

cmd/libp2p-relay-daemon/main.go#L115-L119

Added lines #L115 - L119 were not covered by tests
}
fmt.Printf("RelayV2 is running!\n")

Check warning on line 121 in cmd/libp2p-relay-daemon/main.go

View check run for this annotation

Codecov / codecov/patch

cmd/libp2p-relay-daemon/main.go#L121

Added line #L121 was not covered by tests

select {}
}
Expand Down
2 changes: 1 addition & 1 deletion version.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"version": "v0.4.0"
"version": "v0.5.0"
}

0 comments on commit 593569a

Please sign in to comment.