Skip to content

Conversation

@dapplion
Copy link
Contributor

@dapplion dapplion commented May 16, 2022

Part of dappnode/DAppNode#327

Change slightly the architecture of the SDK to accomodate multiple package managers (PMs)

Deprecate commands "next" and "increase". New list of commands is

  • sdk build: Build, upload
  • sdk publish: Build, upload and print TX
    • Take whatever is found in local disk and push it to the registry
  • sdk version: Bump local fs
    • Bump a package version locally (and commit)?
  • sdk init: Init package dir
  • sdk list: List package's repo latest version

Now only the last step of publish is concerned with fetching blockchain data, only to check if a new contract must be deployed for that repo. To check the latest version use a separate command sdk list. This command set is equivalent to NodeJS npm flow and provides better separation of concerns.

A PM now only has to implement this simple API to fulfull all features of the SDK

export interface IPM {
  /** Returns semver string for latest version of `dnpName`'s canonical repo */
  getLatestVersion(dnpName: string): Promise<SemverStr>;

  /** Tests if the connected JSON RPC is listening and available. Uses the `net_listening` method. */
  isListening(): Promise<boolean>;

  /** Populate transaction to publish a new version or repo */
  populatePublishTransaction(inputs: TxInputs): Promise<TxSummary>;
}

DPM changes

  • Add tags, by default set published version to "latest"
  • As a simplification, only have "latest" tag and nothing else
  • is the developer address field necessary?
  • Should the SDK have capabilities to actually publish or just create link the sdk-publish?

@dapplion
Copy link
Contributor Author

Closing for more atomic PRs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants