Skip to content

Instantly share code, notes, and snippets.

@rajeshsubhankar
rajeshsubhankar / ropsten-peers-istanbul.txt
Created October 4, 2019 08:49
Ropsten peers list on istanbul hard fork.
admin.addPeer("enode://06a80e820a12cf6f2a4910f50695904282dddbd299138ccc230001831647ce9a2b5197307941232bc946c5db4df0823da7ceeda98327fb2fa1a34a0cd1ed7e6b@195.201.192.23:30305");
admin.addPeer("enode://e8f2eaf49cb7ce5d192957879f145471bbae2bfc35f8e86474e2ae192d3aaf443c1c5f97a9ebf5733381564e2c5bda5032c1e62eaf7028fe3b5feb0736cfdcfc@202.231.245.163:30303");
admin.addPeer("enode://f8f093ea210d3c298f635b4a4e89ed003324f912d47502a26b544011fe83ccb24377b8dc238cd8611664c5a90c8bb34cc00cbc6ab12737e80469517f0119e7bf@34.204.189.154:30303");
admin.addPeer("enode://bdacaf02a392c13972cb1b07f0cb2a1a0db0c36a10949dfc4a6643c7995db6f832a56b8fef8174ab13a3dfeed83f5f37b016eb209a5c260d0203e4fefe8dd54d@103.76.36.113:30303");
admin.addPeer("enode://d6cb8cba18828397e22e8852324af7e970b57cadbbd94aba6124790d1895728311b1f274e45d44a7a22b4276726903130a11ac2de19af5bc9294998f948eaad4@144.217.72.209:30303");
admin.addPeer("enode://d3560d6168c7f3e38c27473ac120af4aef6521ef01fe7df9713dca287add8a62ca0cf7cf596e67f2390ac3e2eb11d88f1f29e43bc562ab6f6f35108a1
I, rajeshsubhankar, use SCsBX0uAP as identifier at #Whois0x, a tool to check my ETH address: 0x3d832905d37be42354433c8f88365b0fd4e28fc9. https://Whois0x.io
@rajeshsubhankar
rajeshsubhankar / array_iteration_thoughts.md
Created July 6, 2019 10:36 — forked from ljharb/array_iteration_thoughts.md
Array iteration methods summarized

While attempting to explain JavaScript's reduce method on arrays, conceptually, I came up with the following - hopefully it's helpful; happy to tweak it if anyone has suggestions.

Intro

JavaScript Arrays have lots of built in methods on their prototype. Some of them mutate - ie, they change the underlying array in-place. Luckily, most of them do not - they instead return an entirely distinct array. Since arrays are conceptually a contiguous list of items, it helps code clarity and maintainability a lot to be able to operate on them in a "functional" way. (I'll also insist on referring to an array as a "list" - although in some languages, List is a native data type, in JS and this post, I'm referring to the concept. Everywhere I use the word "list" you can assume I'm talking about a JS Array) This means, to perform a single operation on the list as a whole ("atomically"), and to return a new list - thus making it much simpler to think about both the old list and the new one, what they contain, and

@rajeshsubhankar
rajeshsubhankar / sendRawTokenTransaction.js
Created March 28, 2019 17:03
Create and sends a raw ERC-20 token transaction with ether.js and Infura
const ethers = require('ethers');
const BigNumber = require('bignumber.js');
const provider = new ethers.providers.JsonRpcProvider('https://ropsten.infura.io/v2/INFURA_PROJECT_ID');
const addressFrom = 'SENDER_ADDRESS';
const privateKey = 'SENDER_PRIVATE_KEY';
const wallet = new ethers.Wallet(privateKey, provider);
const addressTo = 'RECEIVER_ADDRESS';

3Box is a social profiles network for web3. This post links my 3Box profile to my Github account!

✅ did:muport:QmSBe7G1QioPMPvBUZU3NqqgdxZSHyKq2ZX85rJfWThyGr ✅

Create your profile today to start building social connection and trust online. https://3box.io/

@rajeshsubhankar
rajeshsubhankar / sendRawEtherTransaction.js
Created March 28, 2019 13:59
Create and sends a raw ether transaction with ether.js and Infura
const ethers = require('ethers');
const provider = new ethers.providers.JsonRpcProvider('https://ropsten.infura.io/v2/INFURA_PROJECT_ID');
const addressFrom = 'SENDER_ADDRESS';
const privateKey = 'SENDER_ADDRESS_PRIVATE_KEY';
const wallet = new ethers.Wallet(privateKey, provider);
const addressTo = 'RECEIVER_ADDRESS';
@rajeshsubhankar
rajeshsubhankar / sendRawTokenTransaction.js
Created March 27, 2019 11:18
Create and sends a raw ERC-20 token transaction with web3 v1.0 and Infura
const Web3 = require('web3');
const Tx = require('ethereumjs-tx');
const BigNumber = require('bignumber.js');
const abi = require('ethereumjs-abi');
// connect to Infura node
const web3 = new Web3(new Web3.providers.HttpProvider('https://ropsten.infura.io/v2/INFURA_PROJECT_ID'));
// the address that will send the test transaction
const addressFrom = 'SENDER_ADDRESS';
@rajeshsubhankar
rajeshsubhankar / sendRawTransaction.js
Created March 13, 2019 12:53 — forked from raineorshine/sendRawTransaction.js
Sends a raw transaction with web3 v1.0 and Infura
const Web3 = require('web3')
const Tx = require('ethereumjs-tx')
// connect to Infura node
const web3 = new Web3(new Web3.providers.HttpProvider('https://mainnet.infura.io/INFURA_KEY'))
// the address that will send the test transaction
const addressFrom = '0x1889EF49cDBaad420EB4D6f04066CA4093088Bbd'
const privKey = 'PRIVATE_KEY'

Keybase proof

I hereby claim:

  • I am rajeshsubhankar on github.
  • I am rajeshsubhankar (https://keybase.io/rajeshsubhankar) on keybase.
  • I have a public key ASC7ai9mx-6lLHCqqUn-vScOYiEW1U0LjPrzzFQVMcVuAgo

To claim this, I am signing this object:

@rajeshsubhankar
rajeshsubhankar / SkipMetamask.js
Created July 17, 2018 10:08
In development mode while dealing with lot of transactions handling Metamask pop-ups are pain. To avoid that we can create and sign raw transactions.
var Web3 = require('web3');
const Tx = require('ethereumjs-tx')
var web3 = new Web3(Web3.givenProvider || "ws://localhost:8546");
// the address that will send the test transaction
const addressFrom = '0xDFf7787B927c0F03C3a8a49aF6726a074923663c'
//private key of above address
const privKey = 'replace_me'
//address to receive ether