Dsorken
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee
    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Engagement control
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Versions and GitHub Sync Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee
  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       owned this note    owned this note      
    Published Linked with GitHub
    Subscribed
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    Subscribe
    # Week 8 ## Recap This week I spent the large majority of my time implementing the necessary client functionality to enable my to more easily implement Portal features. A portion of that involved finding the right libraries to do both logging and have a well designed command line interface. At the beggining of the week I decided to look into available CLI Java solutions to see what was available. It would have been entirely possible to design one myself but I figured that a library would save me time writing essentially boiler-plate code. I decided to opt for the same library that Besu uses, Picocli as it was set up in an easy to use way with custom Java annotations. I then had to configure it in Gradle and learn how to properly use the library. From there I looked into the many available Java logging solutions. Because they are all basically solving the same problem I decided to use SLF4J on top of Log4J2 to match what Besu is doing. In this way, should the client need to interact with other logging libraries the use of SLF4J would automatically enable that. Once I was able to set up the correct dependencies in Gradle it was a matter of properly configuring Log4J2 in my development environment. I was able to do so and the client is now prepared to have Portal specific implementations added. ## Learning My learning this week mainly consisted of reading documentation for different libraries I was considering using for client functionality. Both for figuring out what CLI solution as well as which logging solution that I wanted to use. I also consulted the Besu codebase to see which libraries were being used there and how they were being used in a client context. In addition to how their dependencies were set up across the entire client. ### Concepts #### Besu Codebase When looking at the Besu codebase this week I mainly wanted to learn how they had implemented CLI and logging solutions. After finding they opted to use external libraries I decided it would be best for me to follow suit. I looked into how Picocli was enabled in Besu, and how its dependency was handled. This led me to looking into the use of spring boot for Gradle to handle different dependency versions. I attempted to set up spring boot on my client but only had partial luck. After running into many errors I decided it would be best to leave spring boot setup for later down the line when I have more dependencies to handle. I also looked into Besu's logging solution. Because Java does not really have a fully capable logger by default, there are a few different libraries to choose from. In the case of Besu, it uses Log4J2 managed by SLF4J which is essentially just an interface that adapts to all of the main third-party Java loggers. Because the choice of logger was basically arbitrary I decided to use the same library setup as Besu. ##### Resources 1. https://github.com/hyperledger/besu #### Picocli After learning that Picocli was used by Besu to handle command line interactions it seemed to be the most logical choice for the Portal Client. Additionally the library is really well documented and there are a large number of guides on its use. Furthermore it is designed for use specifically with Java and is relatively lightweight. I learned about its proper use by both looking through Besu's codebase and the Picocli documentation. I found that it is designed in a really nice way that makes the code very easy to read through the use of custom Java annotations. ##### Resources 1. https://picocli.info/ #### Log4J2 and SLF4J In simalar fashion to how I chose my CLI solution, I also chose the same logging solution as Besu. Because the choice of loggers is essentially arbitrary it made the most sense. I learned about how to properly configure both Log4J2 and SLF4J in a Gradle environment and how to use the different levels of logging priority that are offered. It was also useful to see how the dependencies had been setup in Besu for refference. After following the documentation and some troubleshooting I was able to configure the clients logging. ##### Resources https://logging.apache.org/log4j/2.x/manual/configuration.html https://www.slf4j.org/ ## Tasks As stated above my main priorities this week were to configure a proper CLI and logging solution. I also spent some time trying to setup spring boot to make dependency version handling more simple but ran into many errors with Gradle. This is likely something I will have to look into later on as the dependency handling capabilities of spring boot are quite useful. Outside of actually implementing the CLI it took a little while to learn it's correct usage and to test it once implemented, but I am now satisfied with how it works. Getting the logger to work was less about setting up dependencies and more so about learning how to properly configure it with the XML file that it uses. https://github.com/Dsorken/Java-Portal-Client ## Week 9 Plan My plan going into Week 9 is to begin working on the implementation of Discovery V5 in my client. As well work on setting up any dependencies that it may require to run properly. I am hoping to be able to adapt the Besu solution and trim down any unneeded functionality that only applies to the Besu client.

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully