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

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

Merged
merged 11 commits into from
Dec 11, 2023
Merged

Conversation

dtbuchholz
Copy link
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
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
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!

README.md Outdated

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
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?

"ipfs-http-client": "^60.0.1",
"prettier": "^2.8.8",
"ts-node": "^10.9.1"
"ipfs-http-client": "^60.0.1"
Copy link
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
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
2 checks passed
@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