Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ node_modules
/.cache
/build
/coverage

# for sample contracts when they compile
cache
out

# env settings
.env

logs
Expand Down
37 changes: 29 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -389,9 +389,9 @@ The client will attempt to reconnect if:

Reconnect is enabled via options (reconnect.enabled === true)

The client was not manually disconnected (i.e., .disconnect() wasnt explicitly called)
The client was not manually disconnected (i.e., .disconnect() wasn't explicitly called)

The reconnect attempt count hasnt exceeded reconnect.maxAttempts
The reconnect attempt count hasn't exceeded reconnect.maxAttempts

### Reconnect Configuration

Expand Down Expand Up @@ -423,12 +423,12 @@ These application-level security controls could be supplemented through the foll
- For a local instance run on your machine, the operator should only interact with the web server over localhost, to avoid a man-in-the-middle attack.
- For a cloud instance (e.g., AWS), the operator should avoid directly exposing the web server, instead introducing a load balancer that enforces TLS in front of the web server.
- The web server does not employ any authentication mechanism such as credential-based logins. It is accessible by anyone it is exposed to.
- For a local instance run on your machine, the operator should ensure the guest (container)s ports that are forwarded to the host cannot be indirectly accessed by another machine through the host over the local network.
- The system should use Docker configurations to restrict such accesses, or leverage the operating systems firewall to deny such access.
- For a local instance run on your machine, the operator should ensure the guest (container)'s ports that are forwarded to the host cannot be indirectly accessed by another machine through the host over the local network.
- The system should use Docker configurations to restrict such accesses, or leverage the operating system's firewall to deny such access.
- For a cloud instance (e.g., AWS), the operator should not directly expose the web server, instead introducing a gateway component that enforces authentication in front of the web server. Alternatively, operators may opt to not allow external access to the component, leveraging a VPN to access it.
- The web server may be exposed to other components on the same network. An attacker that compromised a component within the same network could use it to access the web server.
- For a local instance run on your machine, the operator should ensure the guest (container)s ports that are forwarded to the host cannot be indirectly accessed by another machine through the host over the local network.
- The system should use Docker configurations to restrict such accesses, or leverage the operating systems firewall to deny such access.
- For a local instance run on your machine, the operator should ensure the guest (container)'s ports that are forwarded to the host cannot be indirectly accessed by another machine through the host over the local network.
- The system should use Docker configurations to restrict such accesses, or leverage the operating system's firewall to deny such access.
- For a cloud instance (e.g., AWS), the operator should enforce strict ingress/egress rules that allow only expected component communications.
E.g., with three components, A, B, and C, where only A should communicate
with C, but B should not, ingress and egress rules can be used to enforce these patterns.
Expand Down Expand Up @@ -689,9 +689,9 @@ After deployment, verify the setup with:
> [!IMPORTANT]
> The Transmitter uses [cron-parser](https://github.com/harrisiirak/cron-parser?tab=readme-ov-file#cron-format) for handling cron expressions.
>
> The cron-parser dependency is noted to lose some pattern information when serializing a cron pattern, such as “?” characters. The transmitter is also prone to this when setting a schedule cron pattern using "?" character which is an alias for "*" in cron-parser.
> The cron-parser dependency is noted to lose some pattern information when serializing a cron pattern, such as "?" characters. The transmitter is also prone to this when setting a schedule cron pattern using "?" character which is an alias for "*" in cron-parser.
>
> For example, using “* * * ? * *” will actually set * * * * * *, where in other libraries the “?” character denotes an unspecified one-of (“?”), but not all (“*”).
> For example, using "*" will actually set "* * * * * *", where in other libraries the "?" character denotes an unspecified one-of ("?"), but not all ("*").
>
>Make sure to check and test your cron expressions.

Expand Down Expand Up @@ -767,3 +767,24 @@ By contributing to this project, you agree that your contributions will be gover

- [Chainlink Data Streams Documentation](https://docs.chain.link/data-streams)
- [Chainlink Documentation](https://docs.chain.link/)

## ✨ Sample on-chain **receiver**

For quick local testing the repository ships with a
[`contracts/DataStreamsFeed.sol`](contracts/DataStreamsFeed.sol) file – an
unaltered copy of the **Adrastia community implementation** (see original
source
[here](https://github.com/adrastia-oracle/adrastia-chainlink-data-streams/blob/main/contracts/feed/DataStreamsFeed.sol)).

* It is a **stand-alone Solidity file**, no Foundry/Hardhat project scaffold
around it. Compile it in whichever tool-chain you prefer once you have the
required dependencies (`@openzeppelin/contracts`, `@chainlink/contracts`) in
your `node_modules`.
* The contract retains Adrastia's built-in mechanism for discovering the Chainlink
**fee manager** on-chain; no extra "manager" wrapper is included here.
* Only the single Solidity contract and it's custom dependencies are present – **none of the OpenZeppelin or
Chainlink source files are vendored in this repo** to keep it lightweight.
Install those packages yourself (`pnpm add @openzeppelin/contracts @chainlink/contracts`) or point your compiler's remappings to an existing
node_modules folder.
* **Not audited.** Use it for demos, PoCs, or to inspect the interface, but
perform your own security review before main-net deployments.
6 changes: 6 additions & 0 deletions contracts/common/AdrastiaDataStreamsCommon.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

interface AdrastiaDataStreamsCommon {
error InvalidReportVersion(uint16 reportVersion);
}
25 changes: 25 additions & 0 deletions contracts/common/Roles.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

library Roles {
/**
* @notice The role hash for the admin. Accounts with this role can manage the role and sub-roles.
*/
bytes32 public constant ADMIN = keccak256("ADMIN_ROLE");

/**
* @notice The role hash for the report verifier. Accounts with this role can pass verified reports to the contract
* and update the latest report. Reports are expected to be verified by the report verifier before being passed to
* this contract.
*
* This role is not required when using the `verifyAndUpdateReport` function, as that function will verify the
* report before updating it.
*/
bytes32 public constant REPORT_VERIFIER = keccak256("REPORT_VERIFIER_ROLE");

/**
* @notice The role hash for the update pause admin. Accounts with this role can pause and unpause the update
* functionality of the contract. This is useful for emergency situations or maintenance.
*/
bytes32 public constant UPDATE_PAUSE_ADMIN = keccak256("UPDATE_PAUSE_ADMIN_ROLE");
}
Loading