0

When I send a transaction to BC, I get some error information which is

Status not available at the moment."

What does this mean? How can I fix this problem?

My Solidity contract code is as following:

  function UserRegister(string memory userName,uint feiyong ) public payable returns(string memory isOK){
       if (bytes(users[userName].name).length==0){
           
           users[userName].name=userName;
           emit UserRegisterEVENT(msg.sender,"registered");
           return ("registered");
       }
       else
       {
           emit UserRegisterEVENT(msg.sender,"UserName has been registered");
           return("UserName has been registered");
       }
    }
    function getUserRegistered(string memory xyz) public view returns (bool non)
    {
        
          if (bytes(users[xyz].name).length==0){
              
              return false;
          }
          else
          {
              return true;
          }
    }

and my web3 client code is:

    var userReg=contract1.methods.UserRegister("LYQ",100).send({from:'0x18244fbf3b47175cd6b4a1183a476c9e70cb7368',gas:900000})  
.on('transactionHash', function(hash){
    
    console.log("hash="+hash); 
    
})
.on('confirmation', function(confirmationNumber, receipt){
   
   //console.log("confirmation number="+confirmationNumber);
})
.on('receipt', function(receipt){
    
    console.log("receipt="+receipt[0][0]);
    } )
.on('error',function(error){
    
    console.log("error="+error);
})
.on('catch',function(error) {
    console.log("error="+error);
    
});
console.log("userEeg="+userReg);
var userName="LYQ";
var xyz= contract1.methods.getUserRegistered(userName).call( (error, result) => {
    if(error)
        console.log("error="+error);
    else
        console.log("result="+result);
} );

and when I execute the code, the getUserRegistered returned false. and when the send function is executed, the remix get the following log:

 status      Status not available at the moment
 transaction hash   0x1e484dfa3afbbeadbcd1db20c38ef0427f8cf4ab04344045c0f10d24f1055a02
 from   0x18244fbf3b47175cd6b4a1183a476c9e70cb7368
 to     WoTResourceACL.UserRegister(string,uint256) 0x3944fb3e4f97b149689dbf9b1e83d8bd361f02ef
 gas    900000 gas 
 hash   0x1e484dfa3afbbeadbcd1db20c38ef0427f8cf4ab04344045c0f10d24f1055a02
 input  0x39c...00000
 decoded input  {
    "string userName": "LYQ",
    "uint256 feiyong": {
        "_hex": "0x64"
    }
}
 decoded output      - 
 logs   [
    {
        "from": "0x3944fb3e4f97b149689dbf9b1e83d8bd361f02ef",
        "topic": "0x27948276c58d5b63b61d92a95fe3cf7e2d6cf9c00ecdddac43cbe4a492a011e2",
        "event": "UserRegisterEVENT",
        "args": {
            "0": "0x18244fBF3B47175cD6b4a1183A476c9e70cB7368",
            "1": "registered",
            "myaddr": "0x18244fBF3B47175cD6b4a1183A476c9e70cB7368",
            "result": "registered",
            "length": 2
        }
    }
]
 value  0 wei 
TylerH
  • 20,799
  • 66
  • 75
  • 101
HeiHei
  • 11
  • 3
  • Which network that you're using? Private blockchain? – Zulhilmi Zainudin Aug 23 '19 at 10:48
  • yes, on one laptop by using geth. – HeiHei Aug 23 '19 at 11:25
  • Grab all lines starts with `eip` inside this `params` block and try adding it inside your private blockchain _genesis.json_ file. If you're on Geth, you need to nuke the network and start all over again. If you're on Parity (means if you have _spec.json_ file), you can just edit without nuking the network and starting over. https://github.com/paritytech/parity-ethereum/blob/master/ethcore/res/instant_seal.json#L15 – Zulhilmi Zainudin Aug 23 '19 at 15:38

1 Answers1

0

@HeiHei @Zulhilmi Zainudin I have encountered the same issue. I have tried Zulhilmi Zainudin's method, but not work for me. At last I found a way to make it work on my side. I post it here hope can be helpful for others. I have added following lines into genesis.json file, and recreate the private chain, and it works.

"homesteadBlock": 0,
"eip155Block": 0,
"eip158Block": 0,
"eip150Block": 0,
"byzantiumBlock": 0,
"constantinopleBlock": 0,
"petersburgBlock": 0
Bob Wang
  • 1
  • 1