Code Monkey home page Code Monkey logo

avash's Issues

runtime error in function avash_call

Hello, when I want to run a .lua script i get an error:

RunScript: Failed to run scripts/five_node_network.lua
runtime error: invalid memory address or nil pointer dereference
stack traceback: in function 'avash_call'
scripts/five_node_network.lua:12: in main chunk

the problem comes from the avash_call function.
I specify that the functions avash_sleepmicro and avash_setvar work well.

How i can fix it ?

formatting.CB58 is not a type

I got this error while compiling the source code

formatting.CB58 is not a type

What version of avalanchgo should I use with avash on master?

Use network alias "local" as default for cli param "network-id"

There's now a proper alias for the local network Network ID. It's "local". If someone passes network-id=local to the gecko node, it will translate that to 12345. This is better because it keeps default network IDs standard. Since Avash technically "implements" Gecko, please use the same system with the same default being "local".

Installation fails to work as intended if "go.mod" file present

INTRO:

After installing gecko 0.5.5, I was confused why the standard avash install directions were not working:
$ go get github.com/ava-labs/avash
$ cd $GOPATH/src/github.com/ava-labs/avash
No such file or directory
The initial sign that things to wrong is the "avash" folder is not present in the $GOPATH

SUMMARY:

I discovered the core issue is that avash cannot be installed in a directory that has a "go.mod" file present, such as the gecko installation directory. Install directions for avash should warn user to be either in a clean directory, or perhaps switch to cd $GOPATH since that should not have "go.mod" directly in it.

DETAILS:

Let's revisit my issue via docker. I create a "mike" user to mimic conditions on my regular bare metal system:

TEST 1: ITS GOING TO BE UGLY

