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
var ripple = require('ripple-lib').RippleAPI | |
var kp = require('ripple-keypairs') | |
const api = new ripple.RippleAPI({ | |
server: 'wss://s.altnet.rippletest.net' | |
}); | |
async function addSigners (account, secret, signers, threshold) { | |
let weights = [] |
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
const RippleAPI = require('ripple-lib').RippleAPI; | |
const api = new RippleAPI({ | |
server: 'wss://s2.ripple.com' | |
}); | |
async function getChannelHistory(previousTxnID) { | |
let prevId = previousTxnID | |
let txs = [] |
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
from sympy import * | |
# nj is larger UNL size, o is common unl size, pi/pj is extra size of ni/nj, qj is nj's quorum, tj is fault tolerance of nj | |
nj, pi, pj, qj, tj = symbols("nj, pi, pj, qj, tj") | |
oij = nj - pj | |
ni = oij + pi | |
ti = ni/4 - pi/4 - pj/4 |
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
from sympy import * | |
# ni is smaller UNL size, o is common unl size, pi/pj is extra size of ni/nj, qi is ni's quorum, ti is fault tolerance of all UNLs | |
ni, pi, pj, qi, ti = symbols("ni, pi, pj, qi, ti") | |
oij = ni - pi | |
nj = oij + pj | |
fork_safei = oij > (nj/2 + ni - qi + ti) |
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
var ripple = require('ripple-lib').RippleAPI | |
const api = new ripple.RippleAPI({ | |
server: 'wss://s.altnet.rippletest.net' | |
}); | |
api.connect().then(() => { | |
const account = 'rDd6FpNbeY2CrQajSmP178BmNGusmQiYMM' | |
api.prepareSettings(account, { |
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
FROM ubuntu:xenial | |
RUN apt-get update | |
RUN apt-get install -y rpm devscripts yum-utils | |
RUN apt-get source rpm | |
RUN apt-get build-dep -y rpm | |
RUN sed -i '383s/.*/ if (strstr(sigt1->fileName, "src") == NULL \&\& strstr(sigt1->fileName, "debuginfo") == NULL) {/' rpm-4.12.0.1+dfsg1/sign/rpmgensig.c | |
RUN sed -i '387s/.*/ }/' rpm-4.12.0.1+dfsg1/sign/rpmgensig.c | |
RUN cd rpm-4.12.0.1+dfsg1 && dpkg-buildpackage -b -us -uc |
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
FROM ubuntu:latest | |
RUN apt-get clean | |
RUN apt-get update --fix-missing | |
RUN apt-get -y install gcc python-software-properties pkg-config libprotobuf-dev libssl-dev libboost-all-dev protobuf-compiler cmake | |
CMD cd /opt/rippled && mkdir -p build/gcc.release && cd build/gcc.release && cmake ../.. -Dtarget=gcc.release -Dstatic=true -DCMAKE_VERBOSE_MAKEFILE=ON && cmake --build . -- -j4 | |
# Build the Docker image once: |
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
FROM debian:latest | |
RUN apt-get update | |
RUN apt-get -y install gcc software-properties-common scons pkg-config libprotobuf-dev libssl-dev libboost-all-dev protobuf-compiler cmake | |
RUN apt-get -y install git | |
RUN cd /opt && git clone --depth 1 https://github.com/ripple/rippled.git | |
RUN apt-get -y install g++ |
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
const unix = Math.round(+new Date()/1000) | |
const rippleEpoch = 946684800 | |
const lifetime = 31536000 // seconds from now | |
const list = { | |
sequence: 1, | |
expiration: unix + lifetime - rippleEpoch, | |
validators: [ | |
{ |
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
// $ npm install ripple-lib | |
// $ RIPPLE_SECRET=sECRET RIPPLE_ADDRESS=rADDRESS SEQUENCE=4 RIPPLE_SERVER="ws://s.altnet.rippletest.net:51233" node escrow-cancel.js | |
// SEQUENCE is the sequence number of the corresponding EscrowCreate transaction | |
// For main network, use RIPPLE_SERVER="wss://s1.ripple.com:443" | |
var ripple = require('ripple-lib') | |
const ADDRESS = process.env['RIPPLE_ADDRESS'] | |
const SECRET = process.env['RIPPLE_SECRET'] | |
const SEQUENCE = process.env['SEQUENCE'] |