Skip to content

Instantly share code, notes, and snippets.

Avatar
🚀
The future is fast

Dennis Juanito djuanit0x

🚀
The future is fast
View GitHub Profile
View 📊 Weekly development breakdown
Rust 5 hrs 44 mins ████░░░░░░░░ 36.3%
Python 3 hrs 56 mins ███░░░░░░░░░ 24.9%
C++ 3 hrs 13 mins ██░░░░░░░░░░ 20.4%
Markdown 50 mins █░░░░░░░░░░░ 5.3%
JavaScript 28 mins ░░░░░░░░░░░░ 3.0%
View keybase.md

Keybase proof

I hereby claim:

  • I am djuanit0x on github.
  • I am djuanit0x (https://keybase.io/djuanit0x) on keybase.
  • I have a public key ASD6smLikipes0XC1QKjHS5HuCOlJKVX2jg4yomy0YowdAo

To claim this, I am signing this object:

View tldr.sh
#!/bin/bash
echo "Getting the Bitcoin price using contracts on provable:starter container using docker compose"
docker-compose -f docker-compose.yml up --build
TR=$?
echo exitcode=${TR}
echo "removing................"
docker-compose -f docker-compose.yml rm -f
@djuanit0x
djuanit0x / BitcoinPrice.test.js
Created Jul 22, 2019
provable-bitcoin-price
View BitcoinPrice.test.js
const BitcoinPrice = artifacts.require("BitcoinPrice");
const sleep = ms => {
return new Promise(resolve => {
setTimeout(resolve, ms);
});
};
const getEventLogByTopic = async eventTopic => {
try {
@djuanit0x
djuanit0x / docker-compose.yml
Created Jul 22, 2019
provable-bitcoin-price
View docker-compose.yml
version: '3'
services:
ganache:
image: trufflesuite/ganache-cli:v6.1.0
command: ganache-cli -h 0.0.0.0
ports:
- "8545:8545"
bridge:
build:
context: .
@djuanit0x
djuanit0x / dockerfile.bridge
Created Jul 22, 2019
provable-bitcoin-price
View dockerfile.bridge
FROM node:carbon-alpine
RUN apk --virtual dependencies add --update git python make g++ gcc && \
rm -rf /tmp/* /var/cache/apk/*
WORKDIR /usr/app
RUN git clone https://github.com/provable-things/ethereum-bridge .
@djuanit0x
djuanit0x / dockerfile.truffle
Created Jul 22, 2019
provable-bitcoin-price
View dockerfile.truffle
FROM node:9-alpine
RUN rm -rf /var/cache/apk/* && \
mkdir /app
WORKDIR /app
RUN apk update && \
apk upgrade && \
apk --update add python py-pip git make g++ && \
apk add --no-cache bash && \
npm install --unsafe-perm -g truffle@5.0.0-beta.2 && \
@djuanit0x
djuanit0x / BitcoinPrice.sol
Created Jul 22, 2019
provable-bitcoin-price
View BitcoinPrice.sol
pragma solidity ^0.5.0;
import './provableAPI_0.5.sol';
contract BitcoinPrice is usingProvable {
string public GET_BITCOIN_PRICE_QUERY = "json(https://api.coingecko.com/api/v3/coins/markets?vs_currency=usd&order=market_cap_desc&per_page=1&page=1&sparkline=false).0.current_price";
event LogNewProvableQuery(string description);
event LogNewProvableResult(string result);
mapping (bytes32 => bool) public pendingQueries;
string public result;
@djuanit0x
djuanit0x / truffle-config.js
Last active Jul 22, 2019
provable-bitcoin-price
View truffle-config.js
module.exports = {
networks: {
development: {
host: process.env.DEVELOPMENT_HOST,
port: 8545,
network_id: "*", // Match any network id
gas: 4700000
},
}
};
You can’t perform that action at this time.