How to use the @casual-simulation/aux-vm.getTreeName function in @casual-simulation/aux-vm

To help you get started, we’ve selected a few @casual-simulation/aux-vm examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github casual-simulation / aux / src / aux-server / server / modules / SetupChannelModule.ts View on Github external
private async _setupChannel(
        info: RealtimeChannelInfo,
        event: SetupChannelAction
    ) {
        try {
            const newChannelInfo = {
                id: getTreeName(event.channel),
                type: 'aux',
            };
            const hasChannel = await this._channelManager.hasChannel(
                newChannelInfo
            );
            if (!hasChannel) {
                console.log(
                    `[SetupChannelModule] Setting up new channel ${
                        event.channel
                    }`
                );
                const channel = await this._channelManager.loadChannel(
                    newChannelInfo
                );

                if (event.botOrMod) {
github casual-simulation / aux / src / aux-vm-node / managers / NodeSimulationFactories.ts View on Github external
export function nodeSimulationForRemote(
    host: string,
    user: AuxUser,
    id: string,
    config: FormulaLibraryOptions['config']
): RemoteSimulation {
    const parsedId = parseSimulationId(id);
    return new RemoteSimulationImpl(
        id,
        config,
        {
            shared: {
                type: 'remote_causal_tree',
                host: host,
                id: id,
                treeName: getTreeName(parsedId.channel),
            },
        },
        cfg =>
            new AuxVMNode(
                new RemoteAuxChannel(user, cfg, {
                    sandboxFactory: lib => getSandbox(lib),
                    partitionOptions: {
                        defaultHost: host,
                        store: new NullCausalTreeStore(),
                        crypto: new NodeSigningCryptoImpl(
                            'ECDSA-SHA256-NISTP256'
                        ),
                    },
                })
            )
    );