Skip to content

Instantly share code, notes, and snippets.

View helderjnpinto's full-sized avatar
☢️

ħþ helderjnpinto

☢️
View GitHub Profile
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<style id="jsbin-css">
.wrapper {
border: 1px solid black;
width: 400px;
geth (used in the Ethereum Wallet) saves its internal states for the main network in the chaindata directory. You can find it in the:
~/.ethereum on Linux
~/Library/Ethereum on OS X
~/AppData/Roaming/Ethereum on Windows
In these directories, there are:
chaindata: production blockchain
testnet: test blockchain
keystore: your keys
1 - https://www.ethereum.org/
2 - Download Ethereum Wallet choosing you SO - https://github.com/ethereum/mist/releases
3 - Ex. linux Ethereum-Wallet-linux64-0-10-0.zip
4 - Copy wetransfer files for respectives SO folders
~/.ethereum on Linux
~/Library/Ethereum on OS X
~/AppData/Roaming/Ethereum on Windows
@helderjnpinto
helderjnpinto / gist:0ac87d59d88befce112817d4ddd6e5f9
Created August 13, 2018 15:01
eth call method on smart contract only with web3
const contract = new web3.eth.Contract(abiArray, contractAddr);
var func = contract.methods.myMethod('foo', 'bar')
var encodedFunc = func.encodeABI();
var tx = {
from: ownerWallet,
to: contractAddr,
gas: web3.utils.toHex(1000000), //1m, also tried string '1000000'
gasPrice: web3.utils.toHex(20000000000), //20gwei, also tried string '20000000000'
/*
* Call a smart contract function from any keyset in which the caller has the
* private and public keys.
* @param {string} senderPublicKey Public key in key pair.
* @param {string} senderPrivateKey Private key in key pair.
* @param {string} contractAddress Address of Solidity contract.
* @param {string} data Data from the function's `getData` in web3.js.
* @param {number} value Number of Ethereum wei sent in the transaction.
* @return {Promise}
*/function rawTransaction(
Follow these steps to set up in IBFT Quorum network:
Install go-quorum >= 1.7.2 on all nodes.
Install istanbul-tools on at least one node.
Generate genesis.json, static-nodes.json templates (and nodekeys) using instanbul-tools on one of the nodes: istanbul setup --nodes --verbose --num --quorum --save (N = number of initial validator nodes).
Create chaindata directory on all nodes: mkdir Blockchain
Create (empty) passwords file on all nodes: touch passwords.txt
Create account(s) on all nodes: geth --datadir Blockchain --password passwords.txt account new > account1.txt
Update coinbase address in genesis.json template and allocate eth (using needed accounts in accounts.txt files on all nodes)
Copy updated genesis.json to all nodes.
# Docker - How to cleanup (unused) resources
Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...
## delete volumes
// see: https://github.com/chadoe/docker-cleanup-volumes
$ docker volume rm $(docker volume ls -qf dangling=true)
$ docker volume ls -qf dangling=true | xargs -r docker volume rm
const fs = require("fs");
const solc = require('solc')
let Web3 = require('web3');
let web3 = new Web3();
web3.setProvider(new web3.providers.HttpProvider('http://localhost:8545'));
var input = {
'strings.sol': fs.readFileSync('strings.sol', 'utf8'),
'StringLib.sol': fs.readFileSync('StringLib.sol', 'utf8'),
@helderjnpinto
helderjnpinto / bitsquat.py
Created November 23, 2018 11:40 — forked from temoto/bitsquat.py
DNS domain bitsquat checker
#!/usr/bin/env python
from __future__ import unicode_literals
# Original idea: http://dinaburg.org/bitsquatting.html
import gevent.monkey
gevent.monkey.patch_all()
import dns.name, dns.resolver
import gevent, gevent.pool
import sys