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.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Rahul Sethuram committed Jan 14, 2020
2 parents c21030e + db9fdda commit b18b805
Show file tree
Hide file tree
Showing 39 changed files with 280 additions and 180 deletions.
25 changes: 8 additions & 17 deletions .github/workflows/cd-master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,16 +78,16 @@ jobs:
steps:
- uses: actions/checkout@v1
- run: make pull-release
- run: make start-test
- run: make test-integration
- run: make start-test-release
- run: TEST_MODE=release make test-integration

test-backwards-compatibility:
runs-on: ubuntu-latest
needs: [build]
steps:
- uses: actions/checkout@v1
- run: make pull-release
- run: make start-test
- run: make start-test-release
- run: sleep 15 && make dls
- run: make test-backwards-compatibility

Expand All @@ -97,33 +97,24 @@ jobs:
steps:
- uses: actions/checkout@v1
- run: make pull-release
- run: make start-test
- run: make test-bot

test-bot-farm:
runs-on: ubuntu-latest
needs: [build]
steps:
- uses: actions/checkout@v1
- run: make pull-release
- run: make start-test
- run: make test-bot-farm
- run: make start-test-release
- run: TEST_MODE=release make test-bot

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

deploy-rinkeby:
env:
INDRA_ADMIN_TOKEN: ${{ secrets.INDRA_ADMIN_TOKEN }}
RINKEBY_DOMAINNAME: rinkeby.indra.connext.network
RINKEBY_ETH_PROVIDER: ${{ secrets.RINKEBY_ETH_PROVIDER }}
needs: [test-backwards-compatibility, test-bot, test-bot-farm, test-cf, test-client, test-daicard, test-integration, test-node, test-ssh]
needs: [test-backwards-compatibility, test-bot, test-cf, test-client, test-daicard, test-integration, test-node, test-ssh]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
Expand All @@ -149,7 +140,7 @@ jobs:
INDRA_ADMIN_TOKEN: ${{ secrets.INDRA_ADMIN_TOKEN }}
MAINNET_DOMAINNAME: indra.connext.network
MAINNET_ETH_PROVIDER: ${{ secrets.MAINNET_ETH_PROVIDER }}
needs: [test-backwards-compatibility, test-bot, test-bot-farm, test-cf, test-client, test-daicard, test-integration, test-node, test-ssh]
needs: [test-backwards-compatibility, test-bot, test-cf, test-client, test-daicard, test-integration, test-node, test-ssh]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
Expand Down
23 changes: 7 additions & 16 deletions .github/workflows/cd-staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,16 +71,16 @@ jobs:
steps:
- uses: actions/checkout@v1
- run: make pull-commit
- run: make start-test
- run: make test-integration
- run: make start-test-staging
- run: TEST_MODE=staging make test-integration

test-backwards-compatibility:
runs-on: ubuntu-latest
needs: [build]
steps:
- uses: actions/checkout@v1
- run: make pull-commit
- run: make start-test
- run: make start-test-staging
- run: sleep 15 && make dls
- run: make test-backwards-compatibility

Expand All @@ -90,32 +90,23 @@ jobs:
steps:
- uses: actions/checkout@v1
- run: make pull-commit
- run: make start-test
- run: make test-bot

test-bot-farm:
runs-on: ubuntu-latest
needs: [build]
steps:
- uses: actions/checkout@v1
- run: make pull-commit
- run: make start-test
- run: make test-bot-farm
- run: make start-test-staging
- run: TEST_MODE=staging make test-bot

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

deploy-staging:
env:
RINKEBY_ETH_PROVIDER: ${{ secrets.RINKEBY_ETH_PROVIDER }}
STAGING_DOMAINNAME: staging.indra.connext.network
needs: [test-backwards-compatibility, test-bot, test-bot-farm, test-cf, test-client, test-daicard, test-integration, test-node, test-ssh]
needs: [test-backwards-compatibility, test-bot, test-cf, test-client, test-daicard, test-integration, test-node, test-ssh]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
Expand Down
21 changes: 6 additions & 15 deletions .github/workflows/cd-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,17 +59,17 @@ jobs:
steps:
- uses: actions/checkout@v1
- run: make pull-commit
- run: make start-test
- run: make start-test-staging
- run: sleep 15 && make dls
- run: make test-integration
- run: TEST_MODE=staging make test-integration

test-backwards-compatibility:
runs-on: ubuntu-latest
needs: [build]
steps:
- uses: actions/checkout@v1
- run: make pull-commit
- run: make start-test
- run: make start-test-staging
- run: sleep 15 && make dls
- run: make test-backwards-compatibility

Expand All @@ -79,23 +79,14 @@ jobs:
steps:
- uses: actions/checkout@v1
- run: make pull-commit
- run: make start-test
- run: make test-bot

