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
Lint
Lint Not Applicable
Unit
Tests Not Applicable

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