diff --git a/src/__tests__/integration/decentralized-sequencer/interactions.ts b/src/__tests__/integration/decentralized-sequencer/interactions.ts index 72bca4cc..996c46c1 100644 --- a/src/__tests__/integration/decentralized-sequencer/interactions.ts +++ b/src/__tests__/integration/decentralized-sequencer/interactions.ts @@ -17,9 +17,10 @@ interface ExampleContractState { counter: number; } -// FIXME: change to the address of the sequencer on dev -const DECENTRALIZED_SEQUENCER_URL = 'http://sequencer-0.warp.cc:1317'; -const GW_URL = 'http://34.141.17.15:5666/'; +const DECENTRALIZED_SEQUENCER_URLS = ['http://sequencer-0.testnet.warp.cc:1317', + 'http://sequencer-1.testnet.warp.cc:1317', + 'http://sequencer-2.testnet.warp.cc:1317']; +const GW_URL = 'http://35.242.203.146:5666/'; describe('Testing sending of interactions to a decentralized sequencer', () => { let contractSrc: string; @@ -42,13 +43,13 @@ describe('Testing sending of interactions to a decentralized sequencer', () => { if (req.url === '/gateway/sequencer/address') { res.writeHead(200, { 'Content-Type': 'application/json' }); res.end(JSON.stringify({ - url: centralizedSequencerType ? mockGwUrl : DECENTRALIZED_SEQUENCER_URL, + urls: centralizedSequencerType ? [mockGwUrl] : DECENTRALIZED_SEQUENCER_URLS, type: centralizedSequencerType ? 'centralized' : 'decentralized' })); return; } else if (req.url === '/gateway/v2/sequencer/register') { centralizedSequencerType = false; - res.writeHead(301, { Location: DECENTRALIZED_SEQUENCER_URL }); + res.writeHead(301, { Location: DECENTRALIZED_SEQUENCER_URLS[0] }); res.end(); return; } else if (req.url?.startsWith('/gateway/interactions/')) { diff --git a/src/__tests__/integration/decentralized-sequencer/send-data-item.ts b/src/__tests__/integration/decentralized-sequencer/send-data-item.ts index 810ee60a..d25deb5b 100644 --- a/src/__tests__/integration/decentralized-sequencer/send-data-item.ts +++ b/src/__tests__/integration/decentralized-sequencer/send-data-item.ts @@ -9,9 +9,8 @@ import { WarpFetchWrapper } from '../../../core/WarpFetchWrapper'; import { Signature } from '../../../contract/Signature'; import { SequencerClient } from '../../../contract/sequencer/SequencerClient'; -// FIXME: change to the address of the sequencer on dev -const SEQUENCER_URL = 'http://sequencer-0.warp.cc:1317'; -const GW_URL = 'http://34.141.17.15:5666/'; +const SEQUENCER_URL = 'http://sequencer-0.testnet.warp.cc:1317'; +const GW_URL = 'https://gw-testnet.warp.cc'; describe('Testing a decentralized sequencer client', () => { diff --git a/src/core/Warp.ts b/src/core/Warp.ts index 441568bd..6db91439 100644 --- a/src/core/Warp.ts +++ b/src/core/Warp.ts @@ -35,7 +35,7 @@ import { SourceData } from '../contract/deploy/Source'; import { Signer, DataItem } from 'warp-arbundles'; import { BasicSortKeyCache } from '../cache/BasicSortKeyCache'; -export type WarpEnvironment = 'local' | 'testnet' | 'mainnet' | 'custom'; +export type WarpEnvironment = 'local' | 'testnet' | 'seqtestnet' | 'mainnet' | 'custom'; export type KVStorageFactory = (contractTxId: string) => SortKeyCache; /** diff --git a/src/core/WarpFactory.ts b/src/core/WarpFactory.ts index 3dd63434..1008920f 100644 --- a/src/core/WarpFactory.ts +++ b/src/core/WarpFactory.ts @@ -25,10 +25,15 @@ export const defaultWarpGwOptions: GatewayOptions = { }; /** - * @Deprecated - will be removed soon, left for backwards compatibility with deploy plugin + * Default Warp Gateway URL */ export const WARP_GW_URL = 'https://gw.warp.cc'; +/** + * The URL of the Warp Gateway that works with a test network of decentralized sequencers + */ +export const WARP_GW_TESTNET_URL = 'https://gw-testnet.warp.cc'; + export const DEFAULT_LEVEL_DB_LOCATION = './cache/warp'; export const defaultCacheOptions: CacheOptions = { @@ -82,6 +87,26 @@ export class WarpFactory { } } + /** + * creates a Warp instance suitable for testing the decentralized Warp Sequencer + * (https://github.com/warp-contracts/sequencer) + */ + static forSeqTestnet( + cacheOptions = defaultCacheOptions, + useArweaveGw = false, + arweave = Arweave.init({ + host: 'arweave.net', + port: 443, + protocol: 'https' + }) + ): Warp { + if (useArweaveGw) { + return this.customArweaveGw(arweave, cacheOptions, 'seqtestnet'); + } else { + return this.customWarpGw(arweave, defaultWarpGwOptions, cacheOptions, 'seqtestnet').useGwUrl(WARP_GW_TESTNET_URL); + } + } + /** * creates a Warp instance suitable for use with mainnet. * By default, the Warp gateway (https://github.com/warp-contracts/gateway#warp-gateway)