Community hub RPC

Community hub RPC

by Donal McMullan -
Number of replies: 1
Here at Catalyst, a few of us have been working on the Community Hub system for Moodle, and the transport layer is ready for enthusiastic Moodlers to start experimenting with. The system is freshly re-based on Moodle 1.7, and in the next few days I hope to add to this forum all the instructions you might need to install the system and get one Moodle to call functions (or methods) on another. The paint really isn't dry yet, so please be prepared for some 'issues' at this stage.

The API isn't at all final yet: Its design will take shape when we've had some feedback from the community. That means you!

The code is available from our Git repo for Moodle. If you don't use Git, gzipped snapshots are available from the repo as well.


Average of ratings: -
In reply to Donal McMullan

Install, configure and test RPC

by Donal McMullan -
I made some additions to the Community Hub transport code today, that make it easier to get running. Here's a quick stepthrough:

  1. Download a snapshot of the code, and install as you would a regular Moodle checkout. The mnet DB tables will get created automatically.
  2. Browse to http://www.example.com/admin/mnet/index.php
  3. Switch the networking value from 'off' (the default) to 'strict'
  4. Click on 'submitNet'
  5. Under 'Add new host', enter your test hostname, and the path to your moodle installation. This can be '/' (root), or perhaps '/moodle/'
  6. Click the checkbox under 'HTTP (self-signed)' to allow your host to use this transport.
At this point, you should have everything in place that you need for your site to communicate with itself, but using the Remote Procedure Call transport layer. All you need now are some Remote Procedures to Call!

Basic introspection is provided as part of the implementation, so if you now navigate to http://www.example.com/mnet/testclient.php, you can test out some of the introspection methods.

Click on 'system/listMethods' to view a list of all the methods that the 'remote' machine makes available to you. The server will return an empty array, but the test-client outputs some interesting insights into what's happening behind the scenes. The script itself is fairly heavily documented, and it demonstrates how to connect to a remote machine.

I'll post again soon with some more information on this transport layer, including the requirements we've sketched out for developing services for remote servers.