Skip to content

Commit

Permalink
Merge pull request #183 from ava-labs/go-install-example-in-readme
Browse files Browse the repository at this point in the history
[AV-1936] add go install instruction to README
  • Loading branch information
felipemadero authored Jul 19, 2022
2 parents 6dab749 + f329c75 commit 0491301
Showing 1 changed file with 41 additions and 32 deletions.
73 changes: 41 additions & 32 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,12 @@ Nonetheless, this README should provide valuable information about using this to
This is a tool to run and interact with a local Avalanche network.
This tool may be especially useful for development and testing.


## Installation

### Using install script

This is the preferred way. Does not require golang to be installed on the system.

To download a binary for the latest release, run:

```
Expand All @@ -33,31 +36,61 @@ export PATH=$PWD:$PATH

To add it to your path permanently, add an export command to your shell initialization script (ex: .bashrc).

### Installing in Custom Location
#### Installing in Custom Location

To download the binary into a specific directory, run:

```
curl -sSfL https://raw.githubusercontent.com/ava-labs/avalanche-network-runner/main/scripts/install.sh | sh -s -- -b <relative directory>
```

## Running from source
### Install using golang

Requires golang to be installed on the system (https://go.dev/doc/install).

```sh
go install github.com/ava-labs/avalanche-network-runner@latest
```

After that, the `avalanche-network-runner` binary should be present under the `$HOME/go/bin/` directory.
Consider adding this directory to the `PATH` environment variable.

### Download
### Install by release download

Does not require golang to be installed on the system.

Download the desired distribution from https://github.com/ava-labs/avalanche-network-runner/releases

Uncompress and locate where is convenient. Consider adding the target bin directory to the `PATH` environment variable.

### Install from source code and execute tests

#### Download

```sh
git clone https://github.com/ava-labs/avalanche-network-runner.git
```

### Run Unit Tests
#### Install

From inside the cloned directory:

```sh
go install
```

After that, `avalanche-network-runner` binary should be present under `$HOME/go/bin/` directory.
Consider adding this directory to the `PATH` environment variable.

#### Run Unit Tests

Inside the directory cloned above:

```sh
go test ./...
```

### Run E2E tests
#### Run E2E tests

The E2E test checks `avalanche-network-runner` RPC communication and control. It starts a network against a fresh RPC
server and executes a set of query and control operations on it.
Expand All @@ -75,7 +108,7 @@ different versions as arguments. For Example:
./scripts/tests.e2e.sh 1.7.9 1.7.10
```

#### `RUN_E2E` environment variable
##### `RUN_E2E` environment variable

To specify that the E2E test should be run with `go test`, set environment variable `RUN_E2E` to any non-empty value.

Expand All @@ -95,14 +128,6 @@ This creates an RPC server that you can send requests to in order to start a net

## `network-runner` RPC server: examples

Download from https://github.com/ava-labs/avalanche-network-runner/releases:

```bash
# or install
cd ${HOME}/go/src/github.com/ava-labs/avalanche-network-runner
go install -v ./cmd/avalanche-network-runner
```

To start the server:

```bash
Expand Down Expand Up @@ -431,14 +456,6 @@ avalanche-network-runner control stop \
## `network-runner` RPC server: `subnet-evm` example
Download from https://github.com/ava-labs/avalanche-network-runner/releases:
```bash
# or install
cd ${HOME}/go/src/github.com/ava-labs/avalanche-network-runner
go install -v ./cmd/avalanche-network-runner
```
To start the server:
```bash
Expand Down Expand Up @@ -553,14 +570,6 @@ curl -X POST -k http://localhost:8081/v1/control/status -d ''
## `network-runner` RPC server: `blobvm` example
Download from https://github.com/ava-labs/avalanche-network-runner/releases:
```bash
# or install
cd ${HOME}/go/src/github.com/ava-labs/avalanche-network-runner
go install -v ./cmd/avalanche-network-runner
```
To start the server:
```bash
Expand Down Expand Up @@ -807,7 +816,7 @@ type Network interface {
GetNodeNames() ([]string, error)
// Save network snapshot
// Network is stopped in order to do a safe preservation
// Returns the full local path to the snapshot dir
// Returns the full local path to the snapshot dir
SaveSnapshot(context.Context, string) (string, error)
// Remove network snapshot
RemoveSnapshot(string) error
Expand Down

0 comments on commit 0491301

Please sign in to comment.