Skip to content

Instantly share code, notes, and snippets.

View adyliu's full-sized avatar
🎯
Focusing

Ady Liu adyliu

🎯
Focusing
  • Beijing, China
View GitHub Profile
@adyliu
adyliu / rinkeby-peers-list.txt
Last active October 12, 2021 16:07
get the peers of rinkeby of ethereum
> console.log(admin.peers.map(function(e){return 'admin.addPeer("enode://'+e.id+'@'+e.network.remoteAddress+'");'}).sort().join('\n'))
admin.addPeer("enode://0db812a93f04c5d255d6b49e2982d682de95fb4d627cb71b1ae09c95ccd142cbfd1e4d81de8f6abd53d7039f71d1b76791637550b8457ccb75ab84924a3427a6@35.170.185.206:30303");
admin.addPeer("enode://15512c6ddd95ade68b6825c464cd076f1ef1b9ccd6675fc6c1a64d9131980e0219fe616c8878a7e9d815df96b6635d90ee2a4ec3a14ec88d4e27839d912f9186@35.236.199.169:30303");
admin.addPeer("enode://1f6dcd2e10a93b7373fd17a715d1a337f73a2a6807a358d2ab0bf9c9a70e78997df4d32468fa1886a8158a947ab44998fa6ca34c53c543bb557024ada2e687eb@34.203.75.150:30303");
admin.addPeer("enode://22745f606bf7846714bb55f0a98437e2b09da1928647965ef511d908392c4110e0a7709c2cc1630b48ff074cf0d519ede1d1b124a4f88aa21b794ddc0e7052e3@34.219.84.192:18546");
admin.addPeer("enode://2ca86aaa816920575eca798a30ee657dcc593a5420c20d129f9008ffe5432e54901f4f0846bb9a88ccde5d8531f14f22528b2ea314386815531f98c51c7818ff@18.234.144.172:30303");
admin.addP
@adyliu
adyliu / OfflineEOSTransfer.java
Created September 28, 2018 09:29
sign transaction offline for eos transfer
package eos.sample;
import java.time.LocalDateTime;
import java.util.Arrays;
import java.util.List;
import org.apache.log4j.BasicConfigurator;
import io.jafka.jeos.EosApi;
import io.jafka.jeos.EosApiFactory;
@adyliu
adyliu / EosCreateKey.java
Created September 6, 2018 08:27
Create EOS Key with java without RPC
package eos.sample;
import io.jafka.jeos.EosApiFactory;
import io.jafka.jeos.LocalApi;
public class EosCreateKey {
public static void main(String[] args) {
LocalApi api = EosApiFactory.createLocalApi();
String privateKey = api.createPrivateKey();
@adyliu
adyliu / TransferEOS.java
Created September 5, 2018 09:52
transfer EOS with java client
package eos.sample;
import java.time.ZoneId;
import java.time.ZonedDateTime;
import java.time.format.DateTimeFormatter;
import java.time.temporal.ChronoUnit;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@adyliu
adyliu / CreateAccount.java
Last active August 25, 2019 08:19
create eos account with java
package eos.sample;
import java.time.ZoneId;
import java.time.ZonedDateTime;
import java.time.format.DateTimeFormatter;
import java.time.temporal.ChronoUnit;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
@adyliu
adyliu / AddressChecker.java
Created August 3, 2018 07:33
ethereum address checker
package demo;
import java.math.BigInteger;
import java.util.Arrays;
import org.web3j.crypto.Hash;
import org.web3j.utils.Numeric;
public class AddressChecker {
pragma solidity ^0.4.24;
//==============================================================================
// _ _ _ _|_ _ .
// (/_\/(/_| | | _\ .
//==============================================================================
contract F3Devents {
// fired whenever a player registers a name
event onNewName
@adyliu
adyliu / ForkJoinDemo.java
Created December 16, 2014 08:43
a fork join demo
/**
*
*/
package demo;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Random;
import java.util.concurrent.ForkJoinPool;
@adyliu
adyliu / Consumers.java
Created June 25, 2014 10:03
Simple Producers for jafka
import java.io.Closeable;
import java.io.IOException;
import java.util.List;
import java.util.Map;
import java.util.Properties;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import com.shijiebang.xpower.configcenter.ConfigCenter;
import com.sohu.jafka.consumer.Consumer;
@adyliu
adyliu / build.sh
Created November 27, 2013 08:05
simple http hook for octopress blog hosted on github
#!/bin/bash
echo "build at `date`"
git pull
rake generate