Skip to content

fix: broken logic, refactoring, and dep updates#115

Merged
dtbuchholz merged 11 commits intomainfrom
dtb/update-sdk-usage
Dec 11, 2023
Merged

fix: broken logic, refactoring, and dep updates#115
dtbuchholz merged 11 commits intomainfrom
dtb/update-sdk-usage

Conversation

@dtbuchholz
Copy link
Copy Markdown
Contributor

Summary

This PR implements a few things:

  • Updates deps to latest SDK and moves dependencies/devDependencies accordingly.
  • Refactors to conform with latest SDK return type for reads with createProcessor.
  • Provides a more secure way (via chatgpt) to use the encryption plugin (even though it's "not recommended," it might as well provide a more robust impl.)
  • Fixes behavior with Pinner class & ipfs-http-client where pinning wasn't working
    • For local-only pinning, the logic was still checking for remote pinning services and always errored out.
    • pinToProvider and pinToLocal now must be instantiated an IPFS node gateway URL before templating is possible.
  • For the Pinner, also allow for raw strings or Uint8Arrays to be pinned, retrieving the CID contents uses cat/streams to get the original text contents.
  • Refactored the truncate method to actually be useful where it truncates text at 1024 bytes to align with table cell limits—i.e., an alternative to using the IPFS plugin & CIDs.

Details

Since the API changes for pinToProvider and pinToLocal as well as behavior for others, this needs a major bump.

@dtbuchholz
Copy link
Copy Markdown
Contributor Author

@joewagner could you maybe give this a passover as well? it basically cleans up existing logic to make it more usable. i've incorporated these changes in the docs site PR, too.

joewagner
joewagner previously approved these changes Dec 11, 2023
Copy link
Copy Markdown
Contributor

@joewagner joewagner left a comment

Choose a reason for hiding this comment

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

@dtbuchholz Thanks for getting this working. I added two inline comments, one is a spelling error, otherwise looks great!

Comment thread README.md Outdated
The [`@tableland/jeti`](https://github.com/tablelandnetwork/jeti) library builds on top of the [`@tableland/sdk`](https://github.com/tablelandnetwork/tableland-js/packages/sdk), allowing you to easily add IPFS data to Tableland and read the underlying data from Tableland. Simply import the library, connect to the Tableland network, and you are ready to start creating, updating, and reading table data.

Simply import the library, connect to the Tableland network, and you are ready to start creating and updating tables.
JETI (JavaScript Extension for Tableland Integrations) is also designed to be extensible. You can create you own custom plugins/processors that transform data inserted into tables or retrieved from tables. For example, the IPFS plugin processes data and inserts a CID in to a cell, and when data is read, it will "see" the CID and fetch/transform the underlying content within the query response. You can do whatever you'd like with an implementation suing the `creatorProcessor` method.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

spelling: should be "using" right?

Comment thread package.json
"ipfs-http-client": "^60.0.1",
"prettier": "^2.8.8",
"ts-node": "^10.9.1"
"ipfs-http-client": "^60.0.1"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@dtbuchholz Do you want to add yourself as a contributor?

@dtbuchholz
Copy link
Copy Markdown
Contributor Author

@joewagner good catches! updated, just need a new 👍 and then i'll publish

@dtbuchholz dtbuchholz merged commit 86d50b7 into main Dec 11, 2023
@dtbuchholz dtbuchholz deleted the dtb/update-sdk-usage branch December 11, 2023 21:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants