Ethereum application recipe

Ingredients for one application

1 Ethereum node

1 private Ethereum node

1 node-js server application

1 public web server

1 private web server

1 public Mapper contract

1 private Messaging contract

Preparation

Set up one server machine to run the two Ethereum nodes with two different users, one for the live blockchain and one for the private blockchain.

The blockchains allow remote procedure call (RPC) connections from localhost only. The node-js application and the private web server run on the same machine.

The node-js application uses RPC calls to interacts with the public and private Ethereum instances. Get the two smart contracts ready:

Prepare a public web server on another maschine to interconnect with the private web server. The latter is only a proxy to forward requests to the node-js application.

Cooking for a simple demo application, no scaling

Once payment is received by the Mapper contract on the live blockchain the paying Ethereum address can register with the public web server in order to get a messaging account on the private blockchain.

Methods are mapped from the public web server to the private web server, which can only be accessed by the public web server using either IP address restriction or a virtual private network (VPN).

For starters we offer the following services

/register
Parameters
address that paid to Mapper contract
Returns
address that is from now available on the private messaging Ethereum network

/send_message
Parameters
address that receives the message
text message to send
Returns
boolean

/get_inbox
Parameters
address of inbox
Returns
number of messages
text of latest message

/get_message
Parameters
address of inbox
number of message to get
Returns
text of message
address of sender

Find below the logical application architecture

ethereum