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

maintaining a set of available engine nodes #9

Merged
merged 2 commits into from
Jul 29, 2024
Merged
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
17 changes: 14 additions & 3 deletions src/server/handlers/wallet-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,19 @@ import { EngineContracts, EngineIds, EngineMetric, EngineRequestPayload, EngineT
import { convertEngineToken, convertRewardsStatus } from "../../models/converters";

//docs: https://hive-engine.github.io/engine-docs/
const BASE_ENGINE_URL = 'https://api2.hive-engine.com';//'https://api2.hive-engine.com';
//available nodes: https://beacon.peakd.com/ select tab 'Hive Engine'
const ENGINE_NODES = [
"https://engine.rishipanthee.com",
"https://herpc.dtools.dev",
"https://api.hive-engine.com/rpc/",
"https://ha.herpc.dtools.dev",
"https://herpc.kanibot.com",
"https://he.sourov.dev",
"https://herpc.actifit.io",
"https://api2.hive-engine.com/rpc/"
];

const BASE_ENGINE_URL = ENGINE_NODES[2];
const BASE_SPK_URL = 'https://spk.good-karma.xyz';

const ENGINE_REWARDS_URL = 'https://scot-api.hive-engine.com/';
Expand All @@ -16,7 +28,6 @@ const ENGINE_CHART_URL = 'https://info-api.tribaldex.com/market/ohlcv';
//docs: https://github.com/hive-engine/ssc_tokens_history/tree/hive#api-usage
const ENGINE_ACCOUNT_HISTORY_URL = 'https://history.hive-engine.com/accountHistory';

const PATH_RPC = 'rpc';
export const PATH_CONTRACTS = 'contracts';


Expand Down Expand Up @@ -54,7 +65,7 @@ export const engineAccountHistory = (req: express.Request, res: express.Response

//raw engine api call
const engineContractsRequest = (data: EngineRequestPayload) => {
const url = `${BASE_ENGINE_URL}/${PATH_RPC}/${PATH_CONTRACTS}`;
const url = `${BASE_ENGINE_URL}/${PATH_CONTRACTS}`;
const headers = { 'Content-type': 'application/json', 'User-Agent': 'Ecency' };

return baseApiRequest(url, "POST", headers, data)
Expand Down