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
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
enableMascamethod in connector.Users could set their own URL on settings page.
Upon RPC calls that need Ceramic: