-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
56 changed files
with
6,261 additions
and
2,579 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
name: Deploy to GitHub Pages | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
build-and-deploy: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: '18' | ||
|
||
- run: | | ||
find . | ||
pwd | ||
- name: Install dependencies | ||
run: npm install | ||
working-directory: ./ui | ||
|
||
- name: Build | ||
run: | | ||
pwd | ||
npm run build | ||
working-directory: ./ui | ||
|
||
- name: Deploy | ||
uses: JamesIves/[email protected] | ||
with: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
BRANCH: gh-pages | ||
FOLDER: ./ui/build | ||
CLEAN: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ | ||
"name": "analysis", | ||
"type": "module", | ||
"version": "1.0.0", | ||
"description": "", | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
}, | ||
"keywords": [], | ||
"author": "", | ||
"license": "ISC", | ||
"devDependencies": { | ||
"@types/node-fetch": "^2.6.9", | ||
"typescript": "^5.3.3" | ||
}, | ||
"dependencies": { | ||
"node-fetch": "^3.3.2" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
export const DEFAULT_RPC = "https://tezos.marigold.dev"; | ||
export const TZKT_API = "https://api.tzkt.io/v1"; | ||
export const OUTPUT_PATH = "../chart/src/data" | ||
export const TEMP_FOLDER_PATH = "../tmp" | ||
export const OVERWRITE = true; | ||
|
||
export const VERSIONS : Record<string, string> = { | ||
"471411811": "0.0.6", | ||
"-1526481454": "0.0.8", | ||
"735333822": "0.0.9", | ||
"2102290129": "0.0.10", | ||
"521053333": "0.0.11", | ||
"793087855": "0.0.11b", | ||
"-426350137": "0.1.1", | ||
"1358594366": "0.3.0", | ||
"46756700": "0.3.1", | ||
"-1892417854": "0.3.2", | ||
"1866000220": "0.3.3", | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import { TEMP_FOLDER_PATH, TZKT_API, VERSIONS } from './context/config'; | ||
import { fetchWithRetry } from './util'; | ||
import * as fs from 'fs'; | ||
import * as path from 'path'; | ||
|
||
const allVersion = () => Object.keys(VERSIONS).join(","); | ||
const tempFolderPath = path.join(TEMP_FOLDER_PATH, 'contracts'); | ||
|
||
const fetchContracts = async () => { | ||
if (!fs.existsSync(tempFolderPath)) { | ||
fs.mkdirSync(tempFolderPath, { recursive: true }); | ||
} | ||
|
||
let offset = 0; | ||
let shouldContinue = false; | ||
const limit = 100; | ||
|
||
do { | ||
const query = `${TZKT_API}/contracts?codeHash.in=${allVersion()}&limit=${limit}&offset=${offset}&sort.desc=lastActivity&includeStorage=true`; | ||
const result = await fetchWithRetry(query); | ||
|
||
if (result && result.length > 0) { | ||
const filePath = path.join(tempFolderPath, `contracts_${offset}.json`); | ||
fs.writeFileSync(filePath, JSON.stringify(result, null, 2)); | ||
console.log(`Data written to ${filePath}`); | ||
|
||
shouldContinue = result.length === limit; | ||
offset += 1; | ||
} else { | ||
shouldContinue = false; | ||
} | ||
} while (shouldContinue); | ||
}; | ||
|
||
fetchContracts().catch(console.error); | ||
console.log('Finish fetching all contracts'); | ||
|
Oops, something went wrong.