fix: warpgw configuration fix
This commit is contained in:
@@ -19,8 +19,6 @@ import {
|
|||||||
WarpGatewayInteractionsLoader
|
WarpGatewayInteractionsLoader
|
||||||
} from '@warp';
|
} from '@warp';
|
||||||
|
|
||||||
export const WARP_GW_URL = 'https://d1o5nlqr4okus2.cloudfront.net';
|
|
||||||
|
|
||||||
export class WarpBuilder {
|
export class WarpBuilder {
|
||||||
private _definitionLoader?: DefinitionLoader;
|
private _definitionLoader?: DefinitionLoader;
|
||||||
private _interactionsLoader?: InteractionsLoader;
|
private _interactionsLoader?: InteractionsLoader;
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ import {
|
|||||||
HandlerExecutorFactory,
|
HandlerExecutorFactory,
|
||||||
SourceType,
|
SourceType,
|
||||||
Warp,
|
Warp,
|
||||||
WARP_GW_URL,
|
|
||||||
WarpBuilder,
|
WarpBuilder,
|
||||||
WarpEnvironment
|
WarpEnvironment
|
||||||
} from '@warp/core';
|
} from '@warp/core';
|
||||||
@@ -24,6 +23,8 @@ export type CacheOptions = {
|
|||||||
dbLocation: string;
|
dbLocation: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const WARP_GW_URL = 'https://d1o5nlqr4okus2.cloudfront.net';
|
||||||
|
|
||||||
export const defaultWarpGwOptions: GatewayOptions = {
|
export const defaultWarpGwOptions: GatewayOptions = {
|
||||||
confirmationStatus: { notCorrupted: true },
|
confirmationStatus: { notCorrupted: true },
|
||||||
source: null,
|
source: null,
|
||||||
@@ -103,6 +104,7 @@ export class WarpFactory {
|
|||||||
if (useArweaveGw) {
|
if (useArweaveGw) {
|
||||||
return this.customArweaveGw(arweave, cacheOptions, 'mainnet');
|
return this.customArweaveGw(arweave, cacheOptions, 'mainnet');
|
||||||
} else {
|
} else {
|
||||||
|
console.log(defaultWarpGwOptions);
|
||||||
return this.customWarpGw(arweave, defaultWarpGwOptions, cacheOptions, 'mainnet');
|
return this.customWarpGw(arweave, defaultWarpGwOptions, cacheOptions, 'mainnet');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -97,7 +97,6 @@ export class WarpGatewayInteractionsLoader implements InteractionsLoader {
|
|||||||
throw new Error(`Unable to retrieve transactions. Warp gateway responded with status ${error.status}.`);
|
throw new Error(`Unable to retrieve transactions. Warp gateway responded with status ${error.status}.`);
|
||||||
});
|
});
|
||||||
this.logger.debug(`Loading interactions: page ${page} loaded in ${benchmarkRequestTime.elapsed()}`);
|
this.logger.debug(`Loading interactions: page ${page} loaded in ${benchmarkRequestTime.elapsed()}`);
|
||||||
this.logger.debug(`Interactions`, response.interactions);
|
|
||||||
|
|
||||||
interactions.push(...response.interactions);
|
interactions.push(...response.interactions);
|
||||||
limit = response.paging.limit;
|
limit = response.paging.limit;
|
||||||
|
|||||||
@@ -23,7 +23,8 @@ async function main() {
|
|||||||
const rssUsedBefore = Math.round((process.memoryUsage().rss / 1024 / 1024) * 100) / 100;
|
const rssUsedBefore = Math.round((process.memoryUsage().rss / 1024 / 1024) * 100) / 100;
|
||||||
|
|
||||||
const arweave = Arweave.init({
|
const arweave = Arweave.init({
|
||||||
host: 'arweave.testnet1.bundlr.network', // Hostname or IP address for a Arweave host
|
/* host: 'arweave.testnet1.bundlr.network',*/ // Hostname or IP address for a Arweave host
|
||||||
|
host: 'arweave.net',
|
||||||
port: 443, // Port
|
port: 443, // Port
|
||||||
protocol: 'https', // Network protocol http or https
|
protocol: 'https', // Network protocol http or https
|
||||||
timeout: 60000, // Network request timeouts in milliseconds
|
timeout: 60000, // Network request timeouts in milliseconds
|
||||||
@@ -31,12 +32,9 @@ async function main() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
const warp = WarpFactory.forTestnet(arweave, {...defaultCacheOptions, inMemory: true});
|
const warp = WarpFactory.forMainnet({...defaultCacheOptions, inMemory: true});
|
||||||
try {
|
try {
|
||||||
const contract = warp.contract("R7wHkzV2bRktpSnOfBj9I7GHn5JaeO6XrQKDFlcu2XA")
|
const contract = warp.contract("Daj-MNSnH55TDfxqC7v4eq0lKzVIwh98srUaWqyuZtY");
|
||||||
.setEvaluationOptions({
|
|
||||||
internalWrites: true
|
|
||||||
});
|
|
||||||
const {state, validity, errorMessages} = await contract.readState();
|
const {state, validity, errorMessages} = await contract.readState();
|
||||||
|
|
||||||
console.log(state);
|
console.log(state);
|
||||||
|
|||||||
Reference in New Issue
Block a user