A complete list of RxJS 5 operators with easy to understand explanations and runnable examples.
This file contains hidden or 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> | |
<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; |
This file contains hidden or 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
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 |
This file contains hidden or 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
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 |
This file contains hidden or 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 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' |
This file contains hidden or 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
/* | |
* 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( |
This file contains hidden or 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
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. |
This file contains hidden or 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
# 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 |
This file contains hidden or 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 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'), |
This file contains hidden or 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
#!/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 |