EOS tutorial: How to upload the 'Hello World' smart contract

in #eos6 years ago

How to publish smart contracts on EOS

In this tutorial, you will learn how to start an EOS blockchain node on your computer, create a wallet and import keys, open an account, upload the 'hello' contract, and write to it on the blockchain. This tutorial is geared towards beginners just learning how to become blockchain developers.

Here's my screen log so you can follow along.

Open a node to start writing blocks on your own computer:

$ nodeos -e -p eosio --delete-all-blocks --plugin eosio::chain_api_plugin --plugin eosio::history_api_plugin

Run the following commands in a new terminal window.

$ cleos wallet list
$ cleos wallet unlock -n eos-key
$ cleos wallet list
$ cleos create key
$ cleos create key
$ cleos wallet create -n myaccount3
$ cleos wallet import -n myaccount3 PRIVATEKEY1
$ cleos wallet import -n myaccount3 PRIVATEKEY2
$ cleos wallet list keys
$ cleos create account eosio myaccount3 EOS63q35uwVA8wCayPaA3cWWJhxz2atkuYqTAhRvYrejvEYm4Lb9Z EOS5yzvWZHopaG7RXDMuVEbgPuiaiiWtLT59b9Uv55E7oghqpiRHW
$ cleos get account myaccount3
$ cleos set contract myaccount3 ~/eos/build/contracts/hello
$ cleos push action myaccount3 hi '["powderskier"]' -p myaccount3
$ cleos get block 1278

I hope this helps you develop your killer dapp! Please upvote if you enjoy these tutorials and please let me know what I should improve upon to make these more effective tutorials. I'm still a newbie at tutorials and could use the help :)

-Gunnar

Sort:  
 6 years ago  Reveal Comment

Some things are good to put on the BC and some not so much. A website might not be a good choice to publish on the BC to put because we commonly want to update/change website content and blockchains are designed to host immutable information.

It could be worth while to publish your website URL, say at http://your_unique_website_name.com, and then post that URL onto the blockchain. That way, people could lookup your website on the BC and find the exact (and immutable) URL location of your site without worrying of visiting an imitating site. This could prevent website 'spoofing' attacks'. I hope this helps!

You got a 95.59% upvote from @proffit courtesy of @smidge-tv!
2-25% Return on investment. Check steembottracker.com for current status
Minimum 0.01 SBD/STEEM to get upvote , Minimum 1 SBD/STEEM to get upvote + resteem