@chainsafe/eth2.0-state-transition

Beacon Chain state transition function and utils

Usage no npm install needed!

<script type="module">
  import chainsafeEth20StateTransition from 'https://cdn.skypack.dev/@chainsafe/eth2.0-state-transition';
</script>

README

eth2.0-state-transition

npm License

The beacon state transition and state transition utilities

Usage


import {stateTransition} from "@chainsafe/eth2.0-state-transition";
import {BeaconBlock, BeaconState} from "@chainsafe/eth2.0-types";
import {config as mainnetConfig} from "@chainsafe/eth2.0-config/lib/presets/mainnet";

const state: BeaconState = {
  ...
};

const block: BeaconBlock = {
  ...
};

let postState: BeaconState;
try {
  postState = stateTransition(mainnetConfig, state, block);
} catch (e) {
  console.log(e);
}

License

Apache-2.0