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

add PUT /api/v1/tree/pin endpoint #59

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft

add PUT /api/v1/tree/pin endpoint #59

wants to merge 4 commits into from

Conversation

worm-emoji
Copy link
Contributor

@worm-emoji worm-emoji commented Aug 30, 2022

this is a draft attempt at adding a /api/v1/tree/pin endpoint.

this endpoint will pin a json representation of a merkle tree to
ipfs. you can see an example of what this code currently produces
pinned to ipfs://QmXdDyUSsM59MUoeZyDS5uVo8gg4WMenduvehUjP4Hs8KG.

open ideas/questions:

  • should we save ipfs hashes to postgres when we pin them and
    return them via /tree and other endpoints?

  • should we save every tree by default to IPFS? if we do that,
    how do we depend on our pinning provider being down/retries/etc. also
    the latency isn't great as is - even locally pinning was taking 600ms-1s

todos if we want to go ahead with merging this:

  • configure env vars in deploy script + deploy secrets to fly
  • update API docs for lanyard.org
  • update api clients/example ts script

this is a draft attempt at adding a /api/v1/tree/pin endpoint.

this endpoint will pin a json representation of a merkle tree to
ipfs. you can see an example of what this code currently produces
pinned to `[ipfs://QmXdDyUSsM59MUoeZyDS5uVo8gg4WMenduvehUjP4Hs8KG](https://cloudflare-ipfs.com/ipfs/QmXdDyUSsM59MUoeZyDS5uVo8gg4WMenduvehUjP4Hs8KG)`.

open ideas/questions:

- should we save ipfs hashes to postgres when we pin them and
return them via `/tree` and other endpoints?

- should we save every tree by default to IPFS? if we do that,
how do we depend on our pinning provider being down/retries/etc. also
the latency isn't great as is - even locally pinning was taking 600ms-1s
@worm-emoji
Copy link
Contributor Author

tagging @ryandotsmith - would love your thoughts on this idea/implementation

@ourzora ourzora deleted a comment from vercel bot Aug 30, 2022
@vercel
Copy link

vercel bot commented Aug 30, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
lanyard ✅ Ready (Inspect) Visit Preview Aug 30, 2022 at 5:20AM (UTC)

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.

1 participant