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 activate¶
Command to help activate packages in your terminal.
usage: ethpm activate [-h] [--ethpm-dir ETHPM_DIR]
[--keyfile-password KEYFILE_PASSWORD]
package_or_uri
Positional Arguments¶
package_or_uri | Installed package or URI of package to activate. |
Named Arguments¶
--ethpm-dir | Path to specific ethPM directory (Defaults to ./_ethpm_packages ). |
--keyfile-password | |
Password to local encrypted keyfile. |
ethpm create¶
Commands to help generate manifests for local smart contracts.
usage: ethpm create [-h] {basic,solc-input,wizard} ...
Positional Arguments¶
create | Possible choices: basic, solc-input, wizard |
Sub-commands:¶
basic¶
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 [-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. |
wizard¶
Start CLI wizard for building custom manifests from the solidity compiler output found in given project directory.
ethpm create wizard [-h] [--manifest-path MANIFEST_PATH]
[--project-dir PROJECT_DIR]
Named Arguments¶
--manifest-path | |
Path of target manifest to amend. | |
--project-dir | Path to specific project directory. |
ethpm install¶
Install an ethPM package to a local _ethpm_packages
directory.
usage: ethpm install [-h] [--local-ipfs] [--package-name PACKAGE_NAME]
[--package-version PACKAGE_VERSION] [--alias ALIAS]
[--ethpm-dir ETHPM_DIR]
uri
Positional Arguments¶
uri | IPFS / Github / Etherscan / Registry URI of target package. |
Named Arguments¶
--local-ipfs | Flag to use locally running IPFS node rather than defualting to Infura. Default: False |
--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. | |
--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 update¶
Update the version of an installed ethPM package from a local _ethpm_packages
directory. Since ethPM does not enforce semver - this command will look for all available versions of the package on the active registry, and prompt you to choose the version to install.
usage: ethpm update [-h] [--ethpm-dir ETHPM_DIR] package
Positional Arguments¶
package | Package name / alias of target package to update. |
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] [--manifest-uri MANIFEST_URI]
[--manifest-path MANIFEST_PATH]
[--package-name PACKAGE_NAME]
[--package-version PACKAGE_VERSION]
[--keyfile-password KEYFILE_PASSWORD]
Named Arguments¶
--manifest-uri | Content addressed URI at which the manifest for released package is located. |
--manifest-path | |
Local path to target manifest used for release. | |
--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. | |
--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,explore} ...
Positional Arguments¶
registry | Possible choices: deploy, list, add, remove, activate, explore |
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. |
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. |
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. |