"Blockchain" records the pits encountered in contract development

Source: Internet
Author: User
record the pits encountered in contract development first, the transaction has not been broadcast

Problem: The contract is able to read and write data on the online compiler remix, but fails to write the data on the local private chain and does not have any error prompts.

For example:

> bikeshared.userRentStart.sendTransaction ("0x34ecdbb13d4e58d5c7aa749feaf5c0f660a3d896", 1, {from:user1})
===>
"0x05ba935316952c5d2f727bf665faad6535b7296761d5b06f6e57165885f57bbb"
view:
> Txpool.inspect
{
  pending: {
    0x1b0e770c80eae3bf5a9d85f970c20fcf02b2b63c: {
      61: " 0x3f232c4d9b685754be7ecaf2ea0da154431aeb9a:0 Wei + 90000 gasx18000000000 wei "
    }
  },
  queued: {}
}< c14/>:
{
  pending: {},
  queued: {}
}
===> But the data has not been modified

Reason: Gas and gasprice are too small to drive to the bottom of the big success

> bikeshared.userRentStart.sendTransaction ("0x34ecdbb13d4e58d5c7aa749feaf5c0f660a3d896", 1, {from:user1, gas : 500000, gasprice:3800000000000})
"0x81edba1d917aaa8ea8c9cbfe885dfeec49f81a6a6041b3a4cec40589be8746a9"
Second, BigNumber

Problem: When trying to read a contract in App.js the data times are wrong

Uncaught bignumber error:new BigNumber () not a base number

Reference: Here

There may be a reason: the node is not synchronized. The same thing happens when you point to an address that does not actually implement the API. If the fallback function does not return a string, you will encounter trouble parsing the string. third, Invalid JSON RPC response:undefined

Reference: Here

Cause: Personal.unlock may be used in the code. The personal parameter is not added when the private chain is started

Workaround: Start command-"Personal,db,eth,net,web3,miner"//Add Personal

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.