Commands

A command-line tool to help manage ethPM packages and registries.

Warning

ethPM CLI is currently in public Alpha:

  • It is expected to have bugs and is not meant to be used in production
  • Things may be ridiculously slow or not work at all

ethpm create

Commands to help generate manifests for local smart contracts.

usage: ethpm create [-h] {basic-manifest,solc-input,manifest-wizard} ...

Positional Arguments

create Possible choices: basic-manifest, solc-input, manifest-wizard

Sub-commands:

basic-manifest

Automatically generate a basic manifest for given projects dir. The generated manifest will package up all available sources and contract types available in the solidity compiler output found in given project directory.

ethpm create basic-manifest [-h] [--package-name PACKAGE_NAME]
                            [--package-version PACKAGE_VERSION]
                            [--project-dir PROJECT_DIR]
Named Arguments
--package-name Package name for generating manifest with basic-manifest command.
--package-version
 Package version for generating manifest with basic-manifest command.
--project-dir Path to specific project directory.

solc-input

Generate solidity compiler standard json input for given project directory.

ethpm create solc-input [-h] [--project-dir PROJECT_DIR]
Named Arguments
--project-dir Path to specific project directory.

manifest-wizard

Start CLI wizard for building custom manifests from the solidity compiler output found in given project directory.

ethpm create manifest-wizard [-h] [--project-dir PROJECT_DIR]
Named Arguments
--project-dir Path to specific project directory.

ethpm install

Install an ethPM package to a local _ethpm_packages directory.

usage: ethpm install [-h] [--package-name PACKAGE_NAME]
                     [--package-version PACKAGE_VERSION] [--local-ipfs]
                     [--alias ALIAS] [--ethpm-dir ETHPM_DIR]
                     uri

Positional Arguments

uri IPFS / Github / Etherscan / Registry URI of target package.

Named Arguments

--package-name Package name to use when installing a package from etherscan URIs.
--package-version
 Package version to use when installing a package from etherscan URIs.
--local-ipfs

Flag to use locally running IPFS node rather than defualting to Infura.

Default: False

--alias Alias to use in reference to this target registry / package.
--ethpm-dir Path to specific ethPM directory (Defaults to ./_ethpm_packages).

ethpm list

List all installed ethPM packages in a local _ethpm_packages directory.

usage: ethpm list [-h] [--ethpm-dir ETHPM_DIR]

Named Arguments

--ethpm-dir Path to specific ethPM directory (Defaults to ./_ethpm_packages).

ethpm uninstall

Uninstall an ethPM package from a local _ethpm_packages directory.

usage: ethpm uninstall [-h] [--ethpm-dir ETHPM_DIR] package

Positional Arguments

package Package name / alias of target package to uninstall.

Named Arguments

--ethpm-dir Path to specific ethPM directory (Defaults to ./_ethpm_packages).

ethpm release

Release a package on the currently active registry. Requires an active registry set via ethpm registry and authentication for tx signing set via ethpm auth.

usage: ethpm release [-h] [--package-name PACKAGE_NAME]
                     [--package-version PACKAGE_VERSION]
                     [--manifest-uri MANIFEST_URI]
                     [--keyfile-password KEYFILE_PASSWORD]

Named Arguments

--package-name Package name of package you want to release. Must match package_name in manifest.
--package-version
 Version of package you want to release. Must match the version field in manifest.
--manifest-uri Content addressed URI at which the manifest for released package is located.
--keyfile-password
 Password to local encrypted keyfile.

ethpm registry

Commands to help manage your local registry store.

usage: ethpm registry [-h] {deploy,list,add,remove,activate} ...

Positional Arguments

registry Possible choices: deploy, list, add, remove, activate

Sub-commands:

deploy

Deploy a new ERC1319 registry on the chain associated with provided chain ID.

ethpm registry deploy [-h] [--alias ALIAS] [--chain-id CHAIN_ID]
                      [--keyfile-password KEYFILE_PASSWORD]
Named Arguments
--alias Alias to use in reference to this target registry / package.
--chain-id Chain ID of target blockchain.
--keyfile-password
 Password to local encrypted keyfile.

list

List all of the available registries in registry store.

ethpm registry list [-h]

add

Add a registry to registry store.

ethpm registry add [-h] [--alias ALIAS] uri
Positional Arguments
uri Registry URI for target registry.
Named Arguments
--alias Alias to use in reference to this target registry / package.

remove

Remove a registry from the registry store.

ethpm registry remove [-h] uri_or_alias
Positional Arguments
uri_or_alias Registry URI or alias for registry to remove.

activate

Activate a registry to be used as the default registry for releasing new packages.

ethpm registry activate [-h] uri_or_alias
Positional Arguments
uri_or_alias Registry URI or alias for target registry.

ethpm auth

Link a keyfile to authorize on-chain transactions (i.e. deploying a registry / releasing a package). To generate a keyfile, use eth-keyfile.

# Example script to generate your own keyfile
import json
from pathlib import Path
from eth_keyfile import create_keyfile_json

keyfile_json = create_keyfile_json(
   private_key = b"11111111111111111111111111111111",  # A bytestring of length 32
   password = b"foo"  # A bytestring which will be the password that can be used to decrypt the resulting keyfile.
)
keyfile_path = Path.cwd() / 'keyfile.json'
keyfile_path.touch()
keyfile_path.write_text(json.dumps(keyfile_json))
usage: ethpm auth [-h] [--keyfile-path KEYFILE_PATH]

Named Arguments

--keyfile-path Path to the keyfile you want to set as default.

ethpm scrape

Scrape a blockchain for all IPFS data associated with any package release. This command will scrape for all VersionRelease events (as specified in ERC 1319). It will lookup all associated IPFS assets with that package, and write them to your ethPM XDG directory.

usage: ethpm scrape [-h] [--ipfs-dir IPFS_DIR] [--start-block START_BLOCK]
                    [--chain-id CHAIN_ID]

Named Arguments

--ipfs-dir Path to specific IPFS directory.
--start-block Block number to begin scraping from (defaults to blocks from ~ March 14, 2019).
--chain-id Chain ID of target blockchain.