dfx is the command-line interface for managing your Internet Computer project and the best place to start.
You can install dfx a few different ways.
sh -ci "$(curl -fsSL https://internetcomputer.org/install.sh)"This command will install a binary compatible with your operating system, and add it to /usr/local/bin.
Find a release for your architecture here.
Once dfx is installed, get acquainted with its capabilities by entering.
dfx helpSee our contributing guidelines here.
Building dfx is very simple:
cargo buildDFX is released in two steps:
-
Publishing a new DFX release.
-
Publishing a new
manifest.jsonandinstall.shto instruct the installer to actually download and install the new DFX release.
-
The release manager makes sure the
dfxstablebranch points to the revision that should be released and that the revision is tagged with a version (like0.5.6). -
The
sdk-releasejobset on Hydra tracks thestablebranch and starts evaluating shortly afterstableadvances. -
As you can see it only has the single job
publish.dfxwhich is defined here in terms of thedfxjob. Note that thepublish.dfxjob only exists when the revision has a proper version tag. This prevents publishing of untagged revisions. -
Our CD system running at
deployer.dfinity.systemsis configured with thepublish-sdk-dfx-releasejob. It will monitor the aforementionedpublish.dfxjob for new builds, whenever there's a new build it will download the output (the CD script) and execute it. -
As you can see the script also sends a message to the
#build-notificationsSlack channel so you can see when and if the SDK has been published.
After the DFX has been released it's available for download but the install
script at https://sdk.dfinity.org/install.sh won't immediately install it. To
make sure the installer actually downloads and installs the new DFX release the
manifest.json file at https://sdk.dfinity.org/manifest.json has to set its
tags.latest field to the new version. The following explains how to do that.
-
Edit the
public/manifest.jsonfile such that it points to the new DFX version and make sure this is merged inmaster. -
Similarly to releasing the DFX there's a
install-shjob that builds a CD script for publishing themanifest.jsonandinstall.shto our CDN. -
This job is built on the
sdkjobset which tracks themasterbranch. -
deployer.dfinity.systemsis configured with thepublish-sdk-install-shjob which will monitor the aforementionedpublish.install-sh.x86_64-linuxjob for new builds, whenever there's a new build it will download the output (the CD script) and execute it.
This section provides solutions to problems you might encounter when using dfx
This command will remove the build directory and restart your replica:
dfx stop && dfx start --clean --backgroundYou can deploy the Internet Identity canister into your replica alongside your project by cloning https://github.com/dfinity/internet-identity. From the internet-identity directory, run the following command:
II_ENV=development dfx deploy --no-wallet --argument '(null)'There are more notes at https://github.com/dfinity/internet-identity#running-locally that may be helpful.