$ brew install emscriptenand setup by following the instruction after the installation.
| /// watch blockchain network & execute in background | |
| const ethers = require('ethers'); | |
| const fs = require('fs'); | |
| const abiDecode = require('abi-decoder'); | |
| abiDecode.addABI(require('./erc20.abi.json')); | |
| const provider = new ethers.providers.JsonRpcProvider('https://ropsten.infura.io/v3/0720d1c4ec394f4090d9be740db47db0'); | |
| const getLastScanBlockIndex = async () => parseInt(fs.readFileSync(__dirname + '/../lastScanBlockIndex')); | 
| # Balancing over 4 nodes by hashing URI (consistently with md5) | |
| # onto 16 shards. | |
| upstream x0 { server 192.168.0.2; server 192.168.0.3 backup; } | |
| upstream x1 { server 192.168.0.2; server 192.168.0.4 backup; } | |
| upstream x2 { server 192.168.0.2; server 192.168.0.5 backup; } | |
| upstream x3 { server 192.168.0.2; server 192.168.0.3 backup; } | |
| upstream x4 { server 192.168.0.3; server 192.168.0.4 backup; } | 
| use deno_core::Op; | |
| use deno_core::ZeroCopyBuf; | |
| use deno_core::{CoreIsolate, StartupData}; | |
| use std::str; | |
| fn main() { | |
| println!("v8 version: {}", deno_core::v8_version()); | |
| let mut isolate = CoreIsolate::new(StartupData::None, false); |