Skip to content

Commit

Permalink
docs: Describe implementation of remote interface
Browse files Browse the repository at this point in the history
  • Loading branch information
ajblane committed May 28, 2019
1 parent 4efa46a commit e07bfb1
Showing 1 changed file with 67 additions and 0 deletions.
67 changes: 67 additions & 0 deletions docs/remote-interface.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# Remote interface
## Introduction

```
+-----------------------------------------------+
| remote interface |
| +----------------------------------------+ |
| +----------------------------------------+| |
| +----------------------------------------+|+ |
| | RabbitMQ-provided RPC |+ |
| +----------------------------------------+ |
| | ^ |
+------------|---------------------|------------+
+------------|---------------------|------------+
| | RabbitMQ broker | |
| | | |
| | +------------------+ |
| v +------------------+| |
| +------------------+ +------------------+|| |
| | incoming queue | | private queue ||| |
| | | | ||| |
| | - trytes | | - PoW result ||| |
| | - mwm | | ||+ |
| | | | |+ |
| +------------------+ +------------------+ |
| | ^ |
+------------|---------------------|------------+
v |
+---------------------------------------------+
+---------------------------------------------+|
+---------------------------------------------+|+
| remote worker |+
+---------------------------------------------+
```
To support asynchronouse remote procedure call, remote interface, `Remote_ImplContext`, in dcurl provides an interface to implement it. dcurl currently uses RabbitMQ C client to implement asynchronouse RPC in remote interface. Remote interface provides thread management to can run an asynchronouse RPC per thread.

Here are detailed implementations of the RabbitMQ-provided RPC pattern as follows:
* Asynchronouse RPC requests are inserted into the message queue, `incoming_queue`, in RabbitMQ broker
* Asynchronouse RPCs with exclusive private queues (callback queues) with TTL = 10s property
* Correlation ID is not used
* An asynchronouse RPC uses a connection to RabbitMQ broker
* Remote workers can obtain requests from `incoming_queue` by default exchange of RabbitMQ broker

## How to test remote interface in localhost
You need to open three terminals

Terminal 1: Run the RabbitMQ broker You can quickly use docker to run the RabbitMQ broker, rabbitmq
```
$ sudo docker run -d rabbitmq
```

Terminal 2: Run remote workers
```
$ ./build/remote-worker
```
How to build remote worker on FPGA board
```
$ make BUILD_REMOTE=1 BUILD_FPGA_ACCEL=1 BOARD=de10nano
```

Terminal 3: Run check
```
$ make BUILD_REMOTE=1 BUILD_DEBUG=1 check
```

## Requirements
Remote interface requires RabbitMQ broker

0 comments on commit e07bfb1

Please sign in to comment.