This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<body> | |
<div class="readReceiptDemo"> | |
<input id="readMessages" type="submit" value="I've read all the messages" /> | |
<br /> | |
<input id="msgText" type="text" /> | |
<input id="sendMsg" type="submit" /> | |
<div id="messagePanel"></div> | |
</div> | |
</body> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const EthereumTx = require('ethereumjs-tx'); | |
const privateKeys = require('./truffle-keys').private; | |
const publicKeys = require('./truffle-keys').public; | |
const Token = artifacts.require('./Token.sol'); | |
contract('Token (integration)', function(accounts) { | |
let contract; | |
let owner; | |
let web3Contract; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Token = artifacts.require('Token'); | |
module.exports = (deployer) => { | |
deployer.deploy(Token); | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const mnemonic = process.env.ethereum_mnemonic; | |
const HDWalletProvider = require("truffle-hdwallet-provider"); | |
require('babel-register'); | |
require('babel-polyfill'); | |
module.exports = { | |
build: "npm run dev", | |
networks: { | |
development: { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var pubnub = new PubNub({ | |
publishKey : '__YOUR_PUBNUB_PUBLISH_KEY__', | |
subscribeKey : '__YOUR_PUBNUB_SUBSCRIBE_KEY__' | |
}); | |
var pubnubSMSChannel = '__YOUR_FUNCTION_LISTENING_CHANNEL__'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const xhr = require('xhr'); | |
const basicAuth = require('codec/auth'); | |
const username = '__YOUR_CLICKSEND_USER_NAME__'; | |
const authKey = '__YOUR_CLICKSEND_AUTH_KEY__'; | |
const uri = 'https://rest.clicksend.com/v3/sms/send'; | |
const authorization = basicAuth.basic(username, authKey); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// A node.js app | |
// Monitors contract events with web3.js and publishes their details over PubNub | |
const Web3 = require('web3'); | |
const PubNub = require('pubnub'); | |
const abi = require('../build/contracts/ShipmentTracking').abi; | |
const providerURI = 'https://mainnet.infura.io/__TOKEN_HERE__'; | |
const ethAddress = process.env.contract_address; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Libs | |
const PubNub = require('pubnub'); | |
const Web3 = require('web3'); | |
const ContractBuild = require('PATH_TO_TRUFFLE/build/contracts/Token.json'); | |
// PubNub | |
pubnub = new PubNub({ | |
publishKey : '__YOUR_PUB_KEY__', | |
subscribeKey : '__YOUR_SUB_KEY__' | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export default (request, response) => { | |
const vault = require('vault'); | |
let paramsObject = request.params; | |
return vault.get('myToken').then((token) => { | |
if (paramsObject.token === token) { | |
response.status = 200; | |
return response.send(); | |
} else { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Token Validator</title> | |
<link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css"> | |
</head> | |
<body> | |
<input id="text" type="text"> | |
<input id="submit" type="submit"> | |
<p id="serverResponse"></p> |
OlderNewer