Skip to content

filswan/ether-test

 
 

Repository files navigation

Go Ethereum Test Suite

Overview

This project contains a suite of tests written in Go for interacting with Ethereum smart contracts and performing various blockchain-related operations. The tests demonstrate how to connect to the Ethereum network, send transactions, and interact with a custom smart contract.

Prerequisites

  • Golang: Ensure you have Go installed on your system. Download Go
  • Ethereum Node: Access to an Ethereum node is required. This can be either a local node or a remote service
  • Solidity Contract: A deployed instance of the smart contract on the Ethereum network.

Installation

  1. Clone the repository:
    git clone https://github.com/filswan/ether-test
  2. Navigate to the project directory:
    cd ether-test
  3. Install dependencies:
    go mod tidy

Configuration

Set up your .env file with the necessary environment variables:

SENDER_PRIVATE_KEY=your_private_key

Test Files

  • ethclient_test.go: Demonstrates how to connect to an Ethereum client and fetches basic blockchain data like the latest block number and network ID.

  • ethclient_fund_test.go: Contains tests for transferring Ether to an Ethereum address. It demonstrates how to construct, sign, and send transactions.

  • config_test.go: (Provide a brief description of what this file does).

Running Tests

To run the tests, use the following command:

go test -v ./...

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 96.9%
  • Solidity 3.1%