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 Answer 1

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
  • Hamnett, Thank you! its works for me. Jan 8, 2021 at 8:44
  • Cool. Be sure to accept and upvote answers that are helpful to you :) Jan 8, 2021 at 8:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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