Contains how-to information referenced from other chapters in this guide.
Source Download
You can obtain the iota source code using one of these methods:
Git Fork
If you intend to make changes to the iota source tree, then install the source tree from GitHub.
Install Git Tools
If you haven’t done so already, install the Git Tools:
- Download the appropriate tool version; Linux or Windows: http://git-scm.com/downloads.
- Set up your git environment: GitHub Documentation
- Ensure that you register your ssh keys.
Download iota Source Tree
You download the iota source tree once the git tools have been installed.
Fork iota Repository
You create a private fork of iota on https://github.com/apache/incubator-iota. Use the fork button top-right on the page to create your fork, which will be named <your-github-id>_fork
.
The following examples use iotadeveloper
to represent <your-github-id>
.
Clone iota Repository
Use the git shell to perform this task.
# Move to the directory where you want to install the iota source code. cd mysource # Clone the iota source code git clone git://git.apache.org/incubator-iota.git # Change to the iota source-tree directory cd incubator-iota # Register your fork as a remote branch git remote add iotadeveloper_fork git@github.com:iotadeveloper/incubator-iota
Create Task Branch
You create a task branch to make changes to the iota source tree. Typically, we name the branches after the Jira we are working on. In this example, the Jira is: iota-1507.
# Ensure that you have the latest changes git fetch --all # Checkout source git checkout -b iota-42 origin/master
tar/zip Download
Typically, you download the iota source tree as a tar/zip file if you don’t intend the change the source code. For example, when you want to build the iota binaries only.
tar file
Download Location: https://dist.apache.org/repos/dist/release/incubator/iota
Open the
iota
folder.PGP Key
The source tar file has been signed with one of the pgp keys, which is included in the download location’s KEYS file.
Open the folder containing the version you want to download. For example: apache-iota-0.1.0-incubating
Download the
-src
file that fits your security needs. For example:apache-iota-0.1.0-incubating-src.tar.gz
Unpack the tar file:
mkdir <target-directory> tar -xzf <tar file> -C <target-directory> # Change direcotry name to match GitHub download name; makes this guide simpler to write. mv <target-directory>/apache-iota-<version>-incubating <target-directory>/incubator-iota
Example
$ mkdir ~/mysource $ tar -xzf apache-iota-0.1.0-incubating-src.tar.gz -C ~/mysource $ ls mysource apache-iota-0.1.0-incubating $ ls mysource/apache-iota-0.1.0-incubating <TBD> $ # Change directory name to match GitHub download name; makes this guide simpler to write. $ mv mysource/apache-iota-0.1.0-incubating mysource/incubator-iota $ ls mysource incubator-iota
zip File
Click on Download ZIP at https://github.com/apache/incubator-iota. The zip file will be named incubator-iota-master.zip
.
- If necessary, FTP the zip file to your Linux development environment using WinSCP or a similar tool.
Unzip to the target directory.
Unzip Trafodion Sourceunzip -q incubator-iota-master.zip -d mysource
Example
Unzip Example$ unzip -q incubator-iota-master.zip -d mysource $ ls mysource incubator-iota-master $ ls mysource/incubator-iota-master <TBD> $ # Change directory name to match GitHub download name; makes this guide simpler to write. $ mv mysource/incubator-iota-master mysource/incubator-iota $ ls mysource incubator-iota
Git Cheat Sheet
Download Git Tools
Refer to Git Tools Download.
Set-Up Git Environment
Refer to GitHub Documentation
Setup ssh Keys
Refer to ssh Keys.
Fork iota Source Tree
iotadeveloper_fork
Clone Repository
Do the following:
# Move to the directory where you want to install the iota source code. cd mysource # Clone the iota source code git clone git://git.apache.org/incubator-iota.git # Change to the source-tree directory cd incubator-iota # Register your fork as a remote branch git remote add <your-github-id>_fork git@github.com:<your-github-id>/incubator-iota
# Move to the directory where you want to install the iota source code. cd mysource # Clone the iota source code git clone git://git.apache.org/incubator-iota.git # Register your fork as a remote branch cd incubator-iota git remote add iotadeveloper_fork git@github.com:iotadeveloper/incubator-iota
Create Task Branch
Do the following:
# Ensure that you have the latest changes git fetch --all # Checkout source git checkout -b iota-<jira-number> origin/master
# Ensure that you have the latest changes git fetch --all # Checkout source git checkout -b IOTA-42 origin/master
Merge Changes
Merge changes from the master branch using the following commands:
git fetch origin ; git merge origin/master
Commit Changes
Do the following:
# Commit changes git commit -a # Dry-run check against main branch git push -n <your-github-id>_fork HEAD # Push changes to your private fork git push <your-github-id>_fork IOTa-42
# Commit changes git commit -a # Dry-run check against main branch git push -n iotadeveloper_fork HEAD # Push changes to your private fork git push iotadeveloper_fork IOTA-42
Create Pull Request
Use the GitHub web interface to generate pull requests.
Checkout Code
Do the following:
git checkout iota-<jira-number>
git checkout iota-42