You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The branch feat/improve-sdk is including a solid draft of the upcoming ordinals-api re-architecture.
Instead of starting ordhook and registering ordinals-api as an http observer receiving payloads including ordinals inscriptions / transfers, the incoming version of ordinals-api will pull a NPM @hirosystems/ordhoook-sdk-js library and implement the following skeleton (present in components/ordhook-sdk-js/lib/test.ts:
import{OrdinalsIndexer}from"./index";constindexer=newOrdinalsIndexer({bitcoinRpcUrl: 'http://0.0.0.0:8332',bitcoinRpcUsername: 'devnet',bitcoinRpcPassword: 'devnet',workingDirectory: '/Users/ludovic/ordhook-sdk-js',logs: false});indexer.applyBlock(block=>{console.log(`Hello from JS ${JSON.stringify(block)}`);});indexer.undoBlock(block=>{console.log(`Hello from JS ${JSON.stringify(block)}`);});indexer.streamBlocks();
The OrdinalsIndexer struct can be fully piloted in Typescript. In case of migrations, the following actions can also be performed:
// Delete blocks and inscriptionsindexer.dropBlocks([32103,32104]);// Re-download + index blocksindexer.rewriteBlocks([32103,32104]);// Sync blocks until chain tipindexer.syncBlocks();// Replay a list of blocksindexer.replayBlocks([32103,32104]);
The ordhook-sdk-js is producing a state (rocksdb+sqlite) identical to the one being produced by ordhook-cli. So a state produced by ordhook-cli can be reused by an app being built with ordhook-sdk-js and vice-versa.
Remaining work:
Wire dropBlocks method
Wire rewriteBlocks method
Wire syncBlocks method
Wire replayBlocks method
Manually publish ordhook-sdk-js on NPM for end to end testing
Automatically publish ordhook-sdk-js via CI
Prepare docker image
The text was updated successfully, but these errors were encountered:
The branch
feat/improve-sdk
is including a solid draft of the upcomingordinals-api
re-architecture.Instead of starting
ordhook
and registeringordinals-api
as an http observer receiving payloads including ordinals inscriptions / transfers, the incoming version ofordinals-api
will pull a NPM@hirosystems/ordhoook-sdk-js
library and implement the following skeleton (present incomponents/ordhook-sdk-js/lib/test.ts
:The
OrdinalsIndexer
struct can be fully piloted in Typescript. In case of migrations, the following actions can also be performed:The
ordhook-sdk-js
is producing a state (rocksdb+sqlite) identical to the one being produced byordhook-cli
. So a state produced byordhook-cli
can be reused by an app being built withordhook-sdk-js
and vice-versa.Remaining work:
dropBlocks
methodrewriteBlocks
methodsyncBlocks
methodreplayBlocks
methodordhook-sdk-js
on NPM for end to end testingordhook-sdk-js
via CIThe text was updated successfully, but these errors were encountered: