Skip to content

Add IPFS pinning example and better error messages when it fails #2

@jsolly

Description

@jsolly

Context

Currently there is no example in the readme that shows how to pin data to IPFS using the client. This would be a good example to show toward the bottom as it's often the thing you do after fetching or creating data.

Current Behavior/Workaround

It looks like the band object has a pin method.

So the user can do band.pin() to pin the data to the local gateway.

Ideal behavior

We might want to re-think this band_Obj class. It would probably make more sense if it was called asset since that will work with many different kinds of data on STAC (Not just Landsat imagery).

So the user would do something like:

item = easier.searchSTACByBox([-76.964657, 38.978967, -76.928008, 39.002783], ["<STAC COLLECTION GOES HERE>"], 0)
asset = easier.getAssetFromItem(item, 'ASSET NAME GOES HERE') # Returns Asset object

If the user has not provided a local gateway when they attempt to call pin() there should be an informative message like:

"The pin operation could not be completed - Pinning files requires an IPFS node running locally (A local gateway). Remote gateways do not support pinning. Please start the IPFS daemon on your machine and try again."

Things to consider

Should the refactoring to use Asset instead of Band be captured in a new issue?

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions