fixed makefile
This commit is contained in:
14
Makefile
14
Makefile
@@ -1,11 +1,11 @@
|
|||||||
# Event Miner Makefile
|
# Event Miner Makefile
|
||||||
# Static build with nostr_core_lib dependency
|
# Build with nostr_core_lib dependency (uses system libraries)
|
||||||
|
|
||||||
CC = gcc
|
CC = gcc
|
||||||
CFLAGS = -Wall -Wextra -std=c99 -O2 -static
|
CFLAGS = -Wall -Wextra -std=c99 -O2
|
||||||
INCLUDES = -Inostr_core_lib/nostr_core
|
INCLUDES = -Inostr_core_lib/nostr_core
|
||||||
LIBS = -lm -lpthread
|
LIBS = -lz -ldl -lpthread -lm -L/usr/local/lib -lsecp256k1 -lssl -lcrypto -L/usr/local/lib -lcurl
|
||||||
NOSTR_LIB = nostr_core_lib/libnostr_core.a
|
NOSTR_LIB = nostr_core_lib/libnostr_core_x64.a
|
||||||
|
|
||||||
# Default target
|
# Default target
|
||||||
all: event_miner
|
all: event_miner
|
||||||
@@ -19,14 +19,14 @@ event_miner: event_miner.c $(NOSTR_LIB)
|
|||||||
# Build nostr_core_lib dependency
|
# Build nostr_core_lib dependency
|
||||||
$(NOSTR_LIB):
|
$(NOSTR_LIB):
|
||||||
@echo "Building nostr_core_lib dependency..."
|
@echo "Building nostr_core_lib dependency..."
|
||||||
cd nostr_core_lib && make
|
cd nostr_core_lib && ./build.sh x64
|
||||||
@echo "✓ nostr_core_lib built successfully"
|
@echo "✓ nostr_core_lib built successfully"
|
||||||
|
|
||||||
# Clean target
|
# Clean target
|
||||||
clean:
|
clean:
|
||||||
@echo "Cleaning build artifacts..."
|
@echo "Cleaning build artifacts..."
|
||||||
rm -f event_miner
|
rm -f event_miner
|
||||||
cd nostr_core_lib && make clean
|
cd nostr_core_lib && rm -f *.o libnostr_core_*.a
|
||||||
|
|
||||||
# Clean only event_miner (keep nostr_core_lib)
|
# Clean only event_miner (keep nostr_core_lib)
|
||||||
clean-miner:
|
clean-miner:
|
||||||
@@ -75,6 +75,6 @@ help:
|
|||||||
@echo " make clean && make # Clean rebuild"
|
@echo " make clean && make # Clean rebuild"
|
||||||
@echo " make test # Build and test"
|
@echo " make test # Build and test"
|
||||||
@echo ""
|
@echo ""
|
||||||
@echo "The binary will be statically linked with no external dependencies."
|
@echo "The binary will be linked with system libraries (OpenSSL, curl, secp256k1)."
|
||||||
|
|
||||||
.PHONY: all clean clean-miner test install uninstall rebuild help
|
.PHONY: all clean clean-miner test install uninstall rebuild help
|
||||||
|
|||||||
BIN
event_miner
Executable file
BIN
event_miner
Executable file
Binary file not shown.
@@ -16,7 +16,10 @@
|
|||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <getopt.h>
|
#include <getopt.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include "nostr_core_lib/nostr_core/nostr_core.h"
|
#include "nostr_core_lib/nostr_core/nostr_common.h" // Common definitions and init/cleanup
|
||||||
|
#include "nostr_core_lib/nostr_core/nip001.h" // Basic protocol functions
|
||||||
|
#include "nostr_core_lib/nostr_core/nip013.h" // Proof-of-work functions
|
||||||
|
#include "nostr_core_lib/nostr_core/nip019.h" // Bech32 decoding for nsec
|
||||||
#include "nostr_core_lib/cjson/cJSON.h"
|
#include "nostr_core_lib/cjson/cJSON.h"
|
||||||
|
|
||||||
// Constants
|
// Constants
|
||||||
@@ -346,7 +349,10 @@ static void* miner_thread(void* arg) {
|
|||||||
void (*progress_cb)(int, uint64_t, void*) = ctx->verbose_enabled ? verbose_pow_callback : NULL;
|
void (*progress_cb)(int, uint64_t, void*) = ctx->verbose_enabled ? verbose_pow_callback : NULL;
|
||||||
|
|
||||||
int result = nostr_add_proof_of_work(local_event, ctx->private_key,
|
int result = nostr_add_proof_of_work(local_event, ctx->private_key,
|
||||||
ctx->target_difficulty, progress_cb, ctx);
|
ctx->target_difficulty, 1000000, // max_attempts
|
||||||
|
1000, // progress_report_interval
|
||||||
|
30, // timestamp_update_interval (seconds)
|
||||||
|
progress_cb, ctx);
|
||||||
|
|
||||||
attempts++;
|
attempts++;
|
||||||
|
|
||||||
|
|||||||
Submodule nostr_core_lib updated: 711a7cc15c...19452f45c2
Reference in New Issue
Block a user