Skip to content

this tool allows SWG workers to check if the local files are identical to the files listed under their bucket in storage node

Notifications You must be signed in to change notification settings

Joystream/swg-files-comparer

Repository files navigation

SWG-files-comparer

This tool allows to check if some of the files for collosus were lost and if they can be found on other nodes.

Installation

# Install dependencies

yarn install

# Build the project

yarn build

Usage

Run the program using yarn start. You will see the command seleciton menu.

  1. Index local files
 localFiles
 @param <pathToDirectory>

This command will index the files in the directory and create a file localFiles.json in the root directory of the project. It will be used for comparison later.

  1. Index objects from bucket
 bucketObjects
 @param <bucketId>
 @param <optional> <bagId>

This will get all the bags from the bucket and index all the objects in them. It will create a file remote.json in the root directory of the project.

With provided bagId it will get all the objects from the bag and index them. It will create a file remote-${bagId}.json in the root directory of the project.

  1. Compare the files
diff
@param <optional><bagId>

This will compare your bags from local.json with the bags from remote.json and will output the results in diff.json in the root directory of the project and in the console.

With provided bagId it will compare your bags from local.json with the bags from remote-${bagId}.json and will output the results in diff-${bagId}.json in the root directory of the project and in the console.

  1. Check missing files
checkMissing
@param <pathToDiff>
@param <optional> <ignoreSp>

This will check the diff.json file and will show if some of the other SP has the missing files. You can specify the custom path to diff file and include the SP that you want to ignore in the search. e.g

  1. Download missing files
downloadMissing

This should be used after the checkMissing command. It will download the missing files from the remote node containing missing files.

$ yarn start restoreMissing ./jsons/diff.json 1,2,5
  1. Manual HEAD request
 head <providerUrl>
 @param <providerUrl>

This will execute a HEAD request to the specified url and will indicate a presence of the file.

  1. Check Remote node

    remotenode
    @param <providerUrl>

This will check the remote node and will return the same output as the localFiles command.

  1. Check single operator

    checknode
    @param <providerUrl>

This is a combination of remoteNode, bucketObjects and diff commands for a single operator. It will check the operator, check all files for its bags in QN and will generate a diff.

  1. Check all operators

    checkalloperators

This is a combination of remoteNode, bucketObjects and diff commands. It will check all the operators, check all files in QN and will generate a diff.

About

this tool allows SWG workers to check if the local files are identical to the files listed under their bucket in storage node

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published