1. Ryler Sturden

    Ryler Sturden Member Staff Member MC Developer

    Since the site is now up in a state which is somewhat manageable I have moved back to developing the node. I am currently finishing up the UDP and P2P networking layers so that they are a lot more efficient and a bit easier to manage going forward, code wise.

    Currently it looks a bit like this.

    UDP NETWORK LAYER <---> GENERIC P2P NETWORK LAYER <----> RULES LAYER (MicroCash)

    The UDP network layer is what connects us to the outside world, using a single UDP socket to send data in and out. Because UDP has no "reliable" transmission feature like TCP does, we also need to implement such a feature here for the messages which have to be "acked" by other nodes.

    The generic P2P network layer is used to handle boilerplate P2P operations which are things like encrypting,joining, disconnecting, pinging, sending transactions/messages, banning misbehaving nodes etc. The reason there is this layer is because this code in the future may be used for other things, like a distributed hash tables (DHT) client or maybe a bittorrent client so I want it rather generic in nature and not bound to only P2P currency.

    The RULES LAYER, which is essentially the MicroCash economy. This layer oversees all the messages to and from nodes and basically makes sure what we call "MicroCash" is actually happening on your node. As might be obvious if you had a different ruleset here, maybe Bitcoin, then we could run a Bitcoin node, provided we also implement a TCP network layer as Bitcoin uses that. So with our already multiple node feature, we support the future possibility to run other cryptocurrencies side by side with the MicroCash network.

    I hope to have Alpha 3 released in a couple of days.
     
    cluck and Julian like this.
  2. Ryler Sturden

    Ryler Sturden Member Staff Member MC Developer

    Gielbier and mishak have done a HTML wallet which essentially clones the Alpha 2 wallet I did. They used semantic UI as the javascript framework, and looking at it, it does seem to offer some nice features. It certainly cleans up a lot of code that looked like spaghetti in my raw javascript version.

    Does anyone have any good ideas about javascript frameworks to use? I think going forward we want something which is easy to update and results in less work on our parts. But I'm unsure of the best approach to take. Whether we build our own framework which does just what we want or whether we use an existing one and deal with its own issues as they come up.
     
    cluck likes this.
  3. fellow

    fellow Member

    Someone told me googles angular framework is one of the fastest and most flexible ones which are almost ready to run.
    I am not aware of the license terms, eg. if you can remove the online dependencies and bundle it with a wallet.

    My first thought about a framework is if it is meant to be used for long term it is always better to create a own one since adjustments to existing stuff is more work if something breaks or does not work out of the box like expected. Beside this it may be best to prototype the wallet with a framework like the semantic ui to get a quick look and feel and then replace it with a custom coded version at some point.

    I think a main advantage of a ready to run framework is that you can target different devices with only minor adjustments (desktop --> mouse based, tablet/phone --> touch based). In a custom framework you require to code such functionality for each device again and again.
     
  4. Ryler Sturden

    Ryler Sturden Member Staff Member MC Developer

    I have started developing our own framework. I'm not sure if we will use it just yet but I want to put a little time into it and see if I can come up with something that is easy to use. From the start it will be "Responsive" and use 2015+ javascript features as I don't care for old browsers at all. Though I think you can easily get some polyfills for pretty much everything which makes old shit work, but I don't want my actual code to be old.

    The only thing I saw that I liked was backbone.js, but it also didn't do some UI stuff I wanted so in the end I thought why not just do exactly what we need to minimize the code. I would probably spend as much time learning these other systems as creating one myself anyhow.
     
  5. GielBier

    GielBier Moderator Staff Member

    Tbh. I really didn't like the semantic ui part, but the controller part and way of interacting with the microcash api is rather good, it creates really readable code to check, and maybe using nodejs and generating it as microcash npm lib, could be a very useful thing. Allowing easier deving.

    - apologies for being a bit absent

    About frameworks, well most if not all frameworks have restrictions which would limit creativity (semanticui total buzzkill). custom framework would allow for more.
     
  6. mishak

    mishak New Member

    Making own framework will be costly and will only distract us from core value which is finishing wallet ASAP.
    We are already using jQuery at this stage and there is no need for creating own framework or being "creative" with UI. Script is structured to have least opinions and allow to easily switch to ReactJS or other framework based on components in future.

    I will write up API calls to RAML so we have at least some formal specification and can communicate changes and new features.
     
    Julian likes this.
  7. Ryler Sturden

    Ryler Sturden Member Staff Member MC Developer

    I liked semantic UI, in theory anyhow. And was about to start using it until semantics own site had issues with its own UI components! I realized that if this was some UI element we were using and it wasn't working like we expected it would just lead to some notion of patching semantic or trying to code around their bugs.

    The other thing I don't like is that there is a weird split in javascript, HTML and CSS usage. I shouldn't have to edit 3 files to add another table of data to the wallet. With responsive web design now pretty much a "standard" on any decent site the whole notion of using some .HTML file at all for the UI is kinda stupid imo. You pretty much have to not care anymore about placement of shit and allow folding and cascading to seamlessly happen. And this can easily be done when you put most of the HTML into the javascript, like React does. Makes it much easier to work on imo.

    The biggest thing I liked about that wallet you guys worked on is the script.js part, and that part isn't really semantic as much as it is raw javascript. I sorta skipped a proper web education on javascript and was using old techniques (even on my sites) that I now see have been put into Javascript. So I put in a way to get "better" inheritance into its objects. And using 2015 javascript allows so much stuff to be done in less time than in the past There are polyfills to get nearly everything I have done working in old browsers so I don't think it will be a problem.

    @mishak - The biggest reason I went this route is because you guys were not active enough and it was slowing down MicroCash development. I understand you guys work full time jobs and have other commitments so it is to be expected! :) . But I don't want to stop you guys working on that version of the wallet because it may end up being better or preferred by most people anyhow, you can just follow my alpha updates and if you have the time update the necessary components. If your wallet is preferred by most people as the launch wallet and you can get it all done by launch I don't have a problem using that one. What I am doing is mainly so I can do alphas and betas in a quicker fashion without having to wait to see the updates.

    I had another reason for doing this and it is because I wanted to get a better education on what is possible now in Javascript and perhaps kill two birds with one stone in regards to mtMOX. After I saw your much improved way of doing Javascript I realized I had a more to learn and I wanted to become better at it.

    So Alpha 3 will take some more time to come out than I initially expected (originally was going to use mishak and gielbiers code), but maybe only by a week. And this will mean my future updates on backend to client will be quicker hopefully too, so save us future time.
     
    Last edited: Mar 25, 2016
  8. Ryler Sturden

    Ryler Sturden Member Staff Member MC Developer

    Also @mishak / @GielBier can you describe you dev environment for web dev? I tried out sublime and it was very nice. I am currently on brackets with a couple addons and the live preview it has makes developing a bit quicker.
     
  9. GielBier

    GielBier Moderator Staff Member

    Well, i'm mostly using sublime for my own projects. But at work, i use atom editor . its bad with larger files. don't output a 100 mb file with urls in it in your working folder :S but it has some nice features and plugins and well netbeans with nodejs plugin ofc.
    I agree on the point of semanticui webpage not being rendered properly. Greyscrollbar, checkboxes not working on all browsers. But a JS module microcash-api.js would be nice.
     
  10. Ryler Sturden

    Ryler Sturden Member Staff Member MC Developer

    Do you use live preview feature much? Does that exist for sublime?
     
  11. roméo

    roméo New Member

  12. GielBier

    GielBier Moderator Staff Member

    Yeah it does exist. (Ctrl-Shift-P; type: Package Control: Install Package and then the View In Browser package. I'm not using it much (because i serve files most of the time from the nodejs httpserver, so ctrl-s and f5 do the trick )
     
  13. Ryler Sturden

    Ryler Sturden Member Staff Member MC Developer

    Live browser + Remote server support is somewhat in Brackets but its not perfect. I didn't try anything in Sublime but from the sounds of that it is local?

    BTW in sublime or whatever, there is usually an option to save when you lose focus, this removes the need to CTRL+S all the time.
     
  14. mishak

    mishak New Member

  15. Ryler Sturden

    Ryler Sturden Member Staff Member MC Developer

    You didn't mention why you like Atom mishak
     
  16. mishak

    mishak New Member

    I like it:
    • plugin system - easy to hack and patch with lot of plugins
    • performance - getting close to Sublime 3 with each minor version
     
  17. Ryler Sturden

    Ryler Sturden Member Staff Member MC Developer

    I have progressed enough on the framework that now logging in and the main screen are replicated on the new framework. It is much easier for me to work on going forward as well which is a bonus. I have to do some more work and pretty it up a bit before I can finish up the node to Alpha 3, but I hope to get that done in the next few days, god willing.
     
    notyep and cluck like this.
  18. Ryler Sturden

    Ryler Sturden Member Staff Member MC Developer

    I have not had as much free time to work on it as I wanted recently. I have progressed more into implementing Alpha 3 API and getting the p2p test completed. The p2p test is actually fully implementing the p2p protocol and the UDP protocol so completing that also means we will have a near full functioning p2p node to play with.

    Things that are taking time atm are having to add in both configuration options and a bit of re-engineering to allow things like the test to use the rest of the framework without adding a lot of boiler plate custom code to do it.
     
    Julian, pineapples and cluck like this.

Share This Page