Skip to content

Instantly share code, notes, and snippets.

View stellar-core.cfg
HTTP_PORT=11626
PUBLIC_HTTP_PORT=true
LOG_FILE_PATH=""
NETWORK_PASSPHRASE="Test SDF Network ; September 2015"
UNSAFE_QUORUM=true
FAILURE_SAFETY=1
CATCHUP_RECENT=10
@abuiles
abuiles / cap33.go
Created Aug 10, 2020
Sample cap33 on standalone
View cap33.go
package main
import (
"log"
"github.com/stellar/go/clients/horizonclient"
"github.com/stellar/go/keypair"
"github.com/stellar/go/txnbuild"
)
View json_paths.sql
CREATE TABLE accounts(address text NOT NULL);
INSERT INTO accounts(address) SELECT md5(RANDOM()::TEXT) FROM generate_series(1, 500000);
CREATE TABLE balances(claimants JSONB NOT NULL);
CREATE INDEX balances_gin_idx ON balances USING gin(claimants jsonb_path_ops);
-- insert 500k balances, one balance per account
INSERT INTO balances(claimants)
SELECT json_build_array(json_build_object('destination',a.address,'predicate', md5(RANDOM()::TEXT))) FROM accounts as a;
View p14.go
package main
import (
"log"
"github.com/stellar/go/clients/horizonclient"
"github.com/stellar/go/keypair"
"github.com/stellar/go/txnbuild"
)
View out.ts
declare namespace xdr {
interface UINT {
readonly MAX_VALUE: 4294967295;
readonly MIN_VALUE: 0;
read(io: Buffer): number;
write(value: number, io: Buffer): void;
isValid(value: number): boolean;
toXDR(value: number): Buffer;
fromXDR(input: Buffer, format?: "raw"): number;
fromXDR(input: string, format: "hex" | "base64"): number;
View xdr.ts
declare namespace xdr {
interface SignedInt {
readonly MAX_VALUE: 2147483647;
readonly MIN_VALUE: -2147483648;
read(io: Buffer): number;
write(value: number, io: Buffer): void;
isValid(value: number): boolean;
toXDR(value: number): Buffer;
fromXDR(input: Buffer, format?: 'raw'): number;
fromXDR(input: string, format: 'hex' | 'base64'): number;
@abuiles
abuiles / protocol13.md
Last active Apr 25, 2020
Protocol 13 support
View protocol13.md

Protocol 13 support

Stellar Protocol 13 is coming soon, and we need your help bringing support for it to your SDK.

The most relevant changes for SDKs are:

View foo.diff
122927c122927
< 7cf06b94575aa6e87112fbd58fea751a3c27f30e5fbe2ae47192c79d0a56bc07,24338403,2,GDGUS6YJV4QKIQZOF7WL7BDEQ4NASB7LUYHH6RH4UB44RL3TNE3KVOHO,67319953052663812,-1794967296,1,104532644921876480,AAAAAM1JewmvIKRDLi/sv4RkhxoJB+umDn9E/KB5yK9zaTaqlQL5AADvKyQAAAAEAAAAAQAAAAAAAAAAAAAAAF0DTNYAAAAAAAAAAQAAAAAAAAAAAAAAAHIKY+bukkRIu/ORC90+OAUYd8VJsLXOY/dBdtjHcTqwAAAAFloLwAAAAAAAAAAAAXNpNqoAAABAgixOvqGdVyD/DYW3PYalzU
7cf06b94575aa6e87112fbd58fea751a3c27f30e5fbe2ae47192c79d0a56bc07,24338403,2,GDGUS6YJV4QKIQZOF7WL7BDEQ4NASB7LUYHH6RH4UB44RL3TNE3KVOHO,67319953052663812,-1794967296,1,104532644921876480,AAAAAM1JewmvIKRDLi/sv4RkhxoJB+umDn9E/KB5yK9zaTaqlQL5AADvKyQAAAAEAAAAAQAAAAAAAAAAAAAAAF0DTNYAAAAAAAAAAQAAAAAAAAAAAAAAAHIKY+bukkRIu/ORC90+OAUYd8VJsLXOY/dBdtjHcTqwAAAAFloLwAAAAAAAAAAAAXNpNqoAAABAgixOvqGdVyD/DYW3PYalzUmxdzQuNUIfxoJjfXFDCkRXlN/4UN4kSWoiMreRhbSSnEiPk/qp38qs+/r7lLQ7AA==,AAAAAAAAAGQAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAA=,AAAAAgAAAAIAAAADAXNf4wAAAAAAAAAAzUl7Ca8gpEMuL+y/hGSHGgkH66YOf0T8oHnIr3NpNqoAAAAWcry/YQDvKyQAAAADAAA
View limit.sql
EXPLAIN ANALYZE
SELECT
ht.id, ht.transaction_hash, ht.ledger_sequence, ht.application_order, ht.account, ht.account_sequence, ht.max_fee,
COALESCE(ht.fee_charged, ht.max_fee) as fee_charged, ht.operation_count, ht.tx_envelope, ht.tx_result,
ht.tx_meta, ht.tx_fee_meta, ht.created_at, ht.updated_at, COALESCE(ht.successful, true) as successful,
array_to_string(ht.signatures, ',') AS signatures, ht.memo_type, ht.memo, lower(ht.time_bounds) AS valid_after,
upper(ht.time_bounds) AS valid_before, hl.closed_at AS ledger_close_time, ht.inner_transaction_hash, ht.fee_account,
ht.new_max_fee, array_to_string(ht.inner_signatures, ',') AS inner_signatures
FROM history_transactions ht
LEFT JOIN history_ledgers hl
View allTxs.json
[
{
"memo": "6375332545341717",
"_links": {
"self": {
"href": "https://horizon.stellar.org/transactions/6fc37da9217c092dab9691a56ba6afc536d853c51c25fc0df180db398b3ec6dc"
},
"account": {
"href": "https://horizon.stellar.org/accounts/GB3RMPTL47E4ULVANHBNCXSXM2ZA5JFY5ISDRERPCXNJUDEO73QFZUNK"
},