Try   HackMD

Day 4

Deploying web 3

Learn to deploy smart contracts to TestNet


Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More β†’
The goal for today is to deploy your contracts and verify they work.
Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More β†’


When we say "application" on NEAR we usually mean software that has been written to define:

  • software that has been written to define
    • (a) on-chain data and behavior controlled by smart contracts (eg. NFT contract)
    • (b) off-chain data and behavior communicating with smart contracts (eg. web app)

We have looked at many contracts and applications this week and now we will deploy them.

Deploying to MainNet is out of scope so we will focus on TestNet and, as bonus activity, LocalNet where you can build in private. Anything that runs on TestNet should work just as well on MainNet. This is the only purpose of TestNet, in fact: to provide a full preview of our work before we take it live on MainNet.

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More β†’
CORE Activities

  1. Reserve your demo spot by completing the form below. You must participate (with a team or by yourself) in the development of a demo to earn a certificate.

    If your demo is solo (just you) then please fill out the form below with your information. If your demo is team (you and others) then fill out the form below ONLY ONCE and include all the names of people on the team.

    [ REGISTER for your demo slot ]

    To earn your certificate of completion, you MUST deliver a demonstration of your work at the end of this week (tomorrow). If you are not ready for a demo tomrrow then you are welcome to wait until the next time we run this course and deliver a demo on that Friday - Demo Day

  2. Watch this orientation video about today's challenge.

  3. Deploy at least one application to TestNet

    • Choose any one (or more) of the contracts and applications you saw on Day 1 and Day 2. It doesn't matter, when deploying, whether the application is written in Rust or AssemblyScript. All contract code is compiled to WebAssembly and deployed to the network to be run inside a Wasm-compatible virtual machine.
      You will use a command like yarn dev for most applications but you can just as easily deploy an application using NEAR CLI with near dev-deploy for TestNet (or near deploy if you have already created an account).
  4. Verify the application was deployed

  5. Verify your use of the application

    • Use NEAR Explorer to verify the deployment (find a record of any transactions related to your account or related the target account to which the contract was deployed)

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More β†’
BONUS Activities

If you have the time to look around the corner, here's a little more for you.

  1. Install nearup and get a local node running. This will include:

    • installing nearup and nearcore prerequisites
    • compiling nearcore (this can take a long while)
    • running nearup with reference to the previously compiled nearcore binary
  2. Make sure you read through the nearup documentation (the README of the repository) for details on setup.

  3. You will end up with a 4-node LocalNet. To create an account you will have to use one of the node validator keys which you will find in your home directory (below is from MacOS)


This is what the filesystem will look like for your LocalNet keystore

/Users/sherif/.near/localnet
β”œβ”€β”€ node0
β”‚   β”œβ”€β”€ config.json
β”‚   β”œβ”€β”€ data
β”‚   β”œβ”€β”€ genesis.json
β”‚   β”œβ”€β”€ node_key.json
β”‚   └── validator_key.json  <-- open one of these files
β”œβ”€β”€ node1
β”‚   β”œβ”€β”€ config.json
β”‚   β”œβ”€β”€ data
β”‚   β”œβ”€β”€ genesis.json
β”‚   β”œβ”€β”€ node_key.json
β”‚   └── validator_key.json
β”œβ”€β”€ node2
β”‚   β”œβ”€β”€ config.json
β”‚   β”œβ”€β”€ data
β”‚   β”œβ”€β”€ genesis.json
β”‚   β”œβ”€β”€ node_key.json
β”‚   └── validator_key.json
└── node3
    β”œβ”€β”€ config.json
    β”œβ”€β”€ data
    β”œβ”€β”€ genesis.json
    β”œβ”€β”€ node_key.json
    └── validator_key.json

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More β†’
Going Deeper

If you're feeling fearless, here's about as far as you might take this road in a day

It's time to prepare for your demos!