Code Monkey home page Code Monkey logo

metaversetutorials's Introduction

MetaverseTutorials

Step by step tutorials for the Metaverse Blockchain

This is a Metaverse Tutorial series

This is a series of Metaverse tutorials. To begin clone this repository

git clone https://github.com/antron3000/MetaverseTutorials.git

navigate to the tutorial directory

cd MetaverseTutorials

update your repo to the latest version of mvs-blockchain-js

git submodule update --init --recursive

Install the metaverse npm package

npm install metaversejs --save

Install the mvs-blockchain-js npm package

cd mvs-blockchain-js && npm install

Each tutorial builds on the previous ones, so it is recommended to do them in order

To begin a tutorial navigate to the tutorials folder and follow instructions.

Tutorial Information:

These tutorials are designed

  • to be simple, no fluff
  • hands on
  • explain inner workings and give broad understanding of Metaverse blockchain
  • Show you step by step how to create dApp on Metaverse. Can also be used to integrate into your existing app.
  • provide working examples of what you should have built.
  • each tutorial comes with complete solutions to show you how its done in the end. Don't look till you're done!

1 - Integrate metaverse wallet into your dapp with your DID
2 - Issue and transfer MST’s
3 - Issue and transfer MIT’s
4 - learn the metaverse command line
5 - create metaverse wallet plugin
6 - execute coin swaps
7 - create multisig transactions
8 - understanding Metaverse MIPs

For more information refer to the Metaverse Documentation

Please follow the Environment setup instructions below before starting.

Environment Setup

Start by entering the "playground" directory. This is where you can build ALL your Metaverse apps during the tutorial.

cd tutorials/playground

Interact with metaverse libraries via nodejs

create a testScript

touch testScript.js

To interact with Metaverse using javascript you can interact with mvs-blockchain-js and metaversejs

For use in nodejs scripts, import mvs-blockchain from the mvs-blockchain folder, and require metaversjs.

Inside the testscript, add:

//import mvs-blockchain-js
let blockchain = require('../../mvs-blockchain-js')({
    url: "https://explorer-testnet.mvs.org/api/"
});


//import metaversjs
let Metaverse = require('metaversejs');

//make sure the libraries have been successfully imported

console.log(blockchain)
console.log("mvs-blockchain-js has been successfully imported!")
console.log(Metaverse)
console.log("Metaversjs has been successfully imported!")

now run

node testScript.js

Interact with metaverse via webapp

First create an html file

touch index.html

and add

<html>
  <head>
    <meta charset="utf-8">
    <title></title>
  </head>
  <body>

  </body>
</html>

To interact with webapps you must generate "index.js" from mvs-blockchain-js and "metaverse.min.js" from metaversejs. To generate these files you must clone each repository separately, namely metaversjs and mvs-blockchain-js and simply run

grunt

This will generate javascript files into the /dist folder that you can import into your app. You don't have to worry about this for now. We have generated these files and placed them in the playground folder. To include them in your webapp just add these script tags into your html page.

<script src = "metaverse.min.js"></script>
<script src = "index.min.js"></script>

Serve your webpage

python -m SimpleHTTPServer 4444

To test that the libraries have been successfully imported into your webpage, open the web console and enter

blockchain = await Blockchain({url: "https://explorer-testnet.mvs.org/api/"})

blockchain

Metaverse

You should see the "blockchain" (from mvs-blockchain-js) and Metaverse (from metaversjs) objects show up in the console.

You should now be fully set up and ready to begin tutorial 1.

metaversetutorials's People

Contributors

antron3000 avatar naftalimurgor avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.