Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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) {
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'
),
},
})
)
);