-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
feat(routing): Delegated Routing #8997
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
Changes from 15 commits
0638d25
104ae3e
b742db9
420c6fd
2f93364
25b9683
0f549a2
c6fb6e5
0b5c9d4
1ed2be0
32c6bba
4bff8ff
dc128d8
bc00d2d
43bc61e
6cb3a11
2f57adf
e3e2c6b
72e9546
4feb2ac
1e42022
04014f5
8020ba8
70d50fe
45a716e
79ed919
1cf68ff
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,5 +5,40 @@ type Routing struct { | |
| // Type sets default daemon routing mode. | ||
| // | ||
| // Can be one of "dht", "dhtclient", "dhtserver", "none", or unset. | ||
| Type *OptionalString `json:",omitempty"` | ||
|
|
||
| Routers map[string]Router | ||
| } | ||
|
|
||
| type Router struct { | ||
|
|
||
| // Currenly only supported Type is "reframe". | ||
| // Reframe type allows to add other resolvers using the Reframe spec: | ||
| // https://github.com/ipfs/specs/blob/master/REFRAME.md | ||
|
lidel marked this conversation as resolved.
Outdated
|
||
| // In the future we will support "dht" and other Types here. | ||
| Type string | ||
|
|
||
| Enabled Flag `json:",omitempty"` | ||
|
|
||
| // Parameters are extra configuration that this router might need. | ||
| // A common one for reframe endpoints is "address". | ||
| Parameters map[string]string | ||
| } | ||
|
|
||
| // Type is the routing type. | ||
| // Depending of the type we need to instantiate different Routing implementations. | ||
| type RouterType string | ||
|
|
||
| const ( | ||
| RouterTypeReframe RouterType = "reframe" | ||
| ) | ||
|
|
||
| type RouterParam string | ||
|
|
||
| const ( | ||
| // RouterParamAddress is the URL where the routing implementation will point to get the information. | ||
| // Usually used for reframe Routers. | ||
| RouterParamAddress RouterParam = "address" | ||
|
|
||
| RouterParamPriority RouterParam = "priority" | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @lidel idk if you have thoughts here, but I'm not sure how much we want to expose here. Might be useful info to have to understand some notion of user preference, but also we may want to just do more in parallel depending on our concerns about resource usage. AFAICT the only areas where priority kicks in are for the GetValue, GetPublicKey and FindPeer functions (https://github.com/libp2p/go-libp2p-routing-helpers/blob/506670d53a31503f257980dbf354b3ea1b990fb7/tiered.go#L30).
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @aschmahmann If we talk about future where we have DHT routers here as well, I think we need two optional settings:
With these, we will be able to model custom rules around parallelism and best-effort/mandatory routers in the future, but for now we can skip them in config (thus optional with implicit default).
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If we add the
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ack, this needs a design first.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. add an issue to track it: #9083 |
||
| ) | ||
Uh oh!
There was an error while loading. Please reload this page.