Is it possible to deploy smartcontract on localchain for testing? Or is it only possible via testnet at the moment?
To make sure I have a working contract, I followed the steps for the crowdfunding example. Building works as expected via the IDE plugin. When I go to deploy any try to create the transaction, it just sits there with the loading icon forever (maybe action should have a timeout / fail immediately and disable button on click until the transaction completes). Using docker tag version of latest and updated since last week.
So my questions are:
Is it possible to use localchain for contract testing? If so, please add to documentation for the public. If I missed it, please let me know where I can find it.
Currently have the Klever node set to localhost. Is there a specific port needed?
Is the latest docker tag the correct tag to use for smart contract testing?
Not seeing and CLI operator commands options for deploy, invoke, upgrade contracts in the docs nor when going through the operator commands manually via docker image.
The operator page says it was last update in 2023 " Auto generated by spf13/cobra on 6-Mar-2023". Maybe this is missing from the public view?
Could you or someone from the team please share what the operator command would like to deploy/invoke a contract for a wasm & json file?
It looks like you’re on the right track, but there’s a small issue with the Docker image you’re using (the one in the steps Duka sent). The kleverapp/klever-go:latest image is the MainNet one does not support smart contracts yet . You should use: kleverapp/klever-go:latest-testnet instead for smart contract testing.
For deploying and invoking smart contracts using the operator, here are the correct commands:
Deploy a Smart Contract
KLEVER_NODE=${KLEVER_NODE} go run ./cmd/operator/ --key-file=${KEY_FILE} \
sc create \
--wasm=${WASM_FILE} \
{--args u32:1 if any} \
--readable --payable --upgradeable --await --result-only --sign
Invoke a Smart Contract
KLEVER_NODE=${KLEVER_NODE} go run ./cmd/operator/ --key-file=${KEY_FILE} \
sc invoke ${CONTRACT_ADDRESS} ${FUNCTION_NAME} \
{--args xxxx --args yyyy if any } \
--await --result-only --sign
Let me know if you run into any issues! Also, if you’re interested, I may be able to provide an easier step to deploy a single node for testing—just let me know if you’d like that.
Docker images now look under config/node. Might see error failed to find config file. Will have to update your volumes in your docker-compose.yml from ./config:/opt/… to ./config/node:/opt/…
Might see error for min consensus nodes exceed min number of nodes. Update your you nodeSetupjson config for consensusGroupSize to number of nodes in local test net. I had 2 like the docs.
How do I prevent this error, I got it while building a Contract
error[E0554]: #![feature] may not be used on the stable release channel
→ /home/eldiablo/.cargo/registry/src/index.crates.io-6f17d22bba15001f/klever-sc-derive-0.43.3/src/lib.rs:4:1
|
4 | #![feature(proc_macro_quote)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Checking clap_builder v4.5.1
For more information about this error, try rustc --explain E0554.
error: could not compile klever-sc-derive (lib) due to 1 previous error