near / react-on-chain

Improved execution layer for NEAR decentralized frontend components
https://roc-docs.near.dev/
23 stars 5 forks source link

Use archival rpc calls if the block id is specified #419

Closed pavelisnear closed 1 month ago

pavelisnear commented 1 month ago

If there is a specified block height (block id) the regular rpc call might not always return the component data. Using the archival rpc url resolves this issue.

To test this fix, please make sure you have Enable block height versioning flag set to true in the Dev Tools.

import BlockHeightWithFlagTest from 'near://pavel-pagoda.near/BlockHeightWithFlagTest@115989105';
import BlockHeightWithFlagTestLatest from 'near://pavel-pagoda.near/BlockHeightWithFlagTest';

export default function () {
  return (
    <div>
      <h1>Sandbox with a block height:</h1>
      <BlockHeightWithFlagTest />
      <hr />
      <h1>Sandbox latest:</h1>
      <BlockHeightWithFlagTestLatest />
    </div>
  );
}
image

Fixes https://github.com/near/bos-web-engine/issues/404

vercel[bot] commented 1 month ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
bos-web-engine ✅ Ready (Inspect) Visit Preview Apr 17, 2024 0:29am
bos-web-engine-docs ✅ Ready (Inspect) Visit Preview Apr 17, 2024 0:29am
bos-web-engine-sandbox ✅ Ready (Inspect) Visit Preview Apr 17, 2024 0:29am