HomePhabricator

[token-server] Serve token icons (or blockie if unset)

Description

[token-server] Serve token icons (or blockie if unset)

Summary:
We want to server token icon files (and, eventually, NFT images) from the token-server. If a token icon is not found, serve a blockie.

With the current system, Cashtab renders a blockie if it cannot find a token icon. It is better to do this server-side to avoid all the server errors for requesting non-existent images (T1981).

We use a --mount for docker to mirror a directory on the server into the docker container. This means the docker container is able to write to this folder (e.g. when we start accepting token icon uploads), and also a user may manually update the directory to include new token icons (not uncommon for someone to request an icon change -- also, when we start using this as the main token icon server, I will need to add all the existing icons to this directory).

In testing, if you add a new icon manually to the folder while the container is running, the container will get the new icon.

Test Plan: npm test

Reviewers: #bitcoin_abc, PiRK

Reviewed By: #bitcoin_abc, PiRK

Differential Revision: https://reviews.bitcoinabc.org/D15690

Details

Provenance
bytesofmanAuthored on Mar 13 2024, 12:55
bytesofmanPushed on Mar 15 2024, 16:45
Reviewer
Restricted Project
Differential Revision
D15690: [token-server] Serve token icons (or blockie if unset)
Parents
rABCd361d204b892: fuzz: Add fuzzing harness for LoadMempool(...) and DumpMempool(...)
Branches
Unknown
Tags
Unknown