0

What is the best way to call a contract (based on the Substrate Blokchain) on the backend side from the code? I know there is Polkadot.js but it's rather a frontend focused tool, and there is also cargo-contract which enables us to call a contract from the command line.

In my case I am building a backend, where I will store account with private keys, loaded with the native tokens for gas fees, to call a given contract. Moreover, I am also looking for a way to sign a message with Polakdot wallet on the frontend, and send this message to backend, to verify the signer. Possibly, the solution should be written in Rust - therefore cargo-contract always comes to my mind, I am just not sure how could I execute the call function straight inside of the code, instead executing it in the command line.

Thanks in advance for any tip

1 Answer 1

1

You can use polkadot-js/api library for both frontend and backend work (if both frontend and backend are based on Javascript).
You can use this api to sign, verify messages and deploy/call ink contracts.
Take a look at the documentation on here.

If you are using any other languages, please find the tool/library that suits you from this link.

1
  • Thanks! I have even built my entire tool for that during the weekend you can check it out here github.com/KowalewskiPawel/… However the problem is that I am still looking for a Rust oriented tool :)
    – Pawel
    Commented Feb 20, 2023 at 11:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.