# Getting started

On your way to your first Proton Smart Contract!

# Pre-requisites

# Create Testnet Account

  1. Install Proton CLI (opens new window)
npm i -g @proton/cli
  1. Change chain to Proton Testnet
proton chain:set proton-test
  1. Create an account (12 characters max using charset a-z and 1-5)
proton account:create <ACCOUNT_NAME>

# Setting up a new project

  1. Run the CLI contract generator:
proton contract:create <ACCOUNT_NAME>
cd <ACCOUNT_NAME>
  1. Build contract (to target folder) and run the playground (a simulated blockchain environment)
npm run playground

# Deploy to the blockchain

  1. Obtain some XPR from testnet faucet
proton faucet:claim XPR <ACCOUNT_NAME>
  1. Purchase some blockchain storage (RAM)
proton ram:buy <ACCOUNT_NAME> <ACCOUNT_NAME> 300000
  1. Deploy Contract
proton contract:set <ACCOUNT_NAME> ./target

# Interact with deployed contract

Typically, users would interact with your smart contract using a web interface integrated with the Proton Web SDK (opens new window), that allows logging in with the WebAuth Wallet (opens new window). Earlier in this tutorial, we also saw how to run a simulated playground and execute actions inside it using npm run playground

Next, we will interact with the contract through our CLI to verify successful deployment to the blockchain.

The following command executes "action1" on your contract:

proton action <ACCOUNT_NAME> action1 '[]' <ACCOUNT_NAME>

# What's next?

In this tutorial, we looked at deploying a barebones contract.

The next steps are to:

  1. Have a look at the different examples
  2. Read the different API functions available inside contracts starting with Authentication
  3. Read the different classes commonly used starting with Asset

Equipped with these resources, you can create anything on the Proton blockchain!