<commit_before><p align="center">
  <img src="https://blockstack.org/images/resources/browser-home-screen@2x.png" alt="Blockstack Browser screenshot" width="686" height="306">
</p>

# Blockstack Browser [![CircleCI](https://img.shields.io/circleci/project/blockstack/blockstack-browser/master.svg)](https://circleci.com/gh/blockstack/blockstack-browser/tree/master) [![License](https://img.shields.io/github/license/blockstack/blockstack-browser.svg)](https://github.com/blockstack/blockstack-browser/blob/master/LICENSE.md) [![Slack](https://img.shields.io/badge/join-slack-e32072.svg?style=flat)](http://slack.blockstack.org/)

The Blockstack Browser allows you to explore the Blockstack internet.

## Table of contents

- [Releases](#releases)
- [Developing](#developing)
- [Building for macOS](#building-for-macos)
- [Building for the Web](#building-for-the-web)
- [Contributing](#contributing)
- [Logging](#logging)
- [Tech Stack](#tech-stack)
- [Testing](#testing)

## Releases

[Download the latest release](https://github.com/blockstack/blockstack-browser/releases)

## Developing

Blockstack Browser requires a local instance of Blockstack Core to run. To get started, first install Blockstack Core and then proceed with the installation of Blockstack Browser.

### macOS

Blockstack for macOS contains a Blockstack Core API endpoint & a CORS proxy.

*Please note these instructions have only been tested on macOS 10.13*

1. Download and install the [latest release of Blockstack for Mac](https://github.com/blockstack/blockstack-browser/releases).
1. Start Blockstack
1. Option-click the Blockstack menu bar item and select "Enable Development Mode"
1. Clone this repo: `git clone https://github.com/blockstack/blockstack-browser.git`
1. Install node dependencies: `npm install`
1. Click the Blockstack menu bar item and select "Copy Core API password"
1. Run `npm run dev`
1. When prompted in your browser, enter the Core API password and click save.


### Linux

#### Part 1: Install & configure Blockstack Core

1. Install [Blockstack Core](https://github.com/blockstack/blockstack-core). Please follow the instructions in Blockstack Core's repository.
1. Setup the Blockstack Core wallet: `blockstack setup`. You will be prompted to select a wallet password. *Skip this step if you already have a Core wallet*
1. Start the Blockstack Core API: `blockstack api start --api_password <core-api-password> --password <wallet-password>` where `<core-api-password>` is a String value you select and `<wallet-password>` is the wallet password you selected previously.
1. Make sure there's a local Blockstack Core API running by checking `http://localhost:6270/v1/names/blockstack.id` to see if it returns a response.

#### Part 2: Install Blockstack Browser

1. Clone this repo: `git clone https://github.com/blockstack/blockstack-browser.git`
1. Install node dependencies: `npm install`
1. Run `npm run dev-proxy` to start the CORS proxy
1. Run `npm run dev`
1. When prompted in your browser, enter the Core API password you selected in part 1.


*Note: npm dev runs a BrowserSync process that watches the assets in `/app`, then builds them and places them in `/build`, and in turn serves them up on port 3000. When changes are made to the original files, they are rebuilt and re-synced to the browser frames you have open.*


### Windows

*Note: The installation instructions below are for setting up a development environment on Windows 10. If you are using Blockstack for the first time or are looking to try Blockstack out, please go to our [downloads page](https://blockstack.org/install) and install the version there.*

The Blockstack API and the Blockstack Browser run best in Docker. There is a provided CLI to help you build and launch `docker` images if you are not comfortable with `docker`:`launcher`. The CLI will pull down the images from our [Quay image repository](https://quay.io/organization/blockstack).

1. Download the [launcher script](https://raw.githubusercontent.com/blockstack/packaging/master/browser-core-docker/launcher) from our packaging repository.

2. In order to use the launcher script, you must have Docker installed and setup on your machine. Our [Windows installer](http://packages.blockstack.com/repositories/windows/) sets up Docker for you and uses the launcher script to start Blockstack Browser automatically. The same Windows installer can be found on the [Installing Blockstack README](https://github.com/blockstack/blockstack-core#installing-blockstack).

3. Run `./launcher pull`. This will fetch the latest docker images from our image repository.

4. Start the Blockstack Core API using `./launcher start`. This will start the Blockstack browser and a paired `blockstack-api` daemon. The first time you run this, it will create a `$HOME/.blockstack` directory to store your Blockstack Core API configuration and wallet. You will also need to create a password to protect these configurations.

5. When you are done, you can clean up your environment: `./launcher stop`


## Building for macOS

1. Make sure you have a working installation of Xcode 9 or higher & valid Mac Developer signing certificate<commit_msg>document a couple of common problems I and others have encountered when running the browser on Linux in development mode<commit_after><p align="center">
  <img src="https://blockstack.org/images/resources/browser-home-screen@2x.png" alt="Blockstack Browser screenshot" width="686" height="306">
</p>

# Blockstack Browser [![CircleCI](https://img.shields.io/circleci/project/blockstack/blockstack-browser/master.svg)](https://circleci.com/gh/blockstack/blockstack-browser/tree/master) [![License](https://img.shields.io/github/license/blockstack/blockstack-browser.svg)](https://github.com/blockstack/blockstack-browser/blob/master/LICENSE.md) [![Slack](https://img.shields.io/badge/join-slack-e32072.svg?style=flat)](http://slack.blockstack.org/)

The Blockstack Browser allows you to explore the Blockstack internet.

## Table of contents

- [Releases](#releases)
- [Developing](#developing)
- [Building for macOS](#building-for-macos)
- [Building for the Web](#building-for-the-web)
- [Contributing](#contributing)
- [Logging](#logging)
- [Tech Stack](#tech-stack)
- [Testing](#testing)

## Releases

[Download the latest release](https://github.com/blockstack/blockstack-browser/releases)

## Developing

Blockstack Browser requires a local instance of Blockstack Core to run. To get started, first install Blockstack Core and then proceed with the installation of Blockstack Browser.

### macOS

Blockstack for macOS contains a Blockstack Core API endpoint & a CORS proxy.

*Please note these instructions have only been tested on macOS 10.13*

1. Download and install the [latest release of Blockstack for Mac](https://github.com/blockstack/blockstack-browser/releases).
1. Start Blockstack
1. Option-click the Blockstack menu bar item and select "Enable Development Mode"
1. Clone this repo: `git clone https://github.com/blockstack/blockstack-browser.git`
1. Install node dependencies: `npm install`
1. Click the Blockstack menu bar item and select "Copy Core API password"
1. Run `npm run dev`
1. When prompted in your browser, enter the Core API password and click save.


### Linux

#### Part 1: Install & configure Blockstack Core

1. Install [Blockstack Core](https://github.com/blockstack/blockstack-core). Please follow the instructions in Blockstack Core's repository.
1. Setup the Blockstack Core wallet: `blockstack setup`. You will be prompted to select a wallet password. *Skip this step if you already have a Core wallet*
1. Start the Blockstack Core API: `blockstack api start --api_password <core-api-password> --password <wallet-password>` where `<core-api-password>` is a String value you select and `<wallet-password>` is the wallet password you selected previously.
1. Make sure there's a local Blockstack Core API running by checking `http://localhost:6270/v1/names/blockstack.id` to see if it returns a response.

#### Part 2: Install Blockstack Browser

1. Clone this repo: `git clone https://github.com/blockstack/blockstack-browser.git`
1. Install node dependencies: `npm install`
1. Run `npm run dev-proxy` to start the CORS proxy
1. Run `npm run dev`
1. When prompted in your browser, enter the Core API password you selected in part 1.


*Note: npm dev runs a BrowserSync process that watches the assets in `/app`, then builds them and places them in `/build`, and in turn serves them up on port 3000. When changes are made to the original files, they are rebuilt and re-synced to the browser frames you have open.*

##### Troubleshooting

Common problems and solutions:

* **The sign-in page does not load**:  These instructions run the Browser in development
  mode, which uses a different port (3000) than the production mode (8888).
However, existing applications will direct you to `http://localhost:8888` on
sign-in.  You will need to *manually* edit the URL to change `8888` to `3000`
and refresh the page.

* **The sign-in page does not load with localhost:3000**:  If you have taken the
  above step and the page still does not load, check your `auth=` query
parameter.  If it starts with any number of `/` characters, remove them and
reload the page.

### Windows

*Note: The installation instructions below are for setting up a development environment on Windows 10. If you are using Blockstack for the first time or are looking to try Blockstack out, please go to our [downloads page](https://blockstack.org/install) and install the version there.*

The Blockstack API and the Blockstack Browser run best in Docker. There is a provided CLI to help you build and launch `docker` images if you are not comfortable with `docker`:`launcher`. The CLI will pull down the images from our [Quay image repository](https://quay.io/organization/blockstack).

1. Download the [launcher script](https://raw.githubusercontent.com/blockstack/packaging/master/browser-core-docker/launcher) from our packaging repository.

2. In order to use the launcher script, you must have Docker installed and setup on your machine. Our [Windows installer](http://packages.blockstack.com/repositories/windows/) sets up Docker for you and uses the launcher script to start Blockstack Browser automatically. The same Windows installer can be found on the [Installing Blockstack README](https://github.com/blockstack/blockstack-core#installing-blockstack).

3. Run `./launcher pull`. This will fetch the latest docker images from our image repository.

4. Start the Blockstack Core API using `./launcher start`. This will start the Blockstack browser and a paired `blockstack-api` daemon. The first time you run this, it will create a `$HOME/.blockstack` directory to store your Blockstack Core API configuration and wallet. You will also need to create a password to protect these configurations.

5. When you are done, you can clean up your environment: `./launcher stop`


## Building for macOS

1. Make sure you have a working installation of Xcode 9 or higher & valid Mac Developer signing certificate
{'fraction_non_alphanumeric': 0.09385988639437381, 'fraction_numerical': 0.011901541790641061, 'mean_word_length': 4.74120082815735, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, 'https://': 30, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 16, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1287371', 'n_tokens_mistral': 3121, 'n_tokens_neox': 2911, 'n_words': 1336}