Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

primea-hypervisor

Package Overview
Dependencies
Maintainers
2
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

primea-hypervisor

this is a JS implemention of the primea hypervisor

  • 0.9.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
2
Created
Source

SYNOPSIS

NPM Package Build Status Coverage Status

js-standard-style

A JavaScript Implementation of Primea HyperVisor

INSTALL

clone and run npm install

USAGE


const Hypervisor = require('primea-hypervisor')
const {Message, FunctionRef} = require('primea-objects')
const WasmContainer = require('primea-wasm-container')

// setup presistant state
const level = require('level-browserify')
const RadixTree = require('dfinity-radix-tree')
const db = level(`${__dirname}/db`)
const tree = new RadixTree({db})

const hypervisor = new Hypervisor({tree, containers: [WasmContainer]})

const wasm // a webassembly binary with an exported function named "main"

// create an actor with a webassembly container
const {module} = hypervisor.createActor(WasmContainer.typeId, wasm)

// create message to send to the actor that was just created
const message = new Message({
  funcRef: module.getFuncRef('main'),
  funcArguments: [new FunctionRef({
    actorId: egress.id,
    params: ['data']
  })]
}).on('execution:error', e => console.error(e))

hypervisor.send(message)

// write everything to the db can create a merkle tree with a single state root
const sr = await hypervisor.createStateRoot()
console.log('state root:', sr.toString('hex'))

API

./docs

DESIGN

Primea is an actor based system with capabilities. Its high level goals are

  • Performant IPC
  • Extensible, allowing for upgrades and customization
  • Interoperability with existing codebases
  • Deterministic execution

SPONSORED BY

LICENSE

MPL-2.0

Keywords

FAQs

Package last updated on 06 Jun 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc