Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/xdc chain and xsswap #45

Merged

Conversation

james-hummingbot
Copy link
Contributor

Before submitting this PR, please make sure:

  • Your code builds clean without any errors or warnings
  • You are using approved title ("feat/", "fix/", "docs/", "refactor/")

A description of the changes proposed in the pull request:
Adds XDC Chain and XSSwap connector into gateway.

Note: The large amount of changes is the result to having to include our own copy of ethers-xdc with changes made specifically for the XDC chain

Tests performed by the developer:
Added manual curl commands and included various unit tests. Tested XSSwap in hummingbot.

Tips for QA testing:
Tested and approved by CoinAlpha QA team.
Ensure that XSSwap connector works as intended.
You will need to use this version of Hummingbot in PR #312 for it to work
You might need to use the curl commands to manual issue a token approval
Note: If testing on xinfin(mainnet) network, please verify that the WXDC address used is as follows:
xdc951857744785e80e2de051c32ee7b25f9c458c42

Tests performed by the developer:

Tips for QA testing:

@james-hummingbot
Copy link
Contributor Author

Install Dependencies error in workflow. Any ideas why this isn't working?
Screenshot 2023-02-28 at 09 37 36

@rapcmia rapcmia requested review from nikspz and rapcmia March 7, 2023 03:12
@nikspz
Copy link
Contributor

nikspz commented Mar 7, 2023

Hi @james-hummingbot could you please fix failing tests?

Steps:

  1. clone repository to xdcgw folder
  2. execute yarn from xdcgw folder

Actual:
Failed to install gateway

image

@james-hummingbot
Copy link
Contributor Author

@nikspz Where do you see xdcgw? I don't see that as a dependency or in node_modules after running locally (on mac).

@nikspz
Copy link
Contributor

nikspz commented Mar 7, 2023

@james-hummingbot never mind that’s just a name of gateway folder.
Like 'git clone -b feat/xdc_chain_and_xsswap repo_url xdcgw'

@james-hummingbot
Copy link
Contributor Author

@nikspz Do you have any insight into the current error?

Arguments: ls-remote --tags --heads ssh://git@github.com/web3-js/scrypt-shim.git
Directory: /home/runner/work/gateway/gateway
Output:
git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.

@nikspz
Copy link
Contributor

nikspz commented Mar 7, 2023

None, except it’s blocking PR gateway installation

@james-hummingbot
Copy link
Contributor Author

it's strange because that dependency already exists in the main branch

https://github.com/hummingbot/gateway/blob/main/yarn.lock#L12120

@rapcmia
Copy link
Contributor

rapcmia commented Mar 8, 2023

@nikspz Do you have any insight into the current error?

Arguments: ls-remote --tags --heads ssh://git@github.com/web3-js/scrypt-shim.git
Directory: /home/runner/work/gateway/gateway
Output:
git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.

Hi @james-hummingbot I tried to do some investigation and what I did is deleted the yarn.lock which able to setup the gateway. However when I tried to remove/install the PR again it reverted to the same error which also I have to repeat the steps to make it work. hmm not sure why this is happening since we are able to setup our dev branch ok

image

Tested using WSL (ubuntu20.04), will have a look with MacOS

@james-hummingbot
Copy link
Contributor Author

@rapcmia I am developing on Mac. My yarn version is 1.22.19. Do you know what version the workflow is using?

@rapcmia
Copy link
Contributor

rapcmia commented Mar 8, 2023

Hi @james-hummingbot ahh yes both WSL and Mac using. version 1.22.19 as well. Here's the screenshot from Mac

image

@james-hummingbot
Copy link
Contributor Author

@rapcmia I guess the changes @fengtality made to workflow in the development branch fixed it.

fengtality
fengtality previously approved these changes Mar 8, 2023
src/network/network.routes.ts Outdated Show resolved Hide resolved
Copy link
Contributor

@rapcmia rapcmia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

  • Setup this PR and Feat/xdc chain and xdcswap hummingbot#6114
  • Connect wallet both xinfin and apothem
  • Tested apothem using WXDC and XSP
  • Modified tokenlist xdc_tokens_apothem.json
    • {wxdc, 0x2a5c77b016Df1b3b0AE4E79a68F8adF64Ee741ba}
    • {xsp, 0x339c94081D1F7808FeEa3E6E5B1feA864c3cef43}
  • Gateway connect xsswap
    • Check wallet balance: ok
    • Ran gateway connector-tokens xxswap_xdc_apothem WXDC,XSWAP ok
    • Ran `gateway approve-token {WXDC, XSP}
      • No go, getting error nonce already used
      • As per advised, manually approved tokens via curl approve script, all ok
    • Test curl
      • Check port connection, ok
      • Check for network status, ok
      • Add xdc private key, ok
      • Get all wallets, ok
      • Delete xdc private key, ok
      • Allowances check
      • Approve {WXDC,XSP}, ok
      • Test transaction polling, ok
      • Get xdc swap price, ok
      • Buy swap, ok
      • Sell swap, ok
  • Setup simple AMM-arb on client
    • Setup coingecko as rate oracle source and added xswap-protocol
    • Observe profitability ok
    • Observe order placed and filled events ok
    • Check client history and CSV. Compare to apothem explorer, all ok

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants