2

I don't understand how a client works. I try to explain my doubts. Since a client in the classic client-server paradigm is a lightweight application, I don't understand how this application can use the blockchain technologies. A smart contract client is a final user that could use his smartphone to access to contract API. To do this, of course, is impossible to download the blockchain on the smartphone. So, I don't understand how this client can use the smart contract without downloading a BC.

Moreover, web3js (just for citing a library) is only for nodeJS and the initialization downloads the blockchain or there are some mechanisms to avoid the download and run it on a browser like, sorry for the stupid parallelism, Angular or JQuery does? In order to imagine some application on mobile device.

0

Some of what you said is actually right, but you still don't get everything right.

The Contract API you talked about is callable via RPC ( an old method of remote invocation, killed by REST and WebServices ). A library called JSON RPC lets you do that invocation using JS. Web3JS does the same work as JSON RPC but with better abstraction and easy to use methods.

Now, Using Web3JS to call a contract method doesn't need you to download the blockchain at all, the contract is your abstraction.

When a function in a contract is called, the contract runs the code of that function and creates a transaction which will be stored in the blockchain. Thus the only layer, in this case, that interacts with the blockchain behind the contract, is the contract itself.

So no web3 client would need to download the blockchain to use certain contract and its methods. You would understand this better if you follow a simple tutorial and make a working contract.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.