Skip to content

Commit

Permalink
add-central-server-integration
Browse files Browse the repository at this point in the history
  • Loading branch information
codersharma2001 committed May 8, 2024
1 parent 4817d44 commit de810c0
Show file tree
Hide file tree
Showing 28 changed files with 4,317 additions and 4,245 deletions.
20 changes: 10 additions & 10 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
.github
tests
data
.env.sample
.gitignore
.pylintrc
Dockerfile
LICENSE
mypy.ini
README.md
.github
tests
data
.env.sample
.gitignore
.pylintrc
Dockerfile
LICENSE
mypy.ini
README.md
16 changes: 8 additions & 8 deletions .env.sample
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
COW_DEX_AG_SOLVER_URL=http://host.docker.internal:8000
ORDERBOOK_URL=https://barn.api.cow.fi/xdai
BASE_TOKENS=0xDDAfbb505ad214D7b80b1f830fcCc89B60fb7A83
NODE_URL=https://rpc.gnosis.gateway.fm
SOLVER_ACCOUNT=0x7942a2b3540d1ec40b2740896f87aecb2a588731
SOLVERS=CowDexAg
TRANSACTION_STRATEGY=DryRun
LOG_FILTER=info
COW_DEX_AG_SOLVER_URL=http://host.docker.internal:8000
ORDERBOOK_URL=https://barn.api.cow.fi/xdai
BASE_TOKENS=0xDDAfbb505ad214D7b80b1f830fcCc89B60fb7A83
NODE_URL=https://rpc.gnosis.gateway.fm
SOLVER_ACCOUNT=0x7942a2b3540d1ec40b2740896f87aecb2a588731
SOLVERS=CowDexAg
TRANSACTION_STRATEGY=DryRun
LOG_FILTER=info
46 changes: 23 additions & 23 deletions .github/workflows/cla.yaml
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
name: "cla"

on:
issue_comment:
types: [created]
pull_request_target:
types: [opened, closed, synchronize]

jobs:
cla:
runs-on: ubuntu-latest
steps:
- name: "CLA Assistant"
if: (github.event.comment.body == 'recheck' || github.event.comment.body == 'I have read the CLA Document and I hereby sign the CLA') || github.event_name == 'pull_request_target'
uses: contributor-assistant/github-action@v2.2.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PERSONAL_ACCESS_TOKEN : ${{ secrets.ORG_TOKEN }}
with:
branch: 'cla-signatures'
path-to-signatures: 'signatures/version1/cla.json'
path-to-document: 'https://github.com/cowprotocol/cla/blob/main/CLA.md'
allowlist: '*[bot]'
name: "cla"

on:
issue_comment:
types: [created]
pull_request_target:
types: [opened, closed, synchronize]

jobs:
cla:
runs-on: ubuntu-latest
steps:
- name: "CLA Assistant"
if: (github.event.comment.body == 'recheck' || github.event.comment.body == 'I have read the CLA Document and I hereby sign the CLA') || github.event_name == 'pull_request_target'
uses: contributor-assistant/github-action@v2.2.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PERSONAL_ACCESS_TOKEN : ${{ secrets.ORG_TOKEN }}
with:
branch: 'cla-signatures'
path-to-signatures: 'signatures/version1/cla.json'
path-to-document: 'https://github.com/cowprotocol/cla/blob/main/CLA.md'
allowlist: '*[bot]'
72 changes: 36 additions & 36 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
@@ -1,36 +1,36 @@
name: deploy

on:
push:
branches: [main]
tags: [v*]

jobs:
deploy:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- uses: actions/checkout@v2

- uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- id: meta
uses: docker/metadata-action@v3
with:
images: ghcr.io/${{ github.repository }}
labels: |
org.opencontainers.image.licenses=MIT OR Apache-2.0
- uses: docker/build-push-action@v2
with:
context: .
file: Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
name: deploy

on:
push:
branches: [main]
tags: [v*]

jobs:
deploy:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- uses: actions/checkout@v2

- uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- id: meta
uses: docker/metadata-action@v3
with:
images: ghcr.io/${{ github.repository }}
labels: |
org.opencontainers.image.licenses=MIT OR Apache-2.0
- uses: docker/build-push-action@v2
with:
context: .
file: Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
56 changes: 28 additions & 28 deletions .github/workflows/pull-request.yaml
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
name: pull request
on:
pull_request:
push:
branches: [ main ]
jobs:
python:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup Python 3.10
uses: actions/setup-python@v2
with:
python-version: '3.10'
- name: Install Requirements
run:
pip install -r requirements.txt
- name: Lint
run:
pylint src/
- name: Format
run:
black --check ./
- name: Type Check
run:
mypy src --strict
- name: Unit Tests
run:
name: pull request
on:
pull_request:
push:
branches: [ main ]
jobs:
python:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup Python 3.10
uses: actions/setup-python@v2
with:
python-version: '3.10'
- name: Install Requirements
run:
pip install -r requirements.txt
- name: Lint
run:
pylint src/
- name: Format
run:
black --check ./
- name: Type Check
run:
mypy src --strict
- name: Unit Tests
run:
python -m pytest tests/unit
16 changes: 8 additions & 8 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
*.pyc
*/__pycache__
venv/
.env

.idea/
.vscode/
.DS_Store
*.pyc
*/__pycache__
venv/
.env

.idea/
.vscode/
.DS_Store
8 changes: 4 additions & 4 deletions .pylintrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[MASTER]
disable=fixme,too-few-public-methods,too-many-instance-attributes,too-many-arguments,logging-fstring-interpolation,too-many-locals,duplicate-code, def buy_amount(self) -> Decimal:

extension-pkg-allow-list=pydantic
[MASTER]
disable=fixme,too-few-public-methods,too-many-instance-attributes,too-many-arguments,logging-fstring-interpolation,too-many-locals,duplicate-code, def buy_amount(self) -> Decimal:

extension-pkg-allow-list=pydantic
30 changes: 15 additions & 15 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
FROM python:3.10-alpine

RUN apk add --update gcc libc-dev linux-headers

WORKDIR /app

# First copy over the requirements.txt and install dependencies, this makes
# building subsequent images easier.
COPY requirements.txt .
RUN pip install -r requirements.txt

# Copy full source (see .dockerignore)
COPY . .

CMD [ "python3", "-m" , "src._server"]
FROM python:3.10-alpine

RUN apk add --update gcc libc-dev linux-headers

WORKDIR /app

# First copy over the requirements.txt and install dependencies, this makes
# building subsequent images easier.
COPY requirements.txt .
RUN pip install -r requirements.txt

# Copy full source (see .dockerignore)
COPY . .

CMD [ "python3", "-m" , "src._server"]
42 changes: 21 additions & 21 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
MIT License

Copyright (c) 2022 CoW Protocol

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
MIT License
Copyright (c) 2022 CoW Protocol
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Loading

0 comments on commit de810c0

Please sign in to comment.