A more complex example showcasing genesis block state configuration with walletsConfig
and deployment of multiple contracts is shown below.
// #import { launchTestNode, TestAssetId, TestMessage };
import { CounterFactory } from 'path/to/typegen/output';
const assets = TestAssetId.random(2);
const message = new TestMessage({ amount: 1000 });
using launched = await launchTestNode({
walletsConfig: {
count: 4,
assets,
coinsPerAsset: 2,
amountPerCoin: 1_000_000,
messages: [message],
},
contractsConfigs: [
{
factory: CounterFactory,
walletIndex: 3,
options: { storageSlots: [] },
},
],
});
const {
contracts: [contract],
wallets: [wallet1, wallet2, wallet3, wallet4],
} = launched;
walletIndex
.