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

Commit

Permalink
Deploy indra-7.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Rahul Sethuram committed Jul 22, 2020
2 parents dc44bb5 + 83ed0a7 commit 9cf7f7c
Show file tree
Hide file tree
Showing 249 changed files with 55,153 additions and 52,876 deletions.
10 changes: 4 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ modules/*/package-lock.json
**/.test-store
**/cache/**

# Data Storage
modules/bot/.connext-store/
.chaindata

# Docs
modules/client/docs

Expand Down Expand Up @@ -54,12 +58,6 @@ cypress/videos
**/.env
**/react-app-env.d.ts
ops/database/snapshots

# Http files
ganache.http
modules/bot/.connext-store/
modules/bot-registry/.node-persist/

.secret

# Local address book
Expand Down
25 changes: 14 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,12 @@ start-headless: dev
start-daicard: dev
INDRA_UI=daicard bash ops/start-dev.sh

start-testnet: contracts
INDRA_CHAIN_LOG_LEVEL=1 bash ops/start-testnet.sh

start-test: start-test-staging
start-test-staging:
INDRA_ETH_PROVIDER=http://localhost:8545 INDRA_MODE=test-staging bash ops/start-prod.sh
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
Expand All @@ -73,6 +76,9 @@ start-bot-farm: bot
stop:
bash ops/stop.sh

stop-all:
bash ops/stop.sh all

restart-headless: dev
bash ops/stop.sh
INDRA_UI=headless bash ops/start-dev.sh
Expand All @@ -87,7 +93,7 @@ restart-prod:
bash ops/stop.sh
bash ops/start-prod.sh

clean: stop
clean: stop-all
docker container prune -f
rm -rf .flags/*
rm -rf node_modules/@connext modules/*/node_modules/@connext
Expand All @@ -110,12 +116,13 @@ quick-reset:
rm -rf modules/*/.connext-store
touch modules/node/src/main.ts

reset: stop
reset: stop-all
docker container prune -f
docker network rm $(project) $(project)_cf_tester $(project)_node_tester $(project)_test_store 2> /dev/null || true
docker secret rm $(project)_database_dev 2> /dev/null || true
docker volume rm $(project)_chain_dev $(project)_database_dev 2> /dev/null || true
docker volume rm $(project)_chain_1337 $(project)_chain_1338 $(project)_database_dev 2> /dev/null || true
docker volume rm `docker volume ls -q -f name=$(project)_database_test_*` 2> /dev/null || true
rm -rf .chaindata/*
rm -rf .flags/deployed-contracts

push-commit:
Expand All @@ -136,10 +143,6 @@ pull-release:
pull-backwards-compatible:
bash ops/pull-images.sh $(backwards_compatible_version)

deployed-contracts: contracts
bash ops/deploy-contracts.sh
touch .flags/$@

build-report:
bash ops/build-report.sh

Expand Down Expand Up @@ -175,7 +178,7 @@ test-tps-lg: bot
bash ops/test/tps.sh 40 0 10

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

test-contracts: contracts utils
bash ops/test/unit.sh contracts
Expand All @@ -202,7 +205,7 @@ test-watcher: watcher
bash ops/test/watcher.sh

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

watch-integration:
bash ops/test/integration.sh watch
Expand All @@ -211,7 +214,7 @@ watch-ui: node-modules
bash ops/test/ui.sh --watch

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

########################################
# Begin Real Build Rules
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,10 @@ If you want to use custom contracts or a new network though, you'll have to depl

For example: to deploy to Goerli testnet, you'll first need to retrieve the mnemonic for an account that has enough funds to pay the gas fees. Copy that mnemonic to your clipboard & then run:

```bash
make contracts
```
then
```bash
bash ops/deploy-contracts.sh https://goerli.infura.io/abc123
```
Expand Down
2 changes: 1 addition & 1 deletion cypress/tests/utils.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* global Cypress, cy */
const eth = require("ethers");
const tokenArtifacts = require("@openzeppelin/contracts/build/contracts/ERC20Mintable.json");
const addressBook = require("../../modules/contracts/address-book.json");
const addressBook = require("../../.chaindata/addresses/1337-1338.json");

