solana: Merge into single workspace

Merge all the separate solana crates into a single workspace.  This is
the same thing we do for terra and will make it easier to check / lint /
test all the crates together.
This commit is contained in:
Chirantan Ekbote 2022-04-08 18:48:33 +09:00 committed by Chirantan Ekbote
parent 275fcb2a36
commit 3fdd9ccc3e
22 changed files with 1074 additions and 13981 deletions

View File

@ -40,10 +40,9 @@ ENV EMITTER_ADDRESS="11111111111111111111111111111115"
ENV BRIDGE_ADDRESS="Bridge1p5gheXUvJ6jGWGeCsgPKgnE3YgdGKRVCMY9o"
RUN --mount=type=cache,target=/root/.cache \
--mount=type=cache,target=bridge/target \
--mount=type=cache,target=modules/token_bridge/target \
--mount=type=cache,target=target \
set -xe && \
cargo build --manifest-path ./bridge/Cargo.toml --package client --release --locked && \
cargo build --manifest-path ./modules/token_bridge/Cargo.toml --package client --release --locked && \
cp bridge/target/release/client /usr/local/bin && \
cp modules/token_bridge/target/release/client /usr/local/bin/token-bridge-client
cargo build --manifest-path ./Cargo.toml --package bridge_client --release --locked && \
cargo build --manifest-path ./Cargo.toml --package token_bridge_client --release --locked && \
cp target/release/bridge_client /usr/local/bin/client && \
cp target/release/token_bridge_client /usr/local/bin/token-bridge-client

File diff suppressed because it is too large Load Diff

17
solana/Cargo.toml Normal file
View File

@ -0,0 +1,17 @@
[workspace]
members = [
"bridge/client",
"bridge/cpi_poster",
"bridge/program",
"bridge/program_stub",
"migration",
"modules/nft_bridge/program",
"modules/token_bridge/client",
"modules/token_bridge/program",
"solitaire/client",
"solitaire/program",
"solitaire/rocksalt",
]
[patch.crates-io]
memmap2 = { path = "bridge/memmap2-rs" }

View File

@ -39,20 +39,17 @@ ARG BRIDGE_ADDRESS
RUN [ -n "${BRIDGE_ADDRESS}" ]
# Build Wormhole Solana programs
RUN --mount=type=cache,target=bridge/target \
--mount=type=cache,target=modules/token_bridge/target \
--mount=type=cache,target=modules/nft_bridge/target \
--mount=type=cache,target=migration/target \
RUN --mount=type=cache,target=target \
cargo build-bpf --manifest-path "bridge/program/Cargo.toml" -- --locked && \
cargo build-bpf --manifest-path "bridge/cpi_poster/Cargo.toml" -- --locked && \
cargo build-bpf --manifest-path "modules/token_bridge/program/Cargo.toml" -- --locked && \
cargo build-bpf --manifest-path "modules/nft_bridge/program/Cargo.toml" -- --locked && \
cargo build-bpf --manifest-path "migration/Cargo.toml" -- --locked && \
cp bridge/target/deploy/bridge.so /opt/solana/deps/bridge.so && \
cp bridge/target/deploy/cpi_poster.so /opt/solana/deps/cpi_poster.so && \
cp migration/target/deploy/wormhole_migration.so /opt/solana/deps/wormhole_migration.so && \
cp modules/token_bridge/target/deploy/token_bridge.so /opt/solana/deps/token_bridge.so && \
cp modules/nft_bridge/target/deploy/nft_bridge.so /opt/solana/deps/nft_bridge.so && \
cp target/deploy/bridge.so /opt/solana/deps/bridge.so && \
cp target/deploy/cpi_poster.so /opt/solana/deps/cpi_poster.so && \
cp target/deploy/wormhole_migration.so /opt/solana/deps/wormhole_migration.so && \
cp target/deploy/token_bridge.so /opt/solana/deps/token_bridge.so && \
cp target/deploy/nft_bridge.so /opt/solana/deps/nft_bridge.so && \
cp modules/token_bridge/token-metadata/spl_token_metadata.so /opt/solana/deps/spl_token_metadata.so
ENV RUST_LOG="solana_runtime::system_instruction_processor=trace,solana_runtime::message_processor=trace,solana_bpf_loader=debug,solana_rbpf=debug"

View File

