Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix query params being stripped #301

Merged
merged 2 commits into from
Jun 7, 2024
Merged
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
3 changes: 2 additions & 1 deletion packages/node/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

### Fixed
- Endpoint search params being stripped (#301)

## [4.4.2] - 2024-06-06
### Fixed
Expand Down
3 changes: 1 addition & 2 deletions packages/node/src/ethereum/api.ethereum.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ import {
} from './block.ethereum';

// Add api key to work
// const HTTP_ENDPOINT = 'https://eth.api.onfinality.io/public';
const HTTP_ENDPOINT = 'https://eth.llamarpc.com';
const HTTP_ENDPOINT = 'https://ethereum.rpc.subquery.network/public';
const BLOCK_CONFIRMATIONS = 20;

const ds: SubqlRuntimeDatasource = {
Expand Down
2 changes: 1 addition & 1 deletion packages/node/src/ethereum/api.ethereum.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ export class EthereumApi implements ApiWrapper {
logger.info(`Api host: ${hostname}, method: ${protocolStr}`);
if (protocolStr === 'https' || protocolStr === 'http') {
const connection: ConnectionInfo = {
url: this.endpoint.split('?')[0],
url: this.endpoint,
headers: {
'User-Agent': `Subquery-Node ${packageVersion}`,
},
Expand Down
3 changes: 1 addition & 2 deletions packages/node/src/ethereum/api.service.ethereum.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ import { EthereumApiService } from './api.service.ethereum';

// Add api key to work
const WS_ENDPOINT = 'wss://eth.api.onfinality.io/ws?apikey=';
// const HTTP_ENDPOINT = 'https://eth.api.onfinality.io/public';
const HTTP_ENDPOINT = 'https://eth.llamarpc.com';
const HTTP_ENDPOINT = 'https://ethereum.rpc.subquery.network/public';

function testSubqueryProject(endpoint: string): SubqueryProject {
return {
Expand Down
5 changes: 1 addition & 4 deletions packages/node/src/ethereum/api.service.ethereum.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,7 @@ export class EthereumApiService extends ApiService<
try {
network = this.project.network;
} catch (e) {
exitWithError(
new Error(`Failed to init api`, { cause: Object.keys(e) }),
logger,
);
exitWithError(new Error(`Failed to init api`, { cause: e }), logger);
}

const endpoints = Array.isArray(network.endpoint)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ import {
EthDictionaryV1,
} from './ethDictionaryV1';

// const HTTP_ENDPOINT = 'https://eth.api.onfinality.io/public';
const HTTP_ENDPOINT = 'https://eth.llamarpc.com';
const mockTempDs: EthereumProjectDsTemplate[] = [
{
name: 'ERC721',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import {
} from './ethDictionaryV2';

const DEFAULT_DICTIONARY = 'https://ethereum.node.subquery.network/public';
const HTTP_ENDPOINT = 'https://eth.llamarpc.com';
const HTTP_ENDPOINT = 'https://ethereum.rpc.subquery.network/public';
const mockDs: EthereumProjectDs[] = [
{
kind: EthereumDatasourceKind.Runtime,
Expand Down
2 changes: 1 addition & 1 deletion packages/node/src/indexer/dictionary/v2/utils.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { RawEthBlock } from './types';
import { rawBlockToEthBlock } from './utils';

const DICTIONARY_URL = 'https://ethereum.node.subquery.network/public';
const RPC_URL = 'https://eth.llamarpc.com';
const RPC_URL = 'https://ethereum.rpc.subquery.network/public';

async function fetchDictionaryBlock(): Promise<RawEthBlock> {
const res = await fetch(DICTIONARY_URL, {
Expand Down
2 changes: 1 addition & 1 deletion packages/node/src/indexer/project.service.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { EventEmitter2 } from '@nestjs/event-emitter';
import { EthereumApi, EthereumApiService } from '../ethereum';
import { ProjectService } from './project.service';

const HTTP_ENDPOINT = 'https://eth.llamarpc.com';
const HTTP_ENDPOINT = 'https://ethereum.rpc.subquery.network/public';

const mockApiService = (): EthereumApiService => {
const ethApi = new EthereumApi(HTTP_ENDPOINT, 20, new EventEmitter2());
Expand Down
Loading