Join our
Discord!
LogoLogo
SupraScan ExplorerStarKey WalletDiscord
MoveVM
  • Network
  • Oracles
  • Automation
  • SupraNova
  • Guides
MoveVM
  • Overview
  • Getting Started
    • Install Supra CLI with Docker
    • Create a Supra Account
    • Create a Move Package
      • Initialize a Package
      • Write a Module
      • Compile and Publish
      • Interact with a Package
    • Create a dApp with StarKey
  • Network Information
  • Token Standards
  • Learn Move 101
    • Getting Started with Move
    • Unsigned Integers in Move
    • Math Operations in Move
    • Using Vectors in Move
    • Reading Resource Data with borrow_global
    • Passing Data in Move: Value vs. Reference
    • Adding Elements with vector::push_back
    • Emitting Events with event::emit
  • Move Book
    • Getting Started
      • Modules and Scripts
      • Move Tutorial
    • Primitive Types
      • Integers
      • Bool
      • Address
      • Vector
      • Signer
      • References
      • Tuples and Unit
    • Basic Concepts
      • Local Variables and Scope
      • Equality
      • Abort and Assert
      • Conditionals
      • While, For, and Loop
      • Functions
      • Structs and Resources
      • Constants
      • Generics
      • Type Abilities
      • Uses and Aliases
      • Friends
      • Packages
      • Package Upgrades
      • Unit Tests
    • Global Storage
      • Structure
      • Operators
    • Reference
      • Standard Library
      • Coding Conventions
  • TypeScript SDK
    • Guides
      • Create Supra Accounts
      • Publish a Package
    • Documentation
    • Repository
  • Rest API
    • Mainnet
      • Accounts
      • Faucet
      • Transactions
      • Block
      • View
      • Consensus
      • Events
      • Tables
    • Testnet
      • Accounts
      • Faucet
      • Transactions
      • Block
      • View
      • Events
      • Tables
  • Developer Resources
    • Supra Dapp Templates
    • Supra Move VS Code Extension
  • Links
    • Supra DevHub
    • SupraScan Block Explorer
    • StarKey Wallet
    • Live Data Feeds
    • Whitepapers
    • Security Audits
    • Supra's Official GitHub
Powered by GitBook
On this page
Edit on GitHub
  1. Getting Started
  2. Create a Move Package

Compile and Publish

Create and deploy your first move module.

PreviousWrite a ModuleNextInteract with a Package

Last updated 7 days ago

It is good practice to review the possible arguments of each command before you execute them. You can do this by passing the --help argument. Example: supra move tool publish --help

For the latest RPC URL, please refer to the page.

1

Compile your package

You do not need to pass the --package-dir command if your current working directory is the root of your package where the Move.toml file is located.

Compiling your package will fetch any dependencies defined in your Move.toml file before building your package. A new directory named build will be created storing the bytecode and sources for your package.

execute me!
supra move tool compile --package-dir /supra/configs/move_workspace/exampleContract
2

Get Testnet Supra from the faucet

Note that CLI commands will be executed from the currently activated profile within your CLI. If you want to execute the command from a different profile, you can pass the --profile argument or you can activate a different profile with supra key activate-profile accountB.

To publish our package, we will need some gas. Obtain some Testnet gas from the faucet to proceed. Testnet tokens do not hold any monetary value.

execute me!
supra move account fund-with-faucet --rpc-url https://rpc-testnet.supra.com

Note, there is no faucet for Mainnet. If you are looking to deploy on Mainnet, you will have to obtain Supra separately.

3

Deploy your package

Once your package is compiled and you have tokens to cover the gas, execute the following command to publish your package to the network.

execute me!
supra move tool publish --package-dir /supra/configs/move_workspace/exampleContract --rpc-url https://rpc-testnet.supra.com
Supra Network Information