Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

Brave Payments should have a dev mode using testnet Bitcoin #4286

Closed
willy-b opened this issue Sep 25, 2016 · 9 comments
Closed

Brave Payments should have a dev mode using testnet Bitcoin #4286

willy-b opened this issue Sep 25, 2016 · 9 comments

Comments

@willy-b
Copy link
Contributor

willy-b commented Sep 25, 2016

Did you search for similar issues before submitting this one?
Yes

Describe the issue you encountered:
While testing/developing for Brave Payments, one must buy at least $5 of Bitcoin to get started.
Every time browsing data is updated with the Ledger server, >= $5 of Bitcoin must be contributed again.

Expected behavior:
For development purposes, one should be able to use testnet Bitcoin, which can be obtained on demand from a testnet faucet (without signing up with Coinbase, etc), saving time and money for those who want to contribute to Brave Ledger development.

  • Affects all Platforms and Brave versions
  • Steps to reproduce:
    1. Open Preferences -> Brave Payments
    2. Enable Payments and create a Wallet.
    3. Observe minimum funding amount is $5, and real Bitcoin is required (even in development mode).

Proposed solution:
The current Ledger server code supports testnet if run with BITGO_ENVIRONMENT=test , with a BITGO_TOKEN obtained from test.bitgo.com .
A second Ledger instance with these settings could be run, say on ledger-test.brave.com . (I am running such an instance privately now for my own testing.)

It then only takes a couple of tiny updates to ledger-balance, ledger-client, and browser-laptop to support an environment variable allowing testnet bitcoin to be used.

Once this is done, here's what it looks like to setup a fresh install of Brave with a " >$3,000 " deposit in < 2min by visiting a testnet faucet webpage:
brave_with_testnet_coin_example

After that you can test Brave Payments 600 times without thinking of funding again :-).

@willy-b
Copy link
Contributor Author

willy-b commented Sep 30, 2016

FYI, there is now a WIP PR in brave/ledger which should make it much easier to run a testnet server (brave/ledger#8)

Partial instructions for running a Ledger server in AWS using docker-machine with that branch are here:
https://github.com/willy-b/ledger/blob/d4f88a9be2735ab96069838a836aaf3a00c53ae9/docker-machine-example.md

@willy-b
Copy link
Contributor Author

willy-b commented Sep 30, 2016

Availability is not guaranteed, but I will be running a Ledger server using testnet bitcoin at ledger-testnet.entropi.info most of the time, see http://ledger-testnet.entropi.info/documentation to test availability.

#4297 shows how to point Brave at the testnet Ledger server.

@mrose17
Copy link
Member

mrose17 commented Oct 11, 2016

@willy-b - it seems to me that if the browser uses a ledger server using testnet, then that ledger server will be telling it where to get the server list for balances (GET /v1/balance/providers), and the ledger server will be talking to testnet as well.

if so, then to resolve this we really need to add an option that tells the browser what ledger server to boot from, right?

@willy-b
Copy link
Contributor Author

willy-b commented Oct 12, 2016

@mrose17, my thoughts exactly. There's an open PR #4297 for letting an ENV variable "LEDGER_SERVER_URL" tell the browser what Ledger server to use.

I think an ENV variable is sufficient rather than adding this to the UI since it is really is only useful for development (We don't actually want to pay Publishers testnet coin :-) ).

@willy-b
Copy link
Contributor Author

willy-b commented Oct 16, 2016

With the resolution of brave/ledger-balance#1 and #4297 I'm going to mark this closed.

Anyone can use testnet coin to test Ledger features now by running Brave with the environment variable "LEDGER_SERVER_URL" set to point to a Ledger server running against Bitcoin testnet (e.g. "http://ledger-testnet.entropi.info" ).

LMK if anyone has difficulty doing this. Thanks.

@willy-b willy-b closed this as completed Oct 16, 2016
@luixxiul
Copy link
Contributor

luixxiul commented Oct 16, 2016

@willy-b thanks for your contribution! If you don't mind, would you please create a wiki page to explain how to use testnet faucet webpage? That would help a lot of people who have not followed this thread :-)

@willy-b
Copy link
Contributor Author

willy-b commented Oct 17, 2016

will do @luixxiul

@willy-b
Copy link
Contributor Author

willy-b commented Oct 19, 2016

@luixxiul
Copy link
Contributor

Lovely! thanks 👍

# for free to subscribe to this conversation on GitHub. Already have an account? #.
Projects
None yet
Development

No branches or pull requests

4 participants