Hello guys,

I hope you all are doing well


I am struggling with an issue for more than a week, I decided to ask you if
you can help me. Currently I am working on a project for executing smart
contracts based on Web-Assembly for Blockchains. The project is named
Durian and you can check it here: https://github.com/b00f/durian

Durian simply provides an interface for blockchains to execute smart
contracts. A client can ask the Durian: "Hey please execute this smart
contract for me", and then Durian tries to execute it. During the
execution, Durian might ask the client to provide some information:
"Blockchain please give me some information like storage, account, etc."
Finally the execution will return with the final result.

Locally everything works fine. I wanted to make it as a web service. So I
have two choices:

Pull model: Client asks blockchain to execute the smart contract and in a
loop he asks Durian: Hey Durian do you need anything that I can provide for
you”, Durian might say:” Yes please, Give me this storage” and so on. In
this case I can use gRPC or CapnProto, Both works fine.

Push model: Client asks Durian to execute a smart contract, during the
execution, Durian calls client several times to get some information. Like
storage as an example. The point is that calling the client happens inside
the execution call.
[image: durian_flows.png]

I decided to implement the second model using CapnP Proto.  I tried and
tried and again tried but unfortunately I failed. The difference between
this model and PubSub is in the PubSub model, the publisher and the
subscriber are running independently.

First of all I want to know do you think the Push model is something
feasible and practical?

If yes, Why can't I call the client from the server?
[image: durian_diagram.png]

I have attached my work. I made it as simple as I could. I removed the
Durian from it and just added only one method for getting storage. I want
to get storage value from the client during the execution.

I really appreciate it if you can take a look at it and let me know which
part I was doing wrong?

In advance I would like to thank you.


Regards,

Mostafa

-- 
You received this message because you are subscribed to the Google Groups 
"Cap'n Proto" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/capnproto/CAJr8eKtwcLa3f7tGiPvM39bQ8S7gqFptDZ1Zw47yRJHzqNr5DQ%40mail.gmail.com.

<<attachment: durian.zip>>

Reply via email to