mirror of
https://gitlab.com/veilid/veilid.git
synced 2025-10-11 18:10:44 -04:00
Read node config from env vars for WASM tests
This commit is contained in:
parent
67be63c91c
commit
000dcf823f
2 changed files with 10 additions and 1 deletions
|
@ -103,7 +103,7 @@ describe('VeilidRoutingContext', () => {
|
|||
const bestCryptoKind = veilidCrypto.bestCryptoKind();
|
||||
const ownerKeyPair = veilidCrypto.generateKeyPair(bestCryptoKind);
|
||||
const [owner, secret] = ownerKeyPair.split(':');
|
||||
const dhtRecordKey = await routingContext.getDhtRecordKey({ kind: 'DFLT', o_cnt: 1 }, `${bestCryptoKind}:owner`);
|
||||
const dhtRecordKey = await routingContext.getDhtRecordKey({ kind: 'DFLT', o_cnt: 1 }, `${bestCryptoKind}:${owner}`);
|
||||
const dhtRecord = await routingContext.createDhtRecord({ kind: 'DFLT', o_cnt: 1 }, ownerKeyPair, bestCryptoKind);
|
||||
expect(dhtRecord.key).toBeDefined();
|
||||
expect(dhtRecord.key).toEqual(dhtRecordKey);
|
||||
|
|
|
@ -21,6 +21,15 @@ export const veilidCoreInitConfig: VeilidWASMConfig = {
|
|||
export var veilidCoreStartupConfig = (() => {
|
||||
var defaultConfig = veilidClient.defaultConfig();
|
||||
defaultConfig.program_name = 'veilid-wasm-test';
|
||||
if(process.env.NETWORK_KEY) {
|
||||
defaultConfig.network.network_key_password = process.env.NETWORK_KEY;
|
||||
}
|
||||
if(process.env.BOOTSTRAP_KEYS) {
|
||||
defaultConfig.network.routing_table.bootstrap_keys = process.env.BOOTSTRAP_KEYS.split(',') as `${string}:${string}`[];
|
||||
}
|
||||
if(process.env.BOOTSTRAP) {
|
||||
defaultConfig.network.routing_table.bootstrap = process.env.BOOTSTRAP.split(',');
|
||||
}
|
||||
// Ensure we are starting from scratch
|
||||
defaultConfig.table_store.delete = true;
|
||||
defaultConfig.protected_store.delete = true;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue