In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly shows you "how to use docker and docker-compose on EOS local Testnet development", the content is easy to understand, clear, hope to help you solve your doubts, the following let Xiaobian lead you to study and learn "how to use docker and docker-compose in EOS local Testnet development" this article.
The development of the EOS blockchain is not immediate because it requires some non-obvious components that need to be configured and work together.
Nodeos: block generator daemon.
Keosd: the wallet daemon that stores the private key.
Eosio-cpp: intelligent contract compiler.
Eosio.token: the reference tag for the platform.
Cleos: CLI for remote interaction with the EOS blockchain.
Scatter: the EOS wallet configured for the local Testnet.
What will I learn?
How to run and initialize EOS local Testnet.
How to compile and run EOS smart contracts.
How to conduct EOS transactions through cleos.
Request
To learn this tutorial, you need to use the following software:
Ubuntu Linux (recommended)
Docker/docker-compose
Degree of difficulty
Middle
Tutorial content
Dockerfile (the software you need)
Docker-compose.yml (how should the software run)
Cleos, command line EOS wallet.
Deploy eosio.token, that is, the EOS monetary system intelligence contract.
Dockerfile (the software you need).
You can install the following components directly on the Linux operating system, but this will make your development environment cleaner, easier to maintain and test.
All of the following documents are official and issued by EOSIO:
FROM ubuntu:18.04RUN apt-get update & & apt-get install-y curl libicu60 libusb-1.0-0 libcurl3-gnutlsRUN curl-LO https://github.com/EOSIO/eos/releases/download/v1.7.0/eosio_1.7.0-1-ubuntu-18.04_amd64.deb\ & & dpkg-I eosio_1.7.0-1-ubuntu-18.04_amd64.debRUN curl-LO https://github.com/EOSIO/eosio.cdt/releases/ Download/v1.6.1/eosio.cdt_1.6.1-1_amd64.deb\ & & dpkg-I eosio.cdt_1.6.1-1_amd64.debRUN curl-LO https://github.com/EOSIO/eosio.cdt/archive/v1.6.1.tar.gz & & tar-xvzf v1.6.1.tar.gz-- one-top-level=eosio.cdt-- strip-components 1RUN cd / eosio.cdt/ & & curl-LO https://github .com/EOSIO/eosio.contracts/archive/v1.6.0-rc3.tar.gz & & tar-xvzf v1.6.0-rc3.tar.gz-one-top-level=eosio.contracts-strip-components 1
You can use the following command to generate a packaged image sandbox:
Docker build-t my/eos. Docker-compose.yml (how the software should run)
As I said, some configurations are needed to discuss all the required parts with each other.
Default.wallet is a preconfigured wallet with a private key for testing.
Config.ini is a Block Producer (BP) file, and you can't / can't change it in EOS Mainnet.
Version: '3'services: nodeos: container_name: nodeos image: my/eos command: nodeos-e-p eosio-- plugin eosio::producer_plugin-- plugin eosio::history_plugin-- plugin eosio::chain_api_plugin-- plugin eosio::history_api_plugin-- plugin eosio::http_plugin-- http-server-address=0.0.0.0:8888-- access-control-allow-origin=*-- contracts-console-- http-validate-host=false -- filter-on= "*" stop_grace_period: 3m0s volumes: -. /: / eosio.cdt/contract -. / config.ini:/root/.local/share/eosio/nodeos/config/config.ini ports:-'8888 eosio.cdt/contract 8888'-'9830 3m0s volumes 9876' depends_on:-keosd keosd: container_name: keosd hostname: keosd image: my/eos command: keosd- -http-server-address=0.0.0.0:8901-- http-validate-host 0-- verbose-http-errors-- unlock-timeout=9999999 volumes: -. / default.wallet:/root/eosio-wallet/default.wallet expose:-8901 ports:-'8901verbose-http-errors 8901' run
Run the following command in the new terminal:
Docker-compose up
Congratulations! You are generating blocks in EOS Localnet!
The fun of initialization is not over yet, because you still need to deploy smart contracts to get the EOS token currency!
Cleos, command line EOS wallet.
Okay, the EOS blockchain is running, but now we need another terminal to interact with it.
Alias cleos= "docker exec-it nodeos cleos-- url http://127.0.0.1:8888-- wallet-url http://keosd:8901"cleos get info {" server_version ":" 686f0deb "," chain_id ":" cf057bbfb72640471fd910bcb67639c22df9f92470936cddc1ade0e2f2e7dc4f "," head_block_num ": 85," last_irreversible_block_num ": 84," last_irreversible_block_id ":" 000000541c75df656485edb9fb71e898db933c78f685fc7a8d883544d141350d "," head_block_id ":" 0000005580f8983a211e4dcddbb783d6bc962726ef271beeee54b63bd906b5a0 " "head_block_time": "2019-03-30T09:37:33.500", "head_block_producer": "eosio", "virtual_block_cpu_limit": 217493, "virtual_block_net_limit": 1140464, "block_cpu_limit": 199900, "block_net_limit": 1048576, "server_version_string": "v1.7.0"}
As you can see in the output, the latest block is 85, and chain_is is the block used in testnet.
Deploy eosio.token, that is, EOS Monetary system Intelligence contract
There are currently no EOS token, so let's add them
Compile them:
Docker exec-it nodeos bash-c "cd / eosio.cdt/eosio.contracts/contracts/ & & eosio-cpp-I eosio.token/include/-abigen-o eosio.token/src/eosio.token.wasm eosio.token/src/eosio.token.cpp"
Create an eosio.token account and publish a smart contract:
Cleos create account eosio eosio.token EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CVexecuted transaction: d196c673f38085e34815900dd47de8ba030d14ed9d7311a1a173df131281e66a 200 bytes 2568 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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.