To begin using the Photon messaging or DataStream protocol, please reach out to Entangle to undergo the KYC process and become registered as an external developer.
Contracts Preparation Guide
To utilize the Photon messaging or DataStream protocol, an external developer must ensure their smart contracts are compatible with the Endpoint contract.
This contract has the following interface for proposing omni-chain operations:
/// @notice function of emitting event Propose for catching by receivers/// @param protocolId protocol id to interact/// @param dstChainId dest chain id/// @param protocolAddress dest protocol address is bytes32 cause dstChainId may be non-EVM /// @param functionSelector dest protocol function id, for EVM is encoded abi func selector, for non-EVM may be func signature or whole func name
/// @param params function params for dest protocol functionfunctionpropose(bytes32 protocolId,uint256 dstChainId,bytescalldata protocolAddress,bytescalldata functionSelector,bytescalldata params ) externalisAllowedProposer(protocolId)
The smart contract on the destination chain will be capable of processing the following call:
Protocol Configuration Guide - Configuring with External Developer Hub contract
To create your protocol X within the ExternalDeveloperHub contract, you should set up the following parameters (note that all values are provided as examples, and it's mandatory to deploy at least one manual Receiver Agent, also known as a Transmitter, for your protocol):
Deposit NGL for protocol fees and receiver rewards.
Once all setups are completed, external developers must supply their address with $NGL tokens by approving and depositing them into the ExternalDeveloperHub contract:
/// @notice Deposit NGL to protocol balance/// @param _protocolId - Protocol id/// @param _amount - Amount of NGL to depositfunctiondeposit(bytes32_protocolId,uint_amount) externalprotocolOwner(_protocolId)
Contract Deploying Guide – Not Required For Photon Messaging
In DataStream integration, the next step involves deploying the StreamDataSpotter contract via the StreamDataFactory contract using your specific parameters. This can be achieved by making a call.
/// @notice Deploy spotter contract for the new sourceID/// @param protocolId protocol id/// @param sourceId source id/// @param processingLib address of deployed processing lib contract to be used for that spotter/// @param consensusRate consensus rate of agents necessary for update to happend/// @param allowedKeys array of allowed data keys, only existing datakeys can be used to vote the data forfunctiondeployNewStreamDataSpotter(bytes32 protocolId,bytes32 sourceId,address processingLib,uint256 consensusRate,uint256 minFinalizationInterval,bytes32[] calldata allowedKeys ) publiconlyProtocolOwner(protocolId) returns (address)
Please note that these contracts are on the Entangle Oracle blockchain, so bridging some $NGL tokens is required to proceed.