Categorygithub.com/ardanlabs/ethereum
modulepackage
0.20.0
Repository: https://github.com/ardanlabs/ethereum.git
Documentation: pkg.go.dev

# README

Ethereum

CircleCI Go Report Card go.mod Go version

Copyright 2022, Ardan Labs
[email protected]

Ethereum provides higher level Go API's for writing applications and smart contracts on the Ethereum blockchain.

Licensing

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Learn More

Reach out about corporate training events, open enrollment live training sessions, and on-demand learning options.

Ardan Labs (www.ardanlabs.com)
[email protected]

To attend any of our high-performance tranings check out this link:
https://www.ardanlabs.com/training

Examples

To see example for using these API's check out these two projects.

Ultimate Go: Smart Contract
This project provides material to help you learn the basics of writing, debuging, and maintaining Ethereum smart contracts. This repository has several smart contracts of increasing complexity to showcase different aspects of smart contract development.

Ultimate Go: Liar's Dice
This project implements a game of Liar's Dice where a crypto wallet is used for authentication and a smart contract is used to maintain the bank. Once a player is authenticated, they bet money for each game played and that money comes from their crypto wallet.

For advanced general blockchain knowledge check out this project.

Ultimate Go: Advanced Engineering
This project implements a semantically correct blockchain in Go. The implementation of the Ardan blockchain takes inspiration from both Bitcoin and Ethereum. This does not incorporate any smart contract development, but is good for advanced learning.

# Packages

Package currency provides information on the price of ETH.
Package etherscan provides Go access to the Etherscan API.

# Functions

CreateDialedBackend constructs an ethereum client value for the specified network and attempts to establish a connection.
CreateSimulatedBackend constructs a simulated backend and a set of private keys registered to the backend with a balance of 100 ETH.
FromAddressAny marshals the specified value into JSON to create an array of bytes.
FromAddressBytes extracts the address for the account that signed the data.
NewClient provides an API for accessing an Ethereum node to perform blockchain related operations.
PrivateKeyByKeyFile opens a key file for the private key.
SignAny marshals the specified value into JSON to create an array of bytes.
SignBytes takes the specified bytes and first hashes them using Keccak256 to create a 32 byte array of data.

# Constants

Set of networks supported by the smart package.
Set of networks supported by the smart package.
Set of networks supported by the smart package.
ZeroHash represents a hash code of zeros.

# Structs

Client provides an API for working with smart contracts.
DialedBackend represents a dialied connection to an ethereum node.
SimulatedBackend represents a simulated connection to an ethereum node.

# Interfaces

Backend represents behavior for interacting with an ethereum node.