{"id":21151167,"url":"https://github.com/web3j/sample-project-maven","last_synced_at":"2025-04-04T07:08:17.939Z","repository":{"id":41170592,"uuid":"157243479","full_name":"web3j/sample-project-maven","owner":"web3j","description":"Sample web3j Maven project","archived":false,"fork":false,"pushed_at":"2024-01-31T06:39:10.000Z","size":177,"stargazers_count":40,"open_issues_count":10,"forks_count":791,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-28T06:09:03.897Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/web3j.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2018-11-12T16:32:17.000Z","updated_at":"2025-03-26T06:06:05.000Z","dependencies_parsed_at":"2024-11-20T10:59:11.686Z","dependency_job_id":"6ba34a03-c62b-4a4a-ad48-8ce47b5ffe89","html_url":"https://github.com/web3j/sample-project-maven","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/web3j%2Fsample-project-maven","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/web3j%2Fsample-project-maven/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/web3j%2Fsample-project-maven/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/web3j%2Fsample-project-maven/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/web3j","download_url":"https://codeload.github.com/web3j/sample-project-maven/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247135144,"owners_count":20889421,"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","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":"2024-11-20T10:14:10.590Z","updated_at":"2025-04-04T07:08:17.916Z","avatar_url":"https://github.com/web3j.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# web3j Sample Project\n\nThis project provides a very simple starter application for working with web3j and the test \nEthereum network (testnet) known as Rinkeby.\n\nThe demo deploys a *hello world* smart contract which contains a greeting message. The current \ngreeting message can be read and modified in the smart contract.  \n\nIn order to run this demo, three pieces of information are required:\n\n1. Ethereum client (or node) endpoint. The simplest thing to do is \n[request a free access token](https://infura.io/register.html) from Infura.\n2. A wallet file. This can be generated using the web3j \n[command line tools](https://docs.web3j.io/command_line.html) by running the command:\n3.  Some Ether. This can be requested from the [Rinkeby Faucet](https://www.rinkeby.io/#faucet).\n\n- To create a wallet file, run the command:\n```aidl\nweb3j wallet create\n```\n\n- You will be asked to secure your wallet with a password. You will have the option\nof choosing a destination directory for your wallet file.\nIn the `Application.java` class under the package `org.web3j.sample`,\non line `66-67` replace the placeholders with your wallet file password and directory path.\n\n- With the access token retrieved from Infura, on line `58` replace the placeholder \nin the url with your token. You can find this under the `Endpoint` section:\n\n![Alt text](Artboard.png)\n\nOnce these details have been added to the main Application class, you'll be good to go.\n\n### Run the project\n- Make sure to be in the root directory\n- First we need to create the smart contracts deriving from the solidity file `Greeter.sol` by running:\n```aidl\nmvn web3j:generate-sources\n```\n- This will create the Greeter and Mortal contract under the package `org.web3j.model`\n- Clean and build the project, run the command:\n```aidl\nmvn install\n```\nThis will also generate a jar file with all the dependencies which we will run once\nit has been created.\n- Run the `Main` method in `Application.java` by running \n```\nmvn exec:java\n```\n- Alternatively, you can run the `main` method in `Application.java` in your chosen IDE, e.g. `IntelliJ`\n\n## Functionality\n\nThis application demonstrates a number of core features of web3j and Ethereum:\n\n- Connecting to a node on the Ethereum network\n- Loading an Ethereum wallet file\n- Sending Ether from one address to another\n- Deploying a smart contract to the network\n- Reading a value from the deployed smart contract\n- Updating a value in the deployed smart contract\n- Viewing an event logged by the smart contract\n\n\n## Background\n\nThis application has purposefully been kept as simple as possible with the aim of demonstrating \nhow to deploy and work with a smart contract on the decentralised Ethereum network.\n\nIf you require further background information about the above configuration items for the project\nyou can refer to the below.\n\nFor a more comprehensive overview, I recommend you read the \n[Java Magazine Article](https://web3j.io/articles/web3j%20article%20-%20Java%20Magazine%20JanuaryFebruary%202017.pdf), watch \nthe \n[YouTube](https://youtube.com/watch?v=ea3miXs_P6Y) talk, and read all of the \n[documentation](https://docs.web3j.io).\n\n### Smart contracts\n\nThe contained smart contract is based on the \n[Greeter contract example](https://www.ethereum.org/greeter), with the addition that the value \nstored in the Greeter can be modified.\n\nThe associated Java smart contract wrapper is named Greeter.\n\nFor more background on smart contracts, refer to the \n[smart contracts](https://docs.web3j.io/smart_contracts.html) section of the docs.\n\n\n### Infura\n\nIf you don't want to sign up to Infura, and would like to run a node yourself, there are \ninstructions in the [getting started](https://docs.web3j.io/getting_started.html#start-a-client) \nsection of the docs.\n\n### Testnets\n\nFor more information on the different Ethereum test networks (or testnets), refer \nto the \n[testnet overview](https://docs.web3j.io/transactions.html#ethereum-testnets) in the docs.\n\n### Ether\n\nFor background on Ether, refer to the transactions \n[overview](https://docs.web3j.io/transactions.html#transactions) section of the docs.\n\n### Wallets and transaction signing\n\nFor a more technical overview of working with wallet files, refer to the \n[Offline transaction signing](https://docs.web3j.io/transactions.html#offline-transaction-signing)\nsection of the docs.\n \n\n## Viewing requests\n\nA logback configuration is included in the project dependencies allowing the logging of protocol \nmessages if required. To enable, simply change the following [line]() in the logback configuration\nto read:\n\n```xml\n\u003clogger name=\"org.web3j.protocol\" level=\"DEBUG\"/\u003e\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fweb3j%2Fsample-project-maven","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fweb3j%2Fsample-project-maven","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fweb3j%2Fsample-project-maven/lists"}