test-bot-farm:
runs-on: ubuntu-latest
needs: [build]
steps:
- uses: actions/checkout@v1
- run: make pull-commit
- run: make start-test
- run: make test-bot-farm
- run: make start-test-staging
- run: TEST_MODE=staging make test-bot

test-daicard:
runs-on: ubuntu-latest
needs: [build]
steps:
- uses: actions/checkout@v1
- run: make pull-commit
- run: make start-test
- run: make start-test-staging
- run: make test-daicard
16 changes: 10 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ flags=.makeflags
VPATH=$(flags)
SHELL=/bin/bash

backwards_compatible_version=2.3.20 #$(shell echo $(version) | cut -d '.' -f 1).0.0

commit=$(shell git rev-parse HEAD | head -c 8)
version=$(shell cat package.json | grep '"version"' | awk -F '"' '{print $$4}')
release=$(shell cat package.json | grep '"version"' | awk -F '"' '{print $$4}')
solc_version=$(shell cat package.json | grep '"solc"' | awk -F '"' '{print $$4}')
backwards_compatible_version=2.3.20 #$(shell echo $(release) | cut -d '.' -f 1).0.0

# Pool of images to pull cached layers from during docker build steps
cache_from=$(shell if [[ -n "${GITHUB_WORKFLOW}" ]]; then echo "--cache-from=$(project)_database:$(commit),$(project)_database,$(project)_ethprovider:$(commit),$(project)_ethprovider,$(project)_node:$(commit),$(project)_node,$(project)_proxy:$(commit),$(project)_proxy,$(project)_relay:$(commit),$(project)_relay,$(project)_bot:$(commit),$(project)_bot,$(project)_builder"; else echo ""; fi)
Expand Down Expand Up @@ -73,8 +73,12 @@ start-daicard: dev
start-dashboard: dev
INDRA_UI=dashboard bash ops/start-dev.sh

start-test:
INDRA_ETH_PROVIDER=http://localhost:8545 INDRA_MODE=test bash ops/start-prod.sh
start-test: start-test-staging
start-test-staging:
INDRA_ETH_PROVIDER=http://localhost:8545 INDRA_MODE=test-staging bash ops/start-prod.sh

start-test-release:
INDRA_ETH_PROVIDER=http://localhost:8545 INDRA_MODE=test-release bash ops/start-prod.sh

start-prod: prod
bash ops/start-prod.sh
Expand Down Expand Up @@ -138,7 +142,7 @@ push-commit:
bash ops/push-images.sh $(commit)

push-release:
bash ops/push-images.sh $(version)
bash ops/push-images.sh $(release)

pull-latest:
bash ops/pull-images.sh latest
Expand All @@ -147,7 +151,7 @@ pull-commit:
bash ops/pull-images.sh $(commit)

pull-release:
bash ops/pull-images.sh $(version)
bash ops/pull-images.sh $(release)

