Here are the steps to get a development environment up and running to write smart contracts in .NET for the Antshares platform.
What we need:
- Visual Studio 2015 (Install the free community edition)
https://www.visualstudio.com/downloads/ - .NET Core tools Preview 2 (or newer) for Visual Studio 2015 : https://www.microsoft.com/net/download/core
- Antshares Visual Studio Plugin:
Open Visual Studio. Install from menu Tools -> Extensions and Updates -> Online -> Search Antshares: Antshares.SmartContract - AntShares.Compiler.MSIL project: https://github.com/AntShares/AntShares.VM
Download as .zip – Unzip and open the .sln file in Visual Studio
Build the AntShares.Compiler.MSIL project, we will reference the build output in the System environment Path variable. You could do this in command line or by going to the Windows variables where you select the Path value in System variables:
Add the folder UnzipDirectory\AntShares.VM-master\src\AntShares.Compiler.MSIL\bin\Debug\netcoreapp1.0\win10-x64
If all is well so far, you can type the following command in your prompt: AntShares.Compiler.MSIL and see if this is recognised:
Thanks to the Antshares visual studio project, it's easy to start a smartcontracts project, just select the new template AntShares.SmartContract.Template:
After the project opened, I ran into a small problem. The DLL “AntShares.SmartContract.Framework” in my references did not load correctly. I fixed it by running “manage NuGet packages” in the project, and restoring AntShares.SmartContract.Framework.
Then you can successfully build the project with the empty contract:
And now you're all ready to start doing the difficult part: writing that damn contract...
Happy coding!
Can you explain what a smart contract is? I'm somewhat proficient with programming, but naive to how one would interact with Antshare? I will keep looking, but your help is appreciated.
Do you know how AntShares prevents infinite loops?
Ah, that's an interesting question, I wish I knew...
It's discussed in this article: https://themerkle.com/reconstructing-smart-contracts-part-1/
I've just grabbed myself some AntShares. What level of confidence do you have in the future of the AntShares platform?
Well I'm not selling my shares anytime soon...
We'll hold the price up with our combined efforts yogi
Yup :) I got in over a month ago and mentioned it as undervalued - and I think time has proven me right on that one... -> https://steemit.com/cryptocurrency/@yogi/undervalued-cryptocurrencies-the-best-crypto-s-no-one-talks-about
Big ups yogi. I'm yet to get in early on a good one. I hope you enjoyed the ride
cool