Hey there, lets first setup some IBM accounts and then get your laptop ready for development life.
You will not have Wi-Fi on your laptop until we set that up later. For the time being take an ethernet cord on your desk and plug into your laptop and one of the jacks behind your desk. Only one of the jacks works and it should be the top left one.
This section will help you obtain the usernames and passwords you need for the various IBM services that are required for this training.
-
Go to IBM ID Registration page and Submit the registration form
-
Go to Bluemix Homepage and click on Sign Up
-
You should receive an email. Click on "Validate Email Address".
-
You can login on Bluemix using your IBM ID from the Bluemix Homepage. Once logged in, you should see the dashboard.
This section walks you through installation of Git, Node.js, and the Cloud Foundry command-line client. These are the command-line tools necessary to complete the training.
- Download the appropriate version for your operating system.
- Run the installer. It's typically OK to accept the default options.
- Open a command prompt on your operating system and type
git version
. Note that on Windows you will want to openGit BASH
from the start menu. You should see a response that's similar to the following:
git version 1.9.5 (Apple Git-50.3)
Although it will probably contain your operating system name in the parenthesis.
-
Download and install the Node.js Binaries.
-
After its installed test it by opening a command prompt on your operating system
- To open a command prompt on windows open the start menu and type
cmd
then hit enter
- To open a command prompt on windows open the start menu and type
-
Type node -v. Node should respond in kind:
> node -v
v4.4.5
- If you get output very similar to the above, you have successfully installed Node.js.
- Close your command prompt.
- Download the Cloud Foundry CLI Installer for your operating system and save it to a directory you can remember. NOTE: Scroll down to the
Downloads
section on the previous link to find theStable Installer
for your operating system! - Double-click the file you have downloaded and execute the installer.
- We recommend the default installation location.
- Next, open a command prompt on your operating system.
- To check that the tool is properly installed, type
cf
at the prompt and press enter. You should get a long list of command line options as shown below.
- Now you will want to target Bluemix as shown in this code block:
C:\> cf api https://api.ng.bluemix.net
Setting api endpoint to https://api.ng.bluemix.net...
OK
API endpoint: https://api.ng.bluemix.net (API version: 2.23.0)
Not logged in. Use 'cf login' to log in.
- And login, as shown here:
C:\> cf login
API endpoint: https://api.ng.bluemix.net
Email> [email protected]
Password>
Authenticating...
OK
Select an org (or press enter to skip):
1. [email protected]
Org> 1
Targeted org [email protected]
Select a space (or press enter to skip):
1. dev
Space> 1
Targeted space dev
API endpoint: https://api.ng.bluemix.net (API version: 2.23.0)
User: [email protected]
Org: [email protected]
Space: dev
It's not a problem if you do not get the option to choose an org or space, so long as once you are logged in, your User
and Org
lines match your IBM ID as shown in the last lines above.
Chaincode is written in GoLang. You will be building Go code locally to make sure it compiles. Therefore setup GoLang on your laptop.
- Download and install GoLang https://golang.org/
- Next check your install (only follow the "Test your installation" section)
You are going to need an editor to develop in. It you do not have a favorite already then I'd recommend Visual Studio Code. For Node.js it is awesome, and for most other things its pretty decent.
- Download and install Visual Studio Code
- Get the Go extension by:
- open VSCode, press and hold "ctrl" + "p"
- type "ext install Go"
##2.0 Test Email
- Make sure your Lotus Notes works. This is IBM's everything client. You will use it for email + instant messaging.
- Send a test email to [email protected] with your name and cell phone number. I will only use your number when I cannot find you physically. It’s also important to send David or Mihir an email or txt message if there is any reason you cannot come into work today or must head home early.
##2.1 Slack
- We use Slack and IBM Sametime for instant messaging. Sametime is already setup on your laptop. Go setup Slack on your laptop and join our team at https://ibm-blockchain.slack.com/ .
- This is an enterprise slack team for IBM Blockchain, you must be added to whitewater before it will let you login. So try to login, and if you can't email me and we'll get you setup.
- Join the channel #operatives
- You will need to login either Sametime or Slack whenever you are at work
- This will be our primary way to reach you. Alternatively, we may just scream your name until you appear.
##3.0 Wi-Fi
- Our Wi-Fi is super complicated to setup. Make sure you are well rested and hydrated before continuing.
- Open Firefox as an admin
- Open the start menu
- Type Firefox, right click the Mozilla Firefox program
- Select "Run as administrator"
- Follow the official instructions here but use the Firefox browser we just opened. Good luck. https://w3-01.ibm.com/helpcentral/Content/View/d6a33202-c082-4f55-969d-fcb2f28ea3b5/automated_ibm_digital_certificate_setup_for_windows_7
- If it all went well, unplug the ethernet cord and place it ontop of the black cabinet near David
#Learn First up lets learn about blockchain basics.
##Links to reference: Below is several links that you should bookmark.
- Glossary - confused on a term, look it up here
- Production Bluemix
- Staging Bluemix
- Hyperledger REST API Documentation Doc - markdown version
- Hyperledger REST API Documentation Swagger - interactive version
- Hyperledger Docs Table of Contents
##Links to Read: Read the links below to understand blockchain and your role.
##Links to Watch: 5. Bitcoin Videos - extra, will likely be helpful but keep in mind that Bitcoin is different in many ways from IBM Blockchain
#Demos Ok you are done with setup! Now lets get experience. Try each demo in order. This is may look like the smallest section but it should take far longer then any other section. Take your time here and ping us with questions/concerns/stuckness.
- Run through learn-chaincode - this is a quick intro into how to write chaincode
- protip build the chaincode locally before deploying
- Run through marbles tutorial 1 choose the "Manual Network Setup" and "Run Marbles on Local Machine" - its a very simple asset trading example
- Run through marbles tutorial 2 - still a very simple asset trading example
#Explore the Bluemix IBM Blockchain Service The last thing you should see before going off into the wild is the IBM Blockchain Service Dashboard. The various tutorials may have pointed you to this at times, but lets fill in any gaps of what it can do.
- First login to Bluemix
- Click the "Catalog" link on the top navigation bar
- Find and click the "Blockchain" tile (you can use the navigation on the left to filter the list: Services > Network)
- Choose any space from the "Space:" dropdown (dealers choice)
- Leave the "App:" field as "Leave unbound" (unless you already have an application, but you probably don't yet)
- Change the "Service name" to "myblockchain" without the quotes
- Leave the "Credential name" field as its default value
- Leave the "Selected Plan" as its default value
- Click the "CREATE" button
- If all goes well you should be on the manage screen for your new service. Click the "LAUNCH" button to see the dashboard for your network.
- You should see a few peers listed in the first table
- from here you can monitor if your peers crash, if the chaincode containers are running, and view logs for all
(Note if you find yourself on the Bluemix Dashboard and want to get back to this service screen just click the tile name "myblockchain" in the "Services" section)
The network is all setup. You are now on your blockchain's dashboard.
-
Network Tab - This is the 'home' of the service
- The top table contains the running peers and their status
- The bottom table contains a list of running chaincodes
- Both tables will update periodically
- The log like icon will open up a static log file for the peer/chaincode. This is very handy for debugging
-
Deploy Tab - Let’s get some chaincode into this bbb...bbllockchain.
- On the deploy tab we have chaincode examples.
- Select "Example02" from the drop down and click the giant "Deploy" button
- Wait for the dancing rectangles to finish their ceremony.
- In the meantime click the "Show API details" checkbox to see the REST call details, uncheck again to hide these details
- Next click the "Query A" button and then "Query B" button and note the values that get printed out
- Next click the "Transfer from A to B" button
- Finally click the "Query A" and "Query B" buttons to see the new values
- Click the "Chaincode" link under the "Links" column for Example02
- Explore the chaincode until you find the code responsible for transfering an amount from A to B
- That’s it for this tab. Play with the other examples or this one some more.
-
Blockchain Tab - Now that we have some chaincode deployed go to the "Blockchain" tab
- You should see at least 3 blocks and some basic stats about the network
- Click the blocks to see details about the block in the table
-
APIs Tab - Jump to the APIs tab.
- Click the "Blockchain" section
- Click the "Try it out!" button
- It should return with details about the blockchain network including things like its block height
You are now ready. Go forth and code.