Skip to content

Contribution

Are you ready to contribute to SingularityNET? We'd love to have you on board, and we will help you as much as we can.

Questions and help

This is our guideline for Issues and Bugs and for Feature Requests.

You can meet and chat with other developers via the following channels:

Issues and Bugs

If you find a bug in the source code or a mistake in the documentation, you can help us by submitting a ticket to our GitHub issues. Even better, you can decide to submit a pull request to our projects if you decide to fix it.

Please see the Submission Guidelines below.

Feature Requests

You can request a new feature by submitting a ticket to any of our repositories in the issues tab. For example, if you would like to give feedback about our Developer Portal, please do that here.

If you would like to implement a new feature then consider what kind of change it is:

  • Major Changes that you wish to contribute to the project should be discussed first. Please open a ticket which clearly states that it is a feature request in the title and explain clearly what you want to achieve in the description, and the developers team will discuss with you what should be done in that ticket. You can then start working on a Pull Request.
  • Small Changes can be proposed without any discussion. Open up a ticket which clearly states that it is a feature request in the title. Explain your change in the description, and you can propose a Pull Request straight away.

Submission Guidelines

Submitting an Issue

Before you submit your issue, please first search the archive. It could be that your question was already answered or the issue was already reported.

If your issue appears to be a bug, and has not been reported, open a new issue. Help us minimize the effort we need to take to fix issues and adding new features by not reporting duplicate issues. Providing the following information will increase the chances of your issue being dealt with quickly:

  • Overview of the issue - If an error is being thrown, a stack trace helps.
  • Motivation for or Use Case - Explain why this is a bug for you.
  • Reproduce the error - An unambiguous set of steps to reproduce the error.
  • Related issues - Has a similar issue been reported before?
  • Suggest a Fix - If you can't fix the bug yourself, perhaps you can point to what might be causing the problem (line of code or commit).
  • Project Version(s) - Is it a regression?
  • Operating System - Indicate the used operating system.

Submitting a Pull Request

Before you submit your pull request consider the following guidelines:

  • Search GitHub for an open or closed Pull Request that relates to your submission.

  • Fork our repository and make your changes.

  • Include appropriate test cases.

  • Follow our Coding Rules.

  • Ensure that all tests pass.

  • Commit your changes using a descriptive commit message that follows our commit message conventions.

    sh
    git commit -a

    Note: the optional commit -a command line option will automatically "add" and "rm" edited files.

  • In GitHub, send a pull request to the original repository.

  • If we suggest changes then:

    • Make the required updates.
    • Re-run all the tests on your sample generated project to ensure tests are still passing.
    • Rebase your branch and force push to your GitHub repository (this will update your Pull Request).

That's it! Thank you for your contribution!

Resolving pull request conflicts

Sometimes your PR will have merge conflicts with the original repository's master branch. There are several ways to solve this but if not done correctly this can end up as a true nightmare. So here is one method that works quite well.

  • First, fetch the latest version from the original repository

    sh
    git fetch original_repository_git_url
  • Merge your changes with the latest changes from the original repository.

    sh
    git merge FETCH_HEAD
  • Commit and push your changes.

    sh
    git add.
    git commit -a
    git push

Coding Rules

To ensure consistency throughout the source code, keep these rules in mind as you are working:

  • All features or bug fixes must be tested by one or more tests.
  • The project must have unit tests and integration tests to all features.
  • Code files must be formatted using default code style of each used language.
  • All code files must be well documented.

Git Commit Guidelines

Please ensure to squash unnecessary commits so that your commit history is clean.

Commit Message Format

We prefer well formatted commit messages - it makes it easier to understand what was done and why it was done, and it helps inform our decisions to accept your PRs or to request for a change.

Each commit message consists of a header, a body and a footer.

sh
<header>
<BLANK LINE>
<body>
<BLANK LINE>
<footer>

Any line of the commit message cannot be longer 100 characters! This allows the message to be easier to read on GitHub as well as in various git tools.

The header contains a succinct description of the change:

  • use the imperative, present tense: "change" not "changed" nor "changes"
  • don't capitalize first letter
  • no dot (.) at the end

Body

If your change is simple, the body is optional. Just as in the header, use the imperative, present tense: "change" not "changed" nor "changes". The body should include the motivation for the change and contrast this with previous behavior.

The footer is the place to reference GitHub issues that this commit Closes.

You must use the GitHub keywords for automatically closing the issues referenced in your commit.

Example

For example, here is a good commit message:

sh
upgrade to Python 3.10+

upgrade the project builds to use the new Python 3.10+
see https://www.python.org/download/releases/

Fix #1234

Developer Portal

If you would like to contribute by helping us improve, expand, or otherwise enhance the SingularityNET Developer Portal you are welcome to do so. You can send a PR for simple changes, or first open an issue for big changes here.

Guidelines for service integration in SingularityNET

These are guidelines to help SingularityNET developers to write/integrate new AI services to the platform.

Supported languages

SingularityNET services use gRPC which is an open-source universal RPC framework. So any new service must provide its API in gRPC.

gRPC supports several programming languages and a guide for each of them is available here.

  • C++
  • Java
  • Python
  • Go
  • Ruby
  • C#
  • Node.js
  • Android Java
  • Objective-C
  • PHP

There are tutorials with step-by-step instructions for implementing a new service in each of these languages:

If you already have a gRPC service, this tutorial explains how to publish it in SingularityNET:

Make sure you follow our naming standardisation guidelines.

AI frameworks

There are a couple of AI frameworks integrated to SingularityNET so you can just add new functionalities to services which are already published.

  • Opencog: an open-source software project aimed at directly confronting the AGIX challenge, using mathematical and biological inspiration and professional software engineering techniques.

There are tutorials with step-by-step instructions on how to extend the existing AI framework service in order to implement new functionalities:

Third-party code and models

Before publishing a service based on third-party code or model(s), make sure you follow all the guidelines below.

  1. The service is FREE.
  2. The main documentation of the service (e.g. README.md) mentions (crystal clear) that the service is based on third-party work.
  3. The original work (code, paper, model etc) is clearly mentioned and properly linked in README.
  4. The authors of the original code or model(s) are clearly mentioned in README.
  5. Any licenses attached to the original work is mentioned in README.
  6. The terms of any license attached to the original work allows its use in SNET.

See this example of third-party based service documentation which is fully compliant with these guidelines.

Service documentation

All the following documentation is mandatory for any service.

  1. README describing the structure of the repository and how to build/test the service. This is a sort of "developer's guide" aimed at people interested in extending or reusing the service.
  2. docs/index.html pointed by standard Github Pages describing how to use the service. This is the "user's guide" of your service.
  3. LICENSE with SNET standard license.

If you are extending an existing service. Follow any particular guidelines of the specific project and make sure you update all the aforementioned documents accordingly.

See this example of service documentation which is fully compliant with these guidelines.

Contributing to existing projects

SingularityNET have several AI service integration projects. See our github for a list of them. Before contributing to any of thees, please read our contribution-guidelines.