website: install abigen with go1.18+ (#28931)
* go install: abigen * abigen: go install * abigen: go install * abigen: solidity
This commit is contained in:
parent
15e83a31f5
commit
7c9548cc09
@ -22,8 +22,7 @@ Ethereum smart contracts have a schema that defines its functions and return typ
|
|||||||
Geth includes a source code generator called `abigen` that can convert Ethereum ABI definitions into easy to use, type-safe Go packages. With a valid Go development environment set up and the go-ethereum repository checked out correctly, `abigen` can be built as follows:
|
Geth includes a source code generator called `abigen` that can convert Ethereum ABI definitions into easy to use, type-safe Go packages. With a valid Go development environment set up and the go-ethereum repository checked out correctly, `abigen` can be built as follows:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
$ cd $GOPATH/src/github.com/ethereum/go-ethereum
|
go install github.com/ethereum/go-ethereum/cmd/abigen@latest
|
||||||
$ go build ./cmd/abigen
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### Generating the bindings {#generating-bindings}
|
### Generating the bindings {#generating-bindings}
|
||||||
|
@ -3,11 +3,10 @@ title: Abigen
|
|||||||
description: Introduction to the Go binding generator tool, Abigen
|
description: Introduction to the Go binding generator tool, Abigen
|
||||||
---
|
---
|
||||||
|
|
||||||
Abigen is a binding-generator for easily interacting with Ethereum using Go. Abigen creates easy-to-use, type-safe Go packages from Ethereum smart contract definitions known as ABIs. This abstracts away a lot of the complexity of handling smart contract deployment and interaction in Go native applications such as encoding and decoding smart contracts into EVM bytecode. Abigen comes bundled with Geth. A full Geth installation includes the abigen binary. Abigen can also be built independently by navigating to `go-ethereum/cmd/abigen` and running `go build`, or equivalently:
|
Abigen is a binding-generator for easily interacting with Ethereum using Go. Abigen creates easy-to-use, type-safe Go packages from Ethereum smart contract definitions known as ABIs. This abstracts away a lot of the complexity of handling smart contract deployment and interaction in Go native applications such as encoding and decoding smart contracts into EVM bytecode. Abigen comes bundled with Geth. A full Geth installation includes the abigen binary. Abigen can also be built independently by running the below `go install` command:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
$ cd $GOPATH/src/github.com/ethereum/go-ethereum
|
go install github.com/ethereum/go-ethereum/cmd/abigen@latest
|
||||||
$ go build ./cmd/abigen
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## What is an ABI? {#what-is-an-abi}
|
## What is an ABI? {#what-is-an-abi}
|
||||||
@ -18,7 +17,7 @@ Ethereum smart contracts have a schema that defines its functions and return typ
|
|||||||
|
|
||||||
To demonstrate the binding generator a contract is required. The contract `Storage.sol` implements two very simple functions: `store` updates a user-defined `uint256` to the contract's storage, and `retrieve` displays the value stored in the contract to the user. The Solidity code is as follows:
|
To demonstrate the binding generator a contract is required. The contract `Storage.sol` implements two very simple functions: `store` updates a user-defined `uint256` to the contract's storage, and `retrieve` displays the value stored in the contract to the user. The Solidity code is as follows:
|
||||||
|
|
||||||
```js
|
```solidity
|
||||||
// SPDX-License-Identifier: GPL-3.0
|
// SPDX-License-Identifier: GPL-3.0
|
||||||
|
|
||||||
pragma solidity >0.7.0 < 0.9.0;
|
pragma solidity >0.7.0 < 0.9.0;
|
||||||
|
Loading…
Reference in New Issue
Block a user