Skip to content

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

Description

@pseudobun

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions