Repository navigation
Publish as @runonflux/bitcore-node 4.0.0 on Node 24 - #19
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
zeromq 6 subscribes with the promise API: a Subscriber socket whose messages are read with for await, and connection logging from its event observer. socket.io 4 accepts Engine.IO v3 clients (allowEIO3) and reflects every origin with credentials on the transport, as socket.io 2 did; socketHandler still applies allowedOriginRegexp. Express 5 apps keep the qs query parser. lru-cache 11, commander 15, liftoff 5, async 3 and body-parser 2 replace their old majors. mkdirp, rimraf and path-is-absolute give way to fs.mkdir/fs.rm recursive and path.isAbsolute. The npm module is replaced by the system npm: remove runs `npm ls <service> --json` in the configuration directory. bitcoind-rpc and bitcore-lib are git+https dependencies pinned to their master heads. npm 12 refuses git dependencies and dependency install scripts by default, so .npmrc allows git and package.json approves the zeromq, bufferutil and utf-8-validate install scripts. Test tooling is mocha 12, chai 6, sinon 22 and proxyquire 2, with c8 for coverage; jshint, istanbul and coveralls are dropped. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
zeromq 6 ships prebuilt binaries with libzmq bundled. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The expectations describe the Flux node: t-addresses, the Flux block header, rpc ports 16124/26124, the address balance subscription and event, the 27 API methods, a history window of 500, getblockhashes with its options argument, getInfo with network info, and console.debug for debug logs. The scaffold create tests wait for their callbacks and check the base configuration create writes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
bitcore-lib's lodash 4 has no _.unique; _.uniq is in both 3 and 4. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The package is published to npm under the runonflux scope and takes @runonflux/bitcore-lib ^0.16.0 and @runonflux/bitcoind-rpc ^0.8.0 from npm, so it has no git dependency. It ships index.js, bin and lib. The CLI finds a node's local install by that name, and `create` writes a package that depends on the scoped packages and approves, by name, the install scripts bitcore-node approves. regtest/p2p.js and its devDependency bitcore-p2p are removed: BitPay's Bitcoin P2P client cannot parse Flux's Zcash-format blocks, and bitcore-node reaches fluxd over RPC and ZMQ only. installExplorer.sh installs bitcore-node and insight-api from npm, names the insight-api service @runonflux/insight-api, and adds the MongoDB 8.0 and Flux apt repositories with signed-by keyrings. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A configured service package @runonflux/insight-api provides the service insight-api: its settings stay under servicesConfig.insight-api and services that depend on insight-api, such as insight-ui, find it. installExplorer.sh installs insight-ui from npm as @runonflux/insight-ui. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
CI runs the tests on every push and pull request. A published GitHub release sets the package version from its tag, runs the tests and stages that version on npm through trusted publishing: it stays unpublished until a maintainer approves it on npmjs.com with 2FA. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… take A socket RPC call passes the registered number of parameters followed by the callback. getNetworkHash takes a height and getAddressSummary an address and options; with the counts at 0 and 1 the callback landed in a data parameter and answering threw, which exits the process. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A request without an Origin gets Access-Control-Allow-Origin "*" and no credentials; one with an Origin gets it back with credentials. The io cookie is SameSite=Strict. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
npm verifies a provenance-signed publish by comparing repository.url with the GitHub repository the workflow ran in, case-sensitively. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…from npm Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A signal listener is called with the signal's name. Bound straight to exitHandler, that name arrived as its error: every SIGINT also took the uncaught-exception path, ran a second shutdown and exited -1. SIGTERM, the stop signal of docker, systemd and pm2, now stops the node the same way. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Each cache held a number of entries whatever their size: an address's utxo or txid list can run to hundreds of thousands of items, and 50,000 of them fill any memory. options.cacheSizeMB (default 512) is now shared out between the caches, each entry is sized by its buffers and lists, and a value larger than 16 MB is not cached. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Publishes
@runonflux/bitcore-node4.0.0: Node 24, zeromq 6, socket.io 4 (v2/v3 clients still served), express 5. A scoped package runs as the service named without its scope (@runonflux/insight-apiis the serviceinsight-api), so existingservicesConfigkeys and service dependencies keep working.installExplorer.shinstalls from npm.The socket.io handshake carries the same CORS headers and
iocookie (SameSite=Strict) as socket.io 2. The socket RPC registersgetNetworkHash(a height) andgetAddressSummary(an address and options) with the arguments they take.379 tests pass. Running on labnet (the lab's own Flux chain) beside 1.3.0's stack on the same node: the API answers identically, and over socket.io 2.x clients get the same handshake headers, the same answers to every socket RPC method and the same events (blocks, transactions, address subscriptions) with identical payloads; socket.io 4.x clients connect too. The React UI works against it in a browser, and a transaction sent through
/api/tx/sendwas mined.Publishing. This package is released through npm's staged publishing. Publishing a
GitHub release (tag
vX.Y.Z) runs CI, which sets the version from the tag, runs the tests andstages that version on npm through trusted publishing (GitHub's OIDC; no npm token is stored).
A staged version is not public: nobody can install it until a maintainer approves it on
npmjs.com, or with
npm stage approve, which requires 2FA. Each package needs a trustedpublisher on npmjs.com for this repository's
ci.yml, allowing staged publishing only.Order: each layer is published before the one above it. The packages depend on each other
by version, so they are released lowest first, each approved before the next:
bitcoind-rpcandbitcore-libbitcore-messagebitcore-node,insight-apiandinsight-uiUntil the packages below this one are on npm, this PR's CI cannot install them and fails; that
is the order, not a broken change. Once they are published, this PR refreshes its
package-lock.jsonagainst npm in one commit, and CI passes.🤖 Generated with Claude Code