Skip to content

Commit

Permalink
init- much cleanup needed
Browse files Browse the repository at this point in the history
  • Loading branch information
austbot committed Aug 12, 2022
0 parents commit 3cbd625
Show file tree
Hide file tree
Showing 77 changed files with 11,530 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
**/target
*/target
target
db-data
node-modules
ledger
.anchor
20 changes: 20 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Generated by Cargo
# will have compiled files and executables
/target/
db-data
.idea
**/target/

# These are backup files generated by rustfmt
**/*.rs.bk
ledger
package-lock.json
node_modules
.anchor
target
*.so
.vscode
dist
test-ledger
*.swp
*error.log
42 changes: 42 additions & 0 deletions Api.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
FROM rust:1.60-bullseye AS chef
RUN cargo install cargo-chef
FROM chef AS planner
COPY das_api /rust/das_api/
WORKDIR /rust/das_api
RUN cargo chef prepare --recipe-path recipe.json

FROM chef AS builder
RUN apt-get update -y && \
apt-get install -y build-essential make git
COPY lib /rust/lib
COPY contracts /rust/contracts
COPY plerkle /rust/plerkle
COPY deps /rust/deps
COPY plerkle_serialization /rust/plerkle_serialization
COPY digital_asset_types /rust/digital_asset_types
COPY messenger /rust/messenger
RUN mkdir -p /rust/das_api
WORKDIR /rust/das_api
COPY --from=planner /rust/das_api/recipe.json recipe.json
# Build dependencies - this is the caching Docker layer!
COPY das_api/Cargo.toml .
RUN cargo chef cook --release --recipe-path recipe.json
COPY das_api .
# Build application
RUN cargo build --release

FROM rust:1.61-slim-bullseye
ARG APP=/usr/src/app
RUN apt update \
&& apt install -y curl ca-certificates tzdata \
&& rm -rf /var/lib/apt/lists/*
ENV TZ=Etc/UTC \
APP_USER=appuser
RUN groupadd $APP_USER \
&& useradd -g $APP_USER $APP_USER \
&& mkdir -p ${APP}
COPY --from=builder /rust/das_api/target/release/das_api ${APP}
RUN chown -R $APP_USER:$APP_USER ${APP}
USER $APP_USER
WORKDIR ${APP}
CMD /usr/src/app/das_api
42 changes: 42 additions & 0 deletions Ingest.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
FROM rust:1.60-bullseye AS chef
RUN cargo install cargo-chef
FROM chef AS planner
COPY nft_ingester /rust/nft_ingester/
WORKDIR /rust/nft_ingester
RUN cargo chef prepare --recipe-path recipe.json

FROM chef AS builder
RUN apt-get update -y && \
apt-get install -y build-essential make git
COPY lib /rust/lib
COPY contracts /rust/contracts
COPY plerkle /rust/plerkle
COPY deps /rust/deps
COPY plerkle_serialization /rust/plerkle_serialization
COPY digital_asset_types /rust/digital_asset_types
COPY messenger /rust/messenger
RUN mkdir -p /rust/nft_ingester
WORKDIR /rust/nft_ingester
COPY --from=planner /rust/nft_ingester/recipe.json recipe.json
# Build dependencies - this is the caching Docker layer!
COPY nft_ingester/Cargo.toml .
RUN cargo chef cook --release --recipe-path recipe.json
COPY nft_ingester .
# Build application
RUN cargo build --release

FROM rust:1.60-slim-bullseye
ARG APP=/usr/src/app
RUN apt update \
&& apt install -y curl ca-certificates tzdata \
&& rm -rf /var/lib/apt/lists/*
ENV TZ=Etc/UTC \
APP_USER=appuser
RUN groupadd $APP_USER \
&& useradd -g $APP_USER $APP_USER \
&& mkdir -p ${APP}
COPY --from=builder /rust/nft_ingester/target/release/nft_ingester ${APP}
RUN chown -R $APP_USER:$APP_USER ${APP}
USER $APP_USER
WORKDIR ${APP}
CMD /usr/src/app/nft_ingester
20 changes: 20 additions & 0 deletions Load.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
FROM node:18
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
RUN sh -c "$(curl -sSfL https://release.solana.com/v1.10.31/install)"
ENV PATH="/root/.cargo/bin:/root/.local/share/solana/install/active_release/bin:${PATH}"
RUN cargo install anchor-cli

WORKDIR /rust/
COPY deps /rust/deps
COPY lib /rust/lib
COPY plerkle_serialization /rust/plerkle_serialization
COPY digital_asset_types /rust/digital_asset_types
COPY messenger /rust/messenger
COPY contracts /rust/contracts
WORKDIR /rust/contracts
COPY ./contracts/package.json .
RUN yarn

COPY ./contracts /rust/
RUN anchor build
CMD yarn run ts-node tests/bubblegum-test-rpc-fast.ts
28 changes: 28 additions & 0 deletions digital_asset_types/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
[package]
name = "digital_asset_types"
version = "0.1.0"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[features]
default=["json_types", "sql_types"]
json_types = ["serde", "serde_json"]
sql_types = ["sea-orm"]

[dependencies]
sea-orm = { optional = true, git = "https://github.com/liberwang1013/sea-orm", branch = "insert-on-conflict", features = [ "macros", "runtime-tokio-rustls", "sqlx-postgres", "with-chrono"] }
sea-query = {version="0.25.0", features = ["postgres-array"]}
serde = { version = "1.0.137", optional = true }
serde_json = { version = "1.0.81", optional = true }
bs58 = "0.4.0"
borsh = { version = "0.9.3", optional = true }
borsh-derive = { version = "0.9.3", optional = true }
solana-sdk = { version = "=1.10.10" }
num-traits = "0.2.15"
num-derive = "0.3.3"
thiserror = "1.0.31"
concurrent-merkle-tree = {path = "../lib/concurrent-merkle-tree" }
mpl-token-metadata = { git = "https://github.com/jarry-xiao/metaplex-program-library", rev = "7e2810a", features = ["no-entrypoint"] }
jsonpath_lib = "0.3.0"
mime_guess = "2.0.4"
url = "2.2.2"
Loading

0 comments on commit 3cbd625

Please sign in to comment.