mirror of
https://github.com/selfxyz/self.git
synced 2026-04-05 03:00:53 -04:00
merkle_tree for ofac data
This commit is contained in:
1
registry/outputs/passport_tree.json
Normal file
1
registry/outputs/passport_tree.json
Normal file
File diff suppressed because one or more lines are too long
13
registry/src/ofac/build_merkle_tree_ofac.ts
Normal file
13
registry/src/ofac/build_merkle_tree_ofac.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
import * as fs from 'fs';
|
||||
import { buildPassTree} from '../../../common/src/utils/passportTree'
|
||||
|
||||
async function passport() {
|
||||
const passports = JSON.parse(fs.readFileSync("../common/ofacdata/passport.json") as unknown as string)
|
||||
const tree = buildPassTree(passports);
|
||||
|
||||
const serializedTree = tree.nodes.map(layer => layer.map(node => node.toString()));
|
||||
fs.writeFileSync("outputs/passport_tree.json", JSON.stringify(serializedTree));
|
||||
console.log("passport_tree.json written and copied in common/pubkeys!")
|
||||
}
|
||||
|
||||
passport()
|
||||
Reference in New Issue
Block a user