# Week 10 ## Recap I spent most of this week working on designing the Portal Clients network handler. I wanted to put an emphasis on matching the design patterns and methodology used in Besu and Teku. Mainly to both make it easier to adopt any necessary implementations in both clients as well as to make it easier for anyone familiar with the clients to work on the Portal Client. I also researched how I could configure the client to interact with the discovery network without manual setup of public IP. I found that the use of UPnP in Teku was quite effective and would suite the clients needs. I aimed to design the network handler in a fashion that would enable the easy configuration of UPnP for when I go to implement it. In order to enable similar design of the network handler I had to go through the Teku codebase and research how the Builder classes as well as config classes were configured. I additionally designed the handler to work similar to the Consensys Discovery handler to enable a similar Builder-style setup. In this way the handler is also easily configurable to include additional network features down the line such as the Portal sub-networks. Outside of implementation I got into contact with another fellow looking to develop a Java Portal client and we began planning how we would portion different parts of the client development. We additionally went over how we might plan to record issues and keep track of client progress. We intend to meet again this week and continue discussion on the client development and potentially finalize a plan. ## Learning Similar to the previous week I spent most of my time learning looking through the Besu and Teku codebases. I also began researching the use of the UPnP library and different NAT configurations in routers. I also refreshed my memory on the use of different Java design patterns in Besu and Teku through reading various guides and posts. ### Concepts #### Besu and Teku Codebase I looked specifically into how Besu and Teku have implemented client network design. The primary design component that I was focused on was the use of network system builder classes as well as network configuration classes. It took me some time to get used to such a design and understand how the different configuration classes worked with the actual network handler classes. I ended up researching the use of the design pattern to refresh my knowledge on its use. This was useful in both understanding the two clients methodology as well as for implementing the design into the Portal Client. ##### Resources 1. https://github.com/hyperledger/besu 2. https://github.com/Consensys/teku #### UPnP Because I wanted to configure the client to be able to easily connect with external nodes without hard-coding a public IP or entering it through the CLI. I reffered to its use in Teku as initial inspiration for using the technology and then began looking through how it actually works as well as libraries that I might use to configure it. Although not necessary for local testing I figured it may be beneficial to have it configured to work with the network handler just to have the task done. ##### Resources 1. https://en.wikipedia.org/wiki/Universal_Plug_and_Play 2. https://www.geeksforgeeks.org/universal-plug-and-play-upnp/ 3. https://www.jupnp.org/docs/introduction/ ## Tasks The primary implementation task this week was designing the clients network handler to work with the the CLI, follow the same design pattern as both Besu and Teku, and to be easily configurable for future network additions. Additions being things like a Portal Wire handler and individual handlers for each sub-network. The network handler is now essentially ready for any of these additions or other upgrades like incorporating UPnP for the clients public node access. https://github.com/Dsorken/Java-Portal-Client/pull/2 ## Week 11 Plan Moving into Week 11 my aim is to finalize the client network configurations and potentially implement UPnP for ease of use. I am also looking to began working on a system to handle the Portal Wire communications in the same style as the Consensys Discovery handler. I also hope to continue communication with the EPF fellow working on Java Portal Client implementation. Potentially to go over creating a dedicated repository under the Consensys organization.