livepeer / livepeer/protocol

Auto-build and publish contract ABI npm and go packages upon mainnet and public testnet migrations

Open
#371 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

devops streamflow
Dominant language
JavaScript
Stars
155
Forks
50
PR merge metrics
No merged PRs in 30d

Description

The protocol repo contains the contract ABIs after compiling the contracts. These ABIs are not only used within the protocol repo's truffle scripts but also in other client-side repos. This requires manual importing and more often than not more ABIs than necessary are imported.

We could add a script that build and publishes a new (or updated) npm package whenever we run mainnet or public testnet migrations. The public network builds would lead to a `dev` tagged package or something similar.

A first step could be to just consider the entire protocol repo as the npm package. For compiled javascript projects tree-shaking should be sufficient to avoid importing non-used ABIs in the build.

A second step could be to extract only the necessary ABIs into a very small package, this would require a little bit more work however.

We could do the same for a go package , running `abigen` and then publishing the generated files.

Alternatively we could use a CI tool to accomplish this but to avoid the built package being out of sync with the on-chain contracts it would require us to not merge changes into master before they are migrated on-chain.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No files or tests are named. Start by locating the mainnet and public testnet migration commands and the compiled ABI output, then compare the npm-package, extracted-ABI, and Go `abigen` options. Done should mean generated packages are published from migrations without becoming out of sync with on-chain contracts.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, javascript, solidity
Domain
blockchain, build-system, release
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.