Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Binary version #563

Closed
Maharacha opened this issue Sep 20, 2024 · 8 comments · Fixed by #616
Closed

Binary version #563

Maharacha opened this issue Sep 20, 2024 · 8 comments · Fixed by #616
Assignees

Comments

@Maharacha
Copy link

Maharacha commented Sep 20, 2024

Is it correct that checking the version of the binary is not supported? E.g. evm-gateway --version. Is that something that can be added?

@m-Peter
Copy link
Collaborator

m-Peter commented Sep 20, 2024

Maybe the following endpoint can be useful:

curl -s -XPOST 'https://testnet.evm.nodes.onflow.org' --header 'Content-Type: application/json' --data-raw '{"jsonrpc":"2.0","method":"web3_clientVersion","params":[],"id":7}' | jq
{
  "jsonrpc": "2.0",
  "id": 7,
  "result": "[email protected]"
}

But that also is specific to how the binary is being built. See:

@Maharacha
Copy link
Author

I build the binary with go build -o evm-gateway cmd/main/main.go and then web3_clientVersion is only showing flow-evm-gateway@development. Will it be added as a cli option to the binary?

@m-Peter
Copy link
Collaborator

m-Peter commented Sep 25, 2024

I build the binary with go build -o evm-gateway cmd/main/main.go and then web3_clientVersion is only showing flow-evm-gateway@development. Will it be added as a cli option to the binary?

@Maharacha What if you build with:

go build -o evm-gateway -ldflags="-X github.com/onflow/flow-evm-gateway/api.Version=$(git describe --tags --abbrev=0 2>/dev/null)" ./cmd/main/main.go

Note that you need to have ran before:

git fetch origin --tags

I have tried this and it works:

curl -s -XPOST 'localhost:8545' --header 'Content-Type: application/json' --data-raw '{"jsonrpc":"2.0","method":"web3_clientVersion","params":[],"id":1}' | jq

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": "[email protected]"
}

@Maharacha
Copy link
Author

@m-Peter yes that works, and is better than nothing! But it would be nice to be able to check the binary version without having to start the node. It is useful for troubleshooting in an environment where you have nodes that have crashed for whatever reasons.

@m-Peter m-Peter reopened this Sep 25, 2024
@m-Peter
Copy link
Collaborator

m-Peter commented Sep 25, 2024

@m-Peter yes that works, and is better than nothing! But it would be nice to be able to check the binary version without having to start the node. It is useful for troubleshooting in an environment where you have nodes that have crashed for whatever reasons.

@Maharacha That is a good point indeed 👍 We'll work on a solution to provide that functionality.

@Maharacha
Copy link
Author

@m-Peter yes that works, and is better than nothing! But it would be nice to be able to check the binary version without having to start the node. It is useful for troubleshooting in an environment where you have nodes that have crashed for whatever reasons.

@Maharacha That is a good point indeed 👍 We'll work on a solution to provide that functionality.

Thanks! And thanks for the workaround in the meantime!

@Maharacha
Copy link
Author

FYI. flow-go has the same problem but I just found out that I can at least get the version by running:

./flow-go --help 2>&1|grep version
{"level":"info","version":"v0.37.10","commit":"feabd3a4f9baaa5d7770a312e5b8dc1bd94b1edb","message":"build details"}

Another problem with both flow-evm-gateway and flow-go is that the output from --help is written to stderr and not stdout (hence the need for 2>&1). Should be a separate issue of course, should I create one?

@m-Peter m-Peter self-assigned this Sep 30, 2024
@m-Peter
Copy link
Collaborator

m-Peter commented Sep 30, 2024

FYI. flow-go has the same problem but I just found out that I can at least get the version by running:

./flow-go --help 2>&1|grep version
{"level":"info","version":"v0.37.10","commit":"feabd3a4f9baaa5d7770a312e5b8dc1bd94b1edb","message":"build details"}

Another problem with both flow-evm-gateway and flow-go is that the output from --help is written to stderr and not stdout (hence the need for 2>&1). Should be a separate issue of course, should I create one?

Hmmm, interesting. If you can, please create a new issue for it 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants