ipfs / helia-remote-pinning

A library that helps Helia consumers pin content via the https://ipfs.github.io/pinning-services-api-spec/. Initial design at https://pl-strflt.notion.site/create-interface-API-example-for-helia-remote-pinning-library-71011845a7b9476cb95ab425bb54455c
Other
5 stars 5 forks source link

feat: package improvements #10

Open SgtPooki opened 1 year ago

SgtPooki commented 1 year ago

See comment from @biglep at https://github.com/ipfs/helia-remote-pinning/issues/1#issuecomment-1689242934

  1. We send relayed addresses for Pin.origins
  2. We should only throw an error if we didn't have any public addresses in Pin.origins AND we couldn't connect to Pin.delegates.
  3. Can we produce API docs that make clear when/what errors are thrown?
  4. Make sure README points to the example being created in https://github.com/ipfs-examples/helia-examples/issues/86
### Tasks
- [ ] For 1 above, we want to make sure the addresses we send to the pinning service are dialable by that service.
- [ ] For 2, pretty clear on action and expectations
- [ ] For 3, we should document in readme what errors are thrown and when. (currently only one)
- [ ] For 4, can do
SgtPooki commented 1 year ago

We should provide default filters and allow users to override them. https://github.com/ipfs/helia-remote-pinning/blob/34167fdcbef5616c9adbe94adeaacc8652dc9785/src/heliaRemotePinner.ts#L48

libp2p.getMultiaddrs() only returns addresses that the node is listening on so we only need to filter for public/private by default, and allow users to override that filter for extraneous situations.

if p2p-circuit is enabled, a libp2p node will likely double the number of listening multiaddrs, so we may need to optimize filtering more