You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
importArweavefrom"arweave";constarweave=Arweave.init({host: "127.0.0.1",port: 1984,protocol: "http",});(async()=>{// Query the blockheight via GQLletcurrentBlockHeight=awaitgetArweaveBlockheight();console.log(`initial blockHeight: ${currentBlockHeight}`);// Mint 110 blocksfor(leti=0;i<110;i++){awaitarweave.api.get(`mine`);}// Query the blockheight via GQL againcurrentBlockHeight=awaitgetArweaveBlockheight();console.error(`queried blockHeight: ${currentBlockHeight}`);// Now check the blockheight via the info endpointconstresponse=awaitarweave.api.get("");console.log(`actual blockHeight: ${response.data.height}`);console.log("done");})();asyncfunctiongetArweaveBlockheight(): Promise<number>{const queryObject ={query: `query{ blocks(sort: HEIGHT_DESC, first:100 ){ edges{ node{ height } } } }`}constresult=awaitarweave.api.post(`/graphql`,queryObject)constedge=result.data.data.blocks.edges[0];if(edge){const arweaveBlockHeight =edge.node.height;returnarweaveBlockHeight;}return-1;}
running this test with a fresh instance of arlocal produces the following output...
Expected result
A block height GQL query returns the same height as the info endpoint when there are more than 100 blocks.
The text was updated successfully, but these errors were encountered:
running this test with a fresh instance of
![image](https://user-images.githubusercontent.com/3269261/180117051-b94bf8ae-5b46-47c2-b341-09f7f12548dc.png)
arlocal
produces the following output...Expected result
A block height GQL query returns the same height as the info endpoint when there are more than 100 blocks.
The text was updated successfully, but these errors were encountered: