Skip to content

Instantly share code, notes, and snippets.

@pllearns
Last active March 14, 2019 21:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pllearns/0297e70bb4fb76a3023aef244abc247f to your computer and use it in GitHub Desktop.
Save pllearns/0297e70bb4fb76a3023aef244abc247f to your computer and use it in GitHub Desktop.
XYO Matrix Guide

Welcome to the Matrix

The XYO Matrix allows you to interact with the XYO network. In order to start interacting with the Matrix you will need a few tools.

Getting Started

What will you need?

Key Concepts you should review before diving into the Matrix

We recommend that you review these items prior to starting, but if you are too excited to get right in, go ahead and continue and these resources will be here when and if you need to dig deeper into a key word or concept.

Set up

To start using the Matrix, you will need to set up your MetaMask for the accounts that you have that contain XYO.

If you clicked on one of the above MetaMask links, that should've started you on the installation and setup of your MetaMask, including your seed phrase (see below).

Seed phrase image goes here

Once you have setup your MetaMask, you will be directed to the main dashboard

Dashboard image here

This Dashboard includes:

  • Your primary account number
  • How much eth you have in the account
    • This will vary depending on which network you are in - to use the Matrix in this Beta State, you will use the Kovan Test Network
  • Transaction History
  • Deposit/Send buttons
  • A Network Selector in the upper right hand side of the dashboard
    • Again, to use the Matrix in this state, you will need to select the Kovan Test Network

Kovan Test Network selection image here

Once you have MetaMask setup you will be able to get XYO Tokens through our XYO Kovan Faucet, and start using the Matrix to query and get responses

Setting up the XYO Kovan Faucet

  • Go to this link
  • Click on Get XYO
  • If you have not received XYO Tokens in the last 100 blocks you will receive 1 eth worth of XYO Tokens
    • Note if you have received XYO tokens within 100 blocks of your request, you will not receive any more tokens until 100 blocks from your last request.
  • 1 eth of XYO should be more than sufficient to get you going on using the Matrix
  • When you click the Get XYO button you will receive confirmation of a successful transaction
  • Now check your MetaMask by clicking on the fox logo to the right of your address bar
    • Your MetaMask will pop-up and show you the transaction cofirmation and should see funds available in your account
  • You now have the funds needed to get to the next step of accessing the Matrix

Connecting Your Wallet

  • It's time to go into the Matrix
  • Click on Connect Wallet on the main Matrix Dashboard
    • After clicking you will see that MetaMask will pop-up again to prompt you to confirm this
  • After MetaMask confirmation the Matrix will be updated with your XYO token balance
  • Now you are ready to ask the Matrix some questions

Using the Request/Response Interface

The XYO Network runs on making requests and getting responses. This query/answer protocol is what fuels the conversations between XYO nodes, and what allows us to reach location data certainty.

Using the Matrix, we can initiate a smart contract with a request, and activate a reward payment upon receipt of a valid response.

In order to initiate a request in the Matrix, we will need to use one of our smart consensus smart contracts (SCSC). The contract we will use is XyPayOnDelivery

You can connect with the SCSC, by updating your Matrix settings with our IPFS hash which will link the Matrix to the Kovan hosted SCSC.

  • After you have connected your wallet with the Matrix, and connected to the SCSC, click on the contracts button, you should see a select contract menu with a list of the smart contracts from the SCSC.
  • From this list, click on XyPayOnDelivery
  • You should then see another menu where you will select the address of that contract. Go ahead and click on the first address that you see, this is the address of our deployed contract on the Kovan Test Network.
  • Click on deploy contract, this deploys the contract from your account address (which you provide from MetaMask), you will notice that the stakingConsensus and _xyoToken fields are generated from both your address for the token and our address for the staking consensus.

place this view image here

  • Click on Deploy Contract you will receive a MetaMask notification that will alert you that you are deploying a contract and show you the gas fee for that transaction. Go ahead and click confirm.
  • You should get a notification from MetaMask once the transaction is confirmed.
  • After confirmation, you will get both an IPFS hash and an address, go ahead and record that on a notepad of your choosing for future reference.
  • You should now have full access to the functions of the smart contract. These functions will be listed on the Matrix, and all play a role in the process of request/response.

place list of functions image here

  • Click on the requestPayOnDelivery() which will point you to enter your request.

  • Enter the request value: request value image

  • Click the execute button

  • You will get confirmation, and now it's time to submit a response

  • To submit a response, click on the submitResponse function

  • You will now see a field for you to enter the response data

  • Enter the response data and click execute

  • Once you enter the response data, you will see a confirmation which validates your response, which should also send you a reward

  • Check your MetaMask after a few seconds, you will notice your balance has now increased by the amount of the reward, you should also see your updated XYO balance in the main dashboard, along your query and transactions on the recent transactions and queries listing.

**You have just executed one of the core essentials of the XYO Network and the Matrix, celebrate by going to our Bridge X Guide and set up your bridge to gather and transmit key heuristics, and if you really want to dive deep, go to our Developer Portal

Congratulations you have continued your journey into XYO and the Matrix!

Check back for more awesome walkthroughs from XYO!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment