From bfe224abab3c3d4736f829cae0e4f40a53cf3880 Mon Sep 17 00:00:00 2001 From: "F. Eugene Aumson" Date: Sat, 9 Nov 2019 09:14:54 -0500 Subject: [PATCH 1/3] CI/test-python: give LK ID of chain, not network For CircleCI job test-python, change docker config for launch-kit-backend to set an environment variable for the chain ID, not for the network ID. This was failing on all branches after a recent update to the `0xorg/launch-kit-backend:v3` tag. --- .circleci/config.yml | 2 +- .../sra_client/src/zero_ex/sra_client/__init__.py | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index e6a834f0dc..bb4afb5ffe 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -219,7 +219,7 @@ jobs: - image: 0xorg/launch-kit-backend:v3 environment: RPC_URL: 'http://localhost:8545' - NETWORK_ID: 50 + CHAIN_ID: 1337 WHITELIST_ALL_TOKENS: True FEE_RECIPIENT: '0x0000000000000000000000000000000000000001' MAKER_FEE_UNIT_AMOUNT: 0 diff --git a/python-packages/sra_client/src/zero_ex/sra_client/__init__.py b/python-packages/sra_client/src/zero_ex/sra_client/__init__.py index 89ae2443aa..8b8ab4722d 100644 --- a/python-packages/sra_client/src/zero_ex/sra_client/__init__.py +++ b/python-packages/sra_client/src/zero_ex/sra_client/__init__.py @@ -168,7 +168,7 @@ >>> relayer.get_order("0x" + order_hash_hex) {'meta_data': {'orderHash': '0x...', 'remainingFillableTakerAssetAmount': '2'}, - 'order': {'chainId': 50, + 'order': {'chainId': 1337, 'exchangeAddress': '0x...', 'expirationTimeSeconds': '...', 'feeRecipientAddress': '0x0000000000000000000000000000000000000000', @@ -195,7 +195,7 @@ >>> relayer.get_orders() {'records': [{'meta_data': {'orderHash': '0x...', 'remainingFillableTakerAssetAmount': '2'}, - 'order': {'chainId': 50, + 'order': {'chainId': 1337, 'exchangeAddress': '0x...', 'expirationTimeSeconds': '...', 'feeRecipientAddress': '0x0000000000000000000000000000000000000000', @@ -255,7 +255,7 @@ {'asks': {'records': [...]}, 'bids': {'records': [{'meta_data': {'orderHash': '0x...', 'remainingFillableTakerAssetAmount': '2'}, - 'order': {'chainId': 50, + 'order': {'chainId': 1337, 'exchangeAddress': '0x...', 'expirationTimeSeconds': '...', 'feeRecipientAddress': '0x0000000000000000000000000000000000000000', @@ -280,7 +280,7 @@ >>> order = jsdict_to_order(orderbook.bids.records[0].order) >>> from pprint import pprint >>> pprint(order) -{'chainId': 50, +{'chainId': 1337, 'expirationTimeSeconds': ..., 'feeRecipientAddress': '0x0000000000000000000000000000000000000000', 'makerAddress': '0x...', From 24d177f0b3d20b897a8c4e2f2c68bde1104f474e Mon Sep 17 00:00:00 2001 From: "F. Eugene Aumson" Date: Sat, 9 Nov 2019 09:51:48 -0500 Subject: [PATCH 2/3] Update docker config used for local testing --- python-packages/sra_client/test/relayer/docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python-packages/sra_client/test/relayer/docker-compose.yml b/python-packages/sra_client/test/relayer/docker-compose.yml index e5b6657ab4..12353c3b34 100644 --- a/python-packages/sra_client/test/relayer/docker-compose.yml +++ b/python-packages/sra_client/test/relayer/docker-compose.yml @@ -35,7 +35,7 @@ services: - "3000:3000" network_mode: "host" # to connect to ganache environment: - - NETWORK_ID=50 + - CHAIN_ID=1337 - RPC_URL=http://localhost:8545 - WHITELIST_ALL_TOKENS=True - FEE_RECIPIENT=0x0000000000000000000000000000000000000001 From ea8e4d5123d1e000ddb277c8d0e4612559c9d2ea Mon Sep 17 00:00:00 2001 From: "F. Eugene Aumson" Date: Sat, 9 Nov 2019 09:52:03 -0500 Subject: [PATCH 3/3] Update documentation of test environment --- .../src/zero_ex/sra_client/__init__.py | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/python-packages/sra_client/src/zero_ex/sra_client/__init__.py b/python-packages/sra_client/src/zero_ex/sra_client/__init__.py index 8b8ab4722d..26e1e5af56 100644 --- a/python-packages/sra_client/src/zero_ex/sra_client/__init__.py +++ b/python-packages/sra_client/src/zero_ex/sra_client/__init__.py @@ -38,9 +38,24 @@ docker run -d -p 8545:8545 0xorg/ganache-cli + docker run -d -p 60557:60557 --network host \ + -e ETHEREUM_RPC_URL=http://localhost:8545 \ + -e ETHEREUM_NETWORK_ID=50 \ + -e ETHEREUM_CHAIN_ID=1337 \ + -e USE_BOOTSTRAP_LIST=false \ + -e VERBOSITY=3 \ + -e PRIVATE_KEY_PATH= \ + -e BLOCK_POLLING_INTERVAL=5s \ + -e P2P_LISTEN_PORT=60557 + 0xorg/mesh:6.0.0-beta-0xv3 + docker run -d --network host \ -e RPC_URL=http://localhost:8545 \ - -e NETWORK_ID=50 \ + -e CHAIN_ID=1337 \ + -e FEE_RECIPIENT=0x0000000000000000000000000000000000000001 \ + -e MAKER_FEE_UNIT_AMOUNT=0 \ + -e TAKER_FEE_UNIT_AMOUNT=0 + -e MESH_ENDPOINT=ws://localhost:60557 -e WHITELIST_ALL_TOKENS=True \ 0xorg/launch-kit-ci