Installation
Get started with Midnight, whether you are here to use privacy-preserving applications or to build them. The installation process includes setting up the Lace wallet, obtaining test tokens, and configuring the development environment.
Prerequisites
Before you begin, ensure you have:
- Google Chrome browser installed
- Basic familiarity with command-line operations
- Administrative privileges on your computer (for installing Docker and Compact)
Install the Lace Midnight Preview wallet
1. Download and install the Lace wallet extension
Lace Midnight Preview wallet is a browser extension wallet for the Midnight network. It is currently only compatible with Google Chrome.
Verification: The Lace wallet icon appears in your Chrome toolbar.
2. Create your wallet
Your wallet is protected by a seed phrase, which acts as your master key. Keep it secret and safe.
Verification: Your wallet dashboard opens, showing a 0 tDUST balance.
3. Get test tokens (tDUST)
tDUST is the token used on the Midnight Testnet. It has no real-world value and is used for testing transactions and interacting with applications.
Verification: Your Lace wallet shows a new balance of tDUST tokens.
You are now ready to interact with DApps. To start building on Midnight, continue with these additional setup steps for the development environment.
Install Compact
4. Install Compact using the installer script
Compact is Midnight's dedicated smart contract language for creating applications (DApps) that allow developers to express the amount of data protection that works for them.
Use the following command to install the pre-built binaries:
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/midnightntwrk/compact/releases/download/compact-v0.2.0/compact-installer.sh | sh
5. Update your shell PATH
Make sure the Compact binary is in your shell's PATH to run it from any directory. Your shell needs to be updated after installation.
6. Verify the Compact installation
compact --version to print version of Compact.which compact to print installation path.compact --version # print version of Compact
which compact # print installation path
Verification: These commands return the Compact version number and installation path.
Set up the proof server
7. Install Docker Desktop
The proof server is required to generate zero-knowledge proofs for transactions locally. It runs as a background service using Docker.
If you don't have Docker, download and install Docker for your operating system (macOS, Windows, or Linux):
- Get Docker here: https://www.docker.com/products/docker-desktop/
8. Run the proof server
Use the following command to start the proof-server in your terminal:
docker run -p 6300:6300 midnightnetwork/proof-server -- midnight-proof-server --network testnet
This command occupies the terminal window while running.
Verification: The terminal displays logs indicating the server is running and listening at http://localhost:6300.
To use a local proof-server with Lace Midnight Preview wallet, go to Settings > Midnight and select Local (http://localhost:6300).
Install Compact VS Code extension
9. Download the Compact VS Code extension
The Compact VS Code extension provides helpful syntax highlighting and code snippets.
Verification: You now see Compact Language Support extension in your installed VS Code extensions.
Your development environment is now configured. You are ready to start building privacy-preserving applications on Midnight.