0

I'm trying to access either of our additional indices of the accountext table. I'm able to access the 3rd index but I'm not sure how to sort it, the second index returns an empty table:

// this I get no rows from
cleos -u https://nodes.get-scatter.com:443 get table dappservices ......2ke1.o4 accountext --index 2 --key-type sha256

// this returns the account names alphabetically, curious how I can sort this with lower/upper
cleos -u https://nodes.get-scatter.com:443 get table dappservices ......2ke1.o4 accountext --index 3 --key-type i128 --limit 10000

Link to indices: https://github.com/liquidapps-io/zeus-sdk/blob/2b5148a92e601f5d6be54d60baf3feaf89010eca/boxes/groups/dapp-network/dapp-services/contracts/eos/dappservices/dappservices.cpp#L185

Get table row RPC link: https://developers.eos.io/eosio-nodeos/reference#get_table_rows-1


Get scope:

cleos -u https://nodes.get-scatter.com:443 get scope dappservices
{
  "rows": [{
      "code": "dappservices",
      "scope": "......2ke1.o4",
      "table": "accountext",
      "payer": "pnxdev111111",
      "count": 2692
    },{
      "code": "dappservices",
      "scope": "......2ke1.o4",
      "table": "accountext..1",
      "payer": "pnxdev111111",
      "count": 1346
    },{
      "code": "dappservices",
      "scope": "......2ke1.o4",
      "table": "stat",
      "payer": "dappservices",
      "count": 1
    },{
      "code": "dappservices",
      "scope": "......2ke1.o4",
      "table": "statext",
      "payer": "dappservices",
      "count": 1
    },{
      "code": "dappservices",
      "scope": "1111test1111",
      "table": "accounts",
      "payer": "instanttrack",
      "count": 1
    },{
      "code": "dappservices",
      "scope": "13v3jeosdac1",
      "table": "accounts",
      "payer": "joneoswallet",
      "count": 1
    },{
      "code": "dappservices",
      "scope": "13v3jeosdac1",
      "table": "staking",
      "payer": "13v3jeosdac1",
      "count": 2
    },{
      "code": "dappservices",
      "scope": "1hellofadrug",
      "table": "accounts",
      "payer": "lovenotfight",
      "count": 1
    },{
      "code": "dappservices",
      "scope": "1lovehalalll",
      "table": "accounts",
      "payer": "gqydcmrtgege",
      "count": 1
    },{
      "code": "dappservices",
      "scope": "1otthrhy1m3a",
      "table": "accounts",
      "payer": "newdexpocket",
      "count": 1
    }
  ],
  "more": "1ozgoldmaple"
}

Says checksum256 is supported here: https://developers.eos.io/eosio-cpp/docs/db-api

  • Have a similar question. I am actually just trying to be able to query a specific account name from dappservices / accountext. – Brendon Ross Aug 19 '19 at 13:51
0

This article answers this question in detail: https://cmichel.io/how-to-fetch-table-indexes-using-eosjs/


Fetching only the ipfsservice1 services for the helloworld12 account using the composite by_account_service key of the accountext table mentioned in the beginning (account << 64 | service) then requires:

  • Little-endian hex encoding of helloworld12
  • Little-endian hex encoding of the bounds for ipfsservice1
  • Concatenating them in a way that matches the little-endian encoding of the uint128_t

const accountHexLE = getTableBoundsForName(`helloworld12`).lower_bound;
const serviceBounds = getTableBoundsForName(`ipfsservice1`);
const bounds = {
    lower_bound: `0x${serviceBounds.lower_bound}${accountHexLE}`,
    upper_bound: `0x${serviceBounds.upper_bound}${accountHexLE}`,
}
const rows = await fetchRows({
  code: `dappservices`,
  table: `accountext`,
  scope: `DAPP`,
  key_type: `i128`,
  index_position: 3,
  ...bounds,
});

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.