pull-backwards-compatible:
bash ops/pull-images.sh $(backwards_compatible_version)
Expand Down
2 changes: 1 addition & 1 deletion modules/cf-adjudicator-contracts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"solidity"
],
"devDependencies": {
"@connext/types": "1.4.4",
"@connext/types": "1.5.0",
"@types/node": "13.1.2",
"@types/chai": "4.2.7",
"chai": "4.2.0",
Expand Down
4 changes: 2 additions & 2 deletions modules/cf-core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@connext/cf-core",
"version": "1.4.4",
"version": "1.5.0",
"main": "dist/src/index.js",
"iife": "dist/src/index.iife.js",
"types": "dist/src/index.d.ts",
Expand All @@ -19,7 +19,7 @@
"dependencies": {
"@connext/cf-adjudicator-contracts": "0.4.1",
"@connext/cf-funding-protocol-contracts": "0.4.1",
"@connext/types": "1.4.4",
"@connext/types": "1.5.0",
"ethers": "4.0.41",
"eventemitter3": "4.0.0",
"loglevel": "1.6.6",
Expand Down
2 changes: 1 addition & 1 deletion modules/cf-funding-protocol-contracts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"solidity"
],
"devDependencies": {
"@connext/types": "1.4.4",
"@connext/types": "1.5.0",
"@connext/cf-adjudicator-contracts": "0.4.1",
"@types/chai": "4.2.7",
"@types/node": "13.1.2",
Expand Down
8 changes: 4 additions & 4 deletions modules/client/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@connext/client",
"version": "1.4.4",
"version": "1.5.0",
"description": "Shared code between wallet and node",
"main": "dist/index.js",
"files": [
Expand All @@ -16,10 +16,10 @@
"test": "./node_modules/.bin/jest"
},
"dependencies": {
"@connext/cf-core": "1.4.4",
"@connext/cf-core": "1.5.0",
"@connext/cf-funding-protocol-contracts": "0.4.1",
"@connext/messaging": "1.4.4",
"@connext/types": "1.4.4",
"@connext/messaging": "1.5.0",
"@connext/types": "1.5.0",
"core-js": "3.6.1",
"eccrypto": "1.1.2",
"ethers": "4.0.41",
Expand Down
9 changes: 8 additions & 1 deletion 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, delayAndThrow } from "./lib";
import { delayAndThrow, Logger, stringify } from "./lib";
import { NodeApiClient } from "./node";
import {
CFCoreTypes,
Expand Down Expand Up @@ -157,6 +157,13 @@ export const connect = async (opts: ClientOptions): Promise<IConnextClient> => {
config = await node.config();
log.debug(`Node provided config: ${stringify(config)}`);

// ensure that node and user xpub are different
if (config.nodePublicIdentifier === xpub) {
throw new Error(
"Client must be instantiated with a mnemonic that is different from the node's mnemonic",
);
}

channelProvider = await createCFChannelProvider({
ethProvider,
keyGen,
Expand Down
12 changes: 8 additions & 4 deletions modules/client/src/connext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,14 @@ export class ConnextClient implements IConnextClient {
this.log.warn(`Cannot restart with an injected provider.`);
return;
}

// ensure that node and user xpub are different
if (this.nodePublicIdentifier === this.publicIdentifier) {
throw new Error(
"Client must be instantiated with a mnemonic that is different from the node's mnemonic",
);
}

// Create a fresh channelProvider & start using that.
// End goal is to use this to restart the cfNode after restoring state
const channelProvider = await createCFChannelProvider({
Expand Down Expand Up @@ -259,10 +267,6 @@ export class ConnextClient implements IConnextClient {
return await this.node.unsubscribeFromSwapRates(from, to);
};

public addPaymentProfile = async (profile: PaymentProfile): Promise<PaymentProfile> => {
return await this.node.addPaymentProfile(profile);
};

public getPaymentProfile = async (assetId?: string): Promise<PaymentProfile | undefined> => {
return await this.node.getPaymentProfile(assetId);
};
Expand Down
5 changes: 0 additions & 5 deletions modules/client/src/node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ const sendFailed = "Failed to send message";

export interface INodeApiClient {
acquireLock(lockName: string, callback: (...args: any[]) => any, timeout: number): Promise<any>;
addPaymentProfile(profile: PaymentProfile): Promise<PaymentProfile>;
appRegistry(appDetails?: {
name: SupportedApplication;
network: SupportedNetwork;
Expand Down Expand Up @@ -206,10 +205,6 @@ export class NodeApiClient implements INodeApiClient {
});
}

public async addPaymentProfile(profile: PaymentProfile): Promise<PaymentProfile> {
return await this.send(`channel.add-profile.${this.userPublicIdentifier}`, profile);
}

public async getPaymentProfile(assetId?: string): Promise<PaymentProfile> {
return await this.send(`channel.get-profile.${this.userPublicIdentifier}`, {
assetId: makeChecksumOrEthAddress(assetId),
Expand Down
5 changes: 0 additions & 5 deletions modules/client/src/testing/mocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ export class MockNodeClientApi implements INodeApiClient {
// should have keys same as the message passed in to fake messaging client
// TODO: how well will this work with dynamic paths?
public static returnValues: any = {
addPaymentProfile: {} as PaymentProfile,
appRegistry: {} as AppRegistry,
config: {
chainId: "mocks", // network that your channel is on
Expand Down Expand Up @@ -179,10 +178,6 @@ export class MockNodeClientApi implements INodeApiClient {
};
}

public async addPaymentProfile(): Promise<any> {
return MockNodeClientApi.returnValues.addPaymentProfile;
}

public async getPaymentProfile(): Promise<PaymentProfile | undefined> {
return undefined;
}
Expand Down
6 changes: 3 additions & 3 deletions modules/daicard/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
"format": "prettier --write \"src/**/*.js\""
},
"dependencies": {
"@connext/client": "1.4.4",
"@connext/types": "1.4.4",
"@connext/client": "1.5.0",
"@connext/types": "1.5.0",
"@material-ui/core": "4.8.2",
"@material-ui/icons": "4.5.1",
"@walletconnect/browser": "1.0.0-beta.41",
Expand All @@ -40,7 +40,7 @@
"xstate": "4.7.5"
},
"devDependencies": {
"@connext/types": "1.4.4",
"@connext/types": "1.5.0",
"bn.js": "5.1.1",
"chai-bn": "0.2.0"
},
Expand Down
Loading

0 comments on commit b18b805

Please sign in to comment.