-
Notifications
You must be signed in to change notification settings - Fork 31
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
0 parents
commit 56ec70b
Showing
59 changed files
with
8,863 additions
and
0 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,4 @@ | ||
CHANGELOG.md | ||
coverage | ||
node_modules | ||
npm-debug.log |
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,24 @@ | ||
# Symbol names of tokens to index from ord indexer | ||
DRC_20_SYMBOLS=drc-20 | ||
# The block until which the startup mode should run | ||
START_BLOCK=4753897 | ||
# The block with first shibescription https://wonky-ord.dogeord.io/shibescription/15f3b73df7e5c072becb1d84191843ba080734805addfccb650929719080f62ei0 | ||
# This is the value for Dogecoin mainnet | ||
STARTUP_BLOCK=4609723 | ||
# The last block to index (mainly for testing, development) | ||
END_BLOCK=9712647 | ||
# The base url of the ord indexer | ||
ORDINALS_BASE_URL=https://wonky-ord.dogeord.io | ||
# false = startup mode, true = daemon mode | ||
DAEMON=false | ||
|
||
# Redis settings | ||
# You can use a redis socket or a redis url | ||
USE_REDIS_SOCK=false | ||
REDIS_PATH=/var/run/redis/redis-server.sock | ||
REDIS_URL=redis://127.0.0.1:6379 | ||
|
||
# How many blocks behind the chain should the indexer be | ||
SLOW_DOWN_MODE_BLOCK_COUNT=100 | ||
# Set to true to slow down the indexer to cover reorgs | ||
SLOW_DOWN_MODE=false |
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,113 @@ | ||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
lerna-debug.log* | ||
|
||
# Diagnostic reports (https://nodejs.org/api/report.html) | ||
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json | ||
|
||
# Runtime data | ||
pids | ||
*.pid | ||
*.seed | ||
*.pid.lock | ||
|
||
# Directory for instrumented libs generated by jscoverage/JSCover | ||
lib-cov | ||
|
||
# Coverage directory used by tools like istanbul | ||
coverage | ||
*.lcov | ||
|
||
# nyc test coverage | ||
.nyc_output | ||
|
||
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) | ||
.grunt | ||
|
||
# Bower dependency directory (https://bower.io/) | ||
bower_components | ||
|
||
# node-waf configuration | ||
.lock-wscript | ||
|
||
# Compiled binary addons (https://nodejs.org/api/addons.html) | ||
build/Release | ||
|
||
# Dependency directories | ||
node_modules/ | ||
jspm_packages/ | ||
|
||
# TypeScript v1 declaration files | ||
typings/ | ||
|
||
# TypeScript cache | ||
*.tsbuildinfo | ||
|
||
# Optional npm cache directory | ||
.npm | ||
|
||
# Optional eslint cache | ||
.eslintcache | ||
|
||
# Microbundle cache | ||
.rpt2_cache/ | ||
.rts2_cache_cjs/ | ||
.rts2_cache_es/ | ||
.rts2_cache_umd/ | ||
|
||
# Optional REPL history | ||
.node_repl_history | ||
|
||
# Output of 'npm pack' | ||
*.tgz | ||
|
||
# Yarn Integrity file | ||
.yarn-integrity | ||
|
||
# dotenv environment variables file | ||
.env | ||
.env.test | ||
.env.btc | ||
.env.doge | ||
.env.btc.* | ||
.env.doge.* | ||
|
||
# parcel-bundler cache (https://parceljs.org/) | ||
.cache | ||
|
||
# Next.js build output | ||
.next | ||
|
||
# Nuxt.js build / generate output | ||
.nuxt | ||
dist | ||
|
||
# Gatsby files | ||
.cache/ | ||
# Comment in the public line in if your project uses Gatsby and *not* Next.js | ||
# https://nextjs.org/blog/next-9-1#public-directory-support | ||
# public | ||
|
||
# vuepress build output | ||
.vuepress/dist | ||
|
||
# Serverless directories | ||
.serverless/ | ||
|
||
# FuseBox cache | ||
.fusebox/ | ||
|
||
# DynamoDB Local files | ||
.dynamodb/ | ||
|
||
# TernJS port file | ||
.tern-port | ||
|
||
# Google API auth credentials file | ||
credentials.json | ||
|
||
.idea |
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,4 @@ | ||
#!/usr/bin/env sh | ||
. "$(dirname -- "$0")/_/husky.sh" | ||
|
||
npx lint-staged |
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,3 @@ | ||
# Ignore artifacts: | ||
build | ||
coverage |
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 @@ | ||
{} |
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,21 @@ | ||
FROM node:18-alpine AS build | ||
|
||
# Create App dir | ||
RUN mkdir -p /app | ||
|
||
# Set working directory to App dir | ||
WORKDIR /app | ||
|
||
# Copy project files | ||
COPY . . | ||
|
||
RUN cp .env.example .env | ||
|
||
# Install deps | ||
RUN npm install && npm install -g typescript && npm run build | ||
|
||
FROM node:18-alpine as app | ||
|
||
COPY --from=build /app . | ||
|
||
WORKDIR /app |
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,49 @@ | ||
# Verydogelabs DRC-20 Indexer | ||
|
||
The Verydogelabs DRC-20 Indexer is an advanced software tool that enables users to efficiently index DRC-20 tokens using two different modes. It is designed to work seamlessly with the Ord Indexer, providing robust and reliable indexing performance. | ||
|
||
## Modes | ||
|
||
This tool operates in two modes: | ||
|
||
1. **Startup Mode**: This mode is optimized for rapid data acquisition from the Ord Indexer. It does not execute the generation of inscription transfers nor does it initiate any DRC-20/Doge-20 indexing tasks. | ||
2. **Daemon Mode**: This mode allows all tasks to run continuously, ensuring constant indexing. | ||
|
||
## Usage | ||
|
||
Here are the recommended steps to use the DRC-20 Indexer: | ||
|
||
1. Run the startup mode (**DAEMON=false**) until the specified startup block is reached. | ||
2. Switch to daemon mode by setting **DAEMON=true** in the environment variables. | ||
3. Optionally, set **SLOW_DOWN_MODE=true** to reduce the indexing speed in order to accommodate for any potential blockchain reorganizations. | ||
|
||
## Environment Variables | ||
|
||
Here is a list of the environment variables used by the DRC-20 Indexer along with their explanation and example values. | ||
|
||
```shell | ||
# Symbol names of tokens to index from ord indexer | ||
DRC_20_SYMBOLS=drc-20 | ||
# The block until which the startup mode should run | ||
START_BLOCK=4753897 | ||
# The block with first shibescription https://wonky-ord.dogeord.io/shibescription/15f3b73df7e5c072becb1d84191843ba080734805addfccb650929719080f62ei0 | ||
# This is the value for Dogecoin mainnet | ||
STARTUP_BLOCK=4609723 | ||
# The last block to index (mainly for testing, development) | ||
END_BLOCK=9712647 | ||
# The base url of the ord indexer | ||
ORDINALS_BASE_URL=https://wonky-ord.dogeord.io | ||
# false = startup mode, true = daemon mode | ||
DAEMON=false | ||
|
||
# Redis settings | ||
# You can use a redis socket or a redis url | ||
USE_REDIS_SOCK=true | ||
REDIS_PATH=/var/run/redis/redis-server.sock | ||
REDIS_URL=redis://127.0.0.1:6379 | ||
|
||
# How many blocks behind the chain should the indexer be | ||
SLOW_DOWN_MODE_BLOCK_COUNT=100 | ||
# Set to true to slow down the indexer to cover reorgs | ||
SLOW_DOWN_MODE=false | ||
``` |
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,15 @@ | ||
version: "3.1" | ||
|
||
services: | ||
cache: | ||
image: redis:7-alpine | ||
restart: always | ||
ports: | ||
- "6379:6379" | ||
command: redis-server --maxmemory 4294967296 --maxmemory-policy allkeys-lru --tracking-table-max-keys 100000 --save 20 1 --loglevel warning --requirepass 123456 | ||
volumes: | ||
- cache:/data | ||
|
||
volumes: | ||
cache: | ||
driver: local |
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,11 @@ | ||
version: "3.8" | ||
services: | ||
indexer: | ||
build: . | ||
working_dir: /app | ||
restart: always | ||
env_file: | ||
- .env | ||
command: npm run start | ||
volumes: | ||
- /var/run/redis/redis-server.sock:/var/run/redis/redis-server.sock:rw |
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,12 @@ | ||
[Unit] | ||
Description=Reorg Watcher | ||
After=network.target | ||
|
||
[Service] | ||
ExecStart=/bin/bash -c "exec /<dir-where-this-repo-is>/d20-indexer/scripts/reorg_watcher.sh" | ||
WorkingDirectory=/<dir-where-this-repo-is>/d20-indexer/scripts | ||
StandardOutput=append:/var/log/reorg-watcher.log | ||
StandardError=append:/var/log/reorg-watcher.log | ||
|
||
[Install] | ||
WantedBy=default.target |
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,8 @@ | ||
module.exports = { | ||
roots: ["<rootDir>/src"], | ||
transform: { | ||
"^.+\\.tsx?$": "ts-jest", | ||
}, | ||
testRegex: "(/__tests__/.*|(\\.|/)(test|spec))\\.tsx?$", | ||
moduleFileExtensions: ["ts", "tsx", "js", "jsx", "json", "node"], | ||
}; |
Oops, something went wrong.