# Truffle: Deploying a Smart Contract
Learn how to deploy a simple Solidity-based smart contract to Majestic StarChain using the Truffle environment
Truffle (opens new window) is a development framework for deploying and managing Solidity (opens new window) smart contracts.
# Install Dependencies
First, install the latest Truffle version on your machine globally.
# Create Truffle Project
In this step we will create a simple counter contract. Feel free to skip this step if you already have your own compiled contract.
Create a new directory to host the contracts and initialize it:
Initialize the Truffle suite with:
Create contracts/Counter.sol
containing the following contract:
Compile the contract using the compile
command:
Create test/counter_test.js
containing the following tests in Javascript using Mocha (opens new window):
# Truffle configuration
Open truffle-config.js
and uncomment the development
section in networks
:
This will allow your contract to connect to your Majestic StarChain local node.
# Deploy contract
In the Truffle terminal, migrate the contract using: