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

@brok/sdk

v0.28.0

Published

![Downloads](https://img.shields.io/npm/dw/@brok/sdk?label=Downloads) ![Issues](https://img.shields.io/github/issues/BROKLab/brok-monorepo)

Downloads

21

Readme

Downloads Issues

Documentation

About

BRØK SDK is a browser and node library to manage cap tables within the BRØK ecosystem.

Cap tables consist of "immutable" data like transactions and balances, handled on a blockchain. It also consist of more personal information about the owner, which is handled on Ceramic. You can interact with your assets throught a wallet (some signing functionality). There are also some services to make data more indexable and quikly accessible. All this is packaged in this library for easier access.

Getting started

Install library from npm

npm i @brok/sdk

... or yarn yarn add @brok/sdk

... or pnpm pnpm i @brok/sdk

Then init the SDK

const sdk = await SDK.init({
  ceramicUrl: 'https://ceramic-clay.3boxlabs.com',
  ethereumRpc: 'https://goerli-rollup.arbitrum.io/rpc',
  secret: 'test test test test test test test test test test test junk',
  theGraphUrl: 'https://api.thegraph.com/subgraphs/name/broklab/captable_dev_11',
  env: 'brokDev',
});

Read more about inputs to init SDK in documentation

You can see examples here:

Instances

You can read current deployments from npm captable

CapTableRegistry.sol

  • dev brokDEV: 0xaC7349fc43fEc778f1FA2475b3F850Ca17163557
  • stage brokStage: 0x5f97A62c01FAe8280344ec7Eb505ADf8397D9a1C
  • prod brokProd: 0x4e33Adb3A77B5685E351A61f6bFb20d9dfF71E76

Blockchain index TheGraph

Development on SDK

Clone repo

Run pnpm i

To clean everything up. Run make clean

Requirements

👩‍💻 Running locally with VSCode tasks (preferred)

In VScode, run task dev ( ⇧⌘B workbench.action.tasks.runTask).

This will fire up all projects in watch mode so you can develop and experience imdiate results (hopefully across pacakges). The graph takes some time to start. Once it is started it will keep running in docker as long as your captable contracts terminal is running. terminal_tabs

Deployments

Release packages of SDK and CapTable (you can choose what to publish update on with changeset)

pnpm changeset
pnpm changeset version
pnpm install
# commit the changes, need to update lockfiles.
pnpm publish -r

Deploy TheGraphCapTable service

Make sure @brok/graph package is useing desired @brok/captable version in package.json

pnpm --filter @brok/graph deploy:brokDev # deploy:brokLocal deploy:brokStage deploy:brokProd

Deploy frontends and servers

Will deploy by instructions of render.yaml file.

Packages

So SDK and Captable are NPM packages that needs to be published for changes to propegate. Graph, demo-server and demo-frontend needs to be deployed to their enviroments to progegate changes.

Environment variables

The main enviorment variables that you need to familirize with:

Environment setup

  1. Copy .env.example to .env in packages/captable, packages/demo-frontend and packages/demo-server. There is a make command for this.
  2. Get yourself an Ethereum RPC and Ethereum secret and put these into /.env and ./packages/captable/.env
  3. Then you should be able to generate the SDK for any chain.

SDK will look for environment variable BROK_ENVIRONMENT to determine which contracts to choose. Set this envrioment in your runtime.

  • local brokLocal - Will use local blockchain
  • dev brokDev - Will use Arbitrum Goerli
  • stage brokStage - Will use Arbitrum Goerli
  • prod brokProd - Will use Arbitrum mainnet (not currently)

To create an approved CapTable, the wallet for fagsystem must first be authorized by BRREG. Contact us.

Ugly hacks

  • If the blockchain node (running inside the captable contracts terminal) is killed, the graph node will stop indexing. To fire it up again run make graph-stop then make graph-start.
  • Problems with Key DID provider secp256k1 so we are deriving ED25519 from secp256k1 private key.