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

[feature](snap, connector): allow developers and users to set their own Ceramic API endpoint #391

Open
pseudobun opened this issue Aug 10, 2023 · 0 comments
Labels
connector feature New feature or request good first issue Good for newcomers snap

Comments

@pseudobun
Copy link
Member

Summary

To make Masca even more configurable, we should allow dApp developers and our users to set their own Ceramic node URL.

Expected behavior / User Story

dApp developers could set their own URL in enableMasca method in connector.
Users could set their own URL on settings page.
Upon RPC calls that need Ceramic:

function healthCheck(url):
    // Perform healthcheck logic here
    if url is healthy:
        return true
    else:
        return false

function getCeramicUrl():
    state = getState() // Get the user's state
    userUrl = state.get("userUrl") // Get user's custom URL from state

    if userUrl is not null and healthCheck(userUrl):
        return userUrl

    dappUrl = getDappUrl() // Get URL provided by developers
    if dappUrl is not null and healthCheck(dappUrl):
        return dappUrl
    
    // Consider checking the fallback URL maybe to ensure that it works and if it doesn't throw error
    return fallbackUrl // will probably be smth like https://ceramic.masca.io
@pseudobun pseudobun added feature New feature or request snap connector good first issue Good for newcomers labels Aug 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
connector feature New feature or request good first issue Good for newcomers snap
Projects
None yet
Development

No branches or pull requests

1 participant