Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v23-beta #476

Closed
wants to merge 8 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
82 changes: 82 additions & 0 deletions .circleci/config.yml
@@ -0,0 +1,82 @@
# Javascript Node CircleCI 2.0 configuration file
#
# Check https://circleci.com/docs/2.0/language-javascript/ for more details
#
version: 2

defaults: &defaults
working_directory: ~/repo
docker:
# Use active LTS release: https://github.com/nodejs/Release#release-schedule
- image: circleci/node:8.12

jobs:
test:
<<: *defaults
steps:

- checkout

- restore_cache:
keys:
# when lock file changes, use increasingly general patterns to restore cache
- "node-v1-{{ .Branch }}-{{ checksum \"package-lock.json\" }}"
- "node-v1-{{ .Branch }}-"
- "node-v1-"

- run:
name: Install
command: npm install

- run:
name: Lint
command: npm run lint

- run:
name: Test
command: npm test

- run:
name: Upload Test Coverage to codecov.io
command: npm run report-coverage

- run:
name: Run Integration Tests
command: if git log -1 --pretty=%B | grep -qF "[skip tests]"; then true; else npm run integration; fi

- save_cache:
paths:
- node_modules
key: node-v1-{{ .Branch }}-{{ checksum "package-lock.json" }}

- persist_to_workspace:
root: ~/repo
paths: .
deploy:
<<: *defaults
steps:
- attach_workspace:
at: ~/repo
- run:
name: Authenticate with registry
command: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > ~/repo/.npmrc
- run:
name: Publish package
command: npm publish

workflows:
version: 2
test-deploy:
jobs:
- test:
filters:
tags:
only: /^v.*/
- deploy:
requires:
- test
filters:
tags:
only: /^v.*/
branches:
ignore: /.*/
2 changes: 2 additions & 0 deletions .dockerignore
@@ -1,4 +1,6 @@
.npmrc
node_modules
npm-debug.log
/integration-test/*
/coverage/*

1 change: 1 addition & 0 deletions .eslintignore
@@ -1 +1,2 @@
node_modules/
build/
7 changes: 3 additions & 4 deletions .gitignore
Expand Up @@ -10,9 +10,7 @@
/coverage/

# TypeScript compiler output
/src/**/*.js
/src/**/*.js.map
/src/**/*.d.ts
/build

# Generated typings for schemas should not be checked in
/src/schemas/*.ts
Expand All @@ -25,4 +23,5 @@
*.log
/.tags*
/web/
.vscode/settings.json
.vscode
.idea
5 changes: 4 additions & 1 deletion .npmignore
Expand Up @@ -3,5 +3,8 @@ integration-test/
*.cluster
/npm-debug.log
/coverage

src
tsconfig.json
tslint.json
typedoc.js
.npmrc
14 changes: 11 additions & 3 deletions Dockerfile
@@ -1,10 +1,18 @@
FROM node:8-slim

RUN mkdir -p /usr/src/app
# Create app directory
WORKDIR /usr/src/app

COPY . /usr/src/app
# Install app dependencies
# A wildcard is used to ensure both package.json AND package-lock.json are copied
# where available (npm@5+)
COPY package*.json ./

EXPOSE 3000
RUN npm install
# If you are building your code for production
# RUN npm install --only=production

# Bundle app source
COPY . .

CMD [ "npm", "start" ]
343 changes: 315 additions & 28 deletions README.md

Large diffs are not rendered by default.

27 changes: 0 additions & 27 deletions circle.yml

This file was deleted.

6 changes: 6 additions & 0 deletions examples/docker/.connector.env
@@ -0,0 +1,6 @@
CONNECTOR_PROFILE=connector
CONNECTOR_ILP_ADDRESS=test.u3
CONNECTOR_ADMIN_API=true
CONNECTOR_ADMIN_API_HOST=0.0.0.0
CONNECTOR_ACCOUNTS={"alice":{"relation":"child","sendRoutes":false,"receiveRoutes":false,"assetScale":6,"assetCode":"XRP","plugin":"ilp-plugin-btp","options":{"listener":{"port":9000, "secret": ""}}}}
DEBUG=*
4 changes: 4 additions & 0 deletions examples/docker/.plugin.env
@@ -0,0 +1,4 @@
CONNECTOR_PROFILE=plugin
CONNECTOR_ACCOUNTS={"parent":{"relation":"parent","assetScale":6,"assetCode":"XRP","plugin":"ilp-plugin-btp","options":{"server":"btp+ws://:@172.17.0.2:9000"}}}
CONNECTOR_ILP_ADDRESS_INHERIT_FROM=parent
DEBUG=*
27 changes: 27 additions & 0 deletions examples/docker/README.md
@@ -0,0 +1,27 @@

#Connector Modes in docker
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need spaces after the # for this to render as a header.


#Run in connector mode
Run the following command

```shell
docker run --net=bridge -p 7780:7780 -it --rm --env-file=./examples/docker/.connector.env --name=connector interledgerjs/ilp-connector
```

Take note of the IP address of the container once running. Port 7780 is exposed to host to allow for connection to admin
API

#Run in plugin mode
Run the following command

```shell
docker run --net=bridge -it --rm --env-file=./examples/docker/.plugin.env interledgerjs/ilp-connector
```

Note that in .plugin.env the IP address of the parent WS connection needs to be updated to
that of the container running the parent

#Updating accounts

profile.js has been included as an easy method to generate JSON stringified account details to pass through
to the containers environment variables. Edit the account details inside and run to get the required variables.
42 changes: 42 additions & 0 deletions examples/docker/profiles.js
@@ -0,0 +1,42 @@

const connectorConfig = {
ilpAddress: 'test.quickstart',
accounts: {
alice: {
relation: 'child',
sendRoutes: false,
receiveRoutes: false,
assetScale: 6,
assetCode: 'XRP',
plugin: 'ilp-plugin-btp',
options: {
listener: {
port: 9000
}
}
}
}
}

const pluginConfig = {
accounts: {
parent: {
relation: 'parent',
sendRoutes: false,
receiveRoutes: false,
assetScale: 6,
assetCode: 'XRP',
plugin: 'ilp-plugin-btp',
options: {
server: 'btp+ws://:u2u3@localhost:10203'
}
}
}
}

const printAccount = (config) => {
console.log(JSON.stringify(config.accounts))
}

printAccount(connectorConfig)
printAccount(pluginConfig)
1 change: 0 additions & 1 deletion npmrc-env

This file was deleted.