From 7c9548cc0916be6d0545e5524de9e88118aab731 Mon Sep 17 00:00:00 2001 From: Hiro Date: Tue, 6 Feb 2024 02:31:16 +0530 Subject: [PATCH] website: install abigen with go1.18+ (#28931) * go install: abigen * abigen: go install * abigen: go install * abigen: solidity --- docs/developers/dapp-developer/native-bindings.md | 3 +-- docs/tools/abigen.md | 7 +++---- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/docs/developers/dapp-developer/native-bindings.md b/docs/developers/dapp-developer/native-bindings.md index 071227a85c..5d82391ba9 100644 --- a/docs/developers/dapp-developer/native-bindings.md +++ b/docs/developers/dapp-developer/native-bindings.md @@ -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: ```sh -$ cd $GOPATH/src/github.com/ethereum/go-ethereum -$ go build ./cmd/abigen +go install github.com/ethereum/go-ethereum/cmd/abigen@latest ``` ### Generating the bindings {#generating-bindings} diff --git a/docs/tools/abigen.md b/docs/tools/abigen.md index 3950f2d981..8ac1ab530c 100644 --- a/docs/tools/abigen.md +++ b/docs/tools/abigen.md @@ -3,11 +3,10 @@ title: 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 -$ cd $GOPATH/src/github.com/ethereum/go-ethereum -$ go build ./cmd/abigen +go install github.com/ethereum/go-ethereum/cmd/abigen@latest ``` ## 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: -```js +```solidity // SPDX-License-Identifier: GPL-3.0 pragma solidity >0.7.0 < 0.9.0;