Skip to content

source code and tests for Sovrin Ledger plugins

License

Notifications You must be signed in to change notification settings

sovrin-foundation/token-plugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

img

Open in Gitpod

Table of Contents

  1. Sovrin Token Plugins
    1. Announcements
    2. Install
    3. Development Environment
      1. Why cant I use my own local machine as my enviroment?
      2. How to Start Working with the Code
      3. Alternative for running tests
    4. How To Contribute

Hex.pm GitHub version

Sovrin Token Plugins

This repo contains the plugins to create the Sovrin payment ledger plugins: Token and Fees

Announcements

February 12 2024

The project branches have changed.

The main branch now contains the Ubuntu 20.04 work stream, and the previous master branch containing the Ubuntu 16.04 work stream has been moved to the ubuntu-16.04 branch.

The following changes were made to the branches:

  • master (default) renamed to ubuntu-16.04
    • This retargeted the associated PRs, which were then closed.
  • ubuntu-20.04 set as the default branch.
  • ubuntu-20.04 (default) renamed to main

Project sunset notice.

The token plugins are being phased out. There will be one final release of the Ubuntu 20.04 based code to be included in the v1.2.0 release of the Sovrin package. Subsequent releases of the Sovrin package will not contain the token plugins.

Following the Sovrin v1.2.0 release this repository will be archived.

Install

run the following command:

./build_indy_pool

Development Environment

Why is a docker environment included?

We provide a docker environment that comes pre-loaded with all required dependencies and consider this to be the easiest way for any new developer to get setup and start testing their code.

How to Start Working with the Code

The preferred method of setting up the development environment is to use the devcontainers. All configuration files for VSCode and Gitpod are already placed in this repository. If you are new to the concept of devcontainers in combination with VSCode here is a good article about it.

Simply clone this repository and VSCode will most likely ask you to open it in the devcontainer, if you have the correct extension("ms-vscode-remote.remote-containers") installed. If VSCode didn't ask to open it, open the command palette and use the Remote-Containers: Rebuild and Reopen in Container command.

If you want to use Gitpod simply use this link or if you want to work with your fork, prefix the entire URL of your branch with gitpod.io/# so that it looks like https://gitpod.io/#https://github.com/sovrin-foundation/token-plugin/tree/ubuntu-20.04.

Be aware that the automatic test discovery may need a kickstart via the command palette and Python: Configure Tests.

Alternative for running tests

To use this script, you will need to use make as instructed above. Once you have the docker image running and synchronized, you can use run-test.sh to run individual tests.

We have a shell script to assist with running tests. Here's an example:

./run-test.sh token test_token_req_handler test_token_req_handler_MINT_PUBLIC_validate_missing_output

The first parameter is required. It can be either token or fees. Anything else will return an error.

The remaining parameters are optional.

The second parameter is file name without the .py.

The third parameter is the name of the test.

  1. To run all sovtoken tests call it like this:

    ./run-test.sh token
    
  2. To run all sovtoken tests in a file, call it like this:

    ./run-test.sh token test_token_req_handler
    

Devops ci/cd

All ci/cd configuration for this project is stored within /devops . This includes a makefile used to build this project. Some useful make targets are:

  1. image_ci builds the token-plugin image in the same manner as the ci/cd scripts. Defaults to building using a base 20.04 ubuntu image. can be customised by specifying the OSNAME ie make image_ci OSNAME=xenial
  2. image_ci_xenial convenience target, results in the same build as make image_ci OSNAME=xenial
  3. test_local_aws execute a local aws codebuild, first building the image, defaulting to a base ubuntu 20.04 image, configurable in the same method as above.

How To Contribute

Please follow the guide here.