Skip to content

Commit

Permalink
Fix query params being stripped (#301)
Browse files Browse the repository at this point in the history
* Fix query params being stripped

* Update changelog, test endpoint
  • Loading branch information
stwiname authored Jun 7, 2024
1 parent 7fc2e3f commit b57630e
Show file tree
Hide file tree
Showing 9 changed files with 9 additions and 15 deletions.
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

0 comments on commit b57630e

Please sign in to comment.