Skip to content

vikiival/squidtegrity

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Squid Data integrity tester

Checks if the data from two squid instances are the same.

Usage

Important

You need Deno installed.

  1. Load original data to KV store:

Important

you JSON entities must contain id field.

Note

Code expects file named load.json

deno task load
  1. Write a sampler function to unify the data

Note

Tou can find these lines in main.ts file L#10-11

const sampleFn = sampleSample
type Sample = ReturnType<typeof sampleFn>

// Sample function
function sampleSample(item: any) {
  return {
    id: item.id,
    name: item.name,
    // note that fields needs to be in the item
    nft_count: item.nft_count,
    count: item.count,
    equal: item.equal
  }
}
  1. Check if data is the same

Note

Code expects file names test.json

deno task start
  1. Understading the output

Note

[Diff] Actual / Expected

  • Green data (Expected) are from load.json
  • Red data (Actual) are from test.json
    {
      count: 9,
-     equal: true,
+     equal: false,
      id: "0xb67bedc5e80a7913b92da0a56fc8aba6c1273a6a",
      name: "strigae",
-     nft_count: 9,
+     nft_count: 7,
    }

About

Integrity of squid data against two DBs

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published