Skip to content

Instantly share code, notes, and snippets.

View djuanit0x's full-sized avatar
🚀
The future is fast

djuanit0x djuanit0x

🚀
The future is fast
  • UCSD
  • San Diego, California
View GitHub Profile
@djuanit0x
djuanit0x / mylogo.png
Last active May 13, 2020 03:05
🏃My Story
mylogo.png
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%

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:

#!/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 July 22, 2019 08:00
provable-bitcoin-price
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 July 22, 2019 07:47
provable-bitcoin-price
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 July 22, 2019 07:39
provable-bitcoin-price
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 July 22, 2019 07:37
provable-bitcoin-price
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 July 22, 2019 07:22
provable-bitcoin-price
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 July 22, 2019 06:51
provable-bitcoin-price
module.exports = {
networks: {
development: {
host: process.env.DEVELOPMENT_HOST,
port: 8545,
network_id: "*", // Match any network id
gas: 4700000
},
}
};