- exchange priority policies in peer introductions
- assign unique sequential IDs in the order the transactions were inved (per peer) receiving a getdata for a tx updates last-known-peer-received inv to all invs up to the one referenced
- include ID-last-received, last-known-peer-received in sparse block
- reference txes in sparse block by index in receiver's prioritiziation with peer's sent invs up to ID-last-received and sender's prior invs up to last-known-peer-received
This file contains 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
# install haproxy | |
yum install -y haproxy | |
# config haproxy for rabbitmq | |
cat > /etc/haproxy/haproxy.cfg << "EOF" | |
global | |
log 127.0.0.1 local0 notice | |
maxconn 10000 | |
user haproxy |
This file contains 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
@Component(modules=MyModule.class) | |
@ApplicationScope | |
public interface MyComponent { | |
void inject(MyApplication application); | |
} | |
@Module | |
public class MyModule { | |
@Provides @ApplicationScope | |
public String provideString() { |
This file contains 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
/* | |
* Copyright (C) 2015 Jake Wharton | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
This file contains 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
public Observable<FilesWrapper> download(List<Thing> things) { | |
return Observable.from(things) | |
.flatMap(thing -> { | |
File file = new File(getExternalCacheDir() + File.separator + thing.getName()); | |
if (file.exists()) { | |
return Observable.just(file); | |
} | |
Request request = new Request.Builder().url(thing.getUrl()).build(); |
This file contains 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
public static Observable<List<String>> paginatedThings(final Observable<Void> onNextObservable) { | |
return Observable.create(new Observable.OnSubscribe<List<String>>() { | |
@Override | |
public void call(final Subscriber<? super List<String>> subscriber) { | |
onNextObservable.subscribe(new Observer<Void>() { | |
int latestPage = -1; | |
@Override | |
public void onCompleted() { | |
subscriber.onCompleted(); |
This file contains 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
package org.paulbetts.shroom.core; | |
import android.os.AsyncTask; | |
import com.squareup.okhttp.*; | |
import java.io.IOException; | |
import java.io.InputStream; | |
import java.io.UnsupportedEncodingException; | |
import java.util.Arrays; |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
This file contains 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
# Raw transaction API example work-through | |
# Send coins to a 2-of-3 multisig, then spend them. | |
# | |
# For this example, I'm using these three keypairs (public/private) | |
# 0491bba2510912a5bd37da1fb5b1673010e43d2c6d812c514e91bfa9f2eb129e1c183329db55bd868e209aac2fbc02cb33d98fe74bf23f0c235d6126b1d8334f86 / 5JaTXbAUmfPYZFRwrYaALK48fN6sFJp4rHqq2QSXs8ucfpE4yQU | |
# 04865c40293a680cb9c020e7b1e106d8c1916d3cef99aa431a56d253e69256dac09ef122b1a986818a7cb624532f062c1d1f8722084861c5c3291ccffef4ec6874 / 5Jb7fCeh1Wtm4yBBg3q3XbT6B525i17kVhy3vMC9AqfR6FH2qGk | |
# 048d2455d2403e08708fc1f556002f1b6cd83f992d085097f9974ab08a28838f07896fbab08f39495e15fa6fad6edbfb1e754e35fa1c7844c41f322a1863d46213 / 5JFjmGo5Fww9p8gvx48qBYDJNAzR9pmH5S389axMtDyPT8ddqmw | |
# First: combine the three keys into a multisig address: | |
./bitcoind createmultisig 2 '["0491bba2510912a5bd37da1fb5b1673010e43d2c6d812c514e91bfa9f2eb129e1c183329db55bd868e209aac2fbc02cb33d98fe74bf23f0c235d6126b1d8334f86","04865c40293a680cb9c020e7b1e106d8c1916d3cef99aa431a56d253e69256dac09ef122b1a9 |
NewerOlder