# Week 11 ## Recap This week my main focus was on completing some tasks to better finalize some network capabilities for the Portal Client as well as to begin work on designing a Portal Wire Protocol handler. I started the week off by looking through how a few clients such as Besu, Teku and then Trin for refference to a Portal Client handle bootnodes. I wanted to create an actual proper bootnode setup for the Portal Client to get that task out of the way so that the Client could more officially interact with mainnet. In this way I was also able to add a command line configuration so that the client can interact with the Portal Network testnet Angelfood. From there I shifted my focus to creating a design for a Portal Wire Protocol handler to deal with the actual Portal Client communication with external Portal nodes. I looked through various designs on both other Portal Clients, as well as the Consensys Discovery Protocol handler. Portal Wire Protocol and Discovery V5 are similar in how they function, in terms of node storage as well as the fact that Portal Wire works on top of Discovery. This means that a handler for Discovery should also be a good base design for creating a handler for the Portal Wire Protocol. After going through some top level design in the handler side of the Consensys Discovery library I began working on my design for the Portal Wire Protocol. I started by working on a general configuration class and moved into more specific portions of how the handler should function, including beginning to work on implementing the specified responses for each message found in the Portal Network Specification repository. ## Learning Most of my learning this week came from reading through various client implementations of different concepts, as well as refreshing my memory on the Portal Network Specification repository as I began implementing the different message responses. Fortunately a good portion of the implementations I went over are at least able to be partially used in the Portal Client as a good base designing the Portal Wire Protocol handler. ### Concepts #### Client Codebases Because I was looking for both a standard as to how clients implement a proper bootnode setup, as well as inspiration and/or a base design for a Portal Wire Protocol handler I looked through a few different clients. I started by looking through Besu and Teku to get an idea of how the two clients setup their bootnodes in a Java environment. From there I looked at Trin to check if there was any different additional steps that were taken for use with the Portal Network. After learning about the bootnode setups I moved on to more network handler research. This was mainly to see if there was anything useful that I had missed or might want to add to a handler for a specific service. ##### Resources 1. https://github.com/hyperledger/besu 2. https://github.com/Consensys/teku 3. https://github.com/ethereum/trin #### Consensys Discovery V5 Due to the very similar nature in which Discovery and the Portal Wire Protocol opperate, I decided it would be best to base my Portal Wire handler on the Consensys Discovery implementation. Going through the library I took inspiration from the message handling design for each message type and really focused on the use of Java completable futures to enable the different asynchronous requests. I also took note of the frequent use of interfaces to enable easier testablility, which is something I aim to also incorporate in the Portal Client. ##### Resources 1. https://github.com/Consensys/discovery ## Tasks In regards to actual implementation, as stated above I was able to fully complete a proper bootnode setup for the client. I then began working on creating a Portal Wire handler based on the Discovery handler in the Consensys Discovery library. I started creating the appropriate message responses for each message specified in the Portal Network specs repository in addition to designing a general configuration class. I have started working on a pre-liminary design/outline of how I intend to meet each requirement from the specification repository as well. Aside from implementation, I continued contact with the other EPF fellow working on Portal Client design. We both have the same goal of syncing our repositories into a single repository hopefully within the next 1-2 weeks. We also both reached out to Besu team members regarding potentially setting up a meeting to establish a mentorship, on top of answering a few questions about general client design to better match the Besu user experience. https://github.com/Dsorken/Java-Portal-Client/pull/3 ## Week 12 Plan For Week 12 my primary focus will be to continue to work on creating a Portal Wire handler. This would also go hand in hand with syncing repositories into a single repository with the other EPF fellow. With my work on the handler I am looking to add testing either as I go or at notable milestones that will allow for testing. Once the handler is complete the client should be ready and configured for proper interaction with other Portal Clients. In regards to mentorship, we both hope to hear back this week and possibly establish a meeting.