Skip to content

Instantly share code, notes, and snippets.

View todkap's full-sized avatar

Todd Kaplinger todkap

View GitHub Profile
const Stellar = require('stellar-sdk');
const rp = require('request-promise');
//global stellar variable
Stellar.Network.use(new Stellar.Network("Test SDF Network ; September 2015"));
const server = new Stellar.Server("http://localhost:8000",{allowHttp: true} );
createAccount = async function(){
let keyPair = Stellar.Keypair.random();
const result = await rp.get({
//get initial token from testnet firendbot
{
"_links": {
"self": {
"href": "http://localhost:8000/accounts/GAAQSHWBQD4Y67WCUSQDSCMOKMYHAIR2UAC7AS6ESZC2XUQVG7T3VHAT"
},
"transactions": {
"href": "http://localhost:8000/accounts/GAAQSHWBQD4Y67WCUSQDSCMOKMYHAIR2UAC7AS6ESZC2XUQVG7T3VHAT/transactions{?cursor,limit,order}",
"templated": true
},
"operations": {
{
"_links": {
"self": {
"href": "/metrics"
}
},
"goroutines": {
"value": 16
},
"history.elder_ledger": {
# example docker compose file for how to run stellar core
version: '3'
services:
stellar-core-postgres:
image: postgres:9
restart: on-failure
environment:
- POSTGRES_DB=stellar-core
stellar-core:
HTTP_PORT=11626
PUBLIC_HTTP_PORT=false
NETWORK_PASSPHRASE="Test SDF Network ; September 2015"
KNOWN_PEERS=[
"core-testnet1.stellar.org",
"core-testnet2.stellar.org",
"core-testnet3.stellar.org"]
# example docker compose file for how to run stellar core
version: '3'
services:
stellar-core-postgres:
image: postgres:9
restart: on-failure
environment:
- POSTGRES_DB=stellar-core
stellar-core:
const {
makeRemoteExecutableSchema,
introspectSchema,
mergeSchemas
} = require('graphql-tools');
const { createHttpLink } = require('apollo-link-http');
const { setContext } = require('apollo-link-context');
const { ApolloServer } = require('apollo-server-express');
const fetch = require('node-fetch');
const log4js = require('log4js');
@todkap
todkap / .travis.yml
Created August 29, 2018 15:22
deployment to ibmcloud
branches:
only:
- master
services:
- 'docker'
before_script:
- 'make prereqs-ibmcloud'
- 'make login-ibmcloud'
@todkap
todkap / .travis.yml
Last active August 29, 2018 14:41
Sample application travis build process
language: node_js
node_js:
- "8"
branches:
only:
- master
services:
- 'docker'
@todkap
todkap / server.js
Last active August 29, 2018 15:05
Node application representing playground deployer process flow
const express = require('express');
const app = express();
const bodyParser = require('body-parser');
const oauth_token = process.env.OAUTH_TOKEN;
const git_project = 'BlockchainInnovation'
const
const octokit = require('@octokit/rest')({
timeout: 0, // 0 means no request timeout
headers: {