# 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 generate:contract <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 -i <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. Read more about how Proton accounts, starting with Accounts and Permissions
  2. Read the different API functions available inside contracts starting with Authentication
  3. Read the different classes commonly used starting with Asset
  4. Have a look at our extensive contract examples

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