Skip to content

Commit

Permalink
Merge pull request #13 from GalactechsLLC/dg_updates
Browse files Browse the repository at this point in the history
Dg updates and Chip22 Updates
  • Loading branch information
DaOneLuna authored Feb 29, 2024
2 parents 20b728c + 9fd8e3a commit 82dfd0f
Show file tree
Hide file tree
Showing 18 changed files with 1,932 additions and 693 deletions.
915 changes: 759 additions & 156 deletions Cargo.lock

Large diffs are not rendered by default.

59 changes: 34 additions & 25 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "dg_fast_farmer"
version = "1.0.1"
version = "1.0.2"
edition = "2021"
authors = ["James Hoerr"]
description = "A lite farmer for the Chia Blockchain."
Expand All @@ -12,35 +12,44 @@ repository = "https://github.com/GalactechsLLC/dg_fast_farmer"
name="ff"
path="src/main.rs"

[profile.release]
codegen-units = 1
lto = "fat"

[dependencies]
async-trait = "0.1.74"
blst = "0.3.11"
async-trait = "0.1.77"
bip39 = {version= "2.0.0", features=["rand"] }
blst = "0.3.7"
bytefmt = "0.1.7"
clap = { version = "4.4.10", features = ["derive"] }
chrono = "0.4.31"
clap = { version = "4.5.1", features = ["derive"] }
chrono = "0.4.34"
crossterm = "0.27.0"
dialoguer = "0.11.0"
dg_xch_cli = { version="1.2.1" }
dg_xch_clients = { version="1.2.1" }
dg_xch_core = { version = "1.2.1", features = ["paperclip"] }
dg_xch_keys = { version="1.2.1" }
dg_xch_macros = { version="1.2.1" }
dg_xch_pos = { version="1.2.1" }
dg_xch_puzzles = { version="1.2.1" }
dg_xch_serialize = { version="1.2.1" }
dg_xch_cli = { version= "2.0.2" }
dg_xch_clients = { version= "2.0.2" }
dg_xch_core = { version = "2.0.2", features = ["paperclip"] }
dg_xch_keys = { version= "2.0.2" }
dg_xch_macros = { version= "2.0.2" }
dg_xch_pos = { version= "2.0.2" }
dg_xch_puzzles = { version= "2.0.2" }
dg_xch_serialize = { version= "2.0.2" }
futures-util = "0.3.29"
hex = "0.4.3"
home = "0.5.5"
home = "0.5.9"
log = "0.4.20"
once_cell = "1.18.0"
ratatui = "0.24.0"
reqwest = {version="0.11.22", default-features = false, features =["rustls-tls", "json"]}
serde = {version="1.0.193", features = ["derive"]}
serde_json = "1.0.108"
serde_yaml = "0.9.27"
simple_logger = "4.3.0"
sysinfo = "0.29.11"
tokio = {version = "1.34.0", features=["rt-multi-thread", "sync", "signal", "macros", "process", "time", "fs", "net"]}
once_cell = "1.19.0"
rand = { version = "0.8.5", features = [] }
ratatui = "0.26.1"
reqwest = {version="0.11.24", default-features = false, features =["rustls-tls", "json"]}
serde = {version="1.0.197", features = ["derive"]}
serde_json = "1.0.114"
serde_yaml = "0.9.32"
simple_logger = "4.3.3"
sysinfo = "0.30.5"
tokio = {version = "1.36.0", features=["rt-multi-thread", "sync", "signal", "macros", "process", "time", "fs", "net"]}
tokio-tungstenite = {version = "0.20.1", features = ["rustls-tls-webpki-roots", "rustls"] }
tui-logger = {version = "0.10.0", default-features = false, features=["examples-ratatui-crossterm"]}
uuid = {version="1.6.1", features=["v4"]}
tui-logger = {version = "0.11.0"}
uuid = {version="1.7.0", features=["v4"]}

[build-dependencies]
bindgen = "0.69.4"
29 changes: 29 additions & 0 deletions Dockerfile
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"]
32 changes: 32 additions & 0 deletions build.rs
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!");
}
19 changes: 19 additions & 0 deletions build_docker.sh
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
23 changes: 21 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,17 @@ Running

To generate the farmer config:
```
ff init -m "MNEMONIC" -f FULLNODE_HOST -p FULLNODE_PORT -n SELECTED_NETWORK
ff init -f FULLNODE_HOST -p FULLNODE_PORT -n SELECTED_NETWORK
```

To use a separate Fullnode for RPC calls during setup:
```
ff init -m "MNEMONIC" -f FULLNODE_HOST -p FULLNODE_PORT -r FULLNODE_RPC_HOST -o FULLNODE_RPC_PORT -n SELECTED_NETWORK
ff init -f FULLNODE_HOST -p FULLNODE_PORT -r FULLNODE_RPC_HOST -o FULLNODE_RPC_PORT -n SELECTED_NETWORK
```

For Wallets with lots of transactions, the init call runs much faster when targeting a launcher_id with -l:
```
ff init -f FULLNODE_HOST -p FULLNODE_PORT -r FULLNODE_RPC_HOST -o FULLNODE_RPC_PORT -n SELECTED_NETWORK -l LAUNCHER_ID
```

To run the Farmer with TUI Interface(Default):
Expand All @@ -41,3 +46,17 @@ To run the Farmer in CLI mode:
```
ff run
```

To Update the PlotNFTs in the Config:
```
ff update-pool-info
```

To Migrate the PlotNFTs in the config:
```
ff join-pool --pool-url <POOL_URL> --mnemonic <MNEMONIC> --launcher-id <LAUNCHER_ID> --fee <FEE>
```

> [!TIP]
> To Print all available commands ```ff --help``` <br>
> To Print Command Help ```ff <COMMAND> --help```
Loading

0 comments on commit 82dfd0f

Please sign in to comment.