const provider = new eth.providers.JsonRpcProvider(Cypress.env("provider"));
const funder = eth.Wallet.fromMnemonic(Cypress.env("funder")).connect(provider);
Expand Down
11 changes: 5 additions & 6 deletions dev.env
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
INDRA_ADMIN_TOKEN="cxt1234"
INDRA_ETH_PROVIDER="http://ethprovider:8545"
INDRA_LOG_LEVEL="3"
INDRA_NATS_JWT_SIGNER_PRIVATE_KEY="-----BEGIN RSA PRIVATE KEY-----MIIEowIBAAKCAQEAqU/GXp8MqmugQyRk5FUFBvlJt1/h7L3Crzlzejz/OxriZdq/lBNQW9S1kzGc7qjXprZ1Kg3zP6irr6wmvP0WYBGltWs2cWUAmxh0PSxuKdT/OyL9w+rjKLh4yo3ex6DX3Ij0iP01Ej2POe5WrPDS8j6LT0s4HZ1FprL5h7RUQWV3cO4pF+1kl6HlBpNzEQzocW9ig4DNdSeUENARHWoCixE1gFYo9RXm7acqgqCk3ihdJRIbO4e/m1aZq2mvAFK+yHTIWBL0p5PF0Fe8zcWdNeEATYB+eRdNJ3jjS8447YrcbQcBQmhFjk8hbCnc3Rv3HvAapk8xDFhImdVF1ffDFwIDAQABAoIBAGZIs2ZmX5h0/JSTYAAw/KCB6W7Glg4XdY21/3VRdD+Ytj0iMaqbIGjZz/fkeRIVHnKwt4d4dgN3OoEeVyjFHMdc4eb/phxLEFqiI1bxiHvtGWP4d6XsON9Y0mBL5NJk8QNiGZjIn08tsWEmA2bm9gkyj6aPoo8BfBqA9Q5uepgmYIPT2NtEXvTbd2dedAEJDJspHKHqBfcuNBVoVhUixVSgehWGGP4GX+FvAEHbawDrwULkMvgblH+X8nBtzikp29LNpOZSRRbqF/Da0AkluFvuDUUIzitjZs5koSEAteaulkZO08BMxtovQjh/ZPtVZKZ27POCNOgRsbm/lVIXRMECgYEA2TQQ2Xy6eO5XfbiT4ZD1Z1xe9B6Ti7J2fC0ZNNSXs4Dz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P01Ej2POe5WrPDS8j6LT0s4HZ1FprL5h7RUQWV3cO4pF+1kl6HlBpNzEQzocW9ig4DNdSeUENARHWoCixE1gFYo9RXm7acqgqCk3ihdJRIbO4e/m1aZq2mvAFK+yHTIWBL0p5PF0Fe8zcWdNeEATYB+eRdNJ3jjS8447YrcbQcBQmhFjk8hbCnc3Rv3HvAapk8xDFhImdVF1ffDFwIDAQAB-----END PUBLIC KEY-----"
INDRA_UI="daicard" # one of: "daicard", "dashboard", "headless"
export INDRA_ADMIN_TOKEN="cxt1234"
export INDRA_LOG_LEVEL="3"
export INDRA_NATS_JWT_SIGNER_PRIVATE_KEY="-----BEGIN RSA PRIVATE KEY-----MIIEowIBAAKCAQEAqU/GXp8MqmugQyRk5FUFBvlJt1/h7L3Crzlzejz/OxriZdq/lBNQW9S1kzGc7qjXprZ1Kg3zP6irr6wmvP0WYBGltWs2cWUAmxh0PSxuKdT/OyL9w+rjKLh4yo3ex6DX3Ij0iP01Ej2POe5WrPDS8j6LT0s4HZ1FprL5h7RUQWV3cO4pF+1kl6HlBpNzEQzocW9ig4DNdSeUENARHWoCixE1gFYo9RXm7acqgqCk3ihdJRIbO4e/m1aZq2mvAFK+yHTIWBL0p5PF0Fe8zcWdNeEATYB+eRdNJ3jjS8447YrcbQcBQmhFjk8hbCnc3Rv3HvAapk8xDFhImdVF1ffDFwIDAQABAoIBAGZIs2ZmX5h0/JSTYAAw/KCB6W7Glg4XdY21/3VRdD+Ytj0iMaqbIGjZz/fkeRIVHnKwt4d4dgN3OoEeVyjFHMdc4eb/phxLEFqiI1bxiHvtGWP4d6XsON9Y0mBL5NJk8QNiGZjIn08tsWEmA2bm9gkyj6aPoo8BfBqA9Q5uepgmYIPT2NtEXvTbd2dedAEJDJspHKHqBfcuNBVoVhUixVSgehWGGP4GX+FvAEHbawDrwULkMvgblH+X8nBtzikp29LNpOZSRRbqF/Da0AkluFvuDUUIzitjZs5koSEAteaulkZO08BMxtovQjh/ZPtVZKZ27POCNOgRsbm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g3zP6irr6wmvP0WYBGltWs2cWUAmxh0PSxuKdT/OyL9w+rjKLh4yo3ex6DX3Ij0iP01Ej2POe5WrPDS8j6LT0s4HZ1FprL5h7RUQWV3cO4pF+1kl6HlBpNzEQzocW9ig4DNdSeUENARHWoCixE1gFYo9RXm7acqgqCk3ihdJRIbO4e/m1aZq2mvAFK+yHTIWBL0p5PF0Fe8zcWdNeEATYB+eRdNJ3jjS8447YrcbQcBQmhFjk8hbCnc3Rv3HvAapk8xDFhImdVF1ffDFwIDAQAB-----END PUBLIC KEY-----"
export INDRA_UI="daicard" # one of: "daicard", "dashboard", "headless"
10 changes: 5 additions & 5 deletions modules/apps/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@connext/apps",
"version": "7.0.0-alpha.20",
"version": "7.0.0",
"description": "Connext Counterfactual Apps",
"main": "dist/index.js",
"module": "dist/index.esm.js",
Expand All @@ -18,13 +18,13 @@
"clean": "rm -rf ./dist"
},
"devDependencies": {
"@connext/contracts": "3.3.1",
"@connext/types": "7.0.0-alpha.20",
"@connext/utils": "7.0.0-alpha.20",
"@connext/contracts": "3.4.1",
"@connext/types": "7.0.0",
"@connext/utils": "7.0.0",
"@rollup/plugin-json": "4.1.0",
"ethers": "5.0.5",
"rollup": "2.21.0",
"rollup-plugin-typescript2": "0.27.1",
"typescript": "3.9.6"
"typescript": "3.9.7"
}
}
4 changes: 2 additions & 2 deletions modules/apps/src/SimpleTwoPartySwapApp/validation.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { AllowedSwap, SwapRate, ProtocolParams } from "@connext/types";
import { AllowedSwap, ProtocolParams } from "@connext/types";
import { calculateExchangeWad, getAddressFromAssetId, stringify } from "@connext/utils";
import { BigNumber } from "ethers";

