Giter Site home page Giter Site logo

token-lists's Introduction

token-lists

Manages custom token lists for Brave Wallet

Automated Publishing

We have the following setup in place to automatically build and publish token-lists to wallet data files.

  1. A daily cron job on GitHub Actions that performs the following tasks:
    1. use @solflare-wallet/utl-aggregator to fetch the top SPL tokens on CoinGecko.
    2. commit the above list to data/solana/tokenlist.json.
    3. download and post-process token logos, and build a new NPM package.
    4. publish the above NPM package.
  2. A weekly cron job on Jenkins that publishes the latest NPM package (in 1.iv) to wallet data files.

The purpose of 2 independent cron jobs is to factor in flakiness of 1., and avoid performing PNG post-processing in 2.

Development

To test out the output of this package you have to use a docker. It has been tested on Linux and macOS:

  • Install docker
  • Create a docker image docker build -t token-lists .
  • Launch the docker image docker run -u "$(id -u):$(id -g)" -v "$PWD/build:/token-lists/build" -ti token-lists
  • You will see an output in the build folder

Publishing token list to npm

brave/brave-core-crx-packager uses the npm package published here brave-wallet-lists.

It will be automatically published when your PR is merged and release is created.

This outputs a no dependency package with output images and token lists.

Testing a deployment

To test wallet data files use the development component updater with a fresh profile.

To do this you can use the command line argument --use-dev-goupdater-url.

You can use a clean profile without clearing with this as well: --user-data-dir=<tmp-dir>.

If you're using a development build, you can set the dev server via this npmrc environment in ~/.npmrc:

updater_dev_endpoint=https://go-updater-dev.bravesoftware.com/extensions

You can test a deployment by running the Jenkins job named: brave-core-ext-wallet-data-files-update-publish-dev Please check to make sure it succeeds.

Wait 5-10 minutes as the server will purge its cache during that timeframe and start serving the new component.

Then startup Brave using: open -a Brave\ Browser\ Beta.app --args --use-dev-goupdater-url --user-data-dir=$(mktemp -d)

After things are tested you can run the Jenkins job: brave-core-ext-wallet-data-files-update-publish and then after success, test on your normal Brave profile. The change will be live within 5-10 minutes. Please also test on production.

After testing on production, gives sign off in Slack on #releases and #prod-changes.

Troubleshooting deployment

You can see a list of the components that the component updater serves by going to these URLs:

token-lists's People

Contributors

bbondy avatar dependabot[bot] avatar diracdeltas avatar github-actions[bot] avatar mihaiplesa avatar muliswilliam avatar nvonpentz avatar onyb avatar renovate-bot avatar sergeyzhukovsky avatar supermassive avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

token-lists's Issues

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

dockerfile
Dockerfile
  • node 16.13.0
github-actions
.github/workflows/audit.yml
  • actions/checkout v3
  • actions/setup-node v3
.github/workflows/build.yml
  • actions/checkout v3
  • actions/setup-node v3
.github/workflows/codeql-analysis.yml
  • actions/checkout v3
  • github/codeql-action v2
  • github/codeql-action v2
  • github/codeql-action v2
.github/workflows/npm-publish.yml
  • actions/checkout v3
  • actions/setup-node v3
.github/workflows/solana-tokenlist.yml
  • actions/checkout v3
  • actions/setup-node v3
  • stefanzweifel/git-auto-commit-action v4
npm
package.json
  • @solflare-wallet/utl-aggregator ^0.0.11
  • node-fetch 2
  • nodejs-file-downloader ^4.9.3
  • qyu ^0.4.7
  • sharp ^0.30.5
  • imagemin ^8.0.1
  • imagemin-pngquant fd51901
  • semver-regex >=4.0.5
  • uuid >=8.3.2
  • got >=11.8.5
  • bin-build da4209b
  • bin-wrapper 4bc5c9e
  • download c9c2589

  • Check this box to trigger a request for Renovate to run again on this repository

Sandboxed environment

@diracdeltas expresses concern about running scripts which contain vulnerabilities on real machines. It would be good to find a way to run them always on isolated environments. We have it running in a docker on CI, but not on dev machines.

can we make sure these scripts only get run in a sandboxed environment (like a docker container that gets destroyed after outputting the compressed PNG icons)? that way if there are malicious images or vulns in the dependencies, it shouldn't compromise any machines.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.