diff --git a/examples/sendE2E/README.md b/examples/sendE2E/README.md index 57681224216f75e4bb4f420ce941d2923ef06604..afca20c4faeec2eee0d8f4dfca3212e0aa6f35db 100644 --- a/examples/sendE2E/README.md +++ b/examples/sendE2E/README.md @@ -5,24 +5,24 @@ message to the other. ## Running the Test -First, compile the WASM binary and start the local HTTP server. Refer to -[Testing and Examples](../../README.md#Testing and Examples) in the repository -README for details on how to do this. Open the two clients, the sender and -receiver. +1. First, compile the WASM binary and start the local HTTP server. Refer to + [Testing and Examples](../../README.md#Testing and Examples) in the + repository README for details on how to do this. Open the two clients, the + sender and receiver. -First start the network using the wasm-network.sh script in integration. This -will start all the gateways and client registrar using localhost as their public -IP addresses and the NDF will be provided by the permissioning server rather -than downloaded from a gateway. +2. Next, start the network using the `run.sh` script in the `wasmTest` directory + in integration. This will start all the gateways and client registrar using + localhost as their public IP addresses and the NDF will be provided by the + permissioning server rather than downloaded from a gateway. -Once rounds are running, on the receiver webpage, navigate to the results folder -in integration and select the `permissions-ndfoutput.json` file. Doing this will -start the client. Once the client generates keys and joins the network, it will -prompt its contact file for download. Copy the contents of this file into the -`recipientContactFile` const in `sender.html`. +3. Once rounds are running, on the receiver webpage, navigate to the results + folder in integration and select the `permissions-ndfoutput.json` file. Doing + this will start the client. Once the client generates keys and joins the + network, it will prompt its contact file for download. Copy the contents of + this file into the `recipientContactFile` const in `sender.html`. -On the sender webpage (make sure to refresh the page), select the NDF file as -described for the recipient above. This will start the sender client. Once it -generates its keys and joins the network, it will add the receiver client as a -partner, they will exchange requests and confirmations, and finally, the sender -will send an E2E message to the recipient. \ No newline at end of file +4. On the sender webpage (make sure to refresh the page), select the NDF file as + described for the recipient above. This will start the sender client. Once it + generates its keys and joins the network, it will add the receiver client as + a partner, they will exchange requests and confirmations, and finally, the + sender will send an E2E message to the recipient. \ No newline at end of file diff --git a/examples/sendE2E/receiver.html b/examples/sendE2E/receiver.html index 31fe3f4ddb5dd8f62e11a709bb799509fdf676e1..2c5e50c3ee9a9124ff455226cb4e860b2f2ce5cc 100644 --- a/examples/sendE2E/receiver.html +++ b/examples/sendE2E/receiver.html @@ -15,7 +15,7 @@ <link rel="shortcut icon" type="image/x-icon" href="receiver.ico"/> - <script type="text/javascript" src="xxdk.js"></script> + <script type="text/javascript" src="sendE2ejs"></script> <script type="text/javascript" src="../assets/utils.js"></script> <script type="text/javascript" src="../assets/wasm_exec.js"></script> <script> diff --git a/examples/sendE2E/xxdk.js b/examples/sendE2E/sendE2ejs similarity index 100% rename from examples/sendE2E/xxdk.js rename to examples/sendE2E/sendE2ejs diff --git a/examples/sendE2E/sender.html b/examples/sendE2E/sender.html index ff70c8b25f2c8bb59cbbd685f718d315681869d4..954d7ff714d380c38ce94aa67f5d51a806ca1912 100644 --- a/examples/sendE2E/sender.html +++ b/examples/sendE2E/sender.html @@ -14,7 +14,7 @@ <link rel="stylesheet" type="text/css" href="../assets/styles.css"> <link rel="shortcut icon" type="image/x-icon" href="sender.ico"/> - <script type="text/javascript" src="xxdk.js"></script> + <script type="text/javascript" src="sendE2ejs"></script> <script type="text/javascript" src="../assets/utils.js"></script> <script type="text/javascript" src="../assets/wasm_exec.js"></script> <script> diff --git a/wasm/channels.go b/wasm/channels.go index 1c17f36efb49698b2a94e95557421aadac308b64..ca2682d13c23bcb966b70524a0c7be7dcd24f721 100644 --- a/wasm/channels.go +++ b/wasm/channels.go @@ -28,18 +28,23 @@ type ChannelsManager struct { func newChannelsManagerJS(api *bindings.ChannelsManager) map[string]interface{} { cm := ChannelsManager{api} channelsManagerMap := map[string]interface{}{ - "GetID": js.FuncOf(cm.GetID), - "JoinChannel": js.FuncOf(cm.JoinChannel), - "GetChannels": js.FuncOf(cm.GetChannels), - "GetChannelId": js.FuncOf(cm.GetChannelId), - "GetChannel": js.FuncOf(cm.GetChannel), - "LeaveChannel": js.FuncOf(cm.LeaveChannel), - "ReplayChannel": js.FuncOf(cm.ReplayChannel), - "SendGeneric": js.FuncOf(cm.SendGeneric), - "SendAdminGeneric": js.FuncOf(cm.SendAdminGeneric), - "SendMessage": js.FuncOf(cm.SendMessage), - "SendReply": js.FuncOf(cm.SendReply), - "SendReaction": js.FuncOf(cm.SendReaction), + // Basic Channel API + "GetID": js.FuncOf(cm.GetID), + "JoinChannel": js.FuncOf(cm.JoinChannel), + "GetChannels": js.FuncOf(cm.GetChannels), + "GetChannelId": js.FuncOf(cm.GetChannelId), + "GetChannel": js.FuncOf(cm.GetChannel), + "LeaveChannel": js.FuncOf(cm.LeaveChannel), + "ReplayChannel": js.FuncOf(cm.ReplayChannel), + + // Channel Sending Methods and Reports + "SendGeneric": js.FuncOf(cm.SendGeneric), + "SendAdminGeneric": js.FuncOf(cm.SendAdminGeneric), + "SendMessage": js.FuncOf(cm.SendMessage), + "SendReply": js.FuncOf(cm.SendReply), + "SendReaction": js.FuncOf(cm.SendReaction), + + // Channel Receiving Logic and Callback Registration "RegisterReceiveHandler": js.FuncOf(cm.RegisterReceiveHandler), } @@ -200,7 +205,7 @@ func (ch *ChannelsManager) ReplayChannel(_ js.Value, args []js.Value) interface{ } //////////////////////////////////////////////////////////////////////////////// -// Channel Sending Methods & Reports // +// Channel Sending Methods and Reports // //////////////////////////////////////////////////////////////////////////////// // SendGeneric is used to send a raw message over a channel. In general, it