<commit_before>The Things Network
==================

[![Build Status](https://travis-ci.org/TheThingsNetwork/ttn.svg?branch=develop)](https://travis-ci.org/TheThingsNetwork/ttn) [![Slack Status](https://slack.thethingsnetwork.org/badge.svg)](https://slack.thethingsnetwork.org/) [![Coverage Status](https://coveralls.io/repos/github/TheThingsNetwork/ttn/badge.svg?branch=develop)](https://coveralls.io/github/TheThingsNetwork/ttn?branch=develop)

![The Things Network](http://thethingsnetwork.org/static/ttn/media/The%20Things%20Uitlijning.svg)

The Things Network is a global open crowdsourced Internet of Things data network.

## Getting Started With The Things Network

When you get started with The Things Network, you'll probably have some questions. Here are some things you can do to find the answer to them:

- Check out our [website](https://www.thethingsnetwork.org/) and see how [others get started](https://www.thethingsnetwork.org/labs/group/getting-started-with-the-things-network)
- Register on the [forum](http://forum.thethingsnetwork.org) and search around
- Join [Slack](https://slack.thethingsnetwork.org) and ask us what you want to know
- Read background information on the [wiki](http://thethingsnetwork.org/wiki)

## Prepare your Development Environment

1. Make sure you have [Go](https://golang.org), [Mosquitto](http://mosquitto.org/download/) and [Redis](http://redis.io/download) installed on your development machine. If you're on a Mac, just run `brew install go mosquitto redis`.
2. Set up your [Go environment](https://golang.org/doc/code.html#GOPATH)
3. Install the [protobuf compiler](https://github.com/google/protobuf/releases)

## Set up The Things Network's backend for Development

1. Fork this repository
2. Clone your fork: `git clone --recursive https://github.com/YOURUSERNAME/ttn.git $GOPATH/src/github.com/TheThingsNetwork/ttn`
3. `cd $GOPATH/src/github.com/TheThingsNetwork/ttn`
4. Install the dependencies for development: `make dev-deps`
5. Run the tests: `make test`

**NOTE:** From now on you should run all commands from the `$GOPATH/src/github.com/TheThingsNetwork/ttn` directory.

## Build, install and run The Things Network's backend locally

1. Configure your `ttnctl` with the settings in `.env/ttnctl.yaml.dev-example`
2. Run `make install`
3. Run `forego start`
4. First time only (or when Redis is flushed):
  * Run `ttn broker register-prefix 00000000/0 --config ./.env/broker/dev.yml`
  * Restart the backend

## Build and run The Things Network's backend in Docker

1. Configure your `ttnctl` with the settings in `.env/ttnctl.yaml.dev-example`
2. Add the following line to your `/etc/hosts` file:<commit_msg>Explicitly mention `protoc` in README<commit_after>The Things Network
==================

[![Build Status](https://travis-ci.org/TheThingsNetwork/ttn.svg?branch=develop)](https://travis-ci.org/TheThingsNetwork/ttn) [![Slack Status](https://slack.thethingsnetwork.org/badge.svg)](https://slack.thethingsnetwork.org/) [![Coverage Status](https://coveralls.io/repos/github/TheThingsNetwork/ttn/badge.svg?branch=develop)](https://coveralls.io/github/TheThingsNetwork/ttn?branch=develop)

![The Things Network](http://thethingsnetwork.org/static/ttn/media/The%20Things%20Uitlijning.svg)

The Things Network is a global open crowdsourced Internet of Things data network.

## Getting Started With The Things Network

When you get started with The Things Network, you'll probably have some questions. Here are some things you can do to find the answer to them:

- Check out our [website](https://www.thethingsnetwork.org/) and see how [others get started](https://www.thethingsnetwork.org/labs/group/getting-started-with-the-things-network)
- Register on the [forum](http://forum.thethingsnetwork.org) and search around
- Join [Slack](https://slack.thethingsnetwork.org) and ask us what you want to know
- Read background information on the [wiki](http://thethingsnetwork.org/wiki)

## Prepare your Development Environment

1. Make sure you have [Go](https://golang.org), [Mosquitto](http://mosquitto.org/download/) and [Redis](http://redis.io/download) installed on your development machine. If you're on a Mac, just run `brew install go mosquitto redis`.
2. Set up your [Go environment](https://golang.org/doc/code.html#GOPATH)
3. Install the [protobuf compiler (`protoc`)](https://github.com/google/protobuf/releases)

## Set up The Things Network's backend for Development

1. Fork this repository
2. Clone your fork: `git clone --recursive https://github.com/YOURUSERNAME/ttn.git $GOPATH/src/github.com/TheThingsNetwork/ttn`
3. `cd $GOPATH/src/github.com/TheThingsNetwork/ttn`
4. Install the dependencies for development: `make dev-deps`
5. Run the tests: `make test`

**NOTE:** From now on you should run all commands from the `$GOPATH/src/github.com/TheThingsNetwork/ttn` directory.

## Build, install and run The Things Network's backend locally

1. Configure your `ttnctl` with the settings in `.env/ttnctl.yaml.dev-example`
2. Run `make install`
3. Run `forego start`
4. First time only (or when Redis is flushed):
  * Run `ttn broker register-prefix 00000000/0 --config ./.env/broker/dev.yml`
  * Restart the backend

## Build and run The Things Network's backend in Docker

1. Configure your `ttnctl` with the settings in `.env/ttnctl.yaml.dev-example`
2. Add the following line to your `/etc/hosts` file:
{'fraction_non_alphanumeric': 0.13263979193758127, 'fraction_numerical': 0.010031580902842282, 'mean_word_length': 4.9035087719298245, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 26, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 2, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3761411', 'n_tokens_mistral': 1753, 'n_tokens_neox': 1636, 'n_words': 512}