# RelayRegistrar

The RelayRegistrar Implementation

Keeps a list of registered relayers.

Provides view functions to read the list of registered relayers and filters out invalid ones.

Protects the list from spamming entries: only staked relayers are added.

# Functions

# constructor(uint256 _relayRegistrationMaxAge)

(public)


# getCreationBlock()

→ uint256 (external)

# Return values

block number in which the contract has been deployed.


# getRelayRegistrationMaxAge()

→ uint256 (external)

# Return values

maximum age the relay is considered registered by default by this RelayRegistrar, in seconds.


# setRelayRegistrationMaxAge(uint256 _relayRegistrationMaxAge)

(public)

Change the maximum relay registration age.


# supportsInterface(bytes4 interfaceId)

→ bool (public)

Returns true if this contract implements the interface defined by interfaceId. See the corresponding https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] to learn more about how these ids are created. This function call must use less than 30 000 gas.


# registerRelayServer(address relayHub, bytes32[3] url)

(external)

This function is called by Relay Servers in order to register or to update their registration.

relayHub: The address of the RelayHub contract for which this action is performed.

url: The URL of the Relay Server that is listening to the clients' requests.


# addItem(address relayHub, address relayManager)

→ struct IRelayRegistrar.RelayInfo (internal)


# storeRelayServerRegistration(address relayManager, address relayHub, bytes32[3] url)

(internal)


# getRelayInfo(address relayHub, address relayManager)

→ struct IRelayRegistrar.RelayInfo (public)

relayManager: An address of a Relay Manager.

relayHub: The address of the RelayHub contract for which this action is performed.

# Return values

All the details of the given Relay Manager's registration. Throws if relay not found for RelayHub.


# readRelayInfos(address relayHub)

→ struct IRelayRegistrar.RelayInfo[] info (public)

Read relay info of registered Relay Server from an on-chain storage.

relayHub: The address of the RelayHub contract for which this action is performed.

# Return values

The list of RelayInfos of registered Relay Servers


# readRelayInfosInRange(address relayHub, uint256 oldestBlockNumber, uint256 oldestBlockTimestamp, uint256 maxCount)

→ struct IRelayRegistrar.RelayInfo[] info (public)

Read relay info of registered Relay Server from an on-chain storage.

relayHub: The address of the RelayHub contract for which this action is performed.

maxCount: The maximum amount of relays to be returned by this function.

oldestBlockNumber: The latest block number in which a Relay Server may be registered.

oldestBlockTimestamp: The latest block timestamp in which a Relay Server may be registered.

# Return values

The list of RelayInfos of registered Relay Servers