Become a Model Provider
Setting up an MP service
Prerequisites
ONT ID
Each Model Provider must have a unique decentralized identifier (DID) to decrypt the data included in request messages. At present, it must be an ONT ID. You can get one by creating a wallet using ONTO app.
You can use one and the same DID to set up a DP and an MP.
Orange Provider SDK
An SDK in Go or Java is needed for signature and data encryption. Below instructions are illustrated in Go.
Wallet
You need to include a wallet file in the local directory of your project for decryption and signature.
Design Models and Build Methods
Usually one model works with one dedicated dataset, so you need to design the model based on your dataset. Or, you can also choose to design and publish your model on the Orange platform and offer a bounty to attract a DP.
Models define the way data is used to determine the reputation for a user. You can create and customize models to define the operations that are performed on the data and the weightage that is assigned to data.
One MP can provide multiple models to Orange users. Every model must have an associated method. A method is an abstract definition or reference to a model that is useful when querying and fetching data.
Each method needs to have a name and a parameter (dataset) associated with it.
The name is used to refer to a particular method
The parameter schema defines the useful data that needs to be passed as input to calculate reputation scores using the model pertaining to the particular method
Create Interfaces for Model Access
MPs need to set up an externally accessible interface with specific endpoints that can be used to fetch models. These endpoints will be called when model requests are made to the Orange system. The endpoint design depends on the design of the associated dataset, so only RESTful API is supported.
Request
Requests should be made with parameters of the following in JSON:
Response
The response should be a score in JSON representing the user's reputation:
Publish Interface
When your interface is ready to be accessed on the mainnet, you can publish it on the Orange platform for developers to discover and use it. You can do it in the Reputation Studio.
Step 1: Click on the "Connect Wallet" button on the top right to connect your wallet. You can find a detailed guide here.
Step 2: Click on the Menu button and select "Management". Choose "My Models".
Step 3: Click on the "Create Profile" button and fill out the form to create your profile as an MP.
Step 4: Click on the "Create Model" and fill out the information following the steps indicated on the page. Then you can either click "Save" to save the draft, or click "Publish" to submit your model for review and publication.
Handle API Requests
Decrypt Request Messages
Since the data in the request is encrypted, you need first to decrypt the data. You need the Orange Go SDK and a wallet to decrypt a request using your DID.
Import SDK
Initialize SDK
Parameters for initialization:
path of the wallet file
wallet password
network info:
TESTNET
orMAINNET
Example
Verify DP Signature
After decryption, you'll get the data and the DP's signature to the data. To verify the authenticity of data, you need to verify DP's signature:
Generate Responses
Now you can use the data to calculate a reputation score and send it back to the Orange system.
Last updated