Stacks-wallet-web: [app] Provide configuration details to run the app locally and with mocknet

Created on 5 Oct 2020  ·  6Comments  ·  Source: blockstack/stacks-wallet-web

Currently, the

  • WalletSigner.getNetwork is hardcoded.
  • getRPCClient chooses between localhost and a hardcoded url based on location.origin

For app developers it is not possible to test their apps against a local mocknet.

The setup should be configurable and documented.

enhancement

All 6 comments

As a first step, I suggest to add a parameter localnode=1 to authOrigin when the local stacks node on port 3999 should be used.
The payload does contain a network specification, this should be used in the signing call.

I think it's more complicated then simply accepting the node value from authOptions. That options is really just to signal "testnet" vs "mainnet". What we need is a way for users to set their node value. And, you'll want to switch between different networks for local development.

I think we can figure out an easier solution for enabling developers, and we'll need something more robust for mainnet / end users.

@hstove Indeed, you are right. I have updated my comment. We could just use the network from the payload for now for developers.

For mainnet, would the authenticator take the network from the payload or if there is a UI from the authenticator UI?

As a temporary workaround you can use the authenticator from https://github.com/friedger/blockstack-app-1/tree/fix/network

In your app provide authOrigin as localhost:8080 in your AuthOptions.

Launch the authenticator with yarn dev (you might need to edit package.json and remove the testapp if your app runs on port 3000)

@psq has also indicated a desire to see this addressed soon

I'll send a PR to update the relevant doc

Was this page helpful?
0 / 5 - 0 ratings