Skip to content

Commit eda79c4

Browse files
authored
Merge pull request #1 from firstbatchxyz/erhant
micro and compose
2 parents a88cb1d + df3403c commit eda79c4

33 files changed

+8636
-0
lines changed

compose.yaml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
version: "3.8"
2+
3+
services:
4+
# Dria HNSW Rust code
5+
# dria-hnsw:
6+
# build: ./dria_hnsw
7+
# ports:
8+
# - "8080:8080"
9+
10+
# Micro API for HollowDB
11+
micro-api:
12+
build: ./micro_api
13+
ports:
14+
- "3000:3000"
15+
volumes:
16+
- ./config/wallet.json:/app/config/wallet.json
17+
environment:
18+
- REDIS_URL=redis://default:redispw@redis:6379
19+
- CONTRACT_TXID=${CONTRACT_TXID}
20+
depends_on:
21+
- redis
22+
23+
# Redis Container
24+
redis:
25+
image: "redis:alpine"
26+
ports:
27+
- "6379"
28+
volumes:
29+
- "./redis.conf:/app/redis.conf:ro"
30+
command: redis-server /app/redis.conf

dria_hnsw/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
target

micro_api/.dockerignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
test
2+
config
3+
.vscode
4+
.github
5+
.env.example
6+
.gitignore
7+
.mocharc.json

micro_api/.env.example

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# contract to connect to
2+
CONTRACT_TXID=<your-contract>
3+
4+
# Path to the Arweave wallet
5+
WALLET_PATH=<./path/to/wallet.json>
6+
7+
# Redis URL for the caching layer
8+
REDIS_URL=<redis-url>
9+
10+
# Bundlr usage
11+
USE_BUNDLR=false
12+
13+
# Treat values as `hash.txid`
14+
USE_HTX=false
15+
16+
# Warp's log level
17+
WARP_LOG_LEVEL=info
18+
19+
# Batch size
20+
BUNDLR_FBS=40

micro_api/.gitignore

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
node_modules
2+
build
3+
cache
4+
logs
5+
6+
dump.rdb
7+
8+
.vscode
9+
.DS_Store
10+
11+
!src/cache
12+
13+
.env
14+
tmp.md

micro_api/.mocharc.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"extension": ["ts"],
3+
"require": "ts-node/register",
4+
"spec": "test/**/*.ts",
5+
"timeout": 100000,
6+
"exit": true
7+
}

micro_api/Dockerfile

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Using Node 20
2+
FROM node:20
3+
WORKDIR /app
4+
5+
# Install dependencies
6+
COPY package.json /app
7+
COPY yarn.lock /app
8+
RUN yarn install
9+
10+
# Run Micro
11+
COPY . /app
12+
CMD ["npx", "micro", "./build/src/index.js"]
13+
EXPOSE 3000

0 commit comments

Comments
 (0)