<|start_filename|>example/contracts/package.json<|end_filename|>
{
  "name": "echo-app",
  "version": "1.0.0",
  "description": "Example echo app",
  "main": "index.js",
  "scripts": {
    "test": "./node_modules/.bin/truffle test",
    "compile": "./node_modules/.bin/truffle compile",
    "dev-blockchain": "./node_modules/.bin/ganache-cli -d --db chain/",
    "deploy-local": "./node_modules/.bin/truffle migrate --network local"
  },
  "author": {
    "name": "<NAME>",
    "email": "<EMAIL>",
    "url": "https://github.com/artemistomaras/"
  },
  "license": "MIT",
  "dependencies": {
    "chai": "^4.2.0",
    "ganache-cli": "^6.4.3",
    "keythereum": "^1.0.4",
    "truffle": "^5.0.19",
    "truffle-assertions": "^0.9.2",
    "truffle-hdwallet-provider": "^1.0.17",
    "web3": "^1.2.4"
  }
}


<|start_filename|>example/contracts/test/echo.js<|end_filename|>
const truffleAssert = require('truffle-assertions');
const Echo = artifacts.require('Echo');

contract('Echo', accounts => {
    let echoContract;

    it('should be able to echo a message', async () => {
        let message = "hello world!"
        let tx = await echoContract.echo(accounts[2], details, timestamp, {from: owner})

        truffleAssert.eventEmitted(tx, 'LogEcho', (ev) => {
            return ev.message == message;
        });
    });

    beforeEach(async () => {
        echoContract = await Echo.new({from: accounts[0]})
    })


});


<|start_filename|>example/contracts/migrations/1_initial_migration.js<|end_filename|>
const Web3 = require('web3')
const TruffleConfig = require('../truffle-config')
const Migrations = artifacts.require("Migrations");


module.exports = function(deployer, network, addresses) {
  const config = TruffleConfig.networks[network];

  if(process.env.ACCOUNT_PASSWORD) {
    // Unlock account before making deployment
    const web3 = new Web3(new Web3.providers.HttpProvider('http://' + config.host + ':' + config.port));

    console.log('Unlocking account ' + config.from);
    web3.eth.personal.unlockAccount(config.from, process.env.ACCOUNT_PASSWORD, 36000);

  }

  deployer.deploy(Migrations);
};


