-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.dev
More file actions
93 lines (82 loc) · 4.33 KB
/
Dockerfile.dev
File metadata and controls
93 lines (82 loc) · 4.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
# Builds and runs solana-test-validator, seeding it with the programs and
# fixtures necessary for local development.
#
# NOTE: The image/container does NOT build the programs. Most of the developers
# use ARM64 Macs, which makes building the programs in Docker unbearably slow.
# The bpf builder requires the target platform to be AMD64, which means the
# programs are built in an emulator for the ARM Macs. The builds can take 20min
# or more, even for the Anchor programs!
#
# See the README for how to update this container without needing to rebuild
# each individual program. (tl;dr - extract existing binaries from this image)
FROM rust:1.79.0
WORKDIR /usr/src/app
# Install dependencies for running Solana CLIs
# https://solana.com/developers/guides/getstarted/setup-local-development#dependencies-for-linux
RUN apt-get update && \
apt-get install -y \
build-essential \
pkg-config \
libudev-dev llvm libclang-dev \
protobuf-compiler libssl-dev \
jq
# Installs Solana CLIs either from the install script (for available builds like linux x86_64)
# or using cargo install to build from source (for unavailable builds like linux aarch64)
COPY scripts/install-solana.sh /tmp/install-solana.sh
RUN --mount=type=cache,id=cargo-cache,target=/usr/local/cargo/registry /tmp/install-solana.sh
ENV PATH="/root/solana-release/bin:${PATH}"
# Ensures the test validator is running
HEALTHCHECK --interval=5s --timeout=5s --retries=10 \
CMD curl -f http://localhost:8899/health || exit 1
# Copy old school bpf programs from the build step
COPY target/deploy/claimable_tokens.so \
target/deploy/audius_reward_manager.so \
target/deploy/audius_eth_registry.so \
target/deploy/track_listen_count.so \
./
# Copy new school anchor programs
COPY payment-router/target/deploy/payment_router.so \
staking-bridge/target/deploy/staking_bridge.so \
./
# Copy account state fixtures
COPY fixtures ./fixtures
# Program addresses
ARG SOLANA_AUDIUS_ETH_REGISTRY_PUBLIC_KEY
ARG SOLANA_TRACK_LISTEN_COUNT_PUBLIC_KEY
ARG SOLANA_CLAIMABLE_TOKENS_PUBLIC_KEY
ARG SOLANA_REWARD_MANAGER_PUBLIC_KEY
ARG SOLANA_PAYMENT_ROUTER_PUBLIC_KEY
# Account addresses
ARG SOLANA_SIGNER_GROUP_PUBLIC_KEY
ARG SOLANA_VALID_SIGNER_PUBLIC_KEY
ARG SOLANA_FEEPAYER_PUBLIC_KEY
ARG SOLANA_OWNER_PUBLIC_KEY
ARG SOLANA_REWARD_MANAGER_PDA_PUBLIC_KEY
ARG SOLANA_REWARD_MANAGER_TOKEN_PDA_PUBLIC_KEY
ARG SOLANA_TOKEN_MINT_PUBLIC_KEY
ARG SOLANA_USDC_TOKEN_MINT_PUBLIC_KEY
ARG SOLANA_STAKING_BRIDGE_USDC_PAYOUT_WALLET
# Seeds the validator with each program
CMD solana-test-validator --ledger /usr/db \
--bpf-program ${SOLANA_AUDIUS_ETH_REGISTRY_PUBLIC_KEY} audius_eth_registry.so \
--bpf-program ${SOLANA_TRACK_LISTEN_COUNT_PUBLIC_KEY} track_listen_count.so \
--bpf-program ${SOLANA_CLAIMABLE_TOKENS_PUBLIC_KEY} claimable_tokens.so \
--bpf-program ${SOLANA_REWARD_MANAGER_PUBLIC_KEY} audius_reward_manager.so \
--bpf-program ${SOLANA_PAYMENT_ROUTER_PUBLIC_KEY} payment_router.so \
--account ${SOLANA_SIGNER_GROUP_PUBLIC_KEY} ./fixtures/eth-registry-signer-group.json \
--account ${SOLANA_VALID_SIGNER_PUBLIC_KEY} ./fixtures/eth-registry-valid-signer.json \
--account ${SOLANA_FEEPAYER_PUBLIC_KEY} ./fixtures/fee-payer.json \
--account ${SOLANA_OWNER_PUBLIC_KEY} ./fixtures/owner.json \
--account ${SOLANA_REWARD_MANAGER_PDA_PUBLIC_KEY} ./fixtures/reward-manager-state.json \
--account ${SOLANA_REWARD_MANAGER_TOKEN_PDA_PUBLIC_KEY} ./fixtures/reward-manager-tokens.json \
--account ${SOLANA_TOKEN_MINT_PUBLIC_KEY} ./fixtures/waudio.json \
--account ${SOLANA_USDC_TOKEN_MINT_PUBLIC_KEY} ./fixtures/usdc.json \
--account ${SOLANA_STAKING_BRIDGE_USDC_PAYOUT_WALLET} ./fixtures/owner-usdc.json \
--account ${SOLANA_REWARD_MANAGER_LOOKUP_TABLE} ./fixtures/reward-manager-lookup-table.json \
--account $(cat ./fixtures/aao-sender.json | jq -r .pubkey) ./fixtures/aao-sender.json \
--account $(cat ./fixtures/dn1-sender.json | jq -r .pubkey) ./fixtures/dn1-sender.json \
--account $(cat ./fixtures/cn1-sender.json | jq -r .pubkey) ./fixtures/cn1-sender.json \
--account $(cat ./fixtures/cn2-sender.json | jq -r .pubkey) ./fixtures/cn2-sender.json \
--account $(cat ./fixtures/cn3-sender.json | jq -r .pubkey) ./fixtures/cn3-sender.json \
--account $(cat ./fixtures/cn4-sender.json | jq -r .pubkey) ./fixtures/cn4-sender.json \
--reset