I wanted to make a DApp that would allow me to thoroughly vet and test solidity contracts fast. So I used Christian's realtime solidity compiler as a base, and build a dev environment DApp on top of it. The result, Cosmo, a light-weight realtime solidity development environment that allows you to write, deploy, vet, test and operate solidity contracts in your browser.
Once I integrate connection toggling, I'll release a deployed POC on meteor.com. For now, you will have to run it manually with Meteor.
A special thanks to Christian and the CPP-Dev's for putting together the in
browser compiler. Also, keep an eye out for
Mix, the official development environment for Solidity that is still under development.
You can checkout the project here:
https://github.com/SilentCicero/meteor-dapp-cosmoAll the best, SC.
Comments
http://meteor-dapp-cosmo.meteor.com/
In regards to the cloud, I don't have any cloud setup for this, its localhost only at the moment (i.e. this will connect with your local geth node).
You need to make sure your corsdomain geth param is set too: http://meteor-dapp-cosmo.meteor.com
I'll be putting recommended geth settings up soon (on the actual utility).
I'm still a little bit green at all of this, I suppose. One important safety tip I've learned is that you do have to be mining for this to work. I've been able to deploy the contract and see address set as the chairperson, and the number of proposals properly set to 5. I've granted the right to vote to a couple of additional addresses and I've attempted to cast votes from those addresses. I get this type of output from voting:
Tx -> Ballot @ 0x127.. vote(1)
However, I can't seem to get any results out of the proposal, and people who did vote show up with their voted value as false:
Call -> Ballot @ 0x127.. voteCounts():
0
Call -> Ballot @ 0x127.. voteCounts(1):
0
Call -> Ballot @ 0x127.. winningProposal():
0
Tx -> Ballot @ 0x127.. voted(0xd38a9416d74261dc4df66f87829263b07fd1b856)
Call -> Ballot @ 0x127.. voted(0xd38a9416d74261dc4df66f87829263b07fd1b856):
false
I'm probably just misunderstanding how the contract is supposed to work. I have three accounts, all have voted for proposal 1.
Looking forward to understanding better.
1) While you have three accounts created, you may not have unlocked them when you want to vote as them.
- Did you unlock the account you wanted to use when you started your geth node, or is it still on "--unlock=primary"
- If you left it on unlock primary, you will need to switch that to the current account you would like to use to vote with on the ballot contract.
- So in this case, you would deploy and vote with one. Stop the geth node, then set the --unlock=YOUR_NEXT_VOTING_ACCOUNT_ADDR, then start up the geth node with these new cmd line params, then re-connect with geth in Cosmo, then vote again as the new unlocked account.
- Although in doing this, you would loose the Cosmo session on restarting/or reconnecting Cosmo (potentially), so this may not work until I get address injection working (that's for later... I'll make a pull request and keep you posted).
2) Gas, you don't have the amount of gas required to interact with or make the contract (a low balance on the current account you have unlocked)
- Do you have enough gas to send transactions to and deploy the contract, if you have unlocked a new account, there is a good chance that newly unlocked account has low to no gas, as you need to switch the mining params to mine to that new address in the geth cmd line in order to build up gas on that account.
- Although, I'm only addressing this issues, if it is the case you cant get anything working with this contract.
This default Ballot contract is generally to show basic functionality, actually switching accounts and voting as another account (i.e. person) may prove either difficult or impossible with the present setup (but with more functionality it will be possible soon).
If you have not been able to get anything working (e.g. transact vote (proposal id) then call voted (your addr)), then it's most likely a corsdomain, gas, unlock or mining issue.
One thing that could help is opening up the console (CNTL+SHIFT+I) while using Cosmo and read/look for errors and whats happens when you connect, deploy and vet the contract. You can post the console output here.
Note, there is two boot errors in the console already, one regarding a theme and another regarding uncaught exception, ignore these. Look what happens after these errors, when you connect to geth and onward.
Cheers, lets get you setup
BTW, now that you are hosting the Cosmo on your own site, does that mean that you are no longer contributing this to GitHub? My team is using your fine tool for development of the contracts and learning Ethereum APIs while looking at the cosmo code. It has been very helpful tool for us. Thanks
In regard to your other question, the plan is to get all critical aspects of Cosmo on Github and for it to be open-source, i.e. all the stuff you see now, plus event handling, natspec and a few other features.
All core aspects of the Web3.JS object will be available in Cosmo's core client on Github, totally open-source and free. Note, I just haven't updated the Github repo with the latest build, which is why you haven't seen the latest updates. I will do that today.
Going forward, Cosmo's hosted service will feature some premium account services for little extras that are not core Web3.js functionality. But these services will be targeted and narrow with the premium service largely a supportive measure to continue the development of Cosmo. But expect Cosmo, at least all core aspects, to be totally open-source, free, hosted and available on Github.
C:\Users\Rocky\Documents\GitHub> cd meteor-dapp-cosmo
C:\Users\Rocky\Documents\GitHub\meteor-dapp-cosmo [master]> cd app
C:\Users\Rocky\Documents\GitHub\meteor-dapp-cosmo\app [master]> ls
Directory: C:\Users\Rocky\Documents\GitHub\meteor-dapp-cosmo\app
Mode LastWriteTime Length Name
---- ------------- ------ ----
d---- 5/29/2015 11:06 AM .meteor
d---- 5/29/2015 11:06 AM client
d---- 5/29/2015 11:06 AM i18n
d---- 5/29/2015 11:06 AM public
-a--- 5/29/2015 11:06 AM 117 project-tap.i18n
-a--- 5/29/2015 11:06 AM 80 settings.example.json
C:\Users\Rocky\Documents\GitHub\meteor-dapp-cosmo\app [master]> meteor
[[[[[ C:\Users\Rocky\Documents\GitHub\meteor-dapp-cosmo\app ]]]]]
=> Started proxy.
=> Started MongoDB.
=> Errors prevented startup:
While checking for mizzao:[email protected]:
error: No compatible binary build found for this package. Contact the package author and ask them to publish it
for your platform.
=> Your application has errors. Waiting for file change.
Thanks for your response. Hopefully, it will be functioning soon. Did you build this in Visual Studio? If so, what version?
So my questions are: what version of Meteor are you using (cmd: "meteor --version"), and is this a fresh git clone of the Cosmo repository?
Re: Visual Studio, no, it's all done in web friendly, lightweight languages (i.e. HTML, LESS -> CSS and Meteor's built in real-time visual framework).
I will try to do a new git clone and make sure I have the latest repo of Cosmo. Let me know whether my version of Meteor should work?