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

Makefile: generate RPC bindings #345

Merged
merged 5 commits into from
Aug 3, 2023
Merged

Conversation

AnnaShaleva
Copy link
Member

@AnnaShaleva AnnaShaleva commented Jun 5, 2023

Waiting for 0.102.0 release of neo-go to convert from draft.

UPD: we'll use fresh NeoGo master to build SCs and RPC bindings.

@AnnaShaleva AnnaShaleva added the enhancement Improving existing functionality label Jun 5, 2023
@AnnaShaleva
Copy link
Member Author

Also need to bump minimum required go version up to 1.18.

Makefile Outdated Show resolved Hide resolved
@AnnaShaleva AnnaShaleva force-pushed the generate-rpc-bindings branch 2 times, most recently from d38082f to 29ca934 Compare June 9, 2023 13:52
@AnnaShaleva
Copy link
Member Author

@roman-khimov, do we need binding files to be stored in this repo or it's OK to add them to .gitignore?

Makefile Outdated Show resolved Hide resolved
README.md Show resolved Hide resolved
@AnnaShaleva AnnaShaleva force-pushed the generate-rpc-bindings branch 2 times, most recently from 3141c6b to 066c6b1 Compare June 9, 2023 16:40
$(NEOGO) contract compile -i $(2)$(1) -c $(if $(2),$(2),$(1)/)config.yml -m $(2)$(1)/config.json -o $(2)$(1)/$(1)_contract.nef
$(NEOGO) contract compile -i $(2)$(1) -c $(if $(2),$(2),$(1)/)config.yml -m $(2)$(1)/config.json -o $(2)$(1)/$(1)_contract.nef --bindings $(2)$(1)/bindings_config.yml
mkdir -p rpc/$(1)
$(NEOGO) contract generate-rpcwrapper -o rpc/$(1)/rpcbinding.go -m $(2)$(1)/config.json --config $(2)$(1)/bindings_config.yml
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This, btw, should be handled by the Makefile. Makefile is not a shell script, it's all about targets, dependencies and the way they're produced.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's the only question I wasn't able to fix. Could you, please, review one more time and point out how to create a proper make target depending on all these rpc/... bindings?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's leave it for now.

.gitignore Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
@AnnaShaleva AnnaShaleva force-pushed the generate-rpc-bindings branch 12 times, most recently from 1f0c100 to 0442927 Compare August 2, 2023 10:35
Extend contract configuration files with additional types information
where needed. Add resulting RPC bindings to the repo.

Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
There's no more *.manifest.json files, we store manifest in the
config.json file (don't know why).

Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
AnnaShaleva and others added 2 commits August 2, 2023 13:43
First of all, RPC bindings must be compiled. After that, if there are
some changes in the bindings for the current NeoGo version, then these
changes have to be committed.

Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
Use afa4530c7d739d08df7865440dbe66f55f7e558b commit (the current master).
It allows to omit hash parameter for RPC bindings and make them reusable
for a set of different networks.

Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
@roman-khimov
Copy link
Member

@smallhive, can you try importing packages from this branch?

@smallhive
Copy link
Contributor

@smallhive, can you try importing packages from this branch?

Working on it

@roman-khimov roman-khimov merged commit b648246 into master Aug 3, 2023
8 checks passed
@roman-khimov roman-khimov deleted the generate-rpc-bindings branch August 3, 2023 19:00
@@ -7,7 +7,7 @@ export GOBIN ?= $(shell pwd)/bin
export CGO_ENABLED=0
NEOGO ?= $(GOBIN)/cli
VERSION ?= $(shell git describe --tags --dirty --match "v*" --always --abbrev=8 2>/dev/null || cat VERSION 2>/dev/null || echo "develop")
NEOGOORIGMOD = github.com/nspcc-dev/neo-go
NEOGOORIGMOD = github.com/nspcc-dev/neo-go@v0.101.5-0.20230802075307-afa4530c7d73
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@AnnaShaleva, since that is a temporary use, do we need an issue for that?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There will be an issue to upgrade to 0.102.0 anyway. Can be created now, doesn't matter much.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improving existing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants