Smart Contracts APIs (RFC-132)
A period when the community can review the RFC (comment Docs).
Document Maintainers: Andi Gabriel Tan 2022. List of other contributors in Annex. 1.
Copyright: MIT license
Copyright © 2018-2022 Axiologic Research and Contributors.
This document is licensed under MIT license.
- Abstract
- 1. BDNS Entries
- 2. Latest Block Info
- 3. Safe Command
- 4. Nonced Command
- 5. PBlock Added
- 6. Validator Not Inclusion
- Annex 1. Contributors
Abstract
1. BDNS Entries
Get the BDNS entry using contract calls for the specified domain.
GET /contracts/{domain}/bdns-entries/{entry}/
1.1. Path Parameters
Name | Type | Value | Description |
---|---|---|---|
domain | string | *required | The domain where the command should be executed. |
entry | string | *required | The BDNS entry for the specified domain. Example: brickStorages. |
1.2. Responses
Status Code | Description |
---|---|
200 | Retrieves the specified BDNS entry. Example: Application/JSON [ “$ORIGIN” ] |
404 | Invalid entry specified. |
500 | Contracts not booted. |
2. Latest Block Info
Send the lastestBlockInfo command to the worker.
GET /contracts/{domain}/latest-block-info/
2.1. Path Parameters
Name | Type | Value | Description |
---|---|---|---|
domain | string | *required | The domain where the command should be executed. |
2.2. Responses
Status Code | Description |
---|---|
200 | Command executed successfully. |
400 | Worker allocation failure, invalid domain or body. |
500 | Error executing the command. |
3. Safe Command
Send the safe command to the worker.
POST /contracts/{domain}/safe-command/
3.1. Path Parameters
Name | Type | Value | Description |
---|---|---|---|
domain | string | *required | The domain where the command should be executed. |
3.2. Body Parameters
Name | Type | Value | Description |
---|---|---|---|
body | Contract Command |
3.2.1. Example: Application/JSON
{
domain:"csc",
contractName: "anchoring",
methodName: "anchoring",
params: [...methodParams]
}
3.3. Responses
Status Code | Description |
---|---|
200 | Command executed successfully. |
400 | Worker allocation failure, invalid domain or body. |
500 | Error executing the command. |
4. Nonced Command
Send the nonced command to the worker.
POST /contracts/{domain}/nonced-command/
4.1. Path Parameters
Name | Type | Value | Description |
---|---|---|---|
domain | string | *required | The domain where the command should be executed. |
4.2. Body Parameters
Name | Type | Value | Description |
---|---|---|---|
body | Contract Command |
4.2.1. Example: Application/JSON
{
domain:"csc",
contractName: "anchoring",
methodName: "anchoring",
params: [...methodParams]
}
4.3. Responses
Status Code | Description |
---|---|
200 | Command executed successfully. |
400 | Worker allocation failure, invalid domain or body. |
500 | Error executing the command. |
5. PBlock Added
Send PBlock to validate the worker.
POST /contracts/{domain}/pblock-added/
5.1. Path Parameters
Name | Type | Value | Description |
---|---|---|---|
domain | string | *required | The domain where the command should be executed. |
5.2. Body Parameters
Name | Type | Value | Description |
---|---|---|---|
body | Contract Command |
5.2.1. Example: Application/JSON
{
domain:"csc",
contractName: "anchoring",
methodName: "anchoring",
params: [...methodParams]
}
5.3. Responses
Status Code | Description |
---|---|
200 | Command executed successfully. |
400 | Worker allocation failure, invalid domain or body. |
500 | Error executing the command. |
6. Validator Not Inclusion
Set domain validator as non-inclusion to consensus phase.
POST /contracts/{domain}/validator-non-inclusion/
6.1. Path Parameters
Name | Type | Value | Description |
---|---|---|---|
domain | string | *required | The domain where the command should be executed. |
6.2. Body Parameters
Name | Type | Value | Description |
---|---|---|---|
body | Contract Command |
6.2.1. Example: Application/JSON
{
domain: "csc",
contractName: "anchoring",
methodName: "anchoring",
params: [...methodParams]
}
6.3. Responses
Status Code | Description |
---|---|
200 | Command executed successfully. |
400 | Worker allocation failure, invalid domain or body. |
500 | Error executing the command. |
Contributors
-
Axiologic Research: New content and improvements. Original texts under PharmaLedger Association and Novartis funding. MIT licensed content accordingly with the contracts. Publish and maintain the www.opendsu.org site.
-
PharmaLedger Project: Review, feedback, observations, new content, and corrections MIT licensed accordingly with the consortium agreements.
- PrivateSky Research Project: MIT licensed content accordingly with the contracts. https://profs.info.uaic.ro/~ads/PrivateSky/
Annex 1. Contributors
Current Editors | |
---|---|
Sînică Alboaie | sinica.alboaie@axiologic.net |
Rafael Mastaleru | rafael@rms.ro |
Nicoleta Mihalache | nicoleta@axiologic.net |
Contributors Axiologic Research | |
Daniel Visoiu | visoiu.daniel.g@gmail.com(S.Giant) |
Andi-Gabriel Țan | andi@axiologic.net |
Cosmin Ursache | cosmin@axiologic.net |
Daniel Sava | daniel@axiologic.net |
Nicoleta Mihalache | nicoleta@axiologic.net |
Valentin Gérard | valentin@axiologic.net |
PharmaLedger | |
Ana Balan | bam@rms.ro (RMS) |
Rafael Mastaleru | raf@rms.ro (RMS) |