Skip to content

Commit

Permalink
merge main
Browse files Browse the repository at this point in the history
  • Loading branch information
manlikeHB committed Sep 1, 2024
2 parents fc474da + 385fb5d commit 0736b6c
Show file tree
Hide file tree
Showing 196 changed files with 9,372 additions and 1,936 deletions.
9 changes: 9 additions & 0 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,15 @@
"contributions": [
"code"
]
},
{
"login": "PoulavBhowmick03",
"name": "Poulav Bhowmick",
"avatar_url": "https://avatars.githubusercontent.com/u/133862694?v=4",
"profile": "https://poulav.vercel.app/",
"contributions": [
"code"
]
}
],
"contributorsPerLine": 7,
Expand Down
20 changes: 13 additions & 7 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
[submodule "onchain/lib/kakarot-rpc"]
path = onchain/lib/kakarot-rpc
url = https://github.com/kkrt-labs/kakarot-rpc
[submodule "onchain/solidity_contracts/lib/forge-std"]
[submodule "onchain/lib/kakarot-rpc"]
path = onchain/lib/kakarot-rpc
url = https://github.com/kkrt-labs/kakarot-rpc
[submodule "onchain/solidity_contracts/lib/forge-std"]
path = onchain/solidity_contracts/lib/forge-std
url = https://github.com/foundry-rs/forge-std
[submodule "onchain/solidity_contracts/lib/kakarot-lib"]
path = onchain/solidity_contracts/lib/kakarot-lib
url = https://github.com/kkrt-labs/kakarot-lib
[submodule "onchain/solidity_contracts/lib/kakarot-lib"]
path = onchain/solidity_contracts/lib/kakarot-lib
url = https://github.com/kkrt-labs/kakarot-lib
[submodule "onchain/solidity_contracts/lib/openzeppelin-contracts-upgradeable"]
path = onchain/solidity_contracts/lib/openzeppelin-contracts-upgradeable
url = https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable
[submodule "onchain/solidity_contracts/lib/openzeppelin-contracts"]
path = onchain/solidity_contracts/lib/openzeppelin-contracts
url = https://github.com/OpenZeppelin/openzeppelin-contracts
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"deno.enable": true
}
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
<td align="center" valign="top" width="14.28%"><a href="https://github.com/manlikeHB"><img src="https://avatars.githubusercontent.com/u/109147010?v=4?s=100" width="100px;" alt="Yusuf Habib"/><br /><sub><b>Yusuf Habib</b></sub></a><br /><a href="https://github.com/AFK-AlignedFamKernel/afk_monorepo/commits?author=manlikeHB" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://isaaconyemaechi.tech/"><img src="https://avatars.githubusercontent.com/u/116242877?v=4?s=100" width="100px;" alt="Isaac Onyemaechi Ugwu"/><br /><sub><b>Isaac Onyemaechi Ugwu</b></sub></a><br /><a href="https://github.com/AFK-AlignedFamKernel/afk_monorepo/commits?author=Dprof-in-tech" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/EjembiEmmanuel"><img src="https://avatars.githubusercontent.com/u/83036156?v=4?s=100" width="100px;" alt="Oche"/><br /><sub><b>Oche</b></sub></a><br /><a href="https://github.com/AFK-AlignedFamKernel/afk_monorepo/commits?author=EjembiEmmanuel" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://poulav.vercel.app/"><img src="https://avatars.githubusercontent.com/u/133862694?v=4?s=100" width="100px;" alt="Poulav Bhowmick"/><br /><sub><b>Poulav Bhowmick</b></sub></a><br /><a href="https://github.com/AFK-AlignedFamKernel/afk_monorepo/commits?author=PoulavBhowmick03" title="Code">💻</a></td>
</tr>
</tbody>
<tfoot>
Expand Down
2 changes: 1 addition & 1 deletion apps/data-backend/src/services/telegram-app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export function launchBot(token:string) {
// Handle stop events
enableGracefulStop(bot)

return bot
// return bot
} catch (e) {
console.log("launchBot error", e)
}
Expand Down
2 changes: 2 additions & 0 deletions apps/indexer/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
AUTH_TOKEN=dna_xxx
POSTGRES_CONNECTION_STRING=postgresql://admin:postgres@localhost:5432/indexer
4 changes: 4 additions & 0 deletions apps/indexer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,8 @@ FROM quay.io/apibara/sink-postgres:0.7.0-x86_64
WORKDIR /app
COPY ./src/* /app

ARG POSTGRES_CONNECTION_STRING

ENV POSTGRES_CONNECTION_STRING=${POSTGRES_CONNECTION_STRING}

ENTRYPOINT ["/nix/store/rh1g8pb7wfnyr527jfmkkc5lm3sa1f0l-apibara-sink-postgres-0.7.0/bin/apibara-sink-postgres"]
9 changes: 4 additions & 5 deletions apps/indexer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,15 @@
## Install Postgres and Init the tables

```
docker run --name afk-indexer -e POSTGRES_PASSWORD=postgres -d -p 5432:5432 -v /afk-indexer:/docker-entrypoint-initdb.d postgres:16
docker run --name afk-indexer -e POSTGRES_PASSWORD=postgres -e POSTGRES_USER=admin -e POSTGRES_DB=indexer -d -p 5432:5432 -v ./:/docker-entrypoint-initdb.d postgres:latest
```

# Test

unrugmeme_deploy
buy-token deploy

```
apibara run ./src/pump-buy-coin.js -A dna_XXX
apibara run ./src/buy-token.ts --allow-env .env -A dna_xxx
```

Expand All @@ -27,4 +26,4 @@ apibara run ./src/pump-buy-coin.js -A dna_XXX
```

### Run it
docker run -it --env-file ./.env afk-indexer run /app/pump-deploy-coin.js --tls-accept-invalid-certificates=true --connection-string POSTGRES:INDEXER_DATABASE_URL
docker run -it --env-file ./.env afk-indexer run /app/buy-token.ts --tls-accept-invalid-certificates=true --allow-env-from-env POSTGRES_CONNECTION_STRING
70 changes: 66 additions & 4 deletions apps/indexer/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ services:
environment:
POSTGRES_DB: indexer
POSTGRES_USER: admin
POSTGRES_PASSWORD: password
POSTGRES_PASSWORD: postgres
ports:
- '5432:5432'
volumes:
Expand All @@ -17,8 +17,9 @@ services:
unruggableMemecoin-deploy-indexer:
environment:
- AUTH_TOKEN=${AUTH_TOKEN}
- POSTGRES_CONNECTION_STRING=postgresql://admin:postgres@postgres:5432/indexer
image: quay.io/apibara/sink-postgres:latest
command: 'run ./indexer/unruggableMemecoin-deploy.indexer.ts --connection-string postgresql://admin:password@postgres:5432/indexer -A ${AUTH_TOKEN}'
command: 'run ./indexer/unruggableMemecoin-deploy.indexer.ts --allow-env-from-env AUTH_TOKEN,POSTGRES_CONNECTION_STRING -A ${AUTH_TOKEN}'
volumes:
- ./src:/indexer
depends_on:
Expand All @@ -30,8 +31,9 @@ services:
unruggableMemecoin-launch-indexer:
environment:
- AUTH_TOKEN=${AUTH_TOKEN}
- POSTGRES_CONNECTION_STRING=postgresql://admin:postgres@postgres:5432/indexer
image: quay.io/apibara/sink-postgres:latest
command: 'run ./indexer/unruggableMemecoin-launch.indexer.ts --connection-string postgresql://admin:password@postgres:5432/indexer -A ${AUTH_TOKEN}'
command: 'run ./indexer/unruggableMemecoin-launch.indexer.ts --allow-env-from-env AUTH_TOKEN,POSTGRES_CONNECTION_STRING -A ${AUTH_TOKEN}'
volumes:
- ./src:/indexer
depends_on:
Expand All @@ -43,8 +45,9 @@ services:
unruggableMemecoin-transfers-indexer:
environment:
- AUTH_TOKEN=${AUTH_TOKEN}
- POSTGRES_CONNECTION_STRING=postgresql://admin:postgres@postgres:5432/indexer
image: quay.io/apibara/sink-postgres:latest
command: 'run ./indexer/unruggableMemecoin-transfers.indexer.ts --connection-string postgresql://admin:password@postgres:5432/indexer -A ${AUTH_TOKEN}'
command: 'run ./indexer/unruggableMemecoin-transfers.indexer.ts --allow-env-from-env AUTH_TOKEN,POSTGRES_CONNECTION_STRING -A ${AUTH_TOKEN}'
volumes:
- ./src:/indexer
depends_on:
Expand All @@ -53,6 +56,65 @@ services:
- backend
restart: on-failure

buy-indexer:
environment:
- AUTH_TOKEN=${AUTH_TOKEN}
- POSTGRES_CONNECTION_STRING=postgresql://admin:postgres@postgres:5432/indexer
image: quay.io/apibara/sink-postgres:latest
command: 'run ./indexer/buy-token.ts --allow-env-from-env AUTH_TOKEN,POSTGRES_CONNECTION_STRING -A ${AUTH_TOKEN}'
volumes:
- ./src:/indexer
depends_on:
- postgres
networks:
- backend
restart: on-failure


sell-indexer:
environment:
- AUTH_TOKEN=${AUTH_TOKEN}
- POSTGRES_CONNECTION_STRING=postgresql://admin:postgres@postgres:5432/indexer
image: quay.io/apibara/sink-postgres:latest
command: 'run ./indexer/sell-token.ts --allow-env-from-env AUTH_TOKEN,POSTGRES_CONNECTION_STRING -A ${AUTH_TOKEN}'
volumes:
- ./src:/indexer
depends_on:
- postgres
networks:
- backend
restart: on-failure

token-indexer:
environment:
- AUTH_TOKEN=${AUTH_TOKEN}
- POSTGRES_CONNECTION_STRING=postgresql://admin:postgres@postgres:5432/indexer
image: quay.io/apibara/sink-postgres:latest
command: 'run ./indexer/token-launch.ts --allow-env-from-env AUTH_TOKEN,POSTGRES_CONNECTION_STRING -A ${AUTH_TOKEN}'
volumes:
- ./src:/indexer
depends_on:
- postgres
networks:
- backend
restart: on-failure

deploy-indexer:
environment:
- AUTH_TOKEN=${AUTH_TOKEN}
- POSTGRES_CONNECTION_STRING=postgresql://admin:postgres@postgres:5432/indexer
image: quay.io/apibara/sink-postgres:latest
command: 'run ./indexer/deploy-token.ts --allow-env-from-env AUTH_TOKEN,POSTGRES_CONNECTION_STRING -A ${AUTH_TOKEN}'
volumes:
- ./src:/indexer
depends_on:
- postgres
networks:
- backend
restart: on-failure



networks:
backend:
driver: bridge
17 changes: 8 additions & 9 deletions apps/indexer/init.sql
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,8 @@ create table token_launch(
current_supply text,
liquidity_raised text,
price text,
_cursor bigint
timestamp TIMESTAMP,


_cursor bigint,
time_stamp TEXT
);

create table token_deploy(
Expand All @@ -32,8 +30,8 @@ create table token_deploy(
initial_supply text,
total_supply text,
created_at timestamp default current_timestamp,
_cursor bigint
timestamp TIMESTAMP,
_cursor bigint,
time_stamp TEXT


);
Expand All @@ -57,10 +55,11 @@ CREATE TABLE token_transactions (
current_supply TEXT,
liquidity_raised TEXT,
price TEXT,
protocol_fee TEXT,
amount TEXT,
timestamp TIMESTAMP,
_cursor bigint,
transaction_type TEXT NOT NULL CHECK (transaction_type IN ('buy', 'sell')),,
_cursor BIGINT,
transaction_type TEXT NOT NULL CHECK (transaction_type IN ('buy', 'sell')),
time_stamp TEXT

);

Expand Down
67 changes: 0 additions & 67 deletions apps/indexer/src/buy-token.js

This file was deleted.

Loading

0 comments on commit 0736b6c

Please sign in to comment.