The daemon's wallet scan hashed every watched script against every block
filter with a BigInt SipHash: ~3 filters/s on the VPS once the gap limits
went to 200/100 (~3,300 scripts), i.e. days for a one-year window. The
matcher now lives in dgbpow.wasm next to the PoW hashes — scripts are
uploaded once per scan, each filter is one call, the set is decoded once
and each target binary-searched — ~5,500 filters/s locally, ~2,000/s on
the VPS with block fetches. The JS path was rewritten with uint32 lanes
and exact 32×32 partial products as a fallback (module missing or filter
beyond its buffers). scripts/gcs-check.ts cross-checks both against a
BigInt reference on random filters; `npm run gcs:test -w @dgb-wallet/p2p`.
NOWNodes stopped accepting the proxy's API key ("Unknown API_key" on every
endpoint), which is why the wallet showed "Blockbook HTTP 401" for every
path. The vhost mirror now proxies /blockbook/ to Atomic Wallet's public
Blockbook; ops/blockbook-upstream.sh switches the live vhost either way.
26 lines
1.2 KiB
Bash
26 lines
1.2 KiB
Bash
#!/usr/bin/env bash
|
|
# Build dgbpow.wasm from DigiByte Core's hash sources with emscripten in
|
|
# docker (no local toolchain needed). Output: packages/p2p/native/dgbpow.wasm
|
|
# which the daemon loads at startup (src/pow.ts).
|
|
#
|
|
# bash packages/p2p/native/build.sh
|
|
set -euo pipefail
|
|
here="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
IMG="${EMSDK_IMAGE:-emscripten/emsdk:3.1.61}"
|
|
|
|
# Git Bash on Windows mangles "/src" style args; MSYS_NO_PATHCONV keeps
|
|
# the container paths intact.
|
|
MSYS_NO_PATHCONV=1 docker run --rm -v "$here":/work -w /work "$IMG" bash -c '
|
|
set -e
|
|
emcc -O3 -DNDEBUG -fno-exceptions -fno-rtti \
|
|
-s STANDALONE_WASM=1 -s PURE_WASI=0 --no-entry \
|
|
-s EXPORTED_FUNCTIONS=_in_ptr,_out_ptr,_hash_qubit,_hash_skein512,_hash_groestl512,_hash_odo,_gcs_scripts_ptr,_gcs_offsets_ptr,_gcs_key_ptr,_gcs_filter_ptr,_gcs_matches_ptr,_gcs_limits_ptr,_gcs_set_count,_gcs_match \
|
|
-s INITIAL_MEMORY=33554432 -s ALLOW_MEMORY_GROWTH=0 -s STACK_SIZE=262144 \
|
|
-Isrc \
|
|
dgbpow.c gcs.c odo_glue.cpp \
|
|
src/luffa.cpp src/cubehash.cpp src/shavite.cpp src/simd.cpp src/echo.cpp \
|
|
src/skein.cpp src/groestl.cpp src/odocrypt.cpp src/KeccakP-800-reference.cpp \
|
|
-o dgbpow.wasm
|
|
ls -la dgbpow.wasm
|
|
'
|
|
echo "built: $here/dgbpow.wasm"
|