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

multiple providers: work tracker issue #6902

Closed
4 of 7 tasks
frankiebee opened this issue Jul 24, 2019 · 10 comments
Closed
4 of 7 tasks

multiple providers: work tracker issue #6902

frankiebee opened this issue Jul 24, 2019 · 10 comments
Assignees

Comments

@frankiebee
Copy link
Contributor

frankiebee commented Jul 24, 2019

goal:
initialize all providers instead of creating and destroying on network switch while maintaining same external behavior

high level todos:

  • (Migration needed) pass in all end points
  • remove the storage of endpoints from preferences controller
  • initialize all providers
  • continue same external behavior of the provider
  • QA
  • some UI tweaks for sanity of params
  • frankie dont go to overboard
@frankiebee frankiebee self-assigned this Jul 24, 2019
@frankiebee
Copy link
Contributor Author

frankiebee commented Jul 24, 2019

current status: broke up provider initialization and proxy management into to files

notes/low level todos:
default networks:
- [ ] never initialize any local hosts unless it's tests. (side option try to initialize and have graceful fallback?)

  • if selected network is a non infura fallback to infura if possible
    - [ ] network.stop()
    metamaskController:

  • async updateAndSetCustomRpc (rpcUrl, chainId, ticker = 'ETH', nickname, rpcPrefs) {

  • async setCustomRpc (rpcTarget, chainId, ticker = 'ETH', nickname = '', rpcPrefs = {}) {

  • async delCustomRpc (rpcTarget) {

@frankiebee
Copy link
Contributor Author

frankiebee commented Jul 24, 2019

MIGRATION NEEDS:

  • PreferencesController.frequentRpcListDetail -> NetworkController.networkConfigs

- [ ] network controller needs selected network and networkconfigs
include the defaults in networkConfigs
check what default ticker is needed

@frankiebee
Copy link
Contributor Author

frankiebee commented Jul 24, 2019

  • if possible unify object in network controller:
  • rpcTarget -> rpcUrl
  • nickname -> name
  • flatten rpcPrefs
 networkConfig = {
    rpcUrl,
    type, // default#type(chainId) || custom#type(chainId) ???
    name,
    chainId,
    blockExplorer,
  }

network class config:

  config = { // should ever only be things for the provider or network class no extra bs
    rpcUrl,
    type,
    chainId, // for ethClassic
  }

@frankiebee frankiebee changed the title multiple providers: work tracker issues multiple providers: work tracker issue Jul 24, 2019
@bdresser bdresser added this to the Backend Sprint 17 [July 22] milestone Jul 24, 2019
@frankiebee
Copy link
Contributor Author

frankiebee commented Jul 29, 2019

  • ui needs some method updates
    more things to come

@frankiebee
Copy link
Contributor Author

updateAndSetCustomRpc -> takes a single object
async updateAndSetCustomRpc (networkConfig) {

@frankiebee
Copy link
Contributor Author

frankiebee commented Jul 30, 2019

actual:

networkConfig = {
    rpcUrl,
    type, // infura#eth:mainnet || custom#eth:rpc
    custom: {
      name,
      chainId,
      blockExplorer,
      ticker,
    }
  }

@frankiebee
Copy link
Contributor Author

  • ensure the initialize param is discarded if passed to the constructor

@frankiebee
Copy link
Contributor Author

wooooooooooo

  1104 passing (5s)
  2 failing

sooooo close and yet so far

@danfinlay
Copy link
Contributor

Let's take a little time to explore H4v0c's work on abstracting multiple chain providers, see if there's a chance to leverage their work at all: http://chainstackjs.org/

@frankiebee
Copy link
Contributor Author

  • needs docs

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

No branches or pull requests

5 participants