@ -33,42 +33,42 @@ ARG SED_REMOVE_INVALID_REFERENCE="/^\s*wasm.__wbg_systeminstruction_free(ptr);$/
# Compile Wormhole
RUN --mount=type=cache,target=/root/.cache \
--mount=type=cache,target=bridge/target \
--mount=type=cache,target=target \
cd bridge/program && /usr/local/cargo/bin/wasm-pack build --target bundler -d bundler -- --features wasm --locked && \
cd bundler && sed -i $SED_REMOVE_INVALID_REFERENCE bridge_bg.js
RUN --mount=type=cache,target=/root/.cache \
--mount=type=cache,target=bridge/target \
--mount=type=cache,target=target \
cd bridge/program && /usr/local/cargo/bin/wasm-pack build --target nodejs -d nodejs -- --features wasm --locked
# Compile Token Bridge
RUN --mount=type=cache,target=/root/.cache \
--mount=type=cache,target=modules/token_bridge/target \
--mount=type=cache,target=target \
cd modules/token_bridge/program && /usr/local/cargo/bin/wasm-pack build --target bundler -d bundler -- --features wasm --locked && \
cd bundler && sed -i $SED_REMOVE_INVALID_REFERENCE token_bridge_bg.js
RUN --mount=type=cache,target=/root/.cache \
--mount=type=cache,target=modules/token_bridge/target \
--mount=type=cache,target=target \
cd modules/token_bridge/program && /usr/local/cargo/bin/wasm-pack build --target nodejs -d nodejs -- --features wasm --locked
# Compile Migration
RUN --mount=type=cache,target=/root/.cache \
--mount=type=cache,target=migration/target \
--mount=type=cache,target=target \
cd migration && /usr/local/cargo/bin/wasm-pack build --target bundler -d bundler -- --features wasm --locked && \
cd bundler && sed -i $SED_REMOVE_INVALID_REFERENCE wormhole_migration_bg.js
RUN --mount=type=cache,target=/root/.cache \
--mount=type=cache,target=migration/target \
--mount=type=cache,target=target \
cd migration && /usr/local/cargo/bin/wasm-pack build --target nodejs -d nodejs -- --features wasm --locked
# Compile NFT Bridge
RUN --mount=type=cache,target=/root/.cache \
--mount=type=cache,target=modules/nft_bridge/target \
--mount=type=cache,target=target \
cd modules/nft_bridge/program && /usr/local/cargo/bin/wasm-pack build --target bundler -d bundler -- --features wasm --locked && \
cd bundler && sed -i $SED_REMOVE_INVALID_REFERENCE nft_bridge_bg.js
RUN --mount=type=cache,target=/root/.cache \
--mount=type=cache,target=modules/nft_bridge/target \
--mount=type=cache,target=target \
cd modules/nft_bridge/program && /usr/local/cargo/bin/wasm-pack build --target nodejs -d nodejs -- --features wasm --locked
FROM scratch AS export

3677
solana/bridge/Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +0,0 @@
[workspace]
members = ["program", "client", "program_stub", "cpi_poster"]
[patch.crates-io]
memmap2 = { path = "memmap2-rs" }

View File

@ -1,5 +1,5 @@
[package]
name = "client"
name = "bridge_client"
version = "0.1.0"
authors = ["Stan Drozd <stan@nexantic.com>"]
edition = "2018"

View File

@ -29,6 +29,6 @@ solitaire = { path = "../../solitaire/program" }
hex = "*"
rand = "0.7.3"
hex-literal = "0.3.1"
libsecp256k1 = { version = "0.3.5", features = [] }
libsecp256k1 = { version = "0.6.0", features = [] }
solana-client = "=1.9.4"
solana-sdk = "=1.9.4"

View File

@ -32,5 +32,5 @@ hex = "*"
rand = "0.7.3"
hex-literal = "0.3.1"
libsecp256k1 = { version = "0.6.0", features = [] }
solana-client = "=1.9.4"
solana-program-test = "=1.9.4"
solana-sdk = "=1.9.4"

View File

@ -29,6 +29,6 @@ wormhole-bridge-solana = { path = "../program", features = ["no-entrypoint"] }
hex = "*"
rand = "0.7.3"
hex-literal = "0.3.1"
libsecp256k1 = { version = "0.3.5", features = [] }
libsecp256k1 = { version = "0.6.0", features = [] }
solana-client = "=1.9.4"
solana-sdk = "=1.9.4"

View File

@ -32,10 +32,7 @@ rand = { version = "0.7.3", optional = true }
[dev-dependencies]
hex = "*"
hex-literal = "0.3.1"
libsecp256k1 = { version = "0.3.5", features = [] }
libsecp256k1 = { version = "0.6.0", features = [] }
solana-client = "=1.9.4"
solana-sdk = "=1.9.4"
spl-token = { version = "=3.2.0", features = ["no-entrypoint"] }
[patch.crates-io]
memmap2 = { path = "../bridge/memmap2-rs" }

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +0,0 @@
[workspace]
members = ["program"]
[patch.crates-io]
memmap2 = { path = "../../bridge/memmap2-rs" }

View File

@ -37,7 +37,7 @@ rand = { version = "0.7.3", optional = true }
[dev-dependencies]
hex = "*"
hex-literal = "0.3.1"
libsecp256k1 = { version = "0.3.5", features = [] }
libsecp256k1 = { version = "0.6.0", features = [] }
solana-client = "=1.9.4"
solana-sdk = "=1.9.4"
spl-token = { version = "=3.2.0", features = ["no-entrypoint"] }

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +0,0 @@
[workspace]
members = ["program", "client"]
[patch.crates-io]
memmap2 = { path = "../../bridge/memmap2-rs" }

View File

@ -1,5 +1,5 @@
[package]
name = "client"
name = "token_bridge_client"
version = "0.1.0"
edition = "2018"

View File

@ -36,7 +36,7 @@ rand = { version = "0.7.3", optional = true }
[dev-dependencies]
hex = "*"
hex-literal = "0.3.1"
libsecp256k1 = { version = "0.3.5", features = [] }
libsecp256k1 = { version = "0.6.0", features = [] }
solana-client = "=1.9.4"
solana-sdk = "=1.9.4"
spl-token = { version = "=3.2.0", features = ["no-entrypoint"] }

View File

@ -0,0 +1,5 @@
# This version should be kept up to date with the value in ci/rust-version.sh in
# the branch of the solana repo that corresponds with the version we're using.
[toolchain]
channel = "nightly-2021-12-03"
profile = "minimal"

File diff suppressed because it is too large Load Diff

View File

@ -1,2 +0,0 @@
[workspace]
members = ["rocksalt", "program", "client"]