Hacker News new | ask | show | jobs
by smuemd 3113 days ago
You have to conceptualise ethereum as a market communication bus to exchange business information between autonomously acting market partners. Nothing more nothing less.

Smart contracts encapsulate market logic, i. e. the stuff where market partners have a need to verify that the information (or value) shared was/is processed exactly as specified.

The key insight is to limit your utilisation of smart contracts to this type of application. You want to keep your smart contract super simple and focused on doing only one thing. Also note that marktet logic is almost always just a tiny fraction of the overall business logic of whatever you are building. So there will always be this other place where you develop the rest of your app with more traditional means (e. g. Javascript)

To integrate the blockchain powered market communication bit into your app, you simply wrap your deployed smart contracts into a software wallet such as ethters.js. This makes the solidity methods available in you application as simple js functions via dot notation for example.

Here is an implementation of this: https://github.com/energychain/StromDAO-BusinessObject

you can just `require` the business object in you app and have access to 30 or so smart contracts that fire into a PoA blockchain network called Fury. Its actually quite simple. Take a look at the tests in the github repository. You can even trigger smart contract factories to mint your own preconfigured contracts if need be.

Here is an other example. A subset of the same smart-contracts but implemented withing a command line tool:

https://github.com/energychain/BusinessObject-MeterPointOper...

What you end up with then is a rather traditional app that 'composes' smart contracts to read and write stuff into/out of a blockhain network where appropriate.