const ALLOWED_DISCREPANCY_PCT = 5;

export const validateSimpleSwapApp = (
params: ProtocolParams.Propose,
allowedSwaps: SwapRate[],
allowedSwaps: AllowedSwap[],
ourRate: string,
responderDecimals: number,
) => {
Expand Down
38 changes: 18 additions & 20 deletions modules/apps/src/middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {
Address,
ContractAddresses,
MiddlewareContext,
NetworkContext,
NetworkContexts,
ProposeMiddlewareContext,
ProtocolName,
ProtocolNames,
Expand Down Expand Up @@ -48,28 +48,24 @@ export const sharedProposalMiddleware = (

// add any validation middlewares
export const generateValidationMiddleware = async (
network: NetworkContext,
supportedTokenAddresses: Address[],
networkContexts: NetworkContexts,
supportedTokenAddresses: { [chainId: number]: Address[] },
): Promise<ValidationMiddleware> => {
if (!network.provider) {
throw new Error(`Validation middleware needs access to a provider`);
}

const validationMiddleware: ValidationMiddleware = async (
protocol: ProtocolName,
middlewareContext: MiddlewareContext,
) => {
switch (protocol) {
case ProtocolNames.propose: {
await proposeMiddleware(
network,
networkContexts,
middlewareContext as ProposeMiddlewareContext,
supportedTokenAddresses,
);
break;
}
case ProtocolNames.uninstall: {
await uninstallMiddleware(network, middlewareContext as UninstallMiddlewareContext);
await uninstallMiddleware(networkContexts, middlewareContext as UninstallMiddlewareContext);
break;
}
case ProtocolNames.setup:
Expand All @@ -87,14 +83,15 @@ export const generateValidationMiddleware = async (
};

const uninstallMiddleware = async (
network: NetworkContext,
networkContexts: NetworkContexts,
middlewareContext: UninstallMiddlewareContext,
) => {
const { appInstance } = middlewareContext;
const { appInstance, stateChannel } = middlewareContext;
const { contractAddresses, provider } = networkContexts[stateChannel.chainId];
const appDef = appInstance.appDefinition;
switch (appDef) {
case network.contractAddresses.DepositApp: {
await uninstallDepositMiddleware(middlewareContext, network.provider);
case contractAddresses.DepositApp: {
await uninstallDepositMiddleware(middlewareContext, provider);
break;
}
default: {
Expand All @@ -104,17 +101,18 @@ const uninstallMiddleware = async (
};

const proposeMiddleware = async (
network: NetworkContext,
networkContexts: NetworkContexts,
middlewareContext: ProposeMiddlewareContext,
supportedTokenAddresses: Address[],
supportedTokenAddresses: { [chainId: number]: Address[] },
) => {
const { contractAddresses } = network;
const { proposal } = middlewareContext;
sharedProposalMiddleware(middlewareContext, contractAddresses, supportedTokenAddresses);
const { proposal, stateChannel } = middlewareContext;
const { contractAddresses, provider } = networkContexts[stateChannel.chainId];
const supportedTokensForChainId = supportedTokenAddresses[stateChannel.chainId];
sharedProposalMiddleware(middlewareContext, contractAddresses, supportedTokensForChainId);
const appDef = proposal.appDefinition;
switch (appDef) {
case contractAddresses.DepositApp: {
await proposeDepositMiddleware(middlewareContext, network.provider);
await proposeDepositMiddleware(middlewareContext, provider);
break;
}
case contractAddresses.GraphSignedTransferApp: {
Expand All @@ -134,7 +132,7 @@ const proposeMiddleware = async (
break;
}
case contractAddresses.HashLockTransferApp: {
await proposeHashLockTransferMiddleware(middlewareContext, network.provider);
await proposeHashLockTransferMiddleware(middlewareContext, provider);
break;
}
case contractAddresses.WithdrawApp: {
Expand Down
14 changes: 7 additions & 7 deletions modules/bot/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,21 @@
"author": "",
"license": "ISC",
"dependencies": {
"@connext/client": "7.0.0-alpha.20",
"@connext/contracts": "3.3.1",
"@connext/store": "7.0.0-alpha.20",
"@connext/types": "7.0.0-alpha.20",
"@connext/utils": "7.0.0-alpha.20",
"@connext/client": "7.0.0",
"@connext/contracts": "3.4.1",
"@connext/store": "7.0.0",
"@connext/types": "7.0.0",
"@connext/utils": "7.0.0",
"axios": "0.19.2",
"body-parser": "1.19.0",
"ethers": "5.0.5",
"express": "4.17.1",
"interval-promise": "1.4.0",
"yargs": "15.4.0"
"yargs": "15.4.1"
},
"devDependencies": {
"@types/yargs": "15.0.5",
"ts-node": "8.10.2",
"typescript": "3.9.6"
"typescript": "3.9.7"
}
}
4 changes: 2 additions & 2 deletions modules/bot/src/env.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
export const env = {
ethProviderUrl: process.env.INDRA_ETH_RPC_URL!,
ethProviderUrl: process.env.INDRA_CHAIN_URL!,
nodeUrl: process.env.INDRA_NODE_URL!,
};

if (!env.ethProviderUrl) {
throw new Error(`An INDRA_ETH_RPC_URL is required but was not provided.`);
throw new Error(`An INDRA_CHAIN_URL is required but was not provided.`);
}

if (!env.nodeUrl) {
Expand Down
12 changes: 0 additions & 12 deletions modules/cf-core/.env.defaults

This file was deleted.

5 changes: 0 additions & 5 deletions modules/cf-core/.env.example

This file was deleted.

6 changes: 0 additions & 6 deletions modules/cf-core/.env.schema

This file was deleted.

12 changes: 0 additions & 12 deletions modules/cf-core/.gitignore

This file was deleted.

31 changes: 0 additions & 31 deletions modules/cf-core/jest.config.js

This file was deleted.

Loading

0 comments on commit 9cf7f7c

Please sign in to comment.