The easiest way to get started on Nightfall.
Mac and Linux machines with at least 16GB of memory and 10GB of disk space are supported.
Nightfall requires the following software to run:
xcode-select —install
to install command line tools.node --version
. If using mac/brew, then you may need to run brew install node@10
and brew link --overwrite node@10 --force
python --version
npm config set python /usr/bin/python2.7
(or wherever your python 2 location is)First ensure you are in a new and empty directory.
Run the unbox
command via npx
and skip to step 3. This will install all necessary dependencies.
npx truffle unbox nightfall
Alternatively, you can install Truffle globally and run the unbox
command.
npm install -g truffle
truffle unbox nightfall
Start Docker.
In the root project directory, we generate the keys and constraint files for our Zero Knowledge Proofs. This is about 7GB and depends on randomness for security. This step can take a while, depending on your hardware (1-3 hours). Before you begin, check once more you have provisioned enough memory for Docker.
npm run setup
Alternatively, you can generate specific verification keys and constraint files one at time using a prompt.
npm run setup-prompt
Now, run the development console.
truffle develop
Compile and migrate the smart contracts. Note inside the development console we don't preface commands with truffle
.
compile
migrate
Execute the script provided for registering Zero Knowledge Proof verification keys on-chain. Note inside the development console we don't preface commands with truffle
.
exec scripts/registerVks.js
Truffle can run tests written in Solidity or JavaScript against your smart contracts. Note the command varies slightly if you're in or outside of the development console.
// inside the development console.
test
// outside the development console..
truffle test
How do I use this with Ganache-CLI?
It's as easy as modifying the config file! Check out our documentation on adding network configurations.
Where can I find more documentation?
This box is a marriage of Truffle, Nightfall, and ZoKrates. Any of them would be a great place to start!