Skip to content

Instantly share code, notes, and snippets.

# Update & Upgrade the System
sudo apt-get update
sudo apt-get upgrade
# Install dependencies there might be more based on your system
# However below instructions are for the fresh Ubuntu install/server
# Please carefully watch the logs because if something could not be install
# You have to make sure it is installed properly by trying the command or that particular
# dependency again
@s-a-y
s-a-y / stellar-sign-example2.js
Last active September 6, 2021 19:18
Difference from requestOperation method - you can add memo or time bounds to your transaction
const StellarSign = require('stellar-sign');
const StellarSdk = require('stellar-sdk');
StellarSdk.Network.usePublicNetwork();
const server = new StellarSdk.Server('https://horizon.stellar.org');
server.loadAccount('GBR3RS2Z277FER476OFHFXQJRKYSQX4Z7XNWO65AN3QPRUANUASANG3L')
.then(account => {
const builder = new StellarSdk.TransactionBuilder(account, {
const StellarSign = require('stellar-sign');
const StellarSdk = require('stellar-sdk');
StellarSign
.setHorizonUrl('https://horizon.stellar.org')
.useNetwork(StellarSdk.Networks.PUBLIC)
.requestOperation(
StellarSdk.Keypair.fromSecret('...'),
'umbre1*papayame.com',
StellarSdk.Operation.createAccount({

Keybase proof

I hereby claim:

  • I am s-a-y on github.
  • I am umbrel (https://keybase.io/umbrel) on keybase.
  • I have a public key ASBKC7sbepa82Nbmf2MKx6XMduhqljOGj1SsdDAX7loccgo

To claim this, I am signing this object:

HTTP_PORT=11626
PUBLIC_HTTP_PORT=true
LOG_FILE_PATH=""
BUCKET_DIR_PATH="/data/buckets"
NETWORK_PASSPHRASE="Public Global Stellar Network ; September 2015"
NODE_NAMES=[
"GAOO3LWBC4XF6VWRP5ESJ6IBHAISVJMSBTALHOQM2EZG7Q477UWA6L7U eno",
"GCJCSMSPIWKKPR7WEPIQG63PDF7JGGEENRC33OKVBSPUDIRL6ZZ5M7OO tempo.eu.com",
@s-a-y
s-a-y / withdraw.js
Last active May 30, 2018 23:17
Withdraw BTC from Stellar network
let server = new StellarSDK.Server('https://horizon.stellar.org');
StellarSDK.FederationServer.resolve('MHk77q9KyZZNefBwmXcjUngggipKJPGPHj*apay.io')
.then((recipient) => {
server.loadAccount(senderAccount)
.then((account) => {
var transaction = new StellarSDK.TransactionBuilder(account)
.addMemo(StellarSdk.Memo.text(recipient.memo))
.addOperation(StellarSdk.Operation.payment({
destination: recipient.account_id,
asset: (new StellarSdk.Asset('LTC', 'GC5LOR3BK6KIOK7GKAUD5EGHQCMFOGHJTC7I3ELB66PTDFXORC2VM5LP')),
@s-a-y
s-a-y / deposit.js
Last active May 30, 2018 23:15
Obtaining Bitcoin address for deposit into Stellar address
let request = require('request-promise');
request({
'url': 'https://apay.io/deposit',
'qs': {
'account_id': '53718485*papayame.com',
'coin': 'BTC'
}
})
.then((result) => {
@s-a-y
s-a-y / trust.js
Last active August 15, 2018 10:46
Opens trustline to Stellar account testnet
let server = new StellarSDK.Server('https://horizon.stellar.org');
server.loadAccount(targetAccount)
.then((account) => {
var transaction = new StellarSDK.TransactionBuilder(account)
.addOperation(StellarSDK.Operation.changeTrust({
asset: new StellarSDK.Asset('BTC', 'GDR5FGQ22CJ66QXYFPNCIX2DKIV7FPYIDQ7WS2NVUJJNCJUFWIHFKOY4'),
limit: 100,
})
.build();