Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to implement HelloWorld with Intelligent contract on EOS Block chain platform

2025-04-03 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly explains how to realize HelloWorld by EOS blockchain platform smart contract. Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Let's let Xiaobian take you to learn how to realize HelloWorld by EOS blockchain platform smart contract!

Running nodeos

To authenticate with Hello World logs, run it with the contracts-console option.

nodeos --contracts-console

Generate smart contracts

Let's try accessing the EOS directory from a different new terminal (other than the nodeos terminal), creating a folder called Hello. The order reads as follows:

$ cd eos$ cd mkdir hello$ cd hello

Then, create a hello.cpp file and copy the following example. Hello contract inherits the contract provided by EOS.IO and has the function of printing the username Hello.

compiled code

For the first command, let's compile the code with WebAssembly. At compile time, a warning may be prompted (but we can ignore it).

For the second command, let's create an ABI.

# Compile webaassemblyeosiocpp -o hello.wast hello.cpp# Creating abieosiocpp -g hello.abi hello.cpp Account creation and contract publishing

Create an account called Hello.Code. We will use this account to publish Hello contracts further.

Publish the contract with cleos set contract ${account} ${path} -p ${permutation}.

$ cleos create account eosio hello.code EOS8QMGRoRPZ4uf3w8WACcrg3wKzLtXpCk5Gpia6pdFzSuftLigWT EOS8QMGRoRPZ4uf3w8WACcrg3wKzLtXpCk5Gpia6pdFzSuftLigWTexecuted transaction: e6847fc85c7733dd70a9ff27c2cad98ea0b50fb6c80c2b0c7ea1bf64f9917916 200 bytes 225 us# eosio

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report