From 3b635164b7c7447df6b184fa62218b4eb5e2efd2 Mon Sep 17 00:00:00 2001 From: Roman Khimov Date: Thu, 27 Oct 2022 22:22:49 +0300 Subject: [PATCH] docs: initial RPC wrapper generator doc --- docs/compiler.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/docs/compiler.md b/docs/compiler.md index 9682b45ea..1b4f5833d 100644 --- a/docs/compiler.md +++ b/docs/compiler.md @@ -434,6 +434,19 @@ $ ./bin/neo-go contract compile -i contract.go --config contract.yml -o contract $ ./bin/neo-go contract generate-wrapper --manifest manifest.json --config contract.bindings.yml --out wrapper.go --hash 0x1b4357bff5a01bdf2a6581247cf9ed1e24629176 ``` +### Generating RPC contract bindings +To simplify interacting with the contract via RPC you can generate +contract-specific RPC bindings with the "generate-rpcwrapper" command. At the +moment it only works for safe (read-only) methods. If your contract is NEP-11 +or NEP-17 that's autodetected and an appropriate package is included as +well. Notice that the type data available in the manifest is limited, so in +some cases the interface generated may use generic stackitem types. Iterators +are not supported yet. + +``` +$ ./bin/neo-go contract generate-rpcwrapper --manifest manifest.json --out rpcwrapper.go --hash 0x1b4357bff5a01bdf2a6581247cf9ed1e24629176 +``` + ## Smart contract examples Some examples are provided in the [examples directory](../examples). For more