-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13 from GalactechsLLC/dg_updates
Dg updates and Chip22 Updates
- Loading branch information
Showing
18 changed files
with
1,932 additions
and
693 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
FROM --platform=linux/amd64 rust:1.75-slim-bullseye AS toolchain | ||
RUN echo "fn main() {println!(\"dummy\");}" > dummy.rs | ||
|
||
FROM toolchain as sources | ||
COPY Cargo.toml Cargo.toml | ||
COPY Cargo.lock Cargo.lock | ||
COPY --from=toolchain dummy.rs src/main.rs | ||
# Build the project | ||
RUN cargo fetch | ||
|
||
FROM sources as build | ||
COPY src/ src/ | ||
RUN mkdir /build | ||
RUN cargo build --release && mv /target/release/* /build | ||
|
||
FROM debian:bullseye-slim AS dg_fast_farmer | ||
LABEL authors="James Hoerr" \ | ||
name="dg_fast_farmer" \ | ||
version="1.0.1" \ | ||
description="A lite farmer for the Chia Blockchain." \ | ||
license="Apache-2.0" \ | ||
homepage="https://github.com/GalactechsLLC/dg_fast_farmer" \ | ||
repository="https://github.com/GalactechsLLC/dg_fast_farmer" | ||
RUN apt update -y \ | ||
&& apt install -y ca-certificates \ | ||
&& apt autoremove -y \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
COPY --from=build --chmod=0755 /build/ff /usr/local/bin/ | ||
CMD ["ff run"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// use std::env; | ||
// use std::path::PathBuf; | ||
|
||
fn main() { | ||
// For Future Use, example on how to add 3rd party C Harvester | ||
// let project_path = | ||
// env::var("CARGO_MANIFEST_DIR").expect("Expected to find env var CARGO_MANIFEST_DIR"); | ||
// let interface_path = | ||
// env::var("C_SOURCE_PATH").unwrap_or(format!("{project_path}/c_interface")); | ||
// let header_file_path = format!("{interface_path}/C_HEADER_FILE.hpp"); | ||
// println!("cargo:rustc-link-arg=-Wl,-z,muldefs"); | ||
// println!("cargo:rustc-link-search={interface_path}"); | ||
// println!("cargo:rustc-link-lib=static:+whole-archive=stdc++"); | ||
// println!("cargo:rerun-if-changed={header_file_path}"); | ||
// let bindings = bindgen::Builder::default() | ||
// // The input header we would like to generate bindings for. | ||
// .header(header_file_path) | ||
// // Tell cargo to invalidate the built crate whenever any of the | ||
// // included header files changed. | ||
// .parse_callbacks(Box::new(bindgen::CargoCallbacks::new())) | ||
// .clang_arg("-std=c++14") | ||
// //Define each Function and Type to Allow | ||
// .allowlist_type("MANUALLY SET ALLOW LIST(These are the function names)") | ||
// .generate() | ||
// .expect("Unable to generate bindings"); | ||
|
||
// Write the bindings to the $OUT_DIR/bindings.rs file. | ||
// let out_path = PathBuf::from(env::var("OUT_DIR").unwrap()); | ||
// bindings | ||
// .write_to_file(out_path.join("bindings.rs")) | ||
// .expect("Couldn't write bindings!"); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/usr/bin/env bash | ||
if [ -z "$DOCKER_REPO" ]; then | ||
echo "DOCKER_REPO Not set" | ||
exit 1 | ||
fi | ||
docker buildx create --append --name cross_builder | ||
docker buildx use cross_builder | ||
docker buildx inspect --bootstrap | ||
|
||
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes | ||
|
||
timestamp=`date +%s` | ||
docker buildx build \ | ||
--ulimit nofile=1024000:1024000 \ | ||
--platform linux/amd64,linux/arm64 \ | ||
--target=dg_fast_farmer \ | ||
. -t $DOCKER_REPO/dg_fast_farmer:latest \ | ||
-t $DOCKER_REPO/dg_fast_farmer:build_${timestamp} \ | ||
--push |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.