etherdelta / etherdelta.github.io

https://etherdelta.com
554 stars 688 forks source link

Yo! Let's talk testing. #243

Closed MeoMix closed 1 year ago

MeoMix commented 6 years ago

Hey again,

So, after burning an obscene amount of gas due to failed testing on mainnet, I decided I'm broke enough to try and develop my bot in a proper testing environment. Hooray best practices. Boo multi-thousand dollar learning experiences.

Anyway, here's what I've got::

I don't have:

If I go to https://etherdelta.com/?config=testnet#1ST-ETH I can see my faucet ETH appearing, the page partially loads, but fails to fully load due to socket connection issues.

Error in dev console reads:

Refused to connect to 'ws://67.205.144.103:8002/socket.io/?EIO=3&transport=websocket' because it violates the following Content Security Policy directive: "connect-src 'self' localhost:8545 cache.etherdelta.com wss://socket.etherdelta.com etherscan.io api.etherscan.io syndication.twitter.com etherchain.org".

Questions:

EDIT:

zackcoburn commented 6 years ago

Oh, the testnet API is currently not running.

What are you trying to test exactly? If you've been wasting gas, it sounds like you've been trying to trade existing orders and failing. Either you've just gotten quite unlucky and people keep "beating you to the punch," or you're not sending the proper trade transaction. Can you send some example failures?

MeoMix commented 6 years ago

Hey,

Aw. Bummer. Any ETA on when it might be back up?

I am trying to perform full integration testing against testnet. I would like to place orders, take another account's orders, and cancel my own orders. I'm struggling with:

I definitely was not sending the proper transaction. My bot had an error with its math for calculating a scaling gasPrice based off of the estimated profit for taking a given transaction. I moved a bunch of ETH from the on-exchange wallet to off-exchange, thought that was 'safe enough', but awoke 50 ETH poorer as it repeatedly issued bad transactions.. compounded by the fact that throwing in solidity maxes out the gas usage. Heh. Check out the devastation here: https://etherscan.io/txs?a=0xe43351Bd6cdf6Cb64b1DfDe1464E98a0c403B631&p=2

Anyway, not trying to make this a pity party. Just acknowledging that I was being super fucking lazy with my testing environment, paid a heavy price for it, and am now trying to do better, but finding that things might be broken as you appear to be WIP on your new EtherDelta layout?

djskinner commented 6 years ago

I'm also interesting in developing against testnet beforing going live.

Did you have any luck finding a way to get some alt coins on testnet? I saw this (https://www.reddit.com/r/ethereum/comments/6i7twg/is_there_a_easy_and_fast_way_of_getting_some/) but suspect the token is not added to the ED contract so wont be of much use for testing purposes.

MeoMix commented 6 years ago

ED can trade any ERC20 token. It doesn't specifically have to be added to the exchange, afaik. I haven't gone through with this yet -- but yes either getting an alt coin, or minting your own coin and issuing yourself some, would be a good starting spot.

yangbod123 commented 6 years ago

Have you done with testnet of ED? I want to test my smart contract interacting with ED too. But live net is too expensive for a test. Hope to hear from you soon.

lexwodo commented 6 years ago

Is there any progress in ED/testnet? Just tried web ui with ?config=testnet and python api calls (from bots example) and I found there is not way to place orders on testnet. I've used BOKKY, STT and my own test ERC20 tokens