Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Tiltfile
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ docker_build(
only=["./sdk", "./package.json", "./package-lock.json", "jest.config.ts", "tsconfig.json", "tsconfig.esm.json", "tsconfig.cjs.json", "tsconfig.test.json"],
dockerfile = "./sdk/Dockerfile",
)
k8s_yaml_with_ns("./sdk/ci.yaml")
k8s_yaml_with_ns("./sdk/ci.yaml")
k8s_resource(
"ntt-ci-tests",
labels = ["ntt"],
Expand Down
3 changes: 2 additions & 1 deletion solana/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
**/*.rs.bk
node_modules
test-ledger
dist
dist
artifacts-*
4 changes: 2 additions & 2 deletions solana/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ RUN cp ./target/sbf-solana-solana/release/example_native_token_transfers.so /opt
COPY solana/tilt /opt/solana/deps

COPY sdk ../sdk
COPY solana/ts ts
COPY solana/ts ts
COPY solana/package.json package.json
COPY solana/tsconfig.esm.json tsconfig.esm.json
COPY solana/tsconfig.cjs.json tsconfig.cjs.json
Expand All @@ -50,7 +50,7 @@ COPY --from=builder /usr/src/solana/ts /usr/src/solana/ts
COPY --from=builder /usr/src/solana/package.json /usr/src/solana/package.json
COPY --from=builder /usr/src/solana/tsconfig.esm.json /usr/src/solana/tsconfig.esm.json
COPY --from=builder /usr/src/solana/tsconfig.cjs.json /usr/src/solana/tsconfig.cjs.json
COPY --from=builder /usr/src/solana/target/idl /usr/src/solana/target/idl
COPY --from=builder /usr/src/solana/target/idl /usr/src/solana/target/idl
COPY --from=builder /usr/src/solana/target/types /usr/src/solana/target/types

FROM node:lts-alpine@sha256:41e4389f3d988d2ed55392df4db1420ad048ae53324a8e2b7c6d19508288107e AS governance
Expand Down
17 changes: 13 additions & 4 deletions solana/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.DEFAULT_GOAL = build
.PHONY: build cargo-build anchor-build prod-build test cargo-test anchor-test idl sdk clean node_modules lint cargo-lint anchor-lint fix-lint
.PHONY: build cargo-build anchor-build artifacts-mainnet artifacts-solana-devnet artifacts-tilt-devnet _artifacts test cargo-test anchor-test idl sdk clean node_modules lint cargo-lint anchor-lint fix-lint

# Find and convert version line:
# Turn `const VERSION: &str = "major.minor.patch";` into `major_minor_patch`
Expand Down Expand Up @@ -27,8 +27,17 @@ anchor-build:
./scripts/patch-idl $$jsonfile; \
done

prod-build:
anchor build --verifiable
artifacts-mainnet:
$(MAKE) _artifacts TARGET_DIR=$@ NETWORK=mainnet

artifacts-solana-devnet:
$(MAKE) _artifacts TARGET_DIR=$@ NETWORK=solana-devnet

artifacts-tilt-devnet:
$(MAKE) _artifacts TARGET_DIR=$@ NETWORK=tilt-devnet

_artifacts:
solana-verify build -- --no-default-features --features $(NETWORK) --target-dir $(TARGET_DIR)

idl: anchor-build
@echo "IDL Version: $(VERSION)"
Expand Down Expand Up @@ -86,4 +95,4 @@ anchor-lint:
bash scripts/anchor-lint.sh

fix-lint:
cargo fmt --all --manifest-path Cargo.toml
cargo fmt --all --manifest-path Cargo.toml
19 changes: 19 additions & 0 deletions solana/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,25 @@ Run the following command to install necessary dependencies and to build the pro
make build
```

#### Verifiable Builds

For building verifiably, make sure [`solana-verify`](https://crates.io/crates/solana-verify) is installed and Docker is installed and running.

Run the following command to build the program binaries deterministically for `mainnet`:

```sh
make artifacts-mainnet
```

> This will produce the generated artifacts in the `artifacts-mainnet` directory.

For Solana devnet builds, or local testing builds, use the following commands:

```sh
make artifacts-solana-devnet
make artifacts-tilt-devnet
```

### Test

Run the following command to generate the IDL and run the full Solana test-suite:
Expand Down
Loading