0

Is it possible to put a smart contract "behind" a restful API, i.e. expose my contract functions and properties through restuful API where I can make RPC to it? Or does it work as an API already, but instead of GET/POST requests, there are .CALL()/.SEND() requests?

1

Read operations you can put behind a regular API as you get the result instantly. As for write operations, you can expose an API which has something like "initiateFunctionA" and another operation which returns the results when it's ready but you shouldn't keep the API call hanging waiting for the result to the write operation - it may take a while (or even infinity if you have too low gas price).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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