Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat!: ask delegated-ipfs.dev in addition to DHT and cid.contact #50

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,13 @@ You can use `someguy` as a client, or as a server.

### Server

You can start the server with `someguy start`. This will, by default, run a Delegated Routing V1 server that proxies requests to the [IPFS Amino DHT](https://blog.ipfs.tech/2023-09-amino-refactoring/) and the [cid.contact](https://cid.contact) indexer (IPNI) node.
You can start the server with `someguy start`. This will, by default, run a Delegated Routing V1 server that proxies requests to the [IPFS Amino DHT](https://blog.ipfs.tech/2023-09-amino-refactoring/), [delegated-ipfs.dev](https://delegated-ipfs.dev) and [cid.contact](https://cid.contact).

For more details run `someguy start --help`.

### Client

If you don't want to run a server yourself, but want to query some other server, you can run `someguy ask` and choose any of the subcommands and ask for a provider, a peer, or even an IPNS record.
If you don't want to run a server yourself, but want to query some other server, you can run `someguy ask` and choose any of the subcommands and ask for a provider, a peer, or even an IPNS record. By default, [delegated-ipfs.dev](https://delegated-ipfs.dev) is the server used.

For more details run `someguy ask --help`.

Expand Down
6 changes: 3 additions & 3 deletions docs/environment-variables.md
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question: how do we avoid cycles in waterworks-infra when someguy with this PR is deployed to delegated-ipfs.dev?
I think we want to avoid a situation where someguy is sending query to itself. Is the plan to set SOMEGUY_PROVIDER_ENDPOINTS="https://cid.contact" SOMEGUY_PEER_ENDPOINTS="" SOMEGUY_IPNS_ENDPOINTS="" in waterworks-infra?

That should be enough, but if we ever need a more generic solution, we could look into ipfs/specs#426.

Original file line number Diff line number Diff line change
Expand Up @@ -32,19 +32,19 @@ Default: `true`

Comma-separated list of other Delegated Routing V1 endpoints to proxy provider requests to.

Default: `https://cid.contact`
Default: `https://cid.contact,https://delegated-ipfs.dev`
Copy link
Member

@lidel lidel Mar 7, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we need to discuss (here or in #24 (comment)) a policy for cases like this one, because whatever we decide here, the same PR could/should be applied to Kubo and Rainbow.

On one hand, makes sense to leverage delegated-ipfs.dev more, allows people to benefit from public caching utility that supports peer and ipns routing and Amino DHT proxy (the https://cid.contact/routing/v1 endpoint does not provide any of these things).

Do we

  • (A) keep both here and accept duplicated IPNI (cid.contact) results for improved resiliency,
  • (B) or is it better to remove cid.contact from being hardcoded in our software (since we are not ones operating that IPNI instance) and hide it behind our caching proxy, which already talks to cid.contact and caches results?

cc @aschmahmann


### `SOMEGUY_PEER_ENDPOINTS`

Comma-separated list of other Delegated Routing V1 endpoints to proxy peer requests to.

Default: none
Default: `https://delegated-ipfs.dev`

### `SOMEGUY_IPNS_ENDPOINTS`

Comma-separated list of other Delegated Routing V1 endpoints to proxy IPNS requests to.

Default: none
Default: `https://delegated-ipfs.dev`

## Logging

Expand Down
13 changes: 8 additions & 5 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@
"github.com/urfave/cli/v2"
)

const cidContactEndpoint = "https://cid.contact"
const (
cidContactEndpoint = "https://cid.contact"
delegatedIpfsEndpoint = "https://delegated-ipfs.dev"
)

func main() {
app := &cli.App{
Expand All @@ -36,19 +39,19 @@
},
&cli.StringSliceFlag{
Name: "provider-endpoints",
Value: cli.NewStringSlice(cidContactEndpoint),
Value: cli.NewStringSlice(cidContactEndpoint, delegatedIpfsEndpoint),

Check warning on line 42 in main.go

View check run for this annotation

Codecov / codecov/patch

main.go#L42

Added line #L42 was not covered by tests
EnvVars: []string{"SOMEGUY_PROVIDER_ENDPOINTS"},
Usage: "other Delegated Routing V1 endpoints to proxy provider requests to",
},
&cli.StringSliceFlag{
Name: "peer-endpoints",
Value: cli.NewStringSlice(),
Value: cli.NewStringSlice(delegatedIpfsEndpoint),

Check warning on line 48 in main.go

View check run for this annotation

Codecov / codecov/patch

main.go#L48

Added line #L48 was not covered by tests
EnvVars: []string{"SOMEGUY_PEER_ENDPOINTS"},
Usage: "other Delegated Routing V1 endpoints to proxy peer requests to",
},
&cli.StringSliceFlag{
Name: "ipns-endpoints",
Value: cli.NewStringSlice(),
Value: cli.NewStringSlice(delegatedIpfsEndpoint),

Check warning on line 54 in main.go

View check run for this annotation

Codecov / codecov/patch

main.go#L54

Added line #L54 was not covered by tests
EnvVars: []string{"SOMEGUY_IPNS_ENDPOINTS"},
Usage: "other Delegated Routing V1 endpoints to proxy IPNS requests to",
},
Expand All @@ -62,7 +65,7 @@
Flags: []cli.Flag{
&cli.StringFlag{
Name: "endpoint",
Value: cidContactEndpoint,
Value: delegatedIpfsEndpoint,
Usage: "the Delegated Routing V1 endpoint to ask",
},
&cli.BoolFlag{
Expand Down
Loading