• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

web3j/sample-project-gradle: Sample web3j project using Gradle

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

web3j/sample-project-gradle

开源软件地址(OpenSource Url):

https://github.com/web3j/sample-project-gradle

开源编程语言(OpenSource Language):

Java 100.0%

开源软件介绍(OpenSource Introduction):

web3j Sample Project

This project provides a very simple starter application for working with web3j and the test Ethereum network (testnet) known as Rinkeby.

The demo deploys a hello world smart contract which contains a greeting message. The current greeting message can be read and modified in the smart contract.

In order to run this demo, three pieces of information are required:

  1. Ethereum client (or node) endpoint. The simplest thing to do is request a free access token from Infura.
  2. A wallet file. This can be generated using the Epirus CLI.
  3. Some Ether. This can be requested from the Rinkeby Faucet.

Once these details have been added to the main Application class, you'll be good to go.

Functionality

This application demonstrates a number of core features of web3j and Ethereum:

  • Connecting to a node on the Ethereum network
  • Loading an Ethereum wallet file
  • Sending Ether from one address to another
  • Deploying a smart contract to the network
  • Reading a value from the deployed smart contract
  • Updating a value in the deployed smart contract
  • Viewing an event logged by the smart contract

Background

This application has purposefully been kept as simple as possible with the aim of demonstrating how to deploy and work with a smart contract on the decentralised Ethereum network.

If you require further background information about the above configuration items for the project you can refer to the below.

For a more comprehensive overview, I recommend you read the Java Magazine Article, watch the YouTube talk, and read all of the documentation.

Smart contracts

The contained smart contract is based on the Greeter contract example, with the addition that the value stored in the Greeter can be modified.

The associated Java smart contract wrapper is named Greeter.

For more background on smart contracts, refer to the smart contracts section of the docs.

Infura

If you don't want to sign up to Infura, and would like to run a node yourself, there are instructions in the getting started section of the docs.

Testnets

For more information on the different Ethereum test networks (or testnets), refer to the testnet overview in the docs.

Ether

For background on Ether, refer to the transactions overview section of the docs.

Wallets and transaction signing

For a more technical overview of working with wallet files, refer to the Offline transaction signing section of the docs.

Viewing requests

A logback configuration is included in the project dependencies allowing the logging of protocol messages if required. To enable, simply change the following line in the logback configuration to read:

<logger name="org.web3j.protocol" level="DEBUG"/>



鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Sponsor @web3j on GitHub Sponsors · GitHub发布时间:2022-06-11
下一篇:
DeekshithSN/CICD_Java_gradle_application发布时间:2022-06-11
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap