Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the relationship between geth, web3.js, JSON RPC and truffle

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

What is the relationship among geth, web3.js, JSON RPC and truffle? in view of this question, this article introduces the corresponding analysis and solution in detail, hoping to help more partners who want to solve this problem to find a more simple and feasible way.

1. Geth

Geth, whose full name is Go-ethereum, is an ethernet client written in go language. It can be launched through an interactive console that provides a JavaScript runtime environment. Built-in objects such as eth, web3.js, etc. (from the book Block chain Development: key Technologies and case Studies of Ethernet Square)

2. Web3.js

Web3.js encapsulates JSON RPC and can link to any etheric block chain node that exposes the RPC interface.

ABI is the abbreviation of Application Binary Interface, which literally uses the binary interface and can be understood as the interface description of the contract. When the contract is compiled, its abi is determined

The address of the Address smart contract (provided by the Ethernet Square), the length of the Ethernet Square address, the size of 20 bytes, 160 bits, so it can be encoded with a uint160. Address is the basis of all contracts, all contracts will inherit the address object, or you can call an address string at any time to get the corresponding code.

3. JSON RPC

JSON RPC can be linked to any ethernet block chain node that exposes the RPC interface. The operation is more tedious than web3.js and needs to be used with curl. The command is long to write, such as:

Curl-X POST-H "Content-Type": application/json-data'{"jsonrpc": "2.0", "method": "eth_getBalance", "params": ["0x75b567b6d35c56a4e25c217efe892cfbb53d3d46", "latest"], "id": 1} 'localhost:3000

4. Truffle

Truffle is the framework for developing smart contracts in Etay Fong, which can quickly build projects and deploy smart contracts to block chains. You can create, compile, and deploy a project in a few steps:

Truffle init

Truffle compile

Truffle migrate

This is the answer to the question about the relationship between geth, web3.js, JSON RPC and truffle. I hope the above content can be of some help to you. If you still have a lot of doubts to be solved, you can follow the industry information channel for more related knowledge.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report