Skip to content

Commit

Permalink
fix: head for follow chain stream was not being updated (#31)
Browse files Browse the repository at this point in the history
  • Loading branch information
jowparks authored Aug 31, 2023
1 parent 9c51649 commit 2f54e75
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
NODE_HOST=node.domain.com
NODE_PORT=8020
NODE_AUTH_TOKEN=your-auth-token
BUILD_CACHE=true
CACHE_PATH=./block-cache
4 changes: 2 additions & 2 deletions src/cache/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@ class LightBlockCache {
}

async cacheBlocks(): Promise<void> {
const head = await this.get("head");
const rpc = await ifClient.getClient();
const followChainStreamParams = head ? { head: head.toString() } : {};

// eslint-disable-next-line no-constant-condition
while (true) {
const head = await this.get("head");
const followChainStreamParams = head ? { head: head.toString() } : {};
const stream = await rpc.chain.followChainStream({
...followChainStreamParams,
serialized: true,
Expand Down

0 comments on commit 2f54e75

Please sign in to comment.