datahaven/test/utils/rpc.ts
Tim B b621f1c04a
test: Add E2E Tests (#36)
This PR adds the basic framework for E2E and the greater typescript
testing framework for the repo.

### Contents

- CI workflow for running E2E tests on push to main, PRs and manual
- Test suite for E2E
  - Currently only read-only tests
  - Using `bun:test` for time being but we can always change in future
- We are using the logging library `pino` so we can help with debugging
- set environment variable `LOG_LEVEL` to get extra information on
helpers
- Local `utils` namespace for all our test suites for easy importing
- Has helpers which interact with both the docker driver and also
blockscout backend
- Allows us to fetch deployed smart contracts by their name or address
and interact with them

---------

Co-authored-by: Facundo Farall <37149322+ffarall@users.noreply.github.com>
2025-04-14 16:22:43 -03:00

11 lines
397 B
TypeScript

import { CONTAINER_NAMES, getPublicPort } from "utils";
export const getRPCUrl = async (): Promise<string> => {
const publicPort = await getPublicPort(CONTAINER_NAMES.EL1, 8545);
return `http://127.0.0.1:${publicPort}`;
};
export const getWSUrl = async (): Promise<string> => {
const publicPort = await getPublicPort(CONTAINER_NAMES.EL1, 8546);
return `ws://127.0.0.1:${publicPort}`;
};