mirror of
https://github.com/fluencelabs/aqua-playground
synced 2025-06-27 09:21:54 +00:00
change krasnodar <-> testNet in one constant
This commit is contained in:
@ -1,6 +1,7 @@
|
||||
import { Fluence } from '@fluencelabs/fluence';
|
||||
import { krasnodar } from '@fluencelabs/fluence-network-environment';
|
||||
import { viaArr, viaOpt, viaStream, registerCustomId } from '../compiled/examples/via';
|
||||
import {relays} from "../run-examples";
|
||||
|
||||
export async function viaCall(): Promise<string[][]> {
|
||||
const relayPeerId = Fluence.getPeer().getStatus().relayPeerId;
|
||||
@ -11,10 +12,10 @@ export async function viaCall(): Promise<string[][]> {
|
||||
},
|
||||
});
|
||||
|
||||
let res = await viaArr(krasnodar[4].peerId, [krasnodar[2].peerId, krasnodar[1].peerId]);
|
||||
let res2 = await viaOpt(relayPeerId, krasnodar[4].peerId, krasnodar[2].peerId);
|
||||
let res3 = await viaOpt(relayPeerId, krasnodar[4].peerId, krasnodar[2].peerId || null);
|
||||
let res4 = await viaStream(krasnodar[4].peerId, [krasnodar[2].peerId, krasnodar[1].peerId]);
|
||||
let res = await viaArr(relays[4].peerId, [relays[2].peerId, relays[1].peerId]);
|
||||
let res2 = await viaOpt(relayPeerId, relays[4].peerId, relays[2].peerId);
|
||||
let res3 = await viaOpt(relayPeerId, relays[4].peerId, relays[2].peerId || null);
|
||||
let res4 = await viaStream(relays[4].peerId, [relays[2].peerId, relays[1].peerId]);
|
||||
|
||||
return [res.external_addresses, res2.external_addresses, res3.external_addresses, res4.external_addresses];
|
||||
}
|
||||
|
@ -54,14 +54,16 @@ function checkCallBy(name: string, actual: any, by: (res: any) => boolean, callB
|
||||
}
|
||||
}
|
||||
|
||||
export const relays = krasnodar
|
||||
|
||||
const main = async () => {
|
||||
// setLogLevel("trace")
|
||||
|
||||
await Fluence.start({ connectTo: krasnodar[0] });
|
||||
await Fluence.start({ connectTo: relays[0] });
|
||||
const selfPeerId = Fluence.getStatus().peerId;
|
||||
|
||||
const peer2 = new FluencePeer();
|
||||
await peer2.start({ connectTo: krasnodar[1] });
|
||||
await peer2.start({ connectTo: relays[1] });
|
||||
|
||||
// this could be called from `println.aqua`
|
||||
registerPrintln({
|
||||
|
Reference in New Issue
Block a user