Page MenuHomePhabricator

[alias-server] Initialize serverState database collection with read and write helper methods
ClosedPublic

Authored by bytesofman on Apr 13 2023, 14:14.

Details

Summary

T3060

Depends on D13701

Initialize serverState collection with read and write helper methods.

serverState will be used to determine how many tx from chronik tx history call have not yet been processed by the server.

Test Plan

npm test

Diff Detail

Repository
rABC Bitcoin ABC
Branch
alias-server-add-server-state
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 23287
Build 46193: Build Diffalias-server-tests
Build 46192: arc lint + arc unit

Event Timeline

Add new unit test for app restart

Fabien added inline comments.
apps/alias-server/src/db.js
60 ↗(On Diff #39691)

why do you need to convert to an array if there is a single element ?

Use .next() instead of .toArray()

bytesofman added inline comments.
apps/alias-server/src/db.js
60 ↗(On Diff #39691)

Looks like there is a way to get just the doc and not the array. patched.

https://www.mongodb.com/docs/drivers/node/current/usage-examples/find/

This revision is now accepted and ready to land.Apr 13 2023, 16:02