Skip to content

MakoLab/Mako2

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

83 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mako2

Requirements:

In the blockchain that you are using, you need to enable websocket. If you are using the Hyperledger Besu client, you can find instructions here

Instructions

  1. Clone the repository to the user's home directory and go to the project directory:
cd "${HOME}" && git clone https://github.com/kostiask/Mako2.git && cd Mako2
  1. Go to directory Oracle:
cd Oracle
  1. Install modules:
npm install
  1. Into truffle-config.js put blockchain and account data:
development: {
      host: '<host blockchain>',
      port: <port>,
      network_id: '*',
      from: <address account>
    }

If using a client Besu.

Besu does not support private key management. To use Besu with Truffle, you must configure a Truffle wallet. To install a Truffle wallet:

npm install --save @truffle/hdwallet-provider

To add the wallet provider, update the truffle-config.js file in the project directory. Replace:

  • with the JSON-RPC endpoint (IP address and port) of a Besu node.
  • with the private key of an Ethereum account containing Ether.
const PrivateKeyProvider = require("@truffle/hdwallet-provider");
const privateKey = "<account-private-key>";
const privateKeyProvider = new PrivateKeyProvider(privateKey, "<JSON-RPC-http-endpoint>");
  1. Compile Smart Contract:
truffle compile
  1. Deploy Smart Contract:
truffle migrate

If you using Besu:

truffle migrate --network besuWallet

After executing the command from point 6 of the instruction, the terminal will display the address of the new Oracle smart contract: alt text

  1. The address of the smart contract Oracle from point 6 of the instruction must be placed in the js_Oracle/index.js file:
const addressOracle = "<address-Oracle-contract>";

and in the dapp/contracts/oracleAPI.sol file:

address OracleAddress = <address-Oracle-contract>;
  1. Go to directory js_Oracle:
cd ../js_Oracle
  1. Install modules:
npm install
  1. In index.js put blockchain websocket address:
web3 = new Web3(new Web3.providers.WebsocketProvider('<blockchain-websocket>'));
  1. In index.js put private account key(0x.....) on which there is ether for signing transactions:
const privateKey = "<private-key-account>";
  1. Start an application:
node index.js
  1. In the new terminal window, go from the main directory to the dapp directory
cd dapp
  1. Install modules:
npm install
  1. Follow step 2 from the instructions for the file truffle-config.js.

  2. Compile Smart Contracts:

truffle compile
  1. Deploy Smart Contracts:
truffle migrate

If you using Besu:

truffle migrate --network besuWallet

After executing the command from point 17 of the instruction, the terminal will display the address of the new RDF smart contract: alt text 18. The address of the smart contract RDF from point 17 of the instruction must be placed in the dapp/client/src/app.js file:

address: "<smart-contract-RDF-address>",
  1. From root directory, go to the directory server:
cd ../server
  1. Start server, which will return the graph:
node server.js
  1. In a new terminal window, from the root directory, go to the directory dapp/client
cd dapp/client
  1. Install module:
npm install
  1. Start app:
npm run dev

Metamask

  1. In Metamask connect to your blockchain network. alt text

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 86.0%
  • HTML 8.7%
  • Solidity 4.8%
  • CSS 0.5%