<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Linus</title>
    <description>The latest articles on DEV Community by Linus (@devgod1994).</description>
    <link>https://dev.to/devgod1994</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1383704%2F9efc25c9-956a-4cdd-85ae-2347ef600f7d.jpg</url>
      <title>DEV Community: Linus</title>
      <link>https://dev.to/devgod1994</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/devgod1994"/>
    <language>en</language>
    <item>
      <title>Compiling, Deploying, Verifying, Testing Smart Contract Through Hardhat.</title>
      <dc:creator>Linus</dc:creator>
      <pubDate>Fri, 18 Oct 2024 16:20:49 +0000</pubDate>
      <link>https://dev.to/devgod1994/compiling-deploying-verifying-testing-smart-contract-through-hardhat-4i5m</link>
      <guid>https://dev.to/devgod1994/compiling-deploying-verifying-testing-smart-contract-through-hardhat-4i5m</guid>
      <description>&lt;p&gt;Hello, everybody.&lt;br&gt;
If you’re a developer looking to deploy your first smart contract using Hardhat, this guide is for you. I’ll walk you through the process step-by-step, from setting up your project to deploying your contract on the Ethereum network.&lt;/p&gt;

&lt;p&gt;Step 1: Project Setup&lt;br&gt;
Create a new project directory:&lt;br&gt;
&lt;code&gt;mkdir smart-contract-guide&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;cd smart-contract-guide&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Initialize a Node.js project and install Hardhat:
&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm init -y 
npm install --save-dev hardhat
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Step 2: Write the Smart Contract&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// SPDX-License-Identifier: MIT
pragma solidity ^0.8.7;

import "@openzeppelin/contracts/token/ERC721/ERC721.sol";

contract BasicNft is ERC721 {
    string public constant TOKEN_URI =
        "ipfs://bafybeig37ioir76s7mg5oobetncojcm3c3hxasyd4rvid4jqhy4gkaheg4/?filename=0-PUG.json";
    uint256 private s_tokenCounter;

    constructor() ERC721("Dogie", "DOG") {
        s_tokenCounter = 0;
    }

    function mintNft() public returns (uint256) {
        _safeMint(msg.sender, s_tokenCounter);
        s_tokenCounter = s_tokenCounter + 1;
        return s_tokenCounter;
    }

    function tokenURI(uint256 tokenId) public view override returns (string memory) {
        // require(_exists(tokenId), "ERC721Metadata: URI query for nonexistent token");
        return TOKEN_URI;
    }

    function getTokenCounter() public view returns (uint256) {
        return s_tokenCounter;
    }
}

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Step 3: Deployment using ignition module.&lt;br&gt;
Inside the ignition/module directory, create a file named BasicNft.ts:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import { buildModule } from "@nomicfoundation/hardhat-ignition/modules";


const DeployMyTokenModule = buildModule("DeployMyTokenModule", (m) =&amp;gt; {
  const myToken = m.contract("BasicNft");

  return { myToken };
});

export default DeployMyTokenModule;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Step 4: Configure Hardhat&lt;br&gt;
Create a file named hardhat.config.js:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;module.exports = {
  solidity: "0.8.0",
  networks: {
    // Define your networks here, such as "sepolia", "goerli", "mainnet", etc.
    // Example:
    // sepolia: {
    //   url: "&amp;lt;SEPOLIA_RPC_URL&amp;gt;",
    //   accounts: ["0xYOUR_PRIVATE_KEY"],
    // },
  },
};
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Step 5: Test Your Contract&lt;br&gt;
Step 6: Deploy Your Contract&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npx hardhat ignition deploy ./ignition/modules/BasicNft.ts --network &amp;lt;networkname&amp;gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Congratulations! 🎉 You’ve completed the guide on deploying and interacting with a simple smart contract using Hardhat. This hands-on experience sets you on the path to exploring more complex contract functionality and advanced features.&lt;/p&gt;

&lt;p&gt;Keep exploring the exciting world of Ethereum smart contracts and enjoy your coding journey! 💡🚀&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Building a Microservices Application Using Spring Boot</title>
      <dc:creator>Linus</dc:creator>
      <pubDate>Tue, 06 Aug 2024 19:00:03 +0000</pubDate>
      <link>https://dev.to/devgod1994/building-a-microservices-application-using-spring-boot-379a</link>
      <guid>https://dev.to/devgod1994/building-a-microservices-application-using-spring-boot-379a</guid>
      <description>&lt;p&gt;Hello, Everyone. In this time I'd like explain cloud computing and containerization technologies continue to evolve, microservices architecture has become increasingly prominent. Organizations are now actively seeking professionals skilled in Microservices Architecture. This article will guide you through developing a microservices application for top sports brands using Spring Boot and Netflix Eureka Server.&lt;/p&gt;

&lt;h1&gt;
  
  
  The Need for Spring Boot
&lt;/h1&gt;

&lt;p&gt;Spring Boot offers numerous benefits that facilitate the rapid development of production-ready applications:&lt;/p&gt;

