Session 2 - Understanding Blockchains and Gitlab
In this session, after making a quick recap of Session 1, we continue understanding blockchain systems.
Understanding Blockchains (cont.)
- Anatomy of a Bitcoin-like Blockchain
- Confirmation of Blocks
- Blockchain Systems and Consensus
- Transactin Life-Cycle with a Trusted Ledger Service
- Going Decentralized with a Replicated Ledger Service
- Attacks to Bitcoin-like Blockchains
Understanding Git and Gitlab
Creating a Gitlab Group
Go to Gitlab.com and create a new Gitlab group for your team:
- Group name:
your group's name - Visibility level:
private - Role:
Development Team Lead - Who will be using this group?:
My company or team - What will you use this group for?:
I want to learn the basics of Git - Do not invite members, we will do after.
Click Create Group, you will be directed to your new group’s Gitlab page.
Inviting Members to a Gitlab Group
Go to Group Information -> Members and click Invite Members.
- GitLab member or email address:
Gitlab member user name - Select a role:
Maintainer
Click Invite, and continue doing the same until you add all team members.
Finally, add your instructor, Gitlab username @ogurcan, to your group as Owner.
Creating a Gitlab Project
Go back to the main page of the Gitlab group (click on the group’s name on the leftmost corner).
- Click
Create Project - Select
Create Blank Project - Project Name:
Hello World - Project description (optional):
Test project - Project deployment target (optional):
No deployment planned - Visibility Level:
Private - Initialize repository with a README:
Yes
Click Create Project, you will be directed to your new project’s Gitlab page.
Creating an Project Issue
On the project’s main page, click New Issue.
- Title:
Create the Hello World Java project - Type:
Issue - Description:
Create a Java project named Hello World using your IDE (Eclipse or IntelliJ) and share it on this Gitlab project. - Assignee: Choose the team member that will push the code
Click Create Issue, you will be directed to your new issue’s Gitlab page.
Then click Create Merge Request.
- Assignee: one of your team members
- Reviewer:
@ogurcan
Click Create Merge Reuqest, you will be directed to your new merge request’s Gitlab page.
Cloning a Gitlab Project
Go back to the main page of the Gitlab project (click on the project’s name on the leftmost corner).
- Click
Clone - Copy the url of
Clone with SSH - Open your IDE (Eclipse or IntelliJ)
- Click
Clone a Git project - Use your Gitlab username and password if asked
- Click
NextandFinish
Creating and Sharing a New Java Project
Now create a new Java project using File -> New -> Java Project.
- Project name:
Hello World - JRE:
Java11or higher - Module name:
helloworld
For sharing the project on Gitlab, right click on the project and select Team -> Share Project...
- Repository:
hello-world
Click Finish.
Now select Window -> Show View -> Git Staging.
- Add all files as
Staged Changes - Commit message:
#1 Create the Hello World Java project - Click
Add Signed-off-by - Click
Commit and Push
Go back to the Gitlab page of your merge request. You will see that your commit has been added. Wait for the reviewer to make his/her comments.
Adding a New Feature to a Project
Now that the Java project is ready and shared on Gitlab, we can go on improving it.
- Create a new issue for creating a
HelloWorldclass with amain()method. - Create a dedicated merge request. This will create a dedicated branch on
git. - In Eclipse make a
git pullto fetch the new branch, and thengit check-outthis branch as a local branch. - Upon execution, this application should print
Hello World!on the terminal and terminate. - Push the contribution using