Monday, August 13, 2018

Serverless Architectures

Serverless Architectures 


SA are new approach to application designs. This is hot topic in the software architecture world right now. All "Big Three" (Amazon, Google, Microsoft) are heavily investing in "Serverlessnes" right now.

What is it?

Unlike traditional architectures (where application run on server) it’s run in stateless compute containers that are event-triggered, ephemeral (may only last for one invocation), and fully managed by a third party. These are typically “rich client” applications—think single-page web apps, or mobile apps. These apps use vast ecosystem of cloud-accessible databases authentication services (e.g., Auth0, AWS Cognito), and so on. But if you need computation, you can use for example AWS Lambdas or Azure Functions.

Upsides and downsides

Upsides:

  • No need for system administration (everything is handled by third party)
  • Decreases complexity of your product
  • Natively micro service architecture. 
  • Lesser cost to scale.
  • Elasticity - native scaling 
  • Smaller development and operational costs
  • Decrease time to market

Downsides:

  • Debugging and monitoring is still and issue.
  • Tooling is not there quite yet.
  • Cold start issues.





Tuesday, March 27, 2018

Truffle execute external script call contract function

errors:

 * Error: VM Exception while processing transaction: out of gas
 * Error: Cannot create instance of YourContract; no code at address
 * Error: sender account not recognized
 * Error: invalid address

If you get some of these errors while trying to execute contract function from truffle script, here is proper way to do it:

Monday, March 26, 2018

Truffle external scripts working example

If you getting errors bellow while trying to execute your truffle external script continue to read.

errors:

TypeError: Cannot read property 'apply' of undefined 

exception at require.js:128:1 

TypeError: fn is not a function 

For some reason it was quite difficult to find solution how to run external script. After some time I finally have figure it out so I'm sharing it with world:


Thursday, March 22, 2018

Smart Contracts and Ethereum solidity

WHAT ARE SMART CONTRACTS?

I have opportunity to work on interesting smart contract project. In that respect I decided that I will write something about this _hot topic on my blog. So, what's smart contract anyways?

In 1994, Nick Szabo, a legal scholar, and cryptographer, realized that the decentralized ledger could be used for smart contracts, otherwise called self-executing contracts, blockchain contracts, or digital contracts. In this format, contracts could be converted to computer code, stored and replicated on the system and supervised by the network of computers that run the blockchain. This would also result in ledger feedback such as transferring money and receiving the product or service.

Smart contracts help you exchange money, property, shares, or anything of value in a transparent, conflict-free way while avoiding the services of a middleman.

Can laws be written on smart contacts. What world would that be? Programmers will become lawyers? Imagine code reviews and testing on that contracts.

HOW ARE THIS CONTRACT EXECUTED


Most smart contracts written today are based on Ethereum blockchain. Ethereum blockchain is world computer that can execute smart contracts. Smart contracts are written in language called Solidity (current version is: 0.4.21). Most popular framework to work with smart contract is called Truffle. Contracts are serving as back-end for application, and front-end is written using web3. Web3 is new way of building web apps called decentralized web. Basically there is no classical back-end, only front-end with decentralized smart contracts.