Coder Social home page Coder Social logo

fast-near's People

Contributors

bowenwang1996 avatar chefsale avatar omahs avatar petersalomonsen avatar vgrichina avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

fast-near's Issues

Endpoint `/account/:accountId/data/:keyPattern` returns inconsistent data and `iterator` doesn't work

I'm trying to fetch the most recent state of priceoracle.testnet contract but the response differs from the one that RPC request returns.

How to reproduce:

  1. Make RPC call
  • Request:
curl --location --request POST 'https://rpc.testnet.near.org' \
--header 'Content-Type: application/json' \
--data-raw '{
    "jsonrpc": "2.0",
    "id": "dontcare",
    "method": "query",
    "params": {
        "request_type": "view_state",
        "finality": "final",
        "account_id": "priceoracle.testnet",
        "prefix_base64": "U1RBVEU=" -> "STATE" in base64
    }
}'
  • Response:
[
    {
        "key": "U1RBVEU=",
        "value": "AgAAAABpBAAAAAAAAAACAAAAAGsEAAAAAAAAAAIAAAAAdgIAAAABaQoAAAAAAAAAAgAAAAFrCgAAAAAAAAACAAAAAXZaAAAAEwAAAHByaWNlb3JhY2xlLnRlc3RuZXQAAAAlpAAKi8oiBAAAAAAA"
    }
]
  1. Make Fast-Near HTTP call:
  • Request:
curl --location --request GET 'https://rpc.web4.testnet.page/account/priceoracle.testnet/data/STATE?encoding=base64'
  • Response:
{
    "data":
    [
     ..996 elements
    ],
    "iterator": "02643a70726963656f7261636c652e746573746e65743a535441544507e78d04"
}
  1. Compare the results:
    The value AgAAAABpBAAAAAAAAAACAAAAAGsEAAAAAAAAAAIAAAAAdgIAAAABaQoAAAAAAAAAAgAAAAFrCgAAAAAAAAACAAAAAXZaAAAAEwAAAHByaWNlb3JhY2xlLnRlc3RuZXQAAAAlpAAKi8oiBAAAAAAA returned from the RPC call is missing within Fast-Near's response.

Also i've tried to supply the iterator param in order to fetch the next page but the response is 1:1 the same as without iterator(it seems like the response is cached but not refetched).

https://rpc.web4.testnet.page/account/priceoracle.testnet/data/STATE?encoding=base64&iterator=02643a70726963656f7261636c652e746573746e65743a535441544507e78d04

The first argument must be of type string or an instance of Buffer, ArrayBuffer, or Array or an Array-like Object. Received undefined

While this works fine with regular RPC, it does not when using fastrpc.

http post https://fastrpc.mainnet.near.org jsonrpc=2.0 id=dontcare method=query \
  params:='{
    "request_type": "call_function",
    "block_id": 55759972,
    "method_name": "web4_get",
    "account_id": "psalomo.near",
    "args_base64": "eyJyZXF1ZXN0IjogeyJwYXRoIjogIi9uZnRpbWFnZS8xLnN2ZyJ9fQ=="
    }'

returns:

HTTP/1.1 400 Bad Request
Content-Length: 140
Date: Thu, 23 Dec 2021 14:02:49 GMT
Server: Google Frontend
X-Cloud-Trace-Context: f5e95c019083877c5ecafe93fa8847ca;o=1
content-type: text/plain; charset=utf-8

Error: The first argument must be of type string or an instance of Buffer, ArrayBuffer, or Array or an Array-like Object. Received undefined

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.