Skip to content

Commit

Permalink
feat: Implement cargo collection (#16)
Browse files Browse the repository at this point in the history
* Install dependencies

* Use Node 12 in functional tests

* Transpile TS in Docker container instead of host

So we can use Node 12

* Fix syntax error in Circle CI config

* Fix typo

* Fix permissions after transpiling TS in functional tests

* Fix args passed to `chown`

* Implement stub for server

* Implement server

* Remove stub client used for testing

* Refactor

* Rename NATS subject for parcels received via PDC

* Implement deliverCargo() method

* Rename "relayer", "user gateway" and "relaying gateway"

AwalaApp/specs#39

* Fix conding convention violation

* Complete service implementation integration

* Upgrade NATS streaming server

* Implement function to publish messages with NATS streaming

* Support streaming arrays

* Prevent NATS publisher from being reused

* Move NATS publisher to new class

* Make NATS Streaming connection async to simplify code

* Introduce method to send single NATS message

* Refactor tests ahead of implementation

* Migrate PoHTTP interface to NATS Streaming

* Upgrade Jest and related deps

* Convert stream-based implementation to iterable-based

* Fix processing of invalid cargoes

* Make NATS streaming publisher yield ids of published msgs

* Integrate NATS Streaming in deliverCargo method

* Remove plain NATS integration

* Integrate NATS Streaming in gRPC service factory
  • Loading branch information
gnarea authored Feb 20, 2020
1 parent 825d611 commit c3860e2
Show file tree
Hide file tree
Showing 17 changed files with 3,712 additions and 2,857 deletions.
9 changes: 6 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,12 @@ jobs:
sudo mv ~/docker-compose /usr/local/bin/docker-compose
# Install dependencies just so we can transpile the TS files to JS; then remove the deps.
- run: npm install
- run: npm run build
- run: rm -rf node_modules
- run:
name: Transpile project to JavaScript
command: |
docker run --rm -v "$(pwd):/tmp/gw" -w "/tmp/gw" node:12.15 bash -c "npm install && npm run build"
sudo chown --recursive "${USER}" build
sudo rm -rf node_modules
- run: ./src/functional_tests/run.sh

Expand Down
16 changes: 14 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
version: '3.7'
services:
app:
pohttp:
build:
dockerfile: Dockerfile.dev
context: .
Expand All @@ -17,11 +17,23 @@ services:
- mongodb
- nats

cogrpc:
build:
dockerfile: Dockerfile.dev
context: .
image: relaynet-gw:local-dev
init: true
command: src/bin/cogrpc-server.ts
ports:
- '127.0.0.1:8081:8080'
volumes:
- ./src:/opt/gw-dev/src:ro

mongodb:
image: mongo:4.0

nats:
image: nats-streaming:0.16.2
image: nats-streaming:0.17.0
command: ['-DV']
ports:
- "127.0.0.1:4222:4222"
Loading

0 comments on commit c3860e2

Please sign in to comment.