Skip to content

filecoin-station/voyager-evaluate

Repository files navigation

voyager-evaluate

Evaluate service

Development

Set up PostgreSQL with default settings:

  • Port: 5432
  • User: your system user name
  • Password: blank
  • Database: voyager_stats

Alternatively, set the environment variable $DATABASE_URL with postgres://${USER}:${PASS}@${HOST}:${POST}/${DATABASE}.

The Postgres user and database need to exist already, and the user needs full management permissions for the database.

You can also run the following command to set up the PostgreSQL server via Docker:

docker run -d --name voyager-db \
  -e POSTGRES_HOST_AUTH_METHOD=trust \
  -e POSTGRES_USER=$USER \
  -e POSTGRES_DB=voyager_stats \
  -p 5432:5432 \
  postgres

Run the tests

$ npm test

Run the service

$ WALLET_SEED=$(cat secrets/mnemonic) npm start

Troubleshooting

You can perform a dry-run evaluation of a given Meridan round using the script bin/dry-run.js.

At the moment, the script requires CID(s) of measurements to load. (In the future, we may discover those CIDs from on-chain events.)

Example: evaluate round 273 of Meridian version 0x3113b83ccec38a18df936f31297de490485d7b2e with measurements from CID bafybeie5rekb2jox77ow64wjjd2bjdsp6d3yeivhzzd234hnbpscfjarv4z.

❯ node bin/dry-run.js 0x3113b83ccec38a18df936f31297de490485d7b2e 273 bafybeie5rekb2jox77ow64wjjd2bjdsp6d3yeivhzzd234hnbpscfjarv4

Deployment

$ git push