docker run --name avashtest1 -it ubuntu:bionic bash
apt update
apt install -y curl git mercurial make binutils bison gcc build-essential golang
adduser mike
su - mike
bash < <(curl -s -S -L https://raw.githubusercontent.com/moovweb/gvm/master/binscripts/gvm-installer)
source /home/mike/.gvm/scripts/gvm
gvm install go1.13.12
gvm use go1.13.12 --default
echo System general setup done.
go get -d -v github.com/ava-labs/gecko/...
cd $GOPATH/src/github.com/ava-labs/gecko
pwd # /home/mike/.gvm/pkgsets/go1.13.12/global/src/github.com/ava-labs/gecko
./scripts/build.sh
./build/ava --version # avalanche/0.5.5
test -f go.mod && echo WARNING: go.mod file found. Avash will not install correctly. Please switch to another directory. || echo INFO: go.mod file not found. Avash ready for installation.
go get github.com/ava-labs/avash
cd $GOPATH/src/github.com/ava-labs/avash # No such file or directory

What happened? The presence of "go.mod" file caused it to be built and stored as a module!
$ find ~/ | grep /avash$
/home/mike/.gvm/pkgsets/go1.13.12/global/bin/avash
/home/mike/.gvm/pkgsets/go1.13.12/global/pkg/mod/cache/download/github.com/ava-labs/avash

TEST 2: THIS WORKS

docker run --name avashtest2 -it ubuntu:bionic bash
apt update
apt install -y curl git mercurial make binutils bison gcc build-essential golang
adduser mike
su - mike
bash < <(curl -s -S -L https://raw.githubusercontent.com/moovweb/gvm/master/binscripts/gvm-installer)
source /home/mike/.gvm/scripts/gvm
gvm install go1.13.12
gvm use go1.13.12 --default
echo System general setup done.
go get -d -v github.com/ava-labs/gecko/...
cd $GOPATH/src/github.com/ava-labs/gecko
pwd # /home/mike/.gvm/pkgsets/go1.13.12/global/src/github.com/ava-labs/gecko
./scripts/build.sh
./build/ava --version # avalanche/0.5.5
cd $GOPATH # Let's go a directory without "go.mod" file
test -f go.mod && echo WARNING: go.mod file found. Avash will not install correctly. Please switch to another directory. || echo INFO: go.mod file not found. Avash ready for installation.
go get github.com/ava-labs/avash
cd $GOPATH/src/github.com/ava-labs/avash
pwd # /home/mike/.gvm/pkgsets/go1.13.12/global/src/github.com/ava-labs/avash
go build

$ find ~/ | grep /avash$
/home/mike/.gvm/pkgsets/go1.13.12/global/bin/avash
/home/mike/.gvm/pkgsets/go1.13.12/global/src/github.com/ava-labs/avash
/home/mike/.gvm/pkgsets/go1.13.12/global/src/github.com/ava-labs/avash/avash

$ file avash
avash: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, not stripped

C-Chain cant bootstrap

Hey, im trying to run avash five_node_staking.lua, the C-Chain gets stuck bootstraping(from health.getLiveness). In the logs I get this error:
ERROR[07-29|09:25:00] /chains/manager.go#250: error while creating vm: Unrecognized remote plugin message:

This usually means that the plugin is either invalid or simply
needs to be recompiled to support the latest protocol.

Im on Ubuntu 20.04 LTS, I just did git pull and buid in both avash ans gecko

Location of avash and gecko:
/home/nita/go/src/github.com/ava-labs/gecko
/home/nita/go/src/github.com/ava-labs/avash

echo $GOPATH/home/nita/go
go version go1.13.8 linux/amd64

0.log

Avash did not start avalanchego

Was not able to get project running following the readme. After starting avalanchego in a separate process then starting avash fixed it. Is avash supposed to automatically start it?

Set up fail as `go get` is deprecated

Following the set up instructions, I am running go get github.com/ava-labs/avash. This gives the following error. Sounds like the fix would be the publish this as a versioned package.

go get: installing executables with 'go get' in module mode is deprecated.
	Use 'go install pkg@version' instead.

Also tried the following but doesn't work.

go install ava-labs/avash@latest
go install: ava-labs/avash@latest: malformed module path "ava-labs/avash": missing dot in first path element

avash installation issue and a work around

Hi there, I tried the avash installation and go get github.com/ava-labs/avash throwed the following error:

package go.uber.org/multierr: unrecognized import path "go.uber.org/multierr" (https fetch: Get https://go.uber.org/multierr?go-get=1: net/http: TLS handshake timeout)

This might be related to paths but not sure exactly, here is my environment variables for Go on a mac os 10.15.2.

export GOPATH="$HOME/go"
export PATH="$GOPATH/bin:$PATH"

However, here is a work around in case someone come across this issue:

mkdir -p $GOPATH/src/go.uber.org
cd $GOPATH/src/go.uber.org
git clone [email protected]:uber-go/multierr.git
git clone [email protected]:uber-go/atomic.git

Then the avash build works fine.

Tab key command completion

Pressing the tab key should auto-complete a command in terminal if the current text is a unique start to that command.

Validate config file when starting Avash

If the config file is incorrect Avash just kinda rolls along. We should check to make sure the Ava binary is where it says it is, the loglevels are valid, or anything else. Just exit if they're not.

Support `yaml` and `yml` equally

Currently avash only looks for the yaml extension for its config file.

As yml is equally standard for YAML files, both should be supported.

Run script run nothing

PS D:\workspace-test\avash> .\avash.exe
Config file not found: .avash.yaml
Created empty config file: C:\Users\test/.avash.yaml
avash> runscript scripts/five_node_staking.lua
avash>

did everything doc told and node didn't start

Add callrpc command

Add a callrpc command to issue RPC commands to any node.

callrpc <nodename> <rpcmethod> <varscope> <varname> args...

Please edit docs/directory

the avax docs are a little off:
https://github.com/ava-labs/avash
This says "cd $GOPATH/src/github.com/ava-labs/avash"
But
go get github.com/ava-labs/avash
installs a diretory not named avash, it is named "[email protected]", so it doesn't match the install docs.

Also the website says "An Avalanche Client Implementing Avalanche Standard CLI Flags", which sort of comes before the Quick Setup, and is sort of confusing ๐Ÿ’˜

Use the same local certs/keys as Gecko

When starting nodes, Avash uses certs in avash/certs/keyX.
Right now, keys 1 through 5 are the same as staker1.key, ..., staker5.key in gecko/keys/local.
These keys are currently funded when running a local network but those keys may change in the future.

What do you think of pointing Avash to use the keys/local files in the gecko repo instead of replicating them in avash/certs?

Version flag

Please add a flag to quickly check the version of an avash executable.

Broken dependencies

After going through a fresh install of go and this package, I get the following after running go build:

../avalanchego/utils/crypto/secp256k1r.go:15:2: cannot find package "github.com/decred/dcrd/dcrec/secp256k1/v3" in any of:
	/usr/local/go/src/github.com/decred/dcrd/dcrec/secp256k1/v3 (from $GOROOT)
	/Users/doug/go/src/github.com/decred/dcrd/dcrec/secp256k1/v3 (from $GOPATH)
../avalanchego/utils/crypto/secp256k1r.go:13:2: cannot find package "github.com/decred/dcrd/dcrec/secp256k1/v3/ecdsa" in any of:
	/usr/local/go/src/github.com/decred/dcrd/dcrec/secp256k1/v3/ecdsa (from $GOROOT)
	/Users/doug/go/src/github.com/decred/dcrd/dcrec/secp256k1/v3/ecdsa (from $GOPATH)
../../spf13/viper/internal/encoding/hcl/codec.go:8:2: cannot find package "github.com/hashicorp/hcl/hcl/printer" in any of:
	/usr/local/go/src/github.com/hashicorp/hcl/hcl/printer (from $GOROOT)
	/Users/doug/go/src/github.com/hashicorp/hcl/hcl/printer (from $GOPATH)

The first two can be resolved by changing the following lines in ava-labs/avalanchego/utils/crypto/secp256k1r.go:

"github.com/decred/dcrd/dcrec/secp256k1/v3/ecdsa" to "github.com/decred/dcrd/dcrec/secp256k1/ecdsa"
secp256k1 "github.com/decred/dcrd/dcrec/secp256k1/v3" to secp256k1 "github.com/decred/dcrd/dcrec/secp256k1"

Output from ls in ~/go/src/github.com/decred/dcrd/dcrec/secp256k1:

README.md			ecdh_test.go			field.go			loadprecomputed.go		privkey_test.go
bench_test.go			ecdsa				field_bench_test.go		modnscalar.go			pubkey.go
compressedbytepoints.go		ellipticadaptor.go		field_test.go			modnscalar_bench_test.go	pubkey_test.go
curve.go			ellipticadaptor_test.go		genprecomps.go			modnscalar_test.go		schnorr
curve_test.go			error.go			genstatics.go			nonce.go
doc.go				error_test.go			go.mod				nonce_test.go
ecdh.go				example_test.go			go.sum				privkey.go

I'm not sure how to resolve the last one, as I'm not familiar with the package. But it seems its directory structure has been altered.

Output from ls in ~/go/src/github.com/hashicorp/hcl:

CHANGELOG.md			eval_context.go			guide				json				schema.go
LICENSE				expr_call.go			hcldec				merged.go			spec.md
README.md			expr_list.go			hcled				merged_test.go			specsuite
cmd				expr_map.go			hclparse			ops.go				static_expr.go
diagnostic.go			expr_unwrap.go			hclsimple			ops_test.go			structure.go
diagnostic_text.go		ext				hclsyntax			pos.go				structure_at_pos.go
diagnostic_text_test.go		go.mod				hcltest				pos_scanner.go			traversal.go
didyoumean.go			go.sum				hclwrite			pos_scanner_test.go		traversal_for_expr.go
doc.go				gohcl				integrationtest			pos_test.go			traversal_for_expr_test.go

My go version:

go version go1.17.4 darwin/amd64

I'm unsure whether this is an isolated issue with just my environment, but considering I just did a fresh install of go, I doubt it.

Inconsistent node exits

Occasionally, after running several nodes (specific case was 4 from script), exit command will not properly call stop on all running nodes.

Invalid ava binary location error

Hello, I am trying to run ./avash but I got the following error:

Invalid ava binary location: /home/myuser/go/src/github.com/ava-labs/avalanchego/build/avalanchego
Make sure your $GOPATH is set or provide a configuration file with a valid `avalancheLocation` value. See README.md for more details.

How can I provide a avalancheLocation? Currently it is installed at:

/home/myuser/avalanche-node/avalanchego

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.