Skip to content

Commit

Permalink
improve env setup instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
dshuffma-ibm committed Jun 12, 2017
1 parent 2637e61 commit f07c201
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 26 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ Follow these environment setup [instructions](./docs/env_setup.md) to install **

- When you have finished come back to this tutorial. Start the next section "Download Marbles" below.

<a name="downloadmarbles"></a>

### 1. Download Marbles
We need to download marbles to your local system.
Let’s do this with Git by cloning this repository.
Expand Down
53 changes: 27 additions & 26 deletions docs/env_setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,15 @@ $ git --version
git version 2.11.1.windows.1
```

Once you have git installed, go create an account for yourself on [GitHub](https://github.com/).
The IBM Blockchain service on Bluemix currently requires that chaincode be in a GitHub repository in order to be deployed through the REST API.

## 2. GoLang

- [Go download page](https://golang.org/dl)
- [Go installation instructions](https://golang.org/doc/install)
- [Go documentation and tutorials](https://golang.org/doc/)
- [GoLang Download Page](https://golang.org/dl)
- [GoLang Installation Instructions](https://golang.org/doc/install)
- [GoLang Documentation and Tutorials](https://golang.org/doc/)

The Go installation installs a set of Go CLI tools which are very useful when writing chaincode.
For example, the `go build` command allows you to check that your chaincode actually compiles before you attempt to deploy it to a network.
At time of writing, this chaincode is known to build successfully with version 1.7.5.
At time of writing, this chaincode is known to build successfully with version `1.7.5`.

### Verify Go Installation
You can verify that Go is installed properly by running the following commands. Of course, the output of `go version` may change depending on your operating system.
Expand All @@ -52,7 +49,7 @@ Next verify you can build GoLang code with the [hello world](https://golang.org/

Download and install the latest Node.js LTS version.

- [Node.js](https://nodejs.org/en/download/)
- [Node.js Download Page](https://nodejs.org/en/download/)


### Verify Node.js Installation
Expand All @@ -69,31 +66,32 @@ $ npm -v

## 4. Hyperledger Fabric

Any chaincode that you write will need to import the chaincode shim from Hyperledger fabric.
Any chaincode that you write will need to import the chaincode shim from Hyperledger Fabric.
Therefore in order to compile chaincode locally you will need to have the fabric code present in your `GOPATH`.
If you only want to run marbles as is, you can skip this step, otherwise follow the steps below.

### Instructions
**Choose 1 option below:**

- [v1.0.0-preview Hyperledger fabric](https://github.com/hyperledger/fabric/tree/v1.0.0-preview)
- [master branch of the Hyperledger fabric](https://gerrit.hyperledger.org/r/gitweb?p=fabric.git;a=summary)
- **Option 1:** :lollipop: I don't want to modify chaincode - **If you only want to run marbles cc as is, you can skip this step completely.** Head back to the [tutorial](../README.md#downloadmarbles).

A few different releases of the fabric are linked above.
The release you should clone needs to match the Hyperledger network you are using.
For example, if you are using the Bluemix Blockchain Service then check the commit level of the Hyperledger Fabric being used by your network.
It can be found in the Release Notes section of the network's UI.
![](/doc_images/marbles-env.PNG)
- **Option 2:** I want to modify chaincode and use a local Fabric network
- You are going to use the [master branch of the Hyperledger fabric](https://gerrit.hyperledger.org/r/gitweb?p=fabric.git;a=summary).
- Remember this hash `14055d7` and go to the `Continue the Fabric Install Instructions` section below. You will enter the hash there.

**If you are not using or do not plan to use the Blockcahin Service then download/clone the v1.0.0-preview version.**
- **Option 3:** I want to modify chaincode and use the Blockchain Service for my network
- You are most likely going to need to use the [v1.0.0-preview Hyperledger fabric](https://github.com/hyperledger/fabric/tree/v1.0.0-preview) version.
If you have a network, then the exact Fabric version can be found in the Release Notes section of your network's UI.
![](/doc_images/marbles-env.PNG)
- Get the hash from your network or use the hash `14055d7`. Go to the `Continue the Fabric Install Instructions` section below. You will enter the hash there.

**Update 5/1/2017**
If you are on Windows and using the Blockchain Sevice, please use this commit instead: `0616a9ddc02cc541409c9d77c8b7e97523a8b96e`.
Windows needs a Fabric fix that disables pkcs11 that was not avaible until April 1st, 2017 (no joking).
Other OSes should be able to use the same version in their release note.
- **Update 5/1/2017**
If you are on Windows and using the Blockchain Sevice, please use this commit hash instead: `0616a9ddc02cc541409c9d77c8b7e97523a8b96e`.
Windows needs a Fabric fix that disables pkcs11 that was not avaible until April 1st, 2017 (no joking).
Other OSes should be able to use the same version in their release note.

Make sure that the fabric release you choose is stored under `$GOPATH/src/github.com/hyperledger/fabric`.
The instructions below should take you through the process of properly installing the v1.0 release on your `GOPATH`.

### Continue the Fabric Install Instructions
The release you are cloning locally should match the Hyperledger Fabric network you are using when you deploy your application.
You should apply the choice you made above to the instructions below when doing the `git checkout` step.

1. Create the parent directories on your GOPATH
```
Expand All @@ -112,7 +110,7 @@ The instructions below should take you through the process of properly installin
git checkout 14055d7
```

4. Confirm the level using git branch, should show the commit level matching your network
4. Confirm the level using git branch. It should show the commit level matching the one you provided.
```
git branch
```
Expand All @@ -136,3 +134,6 @@ Visual Studio Code is a free IDE that supports all the languages in Marbles such
- [Atom](https://atom.io/)

Like VS Code, Atom has plugins to support any of the languages needed to develop chaincode or modify our examples.

## 6. Finish Up
Now that everything is setup, head back to the [tutorial](../README.md#downloadmarbles).

0 comments on commit f07c201

Please sign in to comment.