Page MenuHomePhabricator

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

Authored by bytesofman on Mar 13 2024, 12:56.

Details

Reviewers
PiRK
Group Reviewers
Restricted Project
Commits
rABC867acd34be5d: [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

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

bytesofman retitled this revision from [token-server] Serve static files like token icons to [token-server] Serve token icons (or blockie if unset).
bytesofman edited the summary of this revision. (Show Details)
This revision is now accepted and ready to land.Mar 14 2024, 17:04