Skip to content

copyright-project/agamon

Repository files navigation

Agamon

Process of migrating state from one contract to another

High-level procedure

  1. Move authentication service to register users in a new db
  2. Make changes in image-hash service
  3. Stop sync jobs
  4. Deploy new contract
  5. Run migration script
  6. Make change in cron jobs
  7. Start the jobs again

Migration script

  1. Take users from the old db and put them in Q1

  2. Take a user from Q1

    1. Check that Instagram access token is valid
    2. Create a new record in the db with userId, accessToken and copyright
    3. Get user's all images
    4. Update last maxSyncedMaxId in the db
    5. Put all images in the Q2
  3. Take image from Q2

    1. Calculate image hash
    2. Create a new record in the contract
    3. Update number of registered images

Changes to existing code base

Authentication service

  1. Change db url to store newly registered users

Image hash

  1. Change api of /hash to return binary hash of the image too

Cron jobs

  1. Work with new db
  2. Change the format of state DTO

Releases

No releases published

Packages

No packages published