Create, build, and deploy smart contracts using Visual Studio Code
In this tutorial, you'll use the Truffle extension for Visual Studio Code (VS Code). You will deploy a contract to Quorum Blockchain Service (QBS) using the complete IDE environment of VS Code and securely sign your transactions using the Truffle Dashboard and MetaMask.
Prerequisites
- Connect to the network using MetaMask.
- Connect to your network using the Truffle extension for VS Code.
Steps
1. Start the Truffle Dashboard and connect to MetaMask
Start the Truffle Dashboard by opening a new terminal window in Powershell and execute the
truffle dashboard
command.The Truffle Dashboard opens a new browser window and asks you to connect MetaMask to the browser instance. Select Connect Wallet and MetaMask opens a confirmation window.
importantMake sure you're connected to the QBS Network you configured in the MetaMask guide.
2. Deploy your smart contract
If you connected to the network using the Truffle extension for VS Code, you should have a sample smart contract HelloBlockchain.sol
compiled and ready for deployment.
You will deploy your smart contract, which will use the Truffle Dashboard to sign the transactions through MetaMask. By using the Truffle Dashboard, you don't have to hard code your seed phrase into your truffle-config.js
.
Before deploying your contract, make sure you configured MetaMask properly.
Right-click on your
HelloBlockchain.sol
, and select Deploy Contracts. You're asked for a destination to deploy - select Dashboard.Switch to your browser running the Truffle Dashboard, and notice an INCOMING REQUESTS.
Select the PROCESS button, which prompts MetaMask to open a confirmation window to process the transaction.
Select Confirm in MetaMask.
In this example, three more transactions occur in the Truffle Dashboard that you need to confirm in MetaMask.
3. Confirm that your deployment succeeded
Switch to VS Code and view the OUTPUT to see your smart contract was deployed successfully.