Sign inSign up

provable/ptokens-verifier

By provable

Updated almost 6 years ago

Verifies the proofs returned by the given set of bridges.

Image
0

977

provable/ptokens-verifier repository overview

pTokens Verifier

One liner

Just run

docker run \
    --name provalbe/ptokens-verifier  \
    --volume cache:/home/provable/cache \
    --env BRIDGES=https://pbtconeos-mainnet.ngrok.io/pbtc-on-eos,https://pbtconeth-mainnet.ngrok.io/pbtc-on-eth \
    --env INFO=1 provable/ptokens-verifier a

You may want to specify more bridges into the BRIDGES env variable.

Python

Usage
$ ./verify tests/res/strongbox.proof 529305b4094a51b86207431a287d82419c242f0d9100f488a65e30a939e40135 1de35be63eaea67abc3f52fefdd684ee39145430ffb60fa940d9814fdef7d9fe  

When the above exits with code 0 means the proof has passed, 1 otherwise.

Test
cd verification
python -m pytest

Docker

Build
docker build -t ptokens-verifier . 
Build Arguments

In order to overwrite the following just add the --build-arg option when building the docker. Use the option --env if you want to overwrite them when running the docker.

  • IPFS_GATEWAY: url to the IPFS node (default https://ipfs.ptokens.io)
  • BRIDGES: comma separated list of URLs from which we can get the evidence (default http://localhost:3002/pbtc-on-eth)
Run

You have a bunch of options:

  1. Specifying the index of the bridge we want to run, for example

    docker run --name verifier_0 ptokens-verifier 0

    This will use the first element (BRIDGE[0]) of the set.

  2. Specifying a instead of the index number, in this case all the evidences are verified sequentially:

    docker run --name verifier_all ptokens-verifier a

  3. With 1. and 2. you can also use a caching feature without downloading the apk each time from the IPFS node:

    docker run --name verifier_cache --volume cache:/home/provable/cache ptokens-verifier a

Useful settings:

When using docker run, you set the following environment variables for more verbose logging (disabled by default):

  • DEBUG=1
  • INFO=1
Test

If you are running the bridge locally or the IPFS gateway locally, specify the --nework host flag when running the container.

Tag summary

Content type

Image

Digest

Size

194.7 MB

Last updated

almost 6 years ago

docker pull provable/ptokens-verifier