-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
188 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,4 +37,3 @@ build/ | |
|
||
# Dependencies | ||
node_modules/ | ||
dependencies/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[submodule "contracts/lib/tnt-core"] | ||
path = contracts/lib/tnt-core | ||
url = https://github.com/tangle-network/tnt-core |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,70 @@ | ||
// SPDX-License-Identifier: UNLICENSE | ||
pragma solidity >=0.8.13; | ||
|
||
import "tnt-core/BlueprintServiceManagerBase.sol"; | ||
import "contracts/lib/tnt-core/src/BlueprintServiceManagerBase.sol"; | ||
|
||
/** | ||
* @title BlsBlueprint | ||
* @dev This contract is an example of a service blueprint that provides a single service. | ||
* @dev For all supported hooks, check the `BlueprintServiceManagerBase` contract. | ||
*/ | ||
contract BlsBlueprint is BlueprintServiceManagerBase {} | ||
contract BlsBlueprint is BlueprintServiceManagerBase { | ||
/** | ||
* @dev Hook for service operator registration. Called when a service operator | ||
* attempts to register with the blueprint. | ||
* @param operator The operator's details. | ||
* @param _registrationInputs Inputs required for registration. | ||
*/ | ||
function onRegister(bytes calldata operator, bytes calldata _registrationInputs) | ||
public | ||
payable | ||
onlyFromRootChain | ||
{ | ||
// Do something with the operator's details | ||
} | ||
|
||
/** | ||
* @dev Hook for service instance requests. Called when a user requests a service | ||
* instance from the blueprint. | ||
* @param serviceId The ID of the requested service. | ||
* @param operators The operators involved in the service. | ||
* @param _requestInputs Inputs required for the service request. | ||
*/ | ||
function onRequest(uint64 serviceId, bytes[] calldata operators, bytes calldata _requestInputs) | ||
public | ||
payable | ||
onlyFromRootChain | ||
{ | ||
// Do something with the service request | ||
} | ||
|
||
/** | ||
* @dev Hook for handling job call results. Called when operators send the result | ||
* of a job execution. | ||
* @param serviceId The ID of the service related to the job. | ||
* @param job The job identifier. | ||
* @param _jobCallId The unique ID for the job call. | ||
* @param participant The participant (operator) sending the result. | ||
* @param _inputs Inputs used for the job execution. | ||
* @param _outputs Outputs resulting from the job execution. | ||
*/ | ||
function onJobResult( | ||
uint64 serviceId, | ||
uint8 job, | ||
uint64 _jobCallId, | ||
bytes calldata participant, | ||
bytes calldata _inputs, | ||
bytes calldata _outputs | ||
) public payable virtual onlyFromRootChain { | ||
// Do something with the job call result | ||
} | ||
|
||
/** | ||
* @dev Converts a public key to an operator address. | ||
* @param publicKey The public key to convert. | ||
* @return operator address The operator address. | ||
*/ | ||
function operatorAddressFromPublicKey(bytes calldata publicKey) internal pure returns (address operator) { | ||
return address(uint160(uint256(keccak256(publicKey)))); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +0,0 @@ | ||
forge-std/=dependencies/forge-std-1.9.4/src/ | ||
tnt-core/=dependencies/tnt-core-0.1.0/src/ | ||
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
git submodule update --recursive --remote | ||
git submodule foreach git pull origin HEAD | ||
echo "Update submodules done" | ||
cargo update | ||
forge clean | ||
forge build --force |