Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Sign in
issue
issue
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 23
    • Issues 23
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar

新注册的用户请输入邮箱并保存,随后登录邮箱激活账号。后续可直接使用邮箱登录!

  • chainmaker
  • issueissue
  • Issues
  • #492

Closed
Open
Opened Jan 12, 2023 by czp czp@czp

交易结果出现延迟报错,是什么原因?怎么解决?

我在系统中创建了一个链码newchain24,安装了智能合约balancel,在进行交易时,报错,但是查询时发现其还是执行了智能合约,

只是出现了延迟?这样就造成了一个结果就是:我执行了智能合约,有时候会因为延迟而报错,但实际上智能合约还是执行了。

具体现象如下:原先值为500,交易了100,但是报错(此时认为没有进行交易);之后查询,发现已经执行了交易(若此时我再执行一遍,就会多交易了100);

[root@peer0 newcontract]# ./cmc client contract user invoke --contract-name=balance1 --method=Plus --sdk-conf-path=./sdk_config.yml --params={"number":"100"} --sync-result=true

INVOKE contract resp, [code:0]/[msg:OK]/[contractResult:result:"500" gas_used:10203587 ]/[txId:a5fdaaa4de3f470786993e4ff251bd3a753c9d8beba540ef939dfb1fee680afc]

[root@peer0 newcontract]# ./cmc client contract user invoke --contract-name=balance1 --method=Plus --sdk-conf-path=./sdk_config.yml --params={"number":"100"} --sync-result=true

[ERROR] invoke contract failed, get sync result failed, get tx by txId [17e5029cddb64f2497366d2a75e687dfeb52608844b945b799566ed882c3a13f] failed, QUERY_CONTRACT failed, txStatusCode:4, resultCode:1, contractName[CHAIN_QUERY] method[GET_TX_BY_TX_ID] txType[QUERY_CONTRACT], no such transaction, chainId:newchain24

[root@peer0 newcontract]# ./cmc client contract user get --contract-name=balance1 --method=Show --sdk-conf-path=./sdk_config.yml --params={}

QUERY contract resp: message:"SUCCESS" contract_result:<result:"600" gas_used:7725528 > tx_id:"ff6c2e7a6f0043a583b5d3fe30c4e2cd9ee8d0e87a6d4864a4f0fd12f95fb5f4"

这种情况需要怎么解决呢?造成的结果就是我不知道一笔交易是否成功了。

Edited Jan 12, 2023 by czp czp
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
Reference: chainmaker/issue#492

Copyright © 2021 ChainMaker Org. All Rights Reserved. 长安链 版权所有。