&lt;p&gt;Embedded Servers: Simplifies the deployment process within containers.&lt;br&gt;
Component Monitoring: Enhances the monitoring of various application components.&lt;br&gt;
External Configuration: Streamlines the external configuration of components.&lt;/p&gt;

&lt;h1&gt;
  
  
  Challenges in Microservices Architecture
&lt;/h1&gt;

&lt;p&gt;Although microservices can simplify the development process, they introduce certain complexities:&lt;/p&gt;

&lt;p&gt;Automation: The automation of builds, deployments, and monitoring for multiple small services can be intricate.&lt;br&gt;
Visibility: Ensuring comprehensive visibility across numerous small components is essential for effective monitoring and problem identification.&lt;br&gt;
Configuration Management: Maintaining consistent configurations across different environments is crucial.&lt;br&gt;
Debugging: Centralized logging and dashboards are vital for simplifying error detection and debugging.&lt;br&gt;
Consistency: Maintaining a consistent set of tools, languages, platforms, and technologies is important for effective decentralized governance.&lt;/p&gt;

&lt;h1&gt;
  
  
  Spring Boot Microservices: Developing a Top Sports Brands Architecture
&lt;/h1&gt;

&lt;p&gt;In this example, we will create a Top Sports Brands application comprising three distinct services:&lt;/p&gt;

&lt;h1&gt;
  
  
  1. Eureka Service
&lt;/h1&gt;

&lt;p&gt;Purpose: Manages the registration of each microservice and facilitates service discovery for client microservices.&lt;br&gt;
Implementation: Utilizes Netflix Eureka and Spring Cloud for a declarative approach to service registration and invocation.&lt;/p&gt;

&lt;h1&gt;
  
  
  2. Item Catalog Service
&lt;/h1&gt;

&lt;p&gt;Purpose: Provides a catalog of popular sports brands.&lt;br&gt;
Dependencies: Includes Actuator, Eureka Discovery, JPA, H2, Rest Repositories, Web, DevTools, and Lombok.&lt;/p&gt;

&lt;h1&gt;
  
  
  3. Edge Service
&lt;/h1&gt;

&lt;p&gt;Purpose: Serves as a gateway, offering fallback mechanisms to prevent HTTP errors during service unavailability.&lt;br&gt;
Dependencies: Incorporates Eureka Discovery, Feign, Zuul, Rest Repositories, Web, Hystrix, and Lombok.&lt;/p&gt;

&lt;h1&gt;
  
  
  Essential Tools
&lt;/h1&gt;

&lt;p&gt;Java 8&lt;br&gt;
Eclipse IDE Oxygen&lt;br&gt;
Spring Tool Suite&lt;/p&gt;

&lt;h1&gt;
  
  
  Service Creation Steps
&lt;/h1&gt;

&lt;h1&gt;
  
  
  Eureka Service
&lt;/h1&gt;

&lt;p&gt;Setup: Initialize a new EurekaServer Spring Starter Project in Eclipse IDE.&lt;br&gt;
Configuration: Add necessary dependencies and adjust properties to set the port and disable self-registration.&lt;br&gt;
Startup: Launch the application and verify the Eureka Server at &lt;a href="http://localhost:8761" rel="noopener noreferrer"&gt;http://localhost:8761&lt;/a&gt;.&lt;/p&gt;

&lt;h1&gt;
  
  
  Item Catalog Service
&lt;/h1&gt;

&lt;p&gt;Setup: Initialize a new project named item-catalog-service.&lt;br&gt;
Dependencies: Add essential dependencies including Actuator, Eureka Discovery, JPA, H2, Rest Repositories, Web, DevTools, and Lombok.&lt;br&gt;
Configuration: Specify the application name and port in the properties file.&lt;br&gt;
Cloud Properties: Configure cloud properties for Eureka integration.&lt;br&gt;
Startup: Launch the application and verify its registration with the Eureka Server.&lt;/p&gt;

&lt;h1&gt;
  
  
  Edge Service
&lt;/h1&gt;

&lt;p&gt;Setup: Initialize a new project named edge-service.&lt;br&gt;
Dependencies: Add dependencies such as Eureka Discovery, Feign, Zuul, Rest Repositories, Web, Hystrix, and Lombok.&lt;br&gt;
Configuration: Set the application name and port in the properties file.&lt;br&gt;
Cloud Properties: Configure cloud properties for Eureka integration.&lt;br&gt;
Implementation: Develop DTOs, Feign clients, and controllers with fallback methods using Hystrix.&lt;br&gt;
Startup: Launch the application and ensure successful service registration and functionality.&lt;/p&gt;

&lt;h1&gt;
  
  
  Conclusion
&lt;/h1&gt;

&lt;p&gt;By following these detailed steps, you can establish a robust microservices architecture for a Top Sports Brands application using Spring Boot and Netflix Eureka Server. This architecture ensures scalability, resilience, and efficient monitoring, effectively addressing the common challenges associated with microservices development.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>springboot</category>
      <category>microservices</category>
    </item>
  </channel>
</rss>
