Skip to content

TomDaviesUK/DEVNET-Coin

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DEVNET|Coin Web

This repository contains the website of DEVNET|Coin as well as the truffle framework files for installation and building.

We are running this on the KOVAN ethereum test network.

WebSite

This is a nodejs application. We use web3js for connecting with the blockchain.

We have also created a Dockerfile so the site can be updated quickly and easily.

Truffle

Install Truffle

npm install -g truffle

Compile the contract

The contract is located in contracts/devnetcoin.sol and can be compiled as follows:

cd ~/<repo-root>
truffle compile

To deploy the network we use the Infura network. This way we don't need to run a local blockchain on our server. For instructions on setting this up see this guide.

We use environment variables to set the truffle.json file. These environment variables are:

export INFURA_MNEMONIC="close door open mouth..."
export INFURA_SERVER="https://kovan.infura.io/<your key>"

Once these are set you can deploy the contract on the network with:

truffle migrate --network kovan

Notice the configuration file we use for the truffle.json file where we specify this network:

var HDWalletProvider = require("truffle-hdwallet-provider");
var mnemonic = process.env.INFURA_MNEMONIC;
var server = process.env.INFURA_SERVER;
module.exports = {
  networks: {
    kovan: {
      provider: function() {
        return new HDWalletProvider(mnemonic, server);
      },
      network_id: 42
    }
  }
};

Once the contract is deployed we can now interact with it.

About

Example Crypto Currency for Cisco Live

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 82.9%
  • CSS 11.8%
  • HTML 5.3%