<commit_before>Community Tester Install Guide for Factom Federation (M2)
==========

This will walk you through setting up the experimental distributed version of Factom.

### Prepare Operating System

The most testing to date has been done under Linux. To get the best testing experience, it should be done on Linux. That will also help us recreate the bugs you experience better. If you are running Windows, please install a virtual machine to run Factom. Installing on Windows has been known to work, but is not covered here.

Here are some good directions to get a virtual machine installed with Linux. http://www.instructables.com/id/Introduction-38/?ALLSTEPS

The following are assuming you are using the 64 bit version of Ubuntu, or one of its descendant projects like xubuntu or mint.

#### Install the go language and dependencies, then setup GOPATH

###### Install Package Managers 

In a terminal window, install Git

On Linux:
```
sudo apt-get install git
```

On Mac:
Steps 1 and 3 should be enough in this tutorial:
https://confluence.atlassian.com/pages/viewpage.action?pageId=269981802

###### Install Golang

Download latest version of go https://golang.org/dl/  This example uses 64 bit Linux and 1.7.3 is the latest version.
```
sudo tar -C /usr/local -xzf go1.7.3.linux-amd64.tar.gz
```

On Mac, installing go this way should work:
http://www.cyberciti.biz/faq/installing-go-programming-language-on-mac-os-x/


###### Setup Paths

Put the go binary directory in you path.  Also add the GOPATH to your profile.
Open the file `~/.profile` and add these lines to the bottom.  If they are not exact, then your Linux may not be bootable.
```
export PATH=$PATH:/usr/local/go/bin

export GOPATH=$HOME/go
export PATH=$PATH:$GOPATH/bin
```
**logout and login**.  This is the most straightforward way to run/test these changes.  Run `go version` from a terminal to verify the install.


### Install Factom

Currently, the blog post [here](https://factom.com/blog/factom-launches-federated-testnet) has some screenshots of what to expect Factom Federation (M2) to look like.

These steps will get factom installed onto a linux machine. The steps should be similar for mac.

```
# install glide, the package dependency manager
go get -u github.com/Masterminds/glide
# download the code
git clone https://github.com/FactomProject/factomd $GOPATH/src/github.com/FactomProject/factomd
git clone https://github.com/FactomProject/factom-cli $GOPATH/src/github.com/FactomProject/factom-cli
git clone https://github.com/FactomProject/factom-walletd $GOPATH/src/github.com/FactomProject/factom-walletd

# switch to the develop branch of the factom programs
cd ~/go/src/github.com/FactomProject/factomd
git checkout develop
cd ~/go/src/github.com/FactomProject/factom-cli
git checkout develop
cd ~/go/src/github.com/FactomProject/factom-walletd
git checkout develop

# get the dependencies and build each factom program
glide cc
cd ~/go/src/github.com/FactomProject/factomd
glide install
go install -v
cd ~/go/src/github.com/FactomProject/factom-cli
glide install
go install -v
cd ~/go/src/github.com/FactomProject/factom-walletd
glide install
go install -v

# done.  factomd should be installed
# you can optionally use a config file to run in a non-standard mode
# mkdir -p ~/.factom/m2/
# cp ~/go/src/github.com/FactomProject/factomd/factomd.conf ~/.factom/m2/
```


### Testing Factom

You can run a local version of factomd to get greater flexibility by running it like this:

`factomd -network=LOCAL`
<commit_msg>added git commit printing to build process<commit_after>Community Tester Install Guide for Factom Federation (M2)
==========

This will walk you through setting up the experimental distributed version of Factom.

### Prepare Operating System

The most testing to date has been done under Linux. To get the best testing experience, it should be done on Linux. That will also help us recreate the bugs you experience better. If you are running Windows, please install a virtual machine to run Factom. Installing on Windows has been known to work, but is not covered here.

Here are some good directions to get a virtual machine installed with Linux. http://www.instructables.com/id/Introduction-38/?ALLSTEPS

The following are assuming you are using the 64 bit version of Ubuntu, or one of its descendant projects like xubuntu or mint.

#### Install the go language and dependencies, then setup GOPATH

###### Install Package Managers 

In a terminal window, install Git

On Linux:
```
sudo apt-get install git
```

On Mac:
Steps 1 and 3 should be enough in this tutorial:
https://confluence.atlassian.com/pages/viewpage.action?pageId=269981802

###### Install Golang

Download latest version of go https://golang.org/dl/  This example uses 64 bit Linux and 1.7.3 is the latest version.
```
sudo tar -C /usr/local -xzf go1.7.3.linux-amd64.tar.gz
```

On Mac, installing go this way should work:
http://www.cyberciti.biz/faq/installing-go-programming-language-on-mac-os-x/


###### Setup Paths

Put the go binary directory in you path.  Also add the GOPATH to your profile.
Open the file `~/.profile` and add these lines to the bottom.  If they are not exact, then your Linux may not be bootable.
```
export PATH=$PATH:/usr/local/go/bin

export GOPATH=$HOME/go
export PATH=$PATH:$GOPATH/bin
```
**logout and login**.  This is the most straightforward way to run/test these changes.  Run `go version` from a terminal to verify the install.


### Install Factom

Currently, the blog post [here](https://factom.com/blog/factom-launches-federated-testnet) has some screenshots of what to expect Factom Federation (M2) to look like.

These steps will get factom installed onto a linux machine. The steps should be similar for mac.

```
# install glide, the package dependency manager
go get -u github.com/Masterminds/glide
# download the code
git clone https://github.com/FactomProject/factomd $GOPATH/src/github.com/FactomProject/factomd
git clone https://github.com/FactomProject/factom-cli $GOPATH/src/github.com/FactomProject/factom-cli
git clone https://github.com/FactomProject/factom-walletd $GOPATH/src/github.com/FactomProject/factom-walletd

# switch to the develop branch of the factom programs
cd ~/go/src/github.com/FactomProject/factomd
git checkout develop
cd ~/go/src/github.com/FactomProject/factom-cli
git checkout develop
cd ~/go/src/github.com/FactomProject/factom-walletd
git checkout develop

# get the dependencies and build each factom program
glide cc
cd ~/go/src/github.com/FactomProject/factomd
glide install
go install -v -ldflags "-X github.com/FactomProject/factomd/engine.Build=`git rev-parse HEAD`"
cd ~/go/src/github.com/FactomProject/factom-cli
glide install
go install -v
cd ~/go/src/github.com/FactomProject/factom-walletd
glide install
go install -v
cd ~/go/src/github.com/FactomProject/factomd

# done.  factomd should be installed
# you can optionally use a config file to run in a non-standard mode
# mkdir -p ~/.factom/m2/
# cp ~/go/src/github.com/FactomProject/factomd/factomd.conf ~/.factom/m2/
```


### Testing Factom

You can run a local version of factomd to get greater flexibility by running it like this:

`factomd -network=LOCAL`

{'fraction_non_alphanumeric': 0.09372827145042414, 'fraction_numerical': 0.008065637602558753, 'mean_word_length': 4.2804698972099855, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 12, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3196770', 'n_tokens_mistral': 2289, 'n_tokens_neox': 2151, 'n_words': 859}