Skip to content

Commit d991fbb

Browse files
committed
refactor: rewrite client with dynamic metadata, remove iteration-based queries
- Rewrite client to use subxt dynamic queries (no compile-time codegen) - Remove functions requiring storage iteration (no on-chain index): - get_farm_ids_by_twin, get_farms_by_twin - get_nodes_by_farm, get_nodes_by_twin - is_farmer, get_farmer_info - Fix get_node_ids_by_farm to use correct storage name (NodesByFarmID) - Update dependencies to latest versions - Add example mainnet_test.rs - Update readme with current API documentation
1 parent c29e0b0 commit d991fbb

10 files changed

Lines changed: 2736 additions & 3202 deletions

File tree

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
tfwallet
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#!/bin/bash
2+
set -e
3+
4+
echo "Building tfwallet (optimized)..."
5+
6+
# Build with maximum optimization flags
7+
# -s: omit symbol table
8+
# -w: omit DWARF debugging info
9+
# -trimpath: remove file system paths from binary
10+
CGO_ENABLED=0 go build \
11+
-ldflags="-s -w" \
12+
-trimpath \
13+
-o tfwallet \
14+
./cmd/tfwallet
15+
16+
SIZE=$(ls -lh tfwallet | awk '{print $5}')
17+
echo "Binary size: $SIZE"
18+
19+
# Compress with UPX if available (Linux only - macOS has issues)
20+
if [[ "$OSTYPE" != "darwin"* ]] && command -v upx &> /dev/null; then
21+
echo "Compressing with UPX (maximum compression)..."
22+
upx --best --lzma tfwallet
23+
SIZE=$(ls -lh tfwallet | awk '{print $5}')
24+
echo "Compressed size: $SIZE"
25+
fi
26+
27+
echo ""
28+
echo "Build complete: ./tfwallet"

0 commit comments

Comments
 (0)