I have been trying all the solutions and tutorials I found on the Internet, with no success. Remix fails to compile vyper smart contracts in local and remote. How to make it work?
3 Answers
It appears the public Vyper server is down. This video (https://www.youtube.com/watch?v=5M5p6SnW-Og) explains how to get your local server running. You could follow his instructions, or if you have Mac, you could try what I did:
$ brew install gmp leveldb
Next I activated a Python 3.9 virtualenv and then
$ python3.9 -m pip install vyper
Then I could successfully compile Vyper files like so
$ vyper MyContract.vy
0x7159c2e62 ...
... and start a Vyper server locally like this
$ vyper-serve
Listening on http://localhost:8000
Then in the Remix IDE in the Vyper plugin tab you click on the "LOCAL COMPILER" tab (make sure the port number is correct given the output of the last command) and you should be able to compile successfully.
You can run compile locally using vyper module.
pip install vyper==0.3.1
You can read more about vyper.
Start the vyper server by following command
vyper-serve -b localhost:8000
Verify the vyper-serve is working fine by opening localhost:8000 in browser.
But you will also need NGROK for this to work.
You can run ngrok with the following command
ngrok http http://localhost:8000
This will generate a public link e.g. https://4b47-223-190-93-108.in.ngrok.io
This link can be used as a local compiler in Remix IDE.
PS: It does not show compilation error line by line as Solidity Compiler in Remix IDE
I use the brownie framework for Vyper smart contracts.
-
As of late 2022, Brownie is dormant. Bugs are not being fixed. Many people report they cannot install it on Windows. I used it to learn simple Vyper contracts on Mac. But it doesn't provide runtime error messages, when one contract fails calling another contract. YMMV.– devdankeJan 17 at 10:19
-