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

I want to be able to store my local data #152

Closed
4 tasks
christianbrb opened this issue May 16, 2019 · 7 comments
Closed
4 tasks

I want to be able to store my local data #152

christianbrb opened this issue May 16, 2019 · 7 comments

Comments

@christianbrb
Copy link
Contributor

christianbrb commented May 16, 2019

User Story

As Chris, I want to be able to store my local data so that I can restart in another browser or on another machine.

Acceptance criteria

  • JSON is locally downloaded
  • JSON can be loaded back again
  • User knows they shouldn't run two instances in parallel without syncing their state by downloading/uploading the respective states before starting each instance

Tasks

  • Split issue and iterate
  • Initial UX/UI design (download/upload button)
  • Initial soultion, add a download button, alt. dropdown
  • "Proper" solution, introduce the settings menu
@christianbrb christianbrb changed the title I want to be able to store my local data s I want to be able to store my local data May 16, 2019
@christianbrb
Copy link
Contributor Author

I have met @RachBLondon from 3Box. They have been developing a wrapper to easily use IPFS.
MetaMask is also using it to enable the user to backup their data.

@RachBLondon
Copy link

@christianbrb happy to set up a call if thats useful

@christianbrb christianbrb added this to the Product Backlog milestone Jan 7, 2020
@christianbrb
Copy link
Contributor Author

We check with Rachel how easy it is to set this up and create a new issue for the 3Box integration.

First step:
Just download and upload the JSON locally -> we would need a UI for it -> Settings Screen?

Upload:

  • Stop the SDK
  • Block the UI
  • Show a snackbar

Prototype: Web-UI Address Book

@andrevmatos
Copy link
Contributor

This depends on #614

@andrevmatos
Copy link
Contributor

andrevmatos commented Feb 18, 2020

Ok, now that the above issue is solved, this can be implemented:

  • To download the state, there may be a Save State button in the running instance of the dApp:
    • Once the user clicks to download, warns them that the dApp will be stopped, and that they should only connect to it again on browser if they don't plan to load the Saved State somewhere else, as running multiple instances of the Light Client in parallel is not supported and may cause undefined behavior
    • Stop the SDK, call encodeRaidenState(raiden.state) (exported from raiden-ts, which will return a stringified JSON), and offer it to be downloaded as a JSON file.
      • Filename suggestion: raiden_goerli_${address}_2020-02-18T11:44:13.json
  • To upload the state, there may be a Load State button in the stopped instance, aka Connect screen:
    • The file content may be passed as a string, the SDK will parse it. No need to validate filename, SDK will validate its content
    • Loading a state works as clicking on Connect, but with the new state, therefore it's expected that the account on Metamask is loaded and matches the one in the state. It'll reject if not.
    • If the user has used this account on current browser after the backup (meaning there's a stored state which is newer than the backup), it'll reject as well. The user will need to clean localStorage by hand then if wants to force loading the backup.
    • The SDK's create can be called as:
const raiden = await Raiden.create(provider, account, { storage: window.localStorage, state: 'json file string' }, ...);

@taleldayekh taleldayekh added the 5 label Feb 20, 2020
@christianbrb christianbrb modified the milestone: Product Backlog Feb 24, 2020
@taleldayekh taleldayekh removed this from the Product Backlog milestone Mar 2, 2020
@taleldayekh taleldayekh self-assigned this Mar 2, 2020
@taleldayekh
Copy link
Contributor

Currently looking at an initial design solution for this.

@taleldayekh
Copy link
Contributor

general

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants