Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
2eff08b
refactor: :art: moved runtime apis into their own file
TDemeco Sep 27, 2024
303feb3
fix: :arrow_up: fix upgrade to polkadot-sdk v1.10.0
TDemeco Sep 27, 2024
e5ba5bd
Merge branch 'main' into update/polkadot-sdk-1.10.0
TDemeco Sep 27, 2024
3e4328d
fix: :bug: add removed runtime api `get_worst_case_scenario_slashable…
TDemeco Sep 27, 2024
3605611
fix: :bug: add missing generic in storage providers runtime api
TDemeco Sep 27, 2024
3659377
chore: :label: run typegen
TDemeco Sep 27, 2024
c1219f1
style: :rotating_light: run cargo fmt
TDemeco Sep 27, 2024
5ac0258
fix: :art: fix cargo clippy
TDemeco Sep 28, 2024
e82a113
Merge branch 'main' into update/polkadot-sdk-1.10.0
TDemeco Sep 28, 2024
91ae601
fix: :ambulance: fix mocked relay chain randomness
TDemeco Sep 28, 2024
97c0b64
style: :rotating_light: run cargo fmt
TDemeco Sep 28, 2024
787d1df
chore: :rotating_light: temporary remove unused import (until v1.13.0)
TDemeco Sep 28, 2024
9653a4e
Merge branch 'main' into update/polkadot-sdk-1.10.0
TDemeco Sep 28, 2024
6fb8bd4
fix: :adhesive_bandage: update `query_earliest_file_volunteer_tick` r…
TDemeco Sep 28, 2024
cde6b90
fix: :ambulance: fix issues with merge from main
TDemeco Sep 28, 2024
570e548
style: :rotating_light: run cargo fmt
TDemeco Sep 28, 2024
9bb33cc
feat: :package: initial update to polkadot sdk v1.11.0
TDemeco Sep 30, 2024
e28f09b
feat: :arrow_up: finish upgrade to polkadot sdk v1.11.0
TDemeco Sep 30, 2024
2947b01
Merge branch 'main' into update/polkadot-sdk-1.10.0
TDemeco Sep 30, 2024
5c07140
chore: :label: run typegen
TDemeco Sep 30, 2024
f86f2c1
Merge branch 'update/polkadot-sdk-1.10.0' into update/polkadot-sdk-1.…
TDemeco Sep 30, 2024
f4964fc
chore: :label: run typegen
TDemeco Sep 30, 2024
f85735d
fix: :white_check_mark: fix node tests after rebenchmark of balances …
TDemeco Oct 1, 2024
b7090b5
feat: :arrow_up: update to Polkadot SDK v1.12.0
TDemeco Oct 3, 2024
889fa3c
feat: :arrow_up: update to Polkadot SDK v1.13.0
TDemeco Oct 4, 2024
9587713
fix: :arrow_up: finish upgrading to Polkadot SDK v1.13.0
TDemeco Oct 4, 2024
6bde3e8
Merge branch 'main' into update/polkadot-sdk-1.12.0
TDemeco Oct 4, 2024
d697a9b
merge 'main' into 'update/polkadot-sdk-1.12.0'
TDemeco Oct 4, 2024
22cf3ab
fix: :adhesive_bandage: fix merge from main
TDemeco Oct 4, 2024
a44a169
chore: :rotating_light: run pnpm fmt:fix
TDemeco Oct 4, 2024
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
Prev Previous commit
chore: 🚨 run pnpm fmt:fix
  • Loading branch information
TDemeco committed Oct 4, 2024
commit a44a1693576823185990a735fa8818fa517cb8db
172 changes: 86 additions & 86 deletions test/scripts/fullNetBootstrap.ts
Original file line number Diff line number Diff line change
@@ -1,86 +1,86 @@
import {
BspNetTestApi,
registerToxics,
type BspNetConfig,
type EnrichedBspApi,
type ToxicInfo
} from "../util";
import * as ShConsts from "../util/bspNet/consts";
import { runFullNet } from "../util/fullNet/helpers";
let api: EnrichedBspApi | undefined;
const fullNetConfig: BspNetConfig = {
noisy: process.env.NOISY === "1",
rocksdb: process.env.ROCKSDB === "1"
};
const CONFIG = {
bucketName: "nothingmuch-0",
localPath: "res/whatsup.jpg",
remotePath: "cat/whatsup.jpg"
};
async function bootStrapNetwork() {
await runFullNet(fullNetConfig);
if (fullNetConfig.noisy) {
// For more info on the kind of toxics you can register,
// see: https://github.com/Shopify/toxiproxy?tab=readme-ov-file#toxics
const reqToxics = [
{
type: "latency",
name: "lag-down",
stream: "upstream",
toxicity: 0.8,
attributes: {
latency: 25,
jitter: 7
}
},
{
type: "bandwidth",
name: "low-band",
// Setting as upstream simulates slow user connection
stream: "upstream",
// 50% of the time, the toxic will be applied
toxicity: 0.5,
attributes: {
// 10kbps
rate: 10
}
}
] satisfies ToxicInfo[];
await registerToxics(reqToxics);
}
api = await BspNetTestApi.create(`ws://127.0.0.1:${ShConsts.NODE_INFOS.user.port}`);
await api.file.newStorageRequest(
CONFIG.localPath,
CONFIG.remotePath,
CONFIG.bucketName,
ShConsts.DUMMY_MSP_ID
);
await api.wait.bspVolunteer();
await api.wait.bspStored();
if (fullNetConfig.noisy) {
console.log("✅ NoisyNet Bootstrap success");
} else {
console.log("✅ BSPNet Bootstrap success");
}
}
bootStrapNetwork()
.catch((e) => {
console.error("Error running bootstrap script:", e);
if (fullNetConfig.noisy) {
console.log("❌ NoisyNet Bootstrap failure");
} else {
console.log("❌ BSPNet Bootstrap failure");
}
process.exitCode = 1;
})
.finally(async () => await api?.disconnect());
import {
BspNetTestApi,
registerToxics,
type BspNetConfig,
type EnrichedBspApi,
type ToxicInfo
} from "../util";
import * as ShConsts from "../util/bspNet/consts";
import { runFullNet } from "../util/fullNet/helpers";

let api: EnrichedBspApi | undefined;
const fullNetConfig: BspNetConfig = {
noisy: process.env.NOISY === "1",
rocksdb: process.env.ROCKSDB === "1"
};

const CONFIG = {
bucketName: "nothingmuch-0",
localPath: "res/whatsup.jpg",
remotePath: "cat/whatsup.jpg"
};

async function bootStrapNetwork() {
await runFullNet(fullNetConfig);

if (fullNetConfig.noisy) {
// For more info on the kind of toxics you can register,
// see: https://github.com/Shopify/toxiproxy?tab=readme-ov-file#toxics
const reqToxics = [
{
type: "latency",
name: "lag-down",
stream: "upstream",
toxicity: 0.8,
attributes: {
latency: 25,
jitter: 7
}
},
{
type: "bandwidth",
name: "low-band",
// Setting as upstream simulates slow user connection
stream: "upstream",
// 50% of the time, the toxic will be applied
toxicity: 0.5,
attributes: {
// 10kbps
rate: 10
}
}
] satisfies ToxicInfo[];

await registerToxics(reqToxics);
}

api = await BspNetTestApi.create(`ws://127.0.0.1:${ShConsts.NODE_INFOS.user.port}`);

await api.file.newStorageRequest(
CONFIG.localPath,
CONFIG.remotePath,
CONFIG.bucketName,
ShConsts.DUMMY_MSP_ID
);

await api.wait.bspVolunteer();
await api.wait.bspStored();

if (fullNetConfig.noisy) {
console.log("✅ NoisyNet Bootstrap success");
} else {
console.log("✅ BSPNet Bootstrap success");
}
}

bootStrapNetwork()
.catch((e) => {
console.error("Error running bootstrap script:", e);
if (fullNetConfig.noisy) {
console.log("❌ NoisyNet Bootstrap failure");
} else {
console.log("❌ BSPNet Bootstrap failure");
}
process.exitCode = 1;
})
.finally(async () => await api?.disconnect());
Loading