Skip to content
This repository has been archived by the owner on May 28, 2021. It is now read-only.

Commit

Permalink
Deploy indra-2.3.20
Browse files Browse the repository at this point in the history
  • Loading branch information
Bo Henderson committed Jan 6, 2020
2 parents 5360caf + 31d58f3 commit afdcab2
Show file tree
Hide file tree
Showing 76 changed files with 2,987 additions and 2,664 deletions.
23 changes: 10 additions & 13 deletions .github/workflows/cd-master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- run: make release
- run: make build-report
- run: docker login -u $DOCKER_USER -p $DOCKER_PASSWORD
- run: make push-commit
- run: make push-release

test-node:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -59,6 +59,15 @@ jobs:
SSH_KEY: ${{ secrets.SSH_KEY }}
CMD: 'echo "Successfully connected to $MAINNET_DOMAINNAME: `hostname`";'

# test-integration:
# runs-on: ubuntu-latest
# needs: [build]
# steps:
# - uses: actions/checkout@v1
# - run: make pull
# - run: make start-test
# - run: make test-integration

test-bot:
runs-on: ubuntu-latest
needs: [build]
Expand Down Expand Up @@ -86,18 +95,6 @@ jobs:
- run: make start-test
- run: make test-daicard

push:
env:
DOCKER_USER: ${{ secrets.DOCKER_USER }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
needs: [test-node, test-cf, test-bot, test-bot-farm, test-daicard]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- run: docker login -u $DOCKER_USER -p $DOCKER_PASSWORD
- run: make pull
- run: make push-release

deploy-rinkeby:
env:
INDRA_ADMIN_TOKEN: ${{ secrets.INDRA_ADMIN_TOKEN }}
Expand Down
9 changes: 9 additions & 0 deletions .github/workflows/cd-staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,15 @@ jobs:
SSH_KEY: ${{ secrets.SSH_KEY }}
CMD: 'echo Successfully connected to $STAGING_DOMAINNAME: `hostname`;'

# test-integration:
# runs-on: ubuntu-latest
# needs: [build]
# steps:
# - uses: actions/checkout@v1
# - run: make pull
# - run: make start-test
# - run: make test-integration

test-bot:
runs-on: ubuntu-latest
needs: [build]
Expand Down
9 changes: 9 additions & 0 deletions .github/workflows/cd-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,15 @@ jobs:
- run: make cf-core
- run: make test-cf

test-integration:
runs-on: ubuntu-latest
needs: [build]
steps:
- uses: actions/checkout@v1
- run: make pull
- run: make start-test
- run: make test-integration

test-bot:
runs-on: ubuntu-latest
needs: [build]
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -72,3 +72,6 @@ nohup.out

# Docs
modules/client/docs

# .env
modules/**/.env
35 changes: 29 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
project=indra
dir=$(shell cd "$(shell dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )
project=$(shell cat $(dir)/package.json | jq .name | tr -d '"')
registry=connextproject

# Specify make-specific variables (VPATH = prerequisite search path)
Expand Down Expand Up @@ -32,6 +33,7 @@ messaging=$(cwd)/modules/messaging
node=$(cwd)/modules/node
proxy=$(cwd)/modules/proxy
ssh-action=$(cwd)/ops/ssh-action
tests=$(cwd)/modules/test-runner
types=$(cwd)/modules/types

# Setup docker run time
Expand All @@ -54,9 +56,9 @@ $(shell mkdir -p .makeflags $(node)/dist)

default: dev
all: dev staging release
dev: database ethprovider node client payment-bot-staging indra-proxy ws-tcp-relay
staging: daicard-proxy database indra-proxy-prod node-staging payment-bot-staging ws-tcp-relay ethprovider
release: daicard-proxy database indra-proxy-prod node-release payment-bot-release ws-tcp-relay ethprovider
dev: database ethprovider node client payment-bot-staging indra-proxy test-runner-staging ws-tcp-relay
staging: daicard-proxy database ethprovider indra-proxy-prod node-staging payment-bot-staging test-runner-staging ws-tcp-relay
release: daicard-proxy database ethprovider indra-proxy-prod node-release payment-bot-release test-runner-release ws-tcp-relay

start: start-daicard

Expand Down Expand Up @@ -129,10 +131,10 @@ reset: stop
rm -rf $(flags)/deployed-contracts

push-commit:
bash ops/push-images.sh commit bot database ethprovider node proxy relay
bash ops/push-images.sh commit bot database ethprovider node proxy relay test_runner

push-release:
bash ops/push-images.sh release database node proxy relay
bash ops/push-images.sh release database node proxy relay test_runner

pull:
docker pull $(registry)/$(project)_bot:$(commit) && docker tag $(registry)/$(project)_bot:$(commit) $(project)_bot:$(commit) || true
Expand All @@ -141,12 +143,14 @@ pull:
docker pull $(registry)/$(project)_node:$(commit) && docker tag $(registry)/$(project)_node:$(commit) $(project)_node:$(commit) || true
docker pull $(registry)/$(project)_proxy:$(commit) && docker tag $(registry)/$(project)_proxy:$(commit) $(project)_proxy:$(commit) || true
docker pull $(registry)/$(project)_relay:$(commit) && docker tag $(registry)/$(project)_relay:$(commit) $(project)_relay:$(commit) || true
docker pull $(registry)/$(project)_test_runner:$(commit) && docker tag $(registry)/$(project)_test_runner:$(commit) $(project)_test_runner:$(commit) || true
docker pull $(registry)/$(project)_bot:latest && docker tag $(registry)/$(project)_bot:latest $(project)_bot:latest || true
docker pull $(registry)/$(project)_database:latest && docker tag $(registry)/$(project)_database:latest $(project)_database:latest || true
docker pull $(registry)/$(project)_ethprovider:latest && docker tag $(registry)/$(project)_ethprovider:latest $(project)_ethprovider:latest || true
docker pull $(registry)/$(project)_node:latest && docker tag $(registry)/$(project)_node:latest $(project)_node:latest || true
docker pull $(registry)/$(project)_proxy:latest && docker tag $(registry)/$(project)_proxy:latest $(project)_proxy:latest || true
docker pull $(registry)/$(project)_relay:latest && docker tag $(registry)/$(project)_relay:latest $(project)_relay:latest || true
docker pull $(registry)/$(project)_test_runner:latest && docker tag $(registry)/$(project)_test_runner:latest $(project)_test_runner:latest || true

deployed-contracts: ethprovider
bash ops/deploy-contracts.sh ganache
Expand All @@ -166,6 +170,12 @@ dls:
test: test-node
watch: watch-node

test-integration:
bash ops/test-integration.sh

watch-integration:
bash ops/test-integration.sh --watch

test-cf: cf-core
bash ops/test-cf.sh

Expand Down Expand Up @@ -261,6 +271,19 @@ ssh-action: $(shell find $(ssh-action) $(find_options))
docker build --file $(ssh-action)/Dockerfile --tag $(project)_ssh_action $(ssh-action)
$(log_finish) && mv -f $(totalTime) $(flags)/$@

test-runner-release: $(shell find $(tests)/ops $(find_options))
$(log_start)
$(docker_run) "export MODE=release; cd modules/test-runner && npm run build-bundle"
docker build --file $(tests)/ops/release.dockerfile $(cache_from) --tag $(project)_test_runner:$(version) .
$(log_finish) && mv -f $(totalTime) $(flags)/$@

test-runner-staging: $(shell find $(tests)/ops $(find_options))
$(log_start)
$(docker_run) "export MODE=staging; cd modules/test-runner && npm run build-bundle"
docker build --file $(tests)/ops/staging.dockerfile $(cache_from) --tag $(project)_test_runner:latest .
docker tag $(project)_test_runner:latest $(project)_test_runner:$(commit)
$(log_finish) && mv -f $(totalTime) $(flags)/$@

ws-tcp-relay: ops/ws-tcp-relay.dockerfile
$(log_start)
docker build --file ops/ws-tcp-relay.dockerfile $(cache_from) --tag $(project)_relay:latest .
Expand Down
9 changes: 4 additions & 5 deletions modules/cf-adjudicator-contracts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,17 @@
],
"devDependencies": {
"@connext/types": "1.4.1",
"@connext/cf-types": "1.3.14",
"@types/node": "12.12.14",
"@types/chai": "4.2.6",
"@types/node": "13.1.2",
"@types/chai": "4.2.7",
"chai": "4.2.0",
"dotenv": "8.2.0",
"eth-gas-reporter": "0.2.14",
"ethereum-waffle": "2.1.0",
"ethers": "4.0.40",
"ethers": "4.0.41",
"ethlint": "1.2.5",
"openzeppelin-solidity": "2.3.0",
"shx": "0.3.2",
"truffle": "5.1.2",
"truffle": "5.1.6",
"truffle-deploy-registry": "0.5.1",
"truffle-hdwallet-provider": "1.0.17",
"ts-mocha": "6.0.0",
Expand Down
7 changes: 3 additions & 4 deletions modules/cf-apps/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,16 @@
"lint:ts": "tslint -c tslint.json -p ."
},
"devDependencies": {
"@connext/cf-types": "1.3.14",
"@connext/cf-adjudicator-contracts": "0.4.1",
"@connext/cf-funding-protocol-contracts": "0.4.1",
"@types/chai": "4.2.6",
"@types/chai": "4.2.7",
"@types/mocha": "5.2.7",
"chai": "4.2.0",
"ethereum-waffle": "2.1.0",
"ethers": "4.0.40",
"ethers": "4.0.41",
"ethlint": "1.2.5",
"mocha": "6.2.2",
"truffle": "5.1.2",
"truffle": "5.1.6",
"truffle-deploy-registry": "0.5.1",
"truffle-hdwallet-provider": "1.0.17",
"ts-mocha": "6.0.0",
Expand Down
16 changes: 8 additions & 8 deletions modules/cf-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"@connext/cf-adjudicator-contracts": "0.4.1",
"@connext/cf-funding-protocol-contracts": "0.4.1",
"@connext/types": "1.4.1",
"ethers": "4.0.40",
"ethers": "4.0.41",
"eventemitter3": "4.0.0",
"loglevel": "1.6.6",
"memoizee": "0.4.14",
Expand All @@ -35,12 +35,12 @@
"@connext/cf-apps": "0.4.1",
"@counterfactual/local-ganache-server": "0.0.10",
"@counterfactual/postgresql-node-connector": "0.0.8",
"@types/chai": "4.2.6",
"@types/chai": "4.2.7",
"@types/dotenv-safe": "8.1.0",
"@types/jest": "24.0.23",
"@types/jest": "24.0.25",
"@types/loglevel": "1.6.3",
"@types/node": "12.12.14",
"@types/pg": "7.11.2",
"@types/node": "13.1.2",
"@types/pg": "7.14.0",
"chai": "4.2.0",
"dotenv-extended": "2.5.0",
"dotenv-safe": "8.2.0",
Expand All @@ -50,13 +50,13 @@
"jest": "24.9.0",
"jest-cli": "24.9.0",
"jest-dot-reporter": "1.0.12",
"rollup": "1.27.8",
"rollup": "1.27.14",
"rollup-plugin-babel": "4.3.3",
"rollup-plugin-commonjs": "10.1.0",
"rollup-plugin-json": "4.0.0",
"rollup-plugin-node-resolve": "5.2.0",
"rollup-plugin-typescript2": "0.25.2",
"truffle": "5.1.2",
"rollup-plugin-typescript2": "0.25.3",
"truffle": "5.1.6",
"ts-jest": "24.2.0",
"ts-mockito": "2.5.0",
"tslint": "5.20.1",
Expand Down
8 changes: 4 additions & 4 deletions modules/cf-funding-protocol-contracts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,17 @@
"devDependencies": {
"@connext/types": "1.4.1",
"@connext/cf-adjudicator-contracts": "0.4.1",
"@types/chai": "4.2.6",
"@types/node": "12.12.14",
"@types/chai": "4.2.7",
"@types/node": "13.1.2",
"chai": "4.2.0",
"dotenv": "8.2.0",
"eth-gas-reporter": "0.2.14",
"ethereum-waffle": "2.1.0",
"ethers": "4.0.40",
"ethers": "4.0.41",
"ethlint": "1.2.5",
"openzeppelin-solidity": "2.3.0",
"shx": "0.3.2",
"truffle": "5.1.2",
"truffle": "5.1.6",
"truffle-deploy-registry": "0.5.1",
"truffle-hdwallet-provider": "1.0.17",
"ts-mocha": "6.0.0",
Expand Down
6 changes: 3 additions & 3 deletions modules/client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,17 @@
"@connext/cf-funding-protocol-contracts": "0.4.1",
"@connext/messaging": "1.4.1",
"@connext/types": "1.4.1",
"core-js": "3.4.7",
"core-js": "3.6.1",
"eth-crypto": "1.5.0",
"ethers": "4.0.40",
"ethers": "4.0.41",
"human-standard-token-abi": "2.0.0",
"regenerator-runtime": "0.13.3",
"rpc-server": "0.0.1",
"uuid": "3.3.3"
},
"devDependencies": {
"@babel/polyfill": "7.7.0",
"@types/jest": "24.0.23",
"@types/jest": "24.0.25",
"@types/uuid": "3.4.6",
"jest": "24.9.0",
"ts-jest": "24.2.0",
Expand Down
38 changes: 18 additions & 20 deletions modules/client/src/connect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import "regenerator-runtime/runtime";

import { ChannelProvider, createCFChannelProvider } from "./channelProvider";
import { ConnextClient } from "./connext";
import { Logger, stringify } from "./lib";
import { Logger, stringify, delayAndThrow } from "./lib";
import { NodeApiClient } from "./node";
import {
CFCoreTypes,
Expand Down Expand Up @@ -45,25 +45,23 @@ const setupMultisigAddress = async (
let multisigAddress: string;
if (!myChannel) {
log.debug("no channel detected, creating channel..");
const creationEventData: CFCoreTypes.CreateChannelResult = await new Promise(
async (res: any, rej: any): Promise<any> => {
const timer = setTimeout(
(): void => rej("Create channel event not fired within 30s"),
30000,
);
channelProvider.once(
CFCoreTypes.EventNames.CREATE_CHANNEL_EVENT as CFCoreTypes.EventName,
(data: CreateChannelMessage): void => {
clearTimeout(timer);
res(data.data);
},
);

const creationData = await node.createChannel();
log.debug(`created channel, transaction: ${stringify(creationData)}`);
},
);
multisigAddress = creationEventData.multisigAddress;
const creationEventData: CFCoreTypes.CreateChannelResult | {} = await Promise.race([
new Promise(
async (res: any): Promise<any> => {
channelProvider.once(
CFCoreTypes.EventNames.CREATE_CHANNEL_EVENT as CFCoreTypes.EventName,
(data: CreateChannelMessage): void => {
res(data.data);
},
);

const creationData = await node.createChannel();
log.debug(`created channel, transaction: ${stringify(creationData)}`);
},
),
delayAndThrow(30_000, "Create channel event not fired within 30s"),
]);
multisigAddress = (creationEventData as CFCoreTypes.CreateChannelResult).multisigAddress;
} else {
multisigAddress = myChannel.multisigAddress;
}
Expand Down
7 changes: 3 additions & 4 deletions modules/contracts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,14 @@
"devDependencies": {
"@connext/cf-adjudicator-contracts": "0.4.1",
"@connext/cf-funding-protocol-contracts": "0.4.1",
"@connext/cf-types": "1.3.14",
"@types/chai": "4.2.6",
"@types/chai": "4.2.7",
"chai": "4.2.0",
"dotenv": "8.2.0",
"eth-gas-reporter": "0.2.14",
"ethereum-waffle": "2.1.0",
"ethers": "4.0.40",
"ethers": "4.0.41",
"openzeppelin-solidity": "2.3.0",
"truffle": "5.1.2",
"truffle": "5.1.6",
"truffle-hdwallet-provider": "1.0.17",
"ts-mocha": "6.0.0",
"ts-node": "8.5.4"
Expand Down
Loading

0 comments on commit afdcab2

Please sign in to comment.