ava-test-tool

module
v0.0.0-...-e9c744c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 23, 2023 License: Apache-2.0

README

ava-test-tool

Start a local net 5 node Avalanche testing environment.

Deploy and test solidity contracts on a live local EVM.

Howto run

go run ./cmd/app/

Howto connect

You can interact with the C chain at http://localhost:9650

package main

import (
	"context"
	"github.com/ethereum/go-ethereum/ethclient"
	"github.com/ethereum/go-ethereum/rpc"
	"log"
)

func main() {
	ctx := context.Background()

	rpcClnt, err := rpc.Dial("http://localhost:9650/ext/bc/C/rpc")
	if err != nil {
		log.Fatal(err)
	}
	ethClnt := ethclient.NewClient(rpcClnt)

	chainID, err := ethClnt.ChainID(ctx)
	if err != nil {
		log.Fatal(err)
	}

	log.Println(chainID)
}

Test deploy

revertdeploy deploys the reverted contract and test some calls.

Directories

Path Synopsis
cmd
app
contracts

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL