{"id":27475497,"url":"https://github.com/brunonascdev/besu-guild-sample","last_synced_at":"2025-09-11T05:41:20.322Z","repository":{"id":252777249,"uuid":"841423683","full_name":"Brunonascdev/besu-guild-sample","owner":"Brunonascdev","description":"Introduction to Hyperledger Besu Guild","archived":false,"fork":false,"pushed_at":"2024-08-15T14:58:15.000Z","size":149,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-16T07:16:48.878Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Brunonascdev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-08-12T11:31:49.000Z","updated_at":"2024-08-15T14:58:18.000Z","dependencies_parsed_at":"2024-08-15T16:42:02.919Z","dependency_job_id":null,"html_url":"https://github.com/Brunonascdev/besu-guild-sample","commit_stats":null,"previous_names":["brunonascdev/besu-guild-sample"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Brunonascdev/besu-guild-sample","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Brunonascdev%2Fbesu-guild-sample","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Brunonascdev%2Fbesu-guild-sample/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Brunonascdev%2Fbesu-guild-sample/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Brunonascdev%2Fbesu-guild-sample/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Brunonascdev","download_url":"https://codeload.github.com/Brunonascdev/besu-guild-sample/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Brunonascdev%2Fbesu-guild-sample/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274583950,"owners_count":25311901,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-11T02:00:13.660Z","response_time":74,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-04-16T06:54:42.711Z","updated_at":"2025-09-11T05:41:20.301Z","avatar_url":"https://github.com/Brunonascdev.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Introduction to Hyperledger Besu Guild\n\nThis repository serves as a comprehensive sample project for Hyperledger Besu, an Ethereum client designed to meet enterprise needs, offering both permissioned and public network functionalities.\n\n## Repository Structure\n\nThe folder structure of this project is organized as follows:\n\n```bash\nSample_Network/\n├── Node-1\n│   ├── data\n├── Node-2\n│   ├── data\n└── Node-3\n    ├── data\nToken_Client/\n├── index.ts\nToken_Contract/\n├── contracts\n│   ├── Token.sol\n├── scripts\n│   ├── deploy_token.ts\nREADME.md\n```\n\n### Folder Description\n\n- `Sample_Network`: Contains a sample Hyperledger Besu network setup using the [Clique consensus protocol](https://besu.hyperledger.org/private-networks/tutorials/clique). The nodes in this folder are preconfigured to simulate a simple private network.\n- `Token_Contract`: Houses the code for an [ERC-20 Smart Contract](https://ethereum.org/en/developers/docs/standards/tokens/erc-20/), which is a standard for creating fungible tokens on the Ethereum blockchain. This folder also includes deployment scripts leveraging the Hardhat development environment.\n- `Token_Client`: Contains a Node.js client that interacts with the deployed token contract using the [web3.js library](https://web3js.readthedocs.io/en/v1.10.0/). This client provides several commands to interact with the token contract, such as checking the token name, minting new tokens, and checking account balances.\n\n## Setting Up the Besu Network\n\n### Pre-requisites\n\nBefore you begin, ensure you have the following installed:\n\n- [Hyperledger Besu](https://besu.hyperledger.org/private-networks/get-started/install/binary-distribution)\n- [Prometheus (optional)](https://prometheus.io/download/)\n\nThe `Sample_Network` folder is preconfigured for local execution. To start the network, follow these steps:\n\n1. Navigate to the scripts folder:\n\n```bash\ncd Sample_Network/scripts\n```\n\n2. Set execution permissions for the scripts:\n\n```bash\nchmod +x start_node1.sh \u0026\u0026 chmod +x start_node2.sh \u0026\u0026 chmod +x start_node3.sh\n```\n\n3. Start the first node:\n\n```bash\n./start_node1.sh\n```\n\n4. Open a new terminal and start the second node:\n\n```bash\n./start_node2.sh\n```\n\n5. Open another terminal and start the third node:\n\n```bash\n./start_node3.sh\n```\n\n### Monitoring the Network\n\nTo monitor the network using Prometheus, follow these steps:\n\n1. Navigate to the scripts folder:\n\n```bash\ncd Sample_Network/scripts\n```\n\n2. Install prometheus:\n\n```bash\nbrew install prometheus\n```\n\n3. Start Prometheus:\n\n```bash\n./start_prometheus.sh\n```\n\n4. Open a browser and navigate to `http://localhost:9090` to access the Prometheus dashboard. More infomation on setting up Prometheus can be found in the [Hyperledger Besu documentation](https://besu.hyperledger.org/development/public-networks/how-to/monitor/metrics#view-prometheus-graphical-interface).\n\nTo know more about the network setup, refer to the [Hyperledger Besu documentation](https://besu.hyperledger.org/private-networks/tutorials/clique).\n\n## Deploying the Token Contract\n\n### Pre-requisites\n\nBefore you begin, ensure you have the following installed:\n\n- [Node.js](https://nodejs.org/en)\n\nThe `Token_Contract` folder is preconfigured for deploying the token contract. Please note that the Besu nodes must be running before deploying the contract.\n\n**Optional: Customizing the Token**\n\nIf you wish to customize the token’s name and symbol, follow these steps:\n\n1. Navigate to the contracts folder:\n\n```bash\ncd Token_Contract/contracts/\n```\n\n2. Open the Token.sol file and edit the contract constructor as needed. For example, to change the token name to “AnotherName” and the symbol to “ANTK”, update the following lines:\n\nBefore:\n\n```solidity\n    constructor(\n        address initialOwner\n    )\n        ERC20(\"GuildToken\", \"GTK\")\n        Ownable(initialOwner)\n        ERC20Permit(\"GuildToken\")\n    {}\n```\n\nAfter:\n\n```solidity\n    constructor(\n        address initialOwner\n    )\n        ERC20(\"AnotherName\", \"ANTK\")\n        Ownable(initialOwner)\n        ERC20Permit(\"AnotherName\")\n    {}\n```\n\n### Deploying the Contract\n\n1. Navigate to the contract folder:\n\n```bash\ncd Token_Contract/\n```\n\n2. Install the necessary dependencies:\n\n```bash\nnpm install\n```\n\n3. Deploy the contract:\n\n```bash\nnpm run deploy\n```\n\nThis will use the Hardhat library to deploy the contract to your running Besu network.\n\n4. Copy the contract address from the output:\n\n```bash\nToken deployed\nToken address\n0x...\n```\n\n## Interacting with the Deployed Contract\n\n### Pre-requisites\n\n- [Node.js](https://nodejs.org/en)\n\nEnsure that Node.js is installed, and the Besu network is running with the token contract already deployed.\n\nTo interact with the contract, follow these steps:\n\n1. Navigate to the client folder:\n\n```bash\ncd Token_Client/\n```\n\n2. Install the necessary dependencies:\n\n```bash\nnpm install\n```\n\n3. Update the contract address:\n\nOpen the `index.ts` file and update the `CONTRACT_ADDRESS` variable with the address of the deployed token contract:\n\n```typescript\nconst contractAddress = \"0x...\"; // Update this with the deployed contract address\n```\n\n4. Verify the connection to the Besu network:\n\nRun the following command to check if the client is communicating correctly with Besu:\n\n```bash\nnpm run assetCode\n```\n\nIf successful, this command should return the asset code defined in the contract. For example, if unchanged, it should return `GTK`.\n\n### Available commands:\n\n- Get the token name:\n\n```bash\nnpm run name\n```\n\n- Mint a specified amount of tokens to the owner account:\n\n```bash\nnpm run mint \u003camount\u003e\n```\n\n- Check the owner account balance:\n\n```bash\nnpm run balance\n```\n\nThese commands allow you to interact with the deployed token contract, enabling token minting, querying balances, and more.\n\nThis README provides a detailed guide on setting up a Hyperledger Besu network, deploying an ERC-20 token contract, and interacting with it using Node.js. Follow the steps carefully to ensure a successful setup and deployment process.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrunonascdev%2Fbesu-guild-sample","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbrunonascdev%2Fbesu-guild-sample","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrunonascdev%2Fbesu-guild-sample/lists"}