Skip to content

Instantly share code, notes, and snippets.

View dangell7's full-sized avatar
💭
In the ZONE

Denis Angell dangell7

💭
In the ZONE
View GitHub Profile
@dangell7
dangell7 / install_ubuntu_18.04x64.sh
Last active January 8, 2020 06:40
Building rippled with gRPC
# Install some prerequisites.
# Assume you have Ubuntu 18.04 x64 installed
apt-get update \
&& apt-get install -y gcc g++ wget git cmake protobuf-compiler libprotobuf-dev libssl-dev
# Build Boost
wget https://dl.bintray.com/boostorg/release/1.70.0/source/boost_1_70_0.tar.gz \
&& tar -xzf boost_1_70_0.tar.gz \
&& cd boost_1_70_0 \
&& ./bootstrap.sh \
@dangell7
dangell7 / instructions.txt
Created September 13, 2020 15:53 — forked from nathanborror/instructions.txt
Example Kubernetes setup with Postgres and two Services for serving an API and a static site using Ingress. Also have a CronJob example for kicks.
*** Cluster Setup for Google Container Engine ***
0/ Install and configure local gcloud and kubectl: https://cloud.google.com/sdk/docs/
> gcloud components install kubectl
1/ Configure Google Cloud account:
> gcloud config set account YOUR_EMAIL_ADDRESS
> gcloud config set project YOUR_PROJECT_ID
> gcloud config set compute/zone us-west1-a
> gcloud config set container/cluster example
#include <stdint.h>
#include "hookapi.h"
int64_t cbak(uint32_t reserved)
{
TRACESTR("Carbon1: callback called.");
return 0;
}
int64_t hook(uint32_t reserved)
#define HAS_CALLBACK
#include <stdint.h>
#include "hookapi.h"
#define ttNFTOKEN_MINT 25
#define tfBURNABLE 0x00000001UL
#define tfONLYXRP 0x00000002UL
#define tfTRUSTLINE 0x00000004UL
#define tfTRANSFERABLE 0x00000008UL
```
def get_all_holders(w3, currency, issuer):
"""get_all_holders."""
holders = {}
marker = None
has_marker = True
page = 1
logger.info('SNAPSHOT {} FOR {}'.format(currency, issuer))
while has_marker:
logger.info('PAGINATION: PAGE: {}'.format(page))
/**
* This hook just accepts any transaction coming through it
*/
#include "hookapi.h"
#define ttNFTOKEN_MINT 25
#define ttNFTOKEN_OFFER_CREATE 27
#define tfSELLTOKEN 0x00000001UL

Starter is the simplest possible hook: it just accepts all transactions and logs that it is running.

to test:

  • in the develop pane, compile starter.c
  • in the deploy pane, deploy it to Alice account
  • set up payment transaction from Alice to Bob
  • run it and see in the debug stream 'Accept.c: Called.'

Modifying the tracing message and compiling with different optimizations are left as an exercise for the reader.

Starter is the simplest possible hook: it just accepts all transactions and logs that it is running.

to test:

  • in the develop pane, compile starter.c
  • in the deploy pane, deploy it to Alice account
  • set up payment transaction from Alice to Bob
  • run it and see in the debug stream 'Accept.c: Called.'

Modifying the tracing message and compiling with different optimizations are left as an exercise for the reader.

Starter is the simplest possible hook: it just accepts all transactions and logs that it is running.

to test:

  • in the develop pane, compile starter.c
  • in the deploy pane, deploy it to Alice account
  • set up payment transaction from Alice to Bob
  • run it and see in the debug stream 'Accept.c: Called.'

Modifying the tracing message and compiling with different optimizations are left as an exercise for the reader.

Starter is the simplest possible hook: it just accepts all transactions and logs that it is running.

to test:

  • in the develop pane, compile starter.c
  • in the deploy pane, deploy it to Alice account
  • set up payment transaction from Alice to Bob
  • run it and see in the debug stream 'Accept.c: Called.'

Modifying the tracing message and compiling with different optimizations are left as an exercise for the reader.