npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@gooddollar/bridge-app

v1.5.12

Published

Minimalistic bridge

Downloads

327

Readme

Bridge app based on block header proofs

  • main.ts - entry point for the validator app submiting blocks to the registry
  • sdk.ts - sdk for submiting signed blocks from the registry to a bridge

Running the bridge validator app

  • Run the script where you run your validator node
  • The docker expects a local fusenet/config to exists where the private key is
  • Alternatively you can provide a private key or mnemonic via env variables PRIVATE_KEY and MNEMONIC (see below how to set env variables)
curl https://raw.githubusercontent.com/GoodDollar/GoodBridge/master/packages/bridge-app/dockerstart.sh -o dockerstart.sh
chmod u+x dockerstart.sh
./dockerstart.sh

Using the sdk

import { BridgeSDK } from "@gooddollar/bridge-app/dist/sdk.js";

// blockheaderregistry contract
const registry = "0x44a1E0A83821E239F9Cef248CECc3AC5b910aeD2";

// your custom bridges contracts implementing BridgeCore, key is chainId and value the bridge contract
const bridges = {"122":"0x...","1":"0x..."};

//the checkpoint update frequency
const stepSize = 10;

const bridgeSDK = new BridgeSDK(
    registry,
    bridges,
    stepSize
  );

// relayTx = async (sourceChainId: number, targetChainId: number, txHash: string, signer: Signer)
// this will fetch the signed block from the registry and the receipt proof for that txHash and submit them
// to the bridge contract
const = { relayTxHash, relayPromise } = await sdk.relayTx(sourceChain, targetChain, txHash, signer)

Advanced configuration via env variables

  • Edit the dockerstart.sh script and overwrite env variables with -e
  • OR create a .env file in your local fusenet/config folder, env vars defined in this file will override any defined via -e

Env variables

  • POLLING_INTERVAL (default 5000) - How often to query RPCs for new blocks (milliseconds)
  • LOG_LEVEL (default info)
  • REGISTRY_RPC (default http://172.17.0.1:8545) - RPC to for the blockchain with the registry contract
  • FUSE_RPC (default http://172.17.0.1:8545) - RPC for fuse
  • BLOCK_REGISTRY_ADDRESS
  • CONSENSUS_ADDRESS (default 0x3014ca10b91cb3D0AD85fEf7A3Cb95BCAc9c0f79) - The fuse consensus contract to fetch latest set of validators and sign them
  • TEST_MODE (default false) - When true will not submit blocks to registry
  • STEP_SIZE (default 10) - Submit signed blockchain block every STEP_SIZE blocks
  • CONFIG_DIR (default /config/) - Docker folder where private key json can be found
  • DOTENV_FILE (default /config/.env) - Docker folder for .env to override defaults

Running app/sdk tests

  • first deploy dev env by running in the bridge-contracts package the command yarn start:dev
  • run yarn test