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 subscription based cache refresh #2

Open
4 tasks
ghost opened this issue Jul 9, 2021 · 1 comment
Open
4 tasks

add subscription based cache refresh #2

ghost opened this issue Jul 9, 2021 · 1 comment
Labels
enhancement New feature or request
Milestone

Comments

@ghost
Copy link

ghost commented Jul 9, 2021

add subscription based cache refresh.

The current design is optimisic and friendly, it assumes that nobody will spam cache_nft for invalid CIDs.

subscribe specifies the port and protocol used for a callback, the ip address is implied.

unsubscribe removed the ip address from the callback.

has_template_cached returns true if a specific nft template is already cached, based on a CID.
this will internally call get_nft_template_list, which lists all known templates.

cache_template instructs the node to cache a specific nft template, based on a CID.
this will internally call get_nft_template_owner, which caches all template related information.

  • add subscribe {"action": "subscribe", "protocol":"^http|https$", "port":"^[0-9'+$"}
  • add unsubscribe {"action": "unsubscribe"}
  • add has_template_cached {"action": "has_template_cached", "cid", "<cid>"}
  • add cache_template {"action": "cache_template", "cid", "<cid>"}
@ghost ghost self-assigned this Jul 9, 2021
@ghost ghost added the enhancement New feature or request label Jul 9, 2021
@ghost ghost added this to the 1.0.0 milestone Jul 9, 2021
@Airtune
Copy link

Airtune commented Jul 10, 2021

Maybe it would make more sense for the node to simply cache all chains for a template. In most cases this will be called after announcing the template on the Banano ledger and might not even have any sends yet.
I suggest:
cache_assets {"action": "cache_assets", "ipfs_cid": "<nft-template-ipfs-cid>"}
has_assets_cached{"action": "has_assets_cached", "ipfs_cid": "<nft-template-ipfs-cid>"}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant