1

I am trying to get all the insert data using get table on jungle testnet. But I was failed and get only an empty row value.

command:

cleos --url https://jungle3.cryptolions.io:443 get table tulsipadalia addressbook people

Output:

{
  "rows": [],
  "more": false,
  "next_key": "",
  "next_key_bytes": ""
}

Can anyone guide me?

1

The reason is because the scope of the table you gave is incorrect.

You specified that the scope is addressbook, but there are no table entries under that name.

If you type the following command, you can see the valid choices for scope on a particular table:

cleos --url https://jungle3.cryptolions.io:443 get scope tulsipadalia -t people

Which provides the output:

{
  "rows": [{
      "code": "tulsipadalia",
      "scope": "tulsipadalia",
      "table": "people",
      "payer": "awsdwesasw12",
      "count": 2
    }
  ],
  "more": ""
}

From this you can see that the scope required is the same as the contract name, so if you change your command to:

cleos --url https://jungle3.cryptolions.io:443 get table tulsipadalia tulsipadalia people

Then you will get the expected output:

{
  "rows": [{
      "key": "awsdwesasw12",
      "first_name": "alice",
      "last_name": "liddel77l",
      "age": 12377,
      "street": "123 drink me way",
      "city": "wonderland",
      "state": "amsterdam"
    }
  ],
  "more": false,
  "next_key": "",
  "next_key_bytes": ""
}

If you were actually expecting this to be in the scope of address book, then you need to make changes in your smart contract directly. Specifically in the constructor to the multi index table, you should pass in the 2nd argument of "addressbook"_n.value.

2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.