nOS Documentation

nOS Documentation

  • Documentation
  • Blog
  • Help

›nOS Local

Introduction

  • Welcome to nOS
  • Contributing

nOS Client

  • Import NEO or nOS 0.5 Wallet
  • Getting started
  • API Overview
  • Implementation example
  • Debugging
  • Troubleshooting

Create nOS dApp

  • Installation and Usage

nOS ID

  • Getting started

nOS Local

  • Installation and usage

Getting started with nOS Local

nOS Local: An environment for nOS development.

nos-local will quickly get a local NEO blockchain running on your system in a docker container, and the nOS Smart Contract registered within it. This can then be used to load dApps under the .neo domain rather than running against localhost.

Prerequisites


  • Docker:
    • Docker for Windows
    • Docker for MacOSX

 

Installation


For now, manually start the neo-local environment and load contracts:

$ git clone https://github.com/nos/nos-local.git
$ cd nos-local

Usage - MacOSX

Execute nos-local using:

$ make run

Usage - Windows

Make sure your Docker is using Linux containers (right click on tray icon) After that, execute nos-local using:

$ makeWIN

 

General usage (Both Mac and Windows)


If you exit the neo-python prompt, access it again with Docker:

$ sudo docker exec -it neo-python /bin/sh -c /bin/bash
// Private/Local net - for local development and testing
$ np-prompt -p -v
// nOSNet Testnet - for "pre-production" testing
$ np-prompt -p testnet.nos.io -v

Once you're at the neo-python prompt (wallet password is "coz"):

open wallet ./neo-privnet.wallet
build /smart-contracts/contract.py
import contract /smart-contracts/contract.avm 0710 05 True False

Fill out the prompts for the contract meta data. Just hit [enter] if you're in a hurry 😉.

Wait a 🔥 minute and the nOS name service contract is deployed!

 

Register a domain with nOS


Let's register an example domain name with nOS. This is only possible using the private local net - not with the nOS Testnet

testinvoke <Smart_Contract_Hash> RegisterDomain ['AK2nJJpJr6o664CWJKi1QRXjqeic2zRp8y', 'bucket.neo', 'https://ihasabucket.com/', 'AK2nJJpJr6o664CWJKi1QRXjqeic2zRp8y']

Wait for the TX to clear, and test your domain is registered:

testinvoke <Smart_Contract_Hash> GetDomain ['AK2nJJpJr6o664CWJKi1QRXjqeic2zRp8y', 'bucket.neo']

Visit nos://bucket.neo in the client!


← Getting started
  • Prerequisites
  • Installation
  • General usage (Both Mac and Windows)
    • Register a domain with nOS
nOS Documentation
Docs
nOS Client documentationCreate nOS dApp documentationnOS Local documentation
Community
Discord ChatTelegramTelegram AnnouncementsTwitterReddit
More
BlogGitHubStar nOS
Copyright © 2020 nOS