Skip to content

Commit

Permalink
add copy of client for now. uncomment gh workflow to test dockerhub p…
Browse files Browse the repository at this point in the history
…ublish
  • Loading branch information
decartesol committed Feb 20, 2024
1 parent cbb924a commit 864cac1
Show file tree
Hide file tree
Showing 27 changed files with 13,713 additions and 31 deletions.
46 changes: 23 additions & 23 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,32 +5,32 @@ on:
paths:
- "**"
jobs:
# build_and_push:
# name: Push Docker image to Docker Hub
# runs-on: ubuntu-latest
# steps:
# - name: Check out the repo
# uses: actions/checkout@v3
build_and_push:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v3

# - name: Log in to Docker Hub
# uses: docker/login-action@v2
# with:
# username: ${{ secrets.DOCKER_USERNAME }}
# password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

# - name: Extract metadata (tags, labels) for Docker
# id: meta
# uses: docker/metadata-action@v4
# with:
# images: themetadao/indexer
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
with:
images: themetadao/indexer

# - name: Build and push Docker image
# uses: docker/build-push-action@v4
# with:
# context: .
# push: true
# tags: ${{ steps.meta.outputs.tags }}
# labels: ${{ steps.meta.outputs.labels }}
- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

# redeploy_app:
# name: Redeploy app on Railway
Expand Down
3 changes: 3 additions & 0 deletions packages/indexer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
"start": "bun src/index.ts"
},
"dependencies": {
"@coral-xyz/anchor": "^0.28.1-beta.2",
"@openbook-dex/openbook-v2": "^0.1.9",
"@solana/spl-token": "^0.3.8",
"@solana/web3.js": "^1.90.0",
"@themetadao/indexer-db": "workspace:*"
},
Expand Down
6 changes: 3 additions & 3 deletions packages/indexer/src/connection.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { clusterApiUrl } from '@solana/web3.js';
import { Connection } from '@solana/web3.js';

const HELIUS_API_KEY = process.env.FUTARCHY_HELIUS_API_KEY;
const heliusRPCEnpoint = `https://mainnet.helius-rpc.com/?api-key=${HELIUS_API_KEY}`;
//export const rpc = clusterApiUrl(heliusRPCEnpoint);
export const RPC_ENDPOINT = `https://mainnet.helius-rpc.com/?api-key=${HELIUS_API_KEY}`;
export const connection = new Connection(RPC_ENDPOINT);
6 changes: 3 additions & 3 deletions packages/indexer/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { connection } from './connection';



console.log(heliusRPCEnpoint);
const latestBlockHash = await connection.getLatestBlockhash();
console.log(latestBlockHash);
2 changes: 1 addition & 1 deletion packages/indexer/src/proposal-indexer.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@

async function getProposals(connection: ) {
async function getProposals() {

}
3 changes: 3 additions & 0 deletions packages/indexer/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
{
"extends": "../../tsconfig-base.json",
"compilerOptions": {
"module": "ESNext",
"target": "ESNext",
"moduleResolution": "bundler",
"types": ["node"]
}
}
1 change: 1 addition & 0 deletions packages/temp-client-copy/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Temporarily copying the client code from [the frontend](https://github.com/metaDAOproject/meta-dao-frontend/tree/a8c7f14a371fbc16a8cc399366d61ff3978d7361/lib) until we decide between multi vs monorepo
31 changes: 31 additions & 0 deletions packages/temp-client-copy/lib/constants.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import { PublicKey } from '@solana/web3.js';
import { BN } from '@coral-xyz/anchor';
import { AutocratProgram, ProgramVersion } from './types';

export const OPENBOOK_PROGRAM_ID = new PublicKey('opnb2LAfJYbRMAHHvqjCwQxanZn7ReEHp1k81EohpZb');
export const OPENBOOK_TWAP_PROGRAM_ID = new PublicKey(
'TWAPrdhADy2aTKN5iFZtNnkQYXERD9NvKjPFVPMSCNN',
);

export const NUMERAL_FORMAT = '0,0.00';
export const BASE_FORMAT = '0,0';
export const SLOTS_PER_10_SECS: number = 25;
export const TEN_DAYS_IN_SLOTS: number = 10 * 24 * 60 * 6 * SLOTS_PER_10_SECS;
export const QUOTE_LOTS = 0.0001;
export const BN_0 = new BN(0);

const AUTOCRAT_V0_IDL: AutocratProgram = require('@/lib/idl/autocrat_v0.json');
const AUTOCRAT_V0_1_IDL: AutocratProgram = require('@/lib/idl/autocrat_v0.1.json');

export const AUTOCRAT_VERSIONS: ProgramVersion[] = [
{
label: 'V0.1',
programId: new PublicKey('metaX99LHn3A7Gr7VAcCfXhpfocvpMpqQ3eyp3PGUUq'),
idl: AUTOCRAT_V0_1_IDL,
},
{
label: 'V0',
programId: new PublicKey('meta3cxKzFBmWYgCVozmvCQAS3y9b3fGxrG9HkHL7Wi'),
idl: AUTOCRAT_V0_IDL,
},
];
Loading

0 comments on commit 864cac1

Please sign in to comment.