日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

EOS:一些必要的知识与常见错误:cloes工具(杂谈)1

發(fā)布時間:2023/12/31 编程问答 29 豆豆
生活随笔 收集整理的這篇文章主要介紹了 EOS:一些必要的知识与常见错误:cloes工具(杂谈)1 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

巨坑,虛擬機掛了。。。。。測試賬戶什么全沒了。重整精神重來,重新整理一下,理出大致框架
nodeos的配置文檔:~./local/share/eosio/nodeos/config
nodeos 重啟后 ./nodeos --hard-replay-blockchain /nodeos --resync
nodeos --replay-blockchain --hard-replay-blockchain

  • [root@bogon config]# cleos --help 文本信息 Command Line Interface to EOSIO Client Usage: cleos [OPTIONS] SUBCOMMANDOptions:-h,--help Print this help message and exit 獲取幫助信息-u,--url TEXT=http://127.0.0.1:8888/the http/https URL where nodeos is running--wallet-url TEXT=unix:///root/eosio-wallet/keosd.sockthe http/https URL where keosd is running-r,--header pass specific HTTP header; repeat this option to pass multiple headers-n,--no-verify don't verify peer certificate when using HTTPS--no-auto-keosd don't automatically launch a keosd if one is not currently running-v,--verbose output verbose actions on error //輸出冗長的錯誤信息--print-request print HTTP request to STDERR //向標準輸出打印http請求--print-response print HTTP response to STDERR //向標準輸出打印http響應Subcommands:version Retrieve version information //檢索版本信息create Create various items, on and off the blockchain //創(chuàng)建,啟動和關閉鏈上的各種項目convert Pack and unpack transactions //打包和解壓交易get Retrieve various items and information from the blockchainset Set or update blockchain statetransfer Transfer EOS from account to accountnet Interact with local p2p network connectionswallet Interact with local walletsign Sign a transactionpush Push arbitrary transactions to the blockchainmultisig Multisig contract commandswrap Wrap contract commandssystem Send eosio.system contract action to the blockchain.

    cleos [OPTIONS] SUBCOMMAND [OPTIONS]選項 SUBCOMMAND子命令

    version :版本
    Subcommands:

    [root@bogon config]# cleos version client Build version: 59626f1e

    a. create:創(chuàng)建賬戶和密鑰對

    [root@bogon config]# cleos create

    輸出:

    Subcommands:key Create a new keypair and print the public and private keys//創(chuàng)建新的密鑰對和打印公鑰和私鑰account Create a new account on the blockchain (assumes system contract does not restrict RAM usage)//創(chuàng)建區(qū)塊鏈上的賬戶(假定系統(tǒng)合約不限制RAM使用)

    1.創(chuàng)建密鑰對

    Cleos create key -h Options:-h,--help Print this help message and exit--r1 Generate a key using the R1 curve (iPhone), instead of the K1 curve (Bitcoin)-f,--file TEXT Name of file to write private/public key output to. (Must be set, unless "--to-console" is passed //將密鑰對生成輸出到文件中--to-console Print private/public keys to console. //在控制臺上顯示

    以–to-console為例:

    [root@bogon config]# cleos create key --to-console

    輸出:

    2.創(chuàng)建賬戶

    [root@bogon config]# cleos create account eosio bob EOS4uUhxvwm1DdDETv2g8NFgVRCZWzChAcciC4ek2tLuu6oBLDbtw

    輸出:

    b.convert

    [root@bogon config]# cleos convert Subcommands:pack_transaction From plain signed json to packed formunpack_transaction From packed to plain signed json formpack_action_data From json action data to packed formunpack_action_data From packed to json action data form

    輸出:

    c.**get:**重要的,用與從區(qū)塊中獲取信息。

    [root@bogon config]# cleos get Subcommands:info Get current blockchain information //獲得當前區(qū)塊的信息block Retrieve a full block from the blockchain //獲得指定區(qū)塊的信息account Retrieve an account from the blockchain //j檢索區(qū)塊鏈中的一個賬戶code Retrieve the code and ABI for an accountabi Retrieve the ABI for an accounttable Retrieve the contents of a database tablescope Retrieve a list of scopes and tables owned by a contractcurrency Retrieve information related to standard currenciesaccounts Retrieve accounts associated with a public keyservants Retrieve accounts which are servants of a given account transaction Retrieve a transaction from the blockchainactions Retrieve all actions with specific account name referenced in authorization or receiverschedule Retrieve the producer scheduletransaction_id Get transaction id given transaction object

    測試:
    1.

    [root@bogon config]# cleos get info {"server_version": "59626f1e","chain_id": "cf057bbfb72640471fd910bcb67639c22df9f92470936cddc1ade0e2f2e7dc4f","head_block_num": 10187,"last_irreversible_block_num": 10186,"last_irreversible_block_id": "000027cadb2dbda86aa16637bc55b775f6f6dda46efb0cfb42198f2bf44498d5","head_block_id": "000027cb90c5b9a60aae26dd83c4a256a2e31fdb9f95f9249f6476f83bcd40d1","head_block_time": "2018-12-08T18:14:54.500","head_block_producer": "eosio","virtual_block_cpu_limit": 200000000,"virtual_block_net_limit": 1048576000,"block_cpu_limit": 199900,"block_net_limit": 1048576,"server_version_string": "v1.4.4-dirty" }
  • [root@bogon config]# cleos get block Positionals:block TEXT The number or ID of the block to retrieve (required) //指定區(qū)塊的ID號Options:--header-state Get block header state from fork database instead//獲取區(qū)塊的頭部狀態(tài)

    輸出:

    block TEXT 指的是 head_block_num,頭部區(qū)塊編號

    [root@bogon config]# cleos get block 10187

    輸出:

  • [root@bogon config]# cleos get account Usage: cleos get account [OPTIONS] name [core-symbol]Positionals:name TEXT The name of the account to retrieve (required)//檢索賬戶的名字core-symbol TEXT The expected core symbol of the chain you are queryingOptions:-j,--json Output in JSON format //以json格式輸出 [root@bogon config]# cleos get account bob

    看到bob的信息

    created: 2018-12-08T18:40:00.500 permissions: owner 1: 1 EOS4uUhxvwm1DdDETv2g8NFgVRCZWzChAcciC4ek2tLuu6oBLDbtwactive 1: 1 EOS4uUhxvwm1DdDETv2g8NFgVRCZWzChAcciC4ek2tLuu6oBLDbtw memory: quota: unlimited used: 2.66 KiB net bandwidth: used: unlimitedavailable: unlimitedlimit: unlimitedcpu bandwidth:used: unlimitedavailable: unlimitedlimit: unlimited

    1.查看區(qū)塊信息
    cleos -u http://127.0.0.1:8888 get info
    輸出:

    …待續(xù)

    總結

    以上是生活随笔為你收集整理的EOS:一些必要的知识与常见错误:cloes工具(杂谈)1的全部內容,希望文章能夠幫你解決所遇到的問題。

    如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。