Last active
January 18, 2018 12:32
-
-
Save kathyonu/63f9a9e87690526a99b0 to your computer and use it in GitHub Desktop.
Revisions
-
kathyonu revised this gist
Feb 26, 2016 . 1 changed file with 35 additions and 6 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -125,7 +125,7 @@ Amazon Web Services (AWS) cloud. Using Amazon EC2 eliminates your need to invest hardware up front, so you can develop and deploy applications faster. QUESTION: What is an AWS micro instance ? Answer : **A**mazon **W**eb **S**ervices End of [What Is Amazon EC2?](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/concepts.html) @@ -654,10 +654,6 @@ However, I choose to add this variable and script to one page, so far. I open our text editor to open this file and add the above line, combined with the [Stellar Query to Horizon](https://www.stellar.org/developers/js-stellar-sdk/learn/index.html) code. I enter this in `app/tellurians-exchange.js` <pre> @@ -751,9 +747,42 @@ we are working to contact **testnet**. <a name="gitignore"></a> ##### .gitignore Enter the following into your **.gitignore** file: Do not make a first commit without first ensuring your .gitignore file is set. [.gitignore manual](http://git-scm.com/docs/gitignore) [Best .gitignore files resource](https://github.com/github/gitignore) [Global OSX.gitignore](https://github.com/github/gitignore/blob/master/Global/OSX.gitignore) [GitBook.gitignore](https://github.com/github/gitignore/blob/master/GitBook.gitignore) [gulp-gitignore](https://github.com/thomas-lebeau/gulp-gitignore) : [gulp-gitignore package](https://www.npmjs.com/package/gulp-gitignore) : Exlude files defined on `.gitignore` from the stream [Heroku's Getting Started with Node.js](https://devcenter.heroku.com/articles/getting-started-with-nodejs#introduction) [Heroku's Best Practices for Node.js Development](https://devcenter.heroku.com/articles/node-best-practices) [Node.gitignore](https://github.com/github/gitignore/blob/master/Node.gitignore) [Rails.gitignore](https://github.com/github/gitignore/blob/master/Rails.gitignore) [Ruby.gitignore](https://github.com/github/gitignore/blob/master/Ruby.gitignore) [Sass.gitignore](https://github.com/github/gitignore/blob/master/Sass.gitignore) [Yeoman.gitignore](https://github.com/github/gitignore/blob/master/Yeoman.gitignore) [WordPress.gitignore](https://github.com/github/gitignore/blob/master/WordPress.gitignore) : an example we won't be using We are going to keep this next one as the last `.gitignore` file to enter, and the reason is, this one adds two items, both of which may be already included in the above additions. <pre> # Grunt ignore created by https://www.gitignore.io/api/grunt # Grunt usually compiles files inside this directory : dist/ # Grunt usually preprocesses files such as coffeescript, compass .. inside the `.tmp/` directory. </pre> End of **.gitignore** <a name="slugignore"></a> #####[.slugignore](https://devcenter.heroku.com/articles/slug-compiler) -
kathyonu revised this gist
Feb 26, 2016 . 1 changed file with 11 additions and 9 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -15,6 +15,8 @@ ###### [Stellar : streaming](#streaming) ###### [Yeoman-assert](#yeomanassert) 20160226 : this gist is not yet complete, and may have sections removed during editing. **Reference Links** [Stellar : Getting Started](https://www.stellar.org/developers/learn/get-started/get-started.html) @@ -116,16 +118,17 @@ capacity in the cloud. It is designed to make web-scale cloud computing easier f Currently stellar-core requires very modest hardware. It would be fine to run on an AWS micro instance, for example." <a name="ec2"></a> ##### [What Is Amazon EC2?](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/concepts.html) > Amazon Elastic Compute Cloud (Amazon EC2) provides scalable computing capacity in the Amazon Web Services (AWS) cloud. Using Amazon EC2 eliminates your need to invest in hardware up front, so you can develop and deploy applications faster. QUESTION: What is an AWS micro instance ? Answer : 20160223 : **A**mazon **W**eb **S**ervices End of [What Is Amazon EC2?](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/concepts.html) <a name="overview"></a> ##### Overview @@ -659,7 +662,7 @@ I enter this in `app/tellurians-exchange.js` <pre> <code> <script> var StellarSdk = require('stellar-sdk'); var server = new StellarSdk.Server('https://horizon-testnet.stellar.org'); // get a list of transactions that occurred in ledger 1400 @@ -671,7 +674,7 @@ I enter this in `app/tellurians-exchange.js` server.transactions() .forAccount('GASOCNHNNLYFNMDJYQ3XFMI7BYHIOCFW3GJEOWRPEGK2TDPGTG2E5EDW') .call().then(function(r){ console.log(r); }); </script> </code> </pre> @@ -693,8 +696,8 @@ Here, it becomes important to understand the terms: Everything else in the ledger, such as offers or trustlines, are owned by a particular account. **[transactions](https://www.stellar.org/developers/learn/concepts/transactions.html)** : _If you think of the ledger as a database, then transactions are SQL commands._ `ledger` `source account` `fee` @@ -724,7 +727,6 @@ streaming mode in the [Follow Received Payments](https://www.stellar.org/developers/horizon/learn/tutorials/follow-received-payments.html) tutorial." ##### [Variables](https://www.stellar.org/developers/js-stellar-sdk/learn/examples.html) `var StellarSdk = require('stellar-sdk');` @@ -1930,7 +1932,7 @@ Network.usePublicNetwork : replaces : Network.usePublicNet Network.useTestNetwork : replaces : Network.useTestNet Transaction.sign : replaces : TransactionBuilder.addSigner We are not done yet. As of 20160226, we have not made contact with the steller testnet server. Authored by [This Gister](https://github.com/kathyonu) -
kathyonu revised this gist
Feb 26, 2016 . 1 changed file with 36 additions and 161 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -757,13 +757,13 @@ TODO: see .gitignore references in [https://gist.github.com/kathyonu/c53943026d3 #####[.slugignore](https://devcenter.heroku.com/articles/slug-compiler) Enter the following in your **.slugignore** file: <pre> <code> *.psd *.pdf /test /spec </code> </pre> @@ -819,8 +819,8 @@ The note says: "Using **npm** to include **js-stellar-sdk** in your own project: The command says: `npm install --save stellar-sdk` Query : 20160206 : Where is the stellar/stellar-sdk repository ? Answer : Verified the above is the command to run. : Reference for [npm install --save stellar-sdk](https://www.npmjs.com/package/stellar-sdk). : "**stellar-sdk**" is a library for working with the Stellar Horizon server : At the above link, read the **[js-stellar-sdk](https://www.npmjs.com/package/stellar-sdk)** vs **[js-stellar-base](https://github.com/stellar/ruby-stellar-base)** info. : **stellar-sdk** is installed by `npm` : **js-stellar-sdk** is installed by Bower. @@ -857,36 +857,18 @@ Answer : Verified the above is the command to run. :: with incomplete developer tools, and :: What the heck is [metalsmith](https://github.com/stellar/metalsmith) ! Before we install `stellar sdk` we want to create our `~/package.json` file. Terminal will tell you so when you run the command without one. Open a new Terminal if need be: Run: `cd ~/` `touch package.json` `open -e package.json` Insert the contents of the [https://github.com/creationix/nvm/blob/master/package.json](https://github.com/creationix/nvm/blob/master/package.json) file in the new `~/package.json` file. **stellar-sdk** is installed by `npm`: @@ -895,16 +877,11 @@ Insert the contents of the [https://github.com/creationix/nvm/blob/master/packag You can see the results of this command being run in the **[Installation Commands with Results](#results)**. Our system is now ready to build a `js-stellar-sdk` project. How shall we begin ? Where do we begin ? See [Building a Project](#buildingprojects) The above concludes the `brew` `cask` `node` `nvm` `npm` `yo` `gulp` workspace. [Stellar Data Flow reference](https://www.stellar.org/developers/stellar-core/learn/core-data-flow.pdf) @@ -923,30 +900,10 @@ the `ruby-stellar-sdk` material will become another Gist. End of Ruby on Rails and `ruby-stellar-sdk` notes. All of this building of `nvm` and friends, is so we can use the Stellar platform. continuing along that thought .. I seriously doubt we can mix the use of both the `ruby-stellar-sdk` and **Node.js**. We are not working in a **Rails** app, we are working in a **Node.js** app. **THE STELLAR SDK's** I am going to take a few sentences from the [Stellar Developers](https://www.stellar.org/developers/js-stellar-sdk/learn/index.html) page, and translate them for Ruby. @@ -987,12 +944,12 @@ a [JavaScript SDK](https://www.stellar.org/developers/js-stellar-sdk/learn/) for a Ruby SDK for clients to use to interact with Horizon. It seems to me, we can use the JavaScript SDK as a model to create the Ruby SDK. **Connecting with the Server** The **server** object handles a network connection to a Horizon **server**. The **server** object provides methods that makes requests to that Horizon server easy. It is important to note that **server** methods query [Horizon endpoints](https://www.stellar.org/developers/reference/). **CallBuilder** [JS Stellar SDK] > [CallBuilder](https://www.stellar.org/developers/js-stellar-sdk/reference/call_builder.html) is a class that allows specificity and flexibility when querying the Horizon server. By using the Builder Pattern, CallBuilder provides methods that can be @@ -1071,19 +1028,15 @@ Dispatch an event to this EventTarget. There is more to kmow about the **[EventTarget](https://developer.mozilla.org/en-US/docs/Web/API/EventTarget)**, please read the source link. TODO: 20160225 : this goes in after Yo and Gulp are installed : '**stellar-sdk** is installed by `npm`' Now we use `npm` to install others: `npm install --save stellar-sdk` <pre> <code> will-i-am:~ William$ npm install --save stellar-sdk npm WARN deprecated [email protected]: package renamed to "urijs" (lower-case), please update accordingly > [email protected] install /Users/William/node_modules/stellar-base/node_modules/ed25519 @@ -1508,18 +1461,6 @@ Answer : 20160213 ? Perhaps the better question would be, why is `observatory` s --- `nvm` is installed by `brew` `nvm` is required to install `npm` `npm` is a **N**ode **P**ackage **M**anager @@ -1539,9 +1480,11 @@ in the Readme from the [NVM repo](https://github.com/creationix/nvm). Also, exec display a comprehensive list of all the commands along with a brief description. Good to know. To install **Yo**, we will run: `npm install -g yo`. To install **gulp**, we will run: `npm install -g gulp` To install **Grunt**, we will run: `npm install -g grunt-cli` To install **Bower**, we will run: `npm install -g bower` <pre> <code> ? Would you like to include jQuery? (Y/n) @@ -1572,11 +1515,6 @@ Updated Homebrew from 468f0d9 to 6322c47. </code> </pre> <a name="testings"></a> ##### Tests and Testings @@ -1596,14 +1534,6 @@ I have not begun tests yet. End of testings. <a name="installations"></a> ##### Installation Instructions @@ -1646,16 +1576,6 @@ complete `gulp` installation ready to build websites. Before we leave this `stellar-sdk` ignore notice, I provide a few links, a deeper understanding of how I arrived at how I installed `nvm` and `node` and other tools: A Brief Philosophical Discussion: Doing the normal Rails thing, I place the Stellar gem into our Gemfile: @@ -1692,31 +1612,6 @@ and so `node` it is. Node.js is installed as `node`. for the Stellar ecosystem. Horizon requires `go` 1.5 or higher to build. This is the reason a Ruby on Rails developer is installing `nvm`, `npm` and family. > Regarding the **Bower** link telling me it is 'a package manager' system for the web. > @@ -1739,17 +1634,12 @@ internally by other parts of the build process, we will not be installing **CommonJs** directly. As Rails developer, my study of Stellar so far leads me to see the need to install `nvm` and `npm`, and `yo` and `gulp` with **Yo**'s `generator-webapp`. > May I recommend you read this article, [Gulp vs Grunt. Why one? Why the Other?](https://medium.com/@preslavrachev/gulp-vs-grunt-why-one-why-the-other-f5d3b398edc4#.tbnwmem97). It appears it is a case of `gulp` or `grunt`. That being said, while we will be using `gulp`, other parts of the build process do use `grunt`. > Regarding `npm`: [npm software](https://en.wikipedia.org/wiki/Npm_%28software%29) wiki, a quote: > "npm, the **N**ode **P**ackage **M**anager, is the default package manager @@ -1768,18 +1658,11 @@ That one line catches my eye .. '`npm` allows users to install **Node.js** applications that are available on the `npm` registry.' Our tools so far definitely include `nvm` and `npm` and `node`, and `yo`, and `git` and `grunt` and `grunt-cli`, `gulp`. What is [nvm](https://keymetrics.io/2015/02/03/installing-node-js-and-io-js-with-nvm/) : **N**ode **V**ersion **M**anager What is [npm](https://en.wikipedia.org/wiki/Npm_%28software%29) : **N**ode **P**ackage **M**anager. What is [Yo](http://junereycasuga.github.io/blog/2014/11/19/how-to-install-yeoman/) : **Yo** is the tool to use for running Yeoman generators. > Yeoman @@ -1788,7 +1671,6 @@ install Yeoman. Yeoman is using 3 core tools. These core tools are composed by Yo, Grunt, and Bower. So we will install them one by one using `npm` which came with **Node.js** when we installed `node`. What is [grunt](http://gruntjs.com/) : **grunt** is the task-manager. See a great explanation a bit further below. What is [Bower](http://junereycasuga.github.io/blog/2014/11/19/how-to-install-yeoman/) : Bower is a package manager. @@ -1804,8 +1686,7 @@ running `yo webapp` or `yo angular`. To install **Go**, we will run: `brew install go`. To install **Yo**, we will run: `npm install -g yo`. To install **gulp**, we will run: `npm install -g gulp` To install **Grunt**, we will run: `npm install -g grunt-cli` To install **Bower**, we will run: `npm install -g bower` @@ -2035,29 +1916,23 @@ Now, how do I use it ? Right this moment, I haven't a clue. Let's take a look. Run `home` on it and arrive at the [Yeoman Home Page](http://yeoman.io/). `npm home yeoman-assert` This gives us an excellent description of `yeoman-assert` and what it does. <a name="stellarmethods"></a> ##### [Stellar Methods]() Account.isValidAccountId : replaces : Account.isValidAddress Account.sequenceNumber : replaces : Account.getSequenceNumber Keypair.accountId : replaces : Keypair.address Network.usePublicNetwork : replaces : Network.usePublicNet Network.useTestNetwork : replaces : Network.useTestNet Transaction.sign : replaces : TransactionBuilder.addSigner We are not done yet. As of 20160225, we have not made contact with the steller testnet server. Authored by [This Gister](https://github.com/kathyonu) Address of **Node-yo-gulp-stellar-sdk.md** is: [Node-yo-gulp-stellar-sdk-heroku.md](https://gist.github.com/kathyonu/63f9a9e87690526a99b0) -
kathyonu created this gist
Feb 26, 2016 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,2063 @@ ###### [Overview](#overview) ###### [Definitions](#definitions) ###### [Stellar : Getting Started](#stellarstart) ###### [Stellar : Testnet account](#testnet) ###### [Stellar Core testnet.cfg](#testnetcfg) ###### [Stellar Core](#stellarcore) ###### [Install js-stellar-sdk](#installstellar) ###### [Stellar Methods](#stellarmethods) ###### [.slugignore](#slugignore) ###### [.gitignore](#gitignore) ###### [Hardware Requirements](#hardware) ###### [What Is Amazon EC2?](#ec2) ###### [Getting Started with the AWS SDK for JavaScript in Node.js](#awssdk) ###### [What is an AWS micro instance](#aswmicroinstance) ###### [Stellar : streaming](#streaming) ###### [Yeoman-assert](#yeomanassert) **Reference Links** [Stellar : Getting Started](https://www.stellar.org/developers/learn/get-started/get-started.html) [Stellar : Home](https://www.stellar.org/) [Stellar Base](https://www.npmjs.com/package/stellar-base) [Stellar Core](https://www.stellar.org/developers/stellar-core/learn/admin.html) [Stellar Docs](https://github.com/stellar/stellar-core/tree/master/docs) [Stellar Building and Installing](https://github.com/stellar/stellar-core/blob/master/INSTALL.md) : We begin here. [Stellar Core Testnet](https://www.stellar.org/developers/stellar-core/learn/testnet.html) [Stellar Testnet](https://www.stellar.org/developers/learn/get-started/test-net.html) [Strllar : Vanguard of Stellar Explorers](https://strllar.org/) [stellar-core README.md](https://github.com/stellar/stellar-core/blob/master/README.md) [stellar/docs/stellar-core_testnet.cfg](https://github.com/stellar/stellar-core/blob/master/docs/stellar-core_testnet.cfg) [stellar/docs/stellar-core_example.cfg](https://github.com/stellar/stellar-core/blob/master/docs/stellar-core_example.cfg) [stellar/docs/other/stellar-core-validator-example.cfg](https://github.com/stellar/docs/blob/master/other/stellar-core-validator-example.cfg) [stellar/docs/validators.md](https://github.com/stellar/docs/blob/master/validators.md) [Stellar : streaming reference](https://www.stellar.org/developers/horizon/learn/responses.html#streaming) [Basic Examples : js-stellar-sdk](https://www.stellar.org/developers/js-stellar-sdk/learn/examples.html) [Stellar Developers Accounts](https://www.stellar.org/developers/learn/concepts/accounts.html) [Stellar Developers Transactions](https://www.stellar.org/developers/learn/concepts/transactions.html) [Stellar Query to Horizon](https://www.stellar.org/developers/js-stellar-sdk/learn/index.html) [Stellar : build an app](https://github.com/stellar/docs/blob/master/other/things-to-build.md) [Horizon Reference Overview](https://www.stellar.org/developers/reference/) [yeoman/generator-webapp/docs/README.md](https://github.com/yeoman/generator-webapp/blob/master/docs/README.md) [yeoman/generator-generator](https://github.com/yeoman/generator-generator) [yeoman/yeoman.github.io/app/codelab/local-storage.md](https://github.com/yeoman/yeoman.github.io/blob/source/app/codelab/local-storage.md) [The Past, Present & Future of Local Storage for Web Applications](http://diveintohtml5.info/storage.html) [yeoman.io/generator/Storage.html](http://yeoman.io/generator/Storage.html) [yeoman/generator releases](https://github.com/yeoman/generator/releases) [yeoman/generator](https://github.com/yeoman/generator) [AWS Free Tier](http://aws.amazon.com/free/) [AWS Amazon Web Services](http://aws.amazon.com/developers/getting-started/) [What is Amazon EC2](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/concepts.html) [AWS Quick Start Reference Deployments](http://aws.amazon.com/quickstart/) [yeoman/yeoman.github.io/codelab/index.md](https://github.com/yeoman/yeoman.github.io/blob/source/app/codelab/index.md) : 1 hour tutorial [Yeoman Home Page](http://yeoman.io/) [Yeoman Setup](http://yeoman.io/codelab/setup.html) [AWS micro instance](https://aws.amazon.com/ec2/) [Modernizer](https://modernizr.com/docs/#what-is-modernizr) [Heroku Node.js Support](https://devcenter.heroku.com/articles/nodejs-support) [Heroku Node.js Getting Started](https://github.com/heroku/node-js-getting-started) [JavaScript Variables w3schools.com](http://www.w3schools.com/js/js_variables.asp) [CSS/JS Modal](http://www.w3schools.com/howto/howto_css_modals.asp) [heroku/node-js-example](https://github.com/heroku/node-js-sample) [Heroku 10 Habits of a Happy Node Hacker](https://blog.heroku.com/archives/2014/3/11/node-habits) [creationix/nvm/nvm.sh](https://github.com/creationix/nvm/blob/master/nvm.sh) my new favorite commands : `cd heroku-node-starter/` `heroku local web` `heroku open --app stellarworks` [Getting Started with Node.js on Heroku](https://devcenter.heroku.com/articles/getting-started-with-nodejs#introduction) : unfinished by me [Building Transactions](https://www.stellar.org/developers/js-stellar-base/learn/building-transactions.html) : JS Stellar Base [List of Operations](https://www.stellar.org/developers/learn/concepts/list-of-operations.html) [List of Operations : create account](https://www.stellar.org/developers/learn/concepts/list-of-operations.html#create-account) [Basic Examples : js-stellar-sdk](https://www.stellar.org/developers/js-stellar-sdk/learn/examples.html) [Stellar Laboratory Endpoint Explorer](https://www.stellar.org/laboratory/#explorer) : connecting to https://horizon-testnet.stellar.org [Stellar Laboratory Transaction Builder](https://www.stellar.org/laboratory/#txbuilder) : connecting to https://horizon-testnet.stellar.org [Stellar Laboratory Transaction Signer](https://www.stellar.org/laboratory/#txsigner) : connecting to https://horizon-testnet.stellar.org [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) [Promise-Based Coroutines in Node.js](http://tobyho.com/2015/12/27/promise-based-coroutines-nodejs/) [gulp.js automates your tasks](https://scotch.io/tutorials/automate-your-tasks-easily-with-gulp-js) [gulp-sass](https://www.npmjs.com/package/gulp-sass) [Best Practices for Node.js Development](https://devcenter.heroku.com/articles/node-best-practices#start-every-new-project-with-npm-init) [npm css tricks](https://css-tricks.com/gulp-for-beginners/) [color-hex](http://www.color-hex.com/color/b9e5d2) [Stellar Consensus Protocol: Proof and Code](https://www.stellar.org/blog/stellar-consensus-protocol-proof-code/) [Node.js v5.6.0 Documentation](https://nodejs.org/api/fs.html) [CSS Links w3schools](http://www.w3schools.com/css/css_link.asp) [kathyonu/Rails-app-steps-to-establish-ruby-stellar-sdk.md](https://gist.github.com/kathyonu/c53943026d3e1ef0b129) [kathyonu/Rails-applications-health-codes.md](https://gist.github.com/kathyonu/c9ef8190e50422bc0edc) [npm-config](https://docs.npmjs.com/misc/config) [Meet Yeoman](https://github.com/yeoman/yeoman.github.io/blob/source/app/codelab/meet-yeoman.md) [yeoman.github.io/app/codelab/keep-going.md](https://github.com/yeoman/yeoman.github.io/blob/source/app/codelab/keep-going.md) [The Past, Present & Future of Local Storage for Web Applications](http://diveintohtml5.info/storage.html) [Unit Testing Best Practices in AngularJS](http://andyshora.com/unit-testing-best-practices-angularjs.html) [Write Unit Tests](https://github.com/yeoman/yeoman.github.io/blob/source/app/codelab/write-unit-tests.md) <a name="testnet"></a> ##### [Stellar Testnet account reference](https://www.stellar.org/developers/learn/get-started/test-net.html) <a name="testnetcfg"></a> ##### [stellar-core_testnet.cfg reference](https://github.com/stellar/stellar-core/blob/master/docs/stellar-core_testnet.cfg) <a name="stellarcore"></a> ##### [Stellar Core](https://www.stellar.org/developers/stellar-core/learn/admin.html) <a name="aswmicroinstance"></a> ##### [AWS micro instance](https://aws.amazon.com/ec2/) > "Amazon Elastic Compute Cloud (Amazon EC2) is a web service that provides resizable compute capacity in the cloud. It is designed to make web-scale cloud computing easier for developers." <a name="hardware"></a> ##### [Hardware Requirements] > "The hardware requirements scale with the amount of activity in the network. Currently stellar-core requires very modest hardware. It would be fine to run on an AWS micro instance, for example." TODO: What is an AWS micro instance ? Answer : 20160223 : **A**mazon **W**eb **S**ervices <a name="ec2"></a> ##### [What Is Amazon EC2?](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/concepts.html) > Amazon Elastic Compute Cloud (Amazon EC2) provides scalable computing capacity in the Amazon Web Services (AWS) cloud. Using Amazon EC2 eliminates your need to invest in hardware up front, so you can develop and deploy applications faster. <a name="overview"></a> ##### Overview Good Works On Earth is building an interface to [Stellar.org](https://www.stellar.org) 's platform. We have completed the installation of **Node.js** and its tools with [Rails-app-steps-to-establish-ruby-stellar-sdk.md](https://gist.github.com/kathyonu/c53943026d3e1ef0b129#configignore). Sadly, this is misnamed on two accounts, it has nothing to do with Rails, and we cannot yet work with the `ruby-stellar-sdk`. It is nowhere near complete. As a result, that reference is entirely how to install **Node.js** and friends to the point of being able to generate our first app. We have used the following tools to arrive here,, able to generate **Node.js** applications: Homebrew to install Homebrew-Cask and Node.js aka `node` `node` to install `npm` `npm` to install Yeoman's `yo` and `gulp` and the `generator-webapp` We are ready to develop, and while we do so, these definitions will come in handy. <a name="definitions"></a> ##### Definitions **Stellar** is a decentralized, federated peer-to-peer network that allows people to send payments in any asset anywhere in the world instantaneously, and with minimal fee. **Stellar-core** is the core component of this network. Stellar-core is a C++ implementation of the Stellar Consensus Protocol configured to construct a chain of ledgers that are guaranteed to be in agreement across all the participating nodes at all times. **STELLARS** : A **stellar**, also referred to as **STR** .. "is the native currency of the Stellar network. Every transaction requires a very small amount of STR. This is a DOS protection mechanism. STR is the only currency in the system that doesn’t have a counterparty. This means you can send stellars to any account." **LUMENS** TODO: 20160223 add definition from stellar materials with source link End of Definitions for now. <a name="stellarstart"></a> ##### [Stellar : Getting Started](https://www.stellar.org/developers/learn/get-started/get-started.html) TODO: 20160223 BEGIN End of Stellar : Getting Started <a name="installstellar"></a> ##### [Install js-stellar-sdk](https://github.com/stellar/js-stellar-sdk#install) Do not run commands indented like this. There will be more information below them. > **Install** > > To use as a module in a Node.js project > > 1. Install it using npm: > > `npm install --save stellar-sdk` > > 2. require/import it in your JavaScript: > > `var StellarSdk = require('stellar-sdk');` > > Our app now has access to the tools of `js-stellar-sdk` and through this, the `stellar-base`. Because we are hosting on Heroku, we are going to change the above command a bit, and then we will see we need to adjust this code one step further. I already ran the command, so I will show you the results, and then the change I made. Do not run commands when indented like this: > This : `npm install --save stellar-sdk` : becomes this: > > `npm install --save --save-exact stellar-sdk` > > The result of running the code, which shows two `npm WARN` messages: <pre> <code> Last login: Mon Feb 22 13:54:44 on ttys018 will-i-am:~ William$ cd yo-stellar/ will-i-am:yo-stellar William$ npm install --save --save-exact stellar-sdk npm WARN deprecated [email protected]: package renamed to "urijs" (lower-case), please update accordingly npm WARN prefer global [email protected] should be installed with -g > [email protected] install /Users/William/yo-stellar/node_modules/stellar-base/node_modules/ed25519 > node-gyp rebuild xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance CC(target) Release/obj.target/ed25519/src/ed25519/keypair.o CC(target) Release/obj.target/ed25519/src/ed25519/sign.o CC(target) Release/obj.target/ed25519/src/ed25519/open.o CC(target) Release/obj.target/ed25519/src/ed25519/crypto_verify_32.o CC(target) Release/obj.target/ed25519/src/ed25519/ge_double_scalarmult.o CC(target) Release/obj.target/ed25519/src/ed25519/ge_frombytes.o CC(target) Release/obj.target/ed25519/src/ed25519/ge_scalarmult_base.o CC(target) Release/obj.target/ed25519/src/ed25519/ge_precomp_0.o CC(target) Release/obj.target/ed25519/src/ed25519/ge_p2_0.o CC(target) Release/obj.target/ed25519/src/ed25519/ge_p2_dbl.o CC(target) Release/obj.target/ed25519/src/ed25519/ge_p3_0.o CC(target) Release/obj.target/ed25519/src/ed25519/ge_p3_dbl.o CC(target) Release/obj.target/ed25519/src/ed25519/ge_p3_to_p2.o CC(target) Release/obj.target/ed25519/src/ed25519/ge_p3_to_cached.o CC(target) Release/obj.target/ed25519/src/ed25519/ge_p3_tobytes.o CC(target) Release/obj.target/ed25519/src/ed25519/ge_madd.o CC(target) Release/obj.target/ed25519/src/ed25519/ge_add.o CC(target) Release/obj.target/ed25519/src/ed25519/ge_msub.o CC(target) Release/obj.target/ed25519/src/ed25519/ge_sub.o CC(target) Release/obj.target/ed25519/src/ed25519/ge_p1p1_to_p3.o CC(target) Release/obj.target/ed25519/src/ed25519/ge_p1p1_to_p2.o CC(target) Release/obj.target/ed25519/src/ed25519/ge_tobytes.o CC(target) Release/obj.target/ed25519/src/ed25519/fe_0.o CC(target) Release/obj.target/ed25519/src/ed25519/fe_1.o CC(target) Release/obj.target/ed25519/src/ed25519/fe_cmov.o CC(target) Release/obj.target/ed25519/src/ed25519/fe_copy.o CC(target) Release/obj.target/ed25519/src/ed25519/fe_neg.o CC(target) Release/obj.target/ed25519/src/ed25519/fe_add.o CC(target) Release/obj.target/ed25519/src/ed25519/fe_sub.o CC(target) Release/obj.target/ed25519/src/ed25519/fe_mul.o CC(target) Release/obj.target/ed25519/src/ed25519/fe_sq.o CC(target) Release/obj.target/ed25519/src/ed25519/fe_sq2.o CC(target) Release/obj.target/ed25519/src/ed25519/fe_invert.o CC(target) Release/obj.target/ed25519/src/ed25519/fe_tobytes.o CC(target) Release/obj.target/ed25519/src/ed25519/fe_isnegative.o CC(target) Release/obj.target/ed25519/src/ed25519/fe_isnonzero.o CC(target) Release/obj.target/ed25519/src/ed25519/fe_frombytes.o CC(target) Release/obj.target/ed25519/src/ed25519/fe_pow22523.o CC(target) Release/obj.target/ed25519/src/ed25519/sc_reduce.o CC(target) Release/obj.target/ed25519/src/ed25519/sc_muladd.o CXX(target) Release/obj.target/ed25519/src/ed25519.o SOLINK_MODULE(target) Release/ed25519.node /Users/William/yo-stellar ├─┬ [email protected] │ └── [email protected] ├─┬ [email protected] │ ├─┬ [email protected] │ │ ├─┬ [email protected] │ │ │ └─┬ [email protected] │ │ │ ├─┬ [email protected] │ │ │ │ └─┬ [email protected] │ │ │ │ └── [email protected] │ │ │ ├─┬ [email protected] │ │ │ │ └── [email protected] │ │ │ └─┬ [email protected] │ │ │ └─┬ [email protected] │ │ │ └─┬ [email protected] │ │ │ └── [email protected] │ │ └── [email protected] │ ├─┬ [email protected] │ │ └─┬ [email protected] │ │ └── [email protected] │ └─┬ [email protected] │ └─┬ [email protected] │ └─┬ [email protected] │ └─┬ [email protected] │ └── [email protected] ├─┬ [email protected] │ └─┬ [email protected] │ └── [email protected] ├─┬ [email protected] │ └─┬ [email protected] │ └── [email protected] ├─┬ [email protected] │ └─┬ [email protected] │ └── [email protected] └─┬ [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├─┬ [email protected] │ └─┬ [email protected] │ └─┬ [email protected] │ └── [email protected] ├─┬ [email protected] (git://github.com/jsdoc3/jsdoc.git#3dbb94f157290e8a0cbc79cb3580130e8e2c4534) │ ├── [email protected] │ ├── [email protected] │ ├─┬ [email protected] │ │ └─┬ [email protected] │ │ └── [email protected] │ ├── [email protected] │ ├── [email protected] │ ├── [email protected] │ ├─┬ [email protected] │ │ └── [email protected] │ ├── [email protected] │ ├── [email protected] │ └── [email protected] ├─┬ [email protected] │ ├── [email protected] │ ├── [email protected] │ ├── [email protected] │ ├─┬ [email protected] │ │ ├── [email protected] │ │ └── [email protected] │ ├─┬ [email protected] │ │ ├─┬ [email protected] │ │ │ └── [email protected] │ │ ├── [email protected] │ │ ├── [email protected] │ │ ├── [email protected] │ │ └── [email protected] │ ├── [email protected] │ ├─┬ [email protected] │ │ └── [email protected] │ └── [email protected] ├─┬ [email protected] │ ├── [email protected] │ ├── [email protected] │ ├─┬ [email protected] │ │ ├── [email protected] │ │ ├─┬ [email protected] │ │ │ └── [email protected] │ │ └─┬ [email protected] │ │ └── [email protected] │ ├── [email protected] │ ├── [email protected] │ ├── [email protected] │ ├── [email protected] │ └── [email protected] ├── [email protected] └── [email protected] will-i-am:yo-stellar William$ </code> </pre> End of results from : `npm install --save --save-exact stellar-sdk` We want to address these two: <pre> <code> npm WARN deprecated [email protected]: package renamed to "urijs" (lower-case), please update accordingly npm WARN prefer global [email protected] should be installed with -g </code> </pre> The first WARN, I do not know how to fix or if it is my place to fix it. The package showing out of date with old name is part of this package: └─┬ [email protected] └── [email protected] TODO: 20160223 : find the fix to this, if it is something needing to be fixed The second WARN .. I agree, we should have used the `-g` switch .. the `--global` switch. Because we are in our **project** directory, the use of the `-g` switch means the `stellar-sdk` will install into both the global and the project. So, to make matters right, I will uninstall, then install properly. Before I do, I want to see where the stellar-sdk is stored, so I can verify it is uninstalled. `cd ~/node_modules` `ls` I see two entries for stellar: **stellar-base** **stellar-sdk** I run these two commands, the first to undo exactly, the install, and the second command will install properly: `cd ~/` `npm uninstall --save --save-exact stellar-sdk` Now I very **stellar** is gone: `ls` Stellar is no more, both packages are gone. Now I install properly .. `cd ~/` `npm install --global --save --save-exact stellar-sdk` <pre> <code> will-i-am:~ William$ npm install --global --save --save-exact stellar-sdk /Users/William/.nvm/versions/node/v5.6.0/lib └─┬ [email protected] └── [email protected] (git://github.com/jsdoc3/jsdoc.git#3dbb94f157290e8a0cbc79cb3580130e8e2c4534) will-i-am:~ William$ cd /Users/William/.nvm/versions/node/v5.6.0/lib will-i-am:lib William$ ls dtrace node_modules will-i-am:lib William$ cd node_modules/ will-i-am:node_modules William$ ls generator-webapp gulp-cli stellar-sdk grunt npm yo grunt-cli observatory will-i-am:node_modules William$ </code> </pre> Now I install in my Project: `cd ~/` `cd yo-stellar` `npm install --save --save-exact stellar-sdk` <pre> <code> will-i-am:yo-stellar William$ npm install --save --save-exact stellar-sdk npm WARN prefer global [email protected] should be installed with -g > [email protected] install /Users/William/yo-stellar/node_modules/stellar-base/node_modules/ed25519 > node-gyp rebuild xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance CC(target) Release/obj.target/ed25519/src/ed25519/keypair.o CC(target) Release/obj.target/ed25519/src/ed25519/sign.o CC(target) Release/obj.target/ed25519/src/ed25519/open.o CC(target) Release/obj.target/ed25519/src/ed25519/crypto_verify_32.o CC(target) Release/obj.target/ed25519/src/ed25519/ge_double_scalarmult.o CC(target) Release/obj.target/ed25519/src/ed25519/ge_frombytes.o CC(target) Release/obj.target/ed25519/src/ed25519/ge_scalarmult_base.o CC(target) Release/obj.target/ed25519/src/ed25519/ge_precomp_0.o CC(target) Release/obj.target/ed25519/src/ed25519/ge_p2_0.o CC(target) Release/obj.target/ed25519/src/ed25519/ge_p2_dbl.o CC(target) Release/obj.target/ed25519/src/ed25519/ge_p3_0.o CC(target) Release/obj.target/ed25519/src/ed25519/ge_p3_dbl.o CC(target) Release/obj.target/ed25519/src/ed25519/ge_p3_to_p2.o CC(target) Release/obj.target/ed25519/src/ed25519/ge_p3_to_cached.o CC(target) Release/obj.target/ed25519/src/ed25519/ge_p3_tobytes.o CC(target) Release/obj.target/ed25519/src/ed25519/ge_madd.o CC(target) Release/obj.target/ed25519/src/ed25519/ge_add.o CC(target) Release/obj.target/ed25519/src/ed25519/ge_msub.o CC(target) Release/obj.target/ed25519/src/ed25519/ge_sub.o CC(target) Release/obj.target/ed25519/src/ed25519/ge_p1p1_to_p3.o CC(target) Release/obj.target/ed25519/src/ed25519/ge_p1p1_to_p2.o CC(target) Release/obj.target/ed25519/src/ed25519/ge_tobytes.o CC(target) Release/obj.target/ed25519/src/ed25519/fe_0.o CC(target) Release/obj.target/ed25519/src/ed25519/fe_1.o CC(target) Release/obj.target/ed25519/src/ed25519/fe_cmov.o CC(target) Release/obj.target/ed25519/src/ed25519/fe_copy.o CC(target) Release/obj.target/ed25519/src/ed25519/fe_neg.o CC(target) Release/obj.target/ed25519/src/ed25519/fe_add.o CC(target) Release/obj.target/ed25519/src/ed25519/fe_sub.o CC(target) Release/obj.target/ed25519/src/ed25519/fe_mul.o CC(target) Release/obj.target/ed25519/src/ed25519/fe_sq.o CC(target) Release/obj.target/ed25519/src/ed25519/fe_sq2.o CC(target) Release/obj.target/ed25519/src/ed25519/fe_invert.o CC(target) Release/obj.target/ed25519/src/ed25519/fe_tobytes.o CC(target) Release/obj.target/ed25519/src/ed25519/fe_isnegative.o CC(target) Release/obj.target/ed25519/src/ed25519/fe_isnonzero.o CC(target) Release/obj.target/ed25519/src/ed25519/fe_frombytes.o CC(target) Release/obj.target/ed25519/src/ed25519/fe_pow22523.o CC(target) Release/obj.target/ed25519/src/ed25519/sc_reduce.o CC(target) Release/obj.target/ed25519/src/ed25519/sc_muladd.o CXX(target) Release/obj.target/ed25519/src/ed25519.o SOLINK_MODULE(target) Release/ed25519.node /Users/William/yo-stellar ├─┬ [email protected] │ └── [email protected] ├─┬ [email protected] │ ├─┬ [email protected] │ │ ├─┬ [email protected] │ │ │ └─┬ [email protected] │ │ │ ├─┬ [email protected] │ │ │ │ └─┬ [email protected] │ │ │ │ └── [email protected] │ │ │ ├─┬ [email protected] │ │ │ │ └── [email protected] │ │ │ └─┬ [email protected] │ │ │ └─┬ [email protected] │ │ │ └─┬ [email protected] │ │ │ └── [email protected] │ │ └── [email protected] │ ├─┬ [email protected] │ │ └─┬ [email protected] │ │ └── [email protected] │ └─┬ [email protected] │ └─┬ [email protected] │ └─┬ [email protected] │ └─┬ [email protected] │ └── [email protected] ├─┬ [email protected] │ └─┬ [email protected] │ └── [email protected] ├─┬ [email protected] │ └─┬ [email protected] │ └── [email protected] ├─┬ [email protected] │ └─┬ [email protected] │ └── [email protected] └─┬ [email protected] ├─┬ [email protected] │ └── [email protected] ├── [email protected] ├── [email protected] ├─┬ [email protected] │ └─┬ [email protected] │ └─┬ [email protected] │ └── [email protected] ├─┬ [email protected] (git://github.com/jsdoc3/jsdoc.git#3dbb94f157290e8a0cbc79cb3580130e8e2c4534) │ ├── [email protected] │ ├── [email protected] │ ├─┬ [email protected] │ │ └─┬ [email protected] │ │ └── [email protected] │ ├── [email protected] │ ├── [email protected] │ ├── [email protected] │ ├─┬ [email protected] │ │ └── [email protected] │ ├── [email protected] │ ├── [email protected] │ └── [email protected] ├── [email protected] ├─┬ [email protected] │ ├── [email protected] │ ├── [email protected] │ ├── [email protected] │ ├─┬ [email protected] │ │ ├── [email protected] │ │ └── [email protected] │ ├─┬ [email protected] │ │ ├─┬ [email protected] │ │ │ └── [email protected] │ │ ├── [email protected] │ │ ├── [email protected] │ │ ├── [email protected] │ │ └── [email protected] │ ├── [email protected] │ ├─┬ [email protected] │ │ └── [email protected] │ └── [email protected] ├─┬ [email protected] │ ├── [email protected] │ ├── [email protected] │ ├─┬ [email protected] │ │ ├── [email protected] │ │ ├─┬ [email protected] │ │ │ └── [email protected] │ │ └─┬ [email protected] │ │ └── [email protected] │ ├── [email protected] │ ├── [email protected] │ ├── [email protected] │ ├── [email protected] │ └── [email protected] ├── [email protected] └── [email protected] will-i-am:yo-stellar William$ </code> </pre> First thing I notice is the last item is now correct, in small letters. Second thing is we do not have the two **npm WARN** notices, we have only one. End of the results from the `npm install --save --save-exact stellar-sdk` command. We have one **npm WARN**: **npm WARN prefer global [email protected] should be installed with -g** So, I shall do what it asks, from my Project directory: `pwd` <pre> <code> will-i-am:yo-stellar William$ pwd /Users/William/yo-stellar </code> </pre> <pre> <code> will-i-am:yo-stellar William$ `npm install -g [email protected]` will-i-am:yo-stellar William$ npm install -g [email protected] /Users/William/.nvm/versions/node/v5.6.0/bin/marked -> /Users/William/.nvm/versions/node/v5.6.0/lib/node_modules/marked/bin/marked /Users/William/.nvm/versions/node/v5.6.0/lib └── [email protected] </code> </pre> Now I check to make sure the stellar-sdk installed properly: `cd node_modules` `ls` Sure enough, there they are again: **stellar-base** **stellar-sdk** Done Deal, now what ? Well, I think we have finally arrived at the point where we can indeed access the `stellar-sdk` in a script. **Stellar [Developer's js-stellar-sdk](https://github.com/stellar/js-stellar-sdk#install)** page, the Install section. We can require/import it in our JavaScript: > `var StellarSdk = require('stellar-sdk');` > > Our Javascript is in our **app/scripts/main.js** file. However, I choose to add this variable and script to one page, so far. I open our text editor to open this file and add the above line, combined with the [Stellar Query to Horizon](https://www.stellar.org/developers/js-stellar-sdk/learn/index.html) code. > Done: 20160222 : that page has a typo of missing semi-colon on first variable DONE: 20160222 : i informed Stellar with a pull request DONE: 20160223 : pull request merged by stellar, my first I enter this in `app/tellurians-exchange.js` <pre> <code> <script><!-- var StellarSdk = require('stellar-sdk'); var server = new StellarSdk.Server('https://horizon-testnet.stellar.org'); // get a list of transactions that occurred in ledger 1400 server.transactions() .forLedger(1400) .call().then(function(r){ console.log(r); }); // get a list of transactions submitted by a particular account server.transactions() .forAccount('GASOCNHNNLYFNMDJYQ3XFMI7BYHIOCFW3GJEOWRPEGK2TDPGTG2E5EDW') .call().then(function(r){ console.log(r); }); --></script> </code> </pre> I am certain I am have not set our `secret.Key` yet, and I am certain I need to generate new keys. TODO: QUESTION: 20160222 : How do I set the Stellar secret.Key, again ? in `node` development ? Answer : 20160223 : [js-stellar-lib](https://github.com/stellar/js-stellar-sdk) QUESTION: 20160224 : Where do I generate new keys at Stellar ? Answer : 2016022? : Here, it becomes important to understand the terms: **[accounts](https://www.stellar.org/developers/learn/concepts/accounts.html)** : Accounts are the central data structure in Stellar. > **Accounts** are identified by a public key and saved in the ledger. Everything else in the ledger, such as offers or trustlines, are owned by a particular account. **[transactions](https://www.stellar.org/developers/learn/concepts/transactions.html)** : _If you think of the ledger as a database, then transactions are SQL commands._ `ledger` `source account` `fee` `sequence number` `TransactionBuilder` **[operation.js](https://github.com/stellar/js-stellar-base/blob/master/src/operation.js)** : See operation.js for a list of possible operations you can add. `toll collector` : charge small amounts for using your service `toll address` : your app can publish its Stellar toll address for payments. > [Stellar : run a node](https://www.stellar.org/developers/stellar-core/learn/admin.html) TODO: 201602231334pst : per Stellar, the above link is out of date, removing. Answer: 20160223 : far better link to find Stellar material [https://www.stellar.org/developers/](https://www.stellar.org/developers/) [Stellar : build an app](https://github.com/stellar/docs/blob/master/other/things-to-build.md) <a name="streaming"></a> > ##### [Stellar : streaming reference](https://www.stellar.org/developers/horizon/learn/responses.html#streaming) **Streaming** "Certain endpoints in Horizon can be called in streaming mode using Server-Sent Events. This mode will keep the connection to horizon open and horizon will continue to return responses as ledgers close. All parameters for the endpoints that allow this mode are the same. The way a caller initiates this mode is by setting `Accept: text/event-stream` in the HTTP header when you make the request. You can read an example of using the streaming mode in the [Follow Received Payments](https://www.stellar.org/developers/horizon/learn/tutorials/follow-received-payments.html) tutorial." ##### [Variables](https://www.stellar.org/developers/js-stellar-sdk/learn/examples.html) `var StellarSdk = require('stellar-sdk');` > The source account is the account we will be signing and sending from. All keys are examples from the Stellar site. `var sourceSecretKey = 'SAKRB7EE6H23EF733WFU76RPIYOPEWVOMBBUXDQYQ3OF4NF6ZY6B6VLW';` > Derive Keypair object and public key (that starts with a G) from the secret `var sourceKeypair = StellarSdk.Keypair.fromSeed(sourceSecretKey);` `var sourcePublicKey = sourceKeypair.accountId();` `var receiverPublicKey = 'GAIRISXKPLOWZBMFRPU5XRGUUX3VMA3ZEWKBM5MSNRU3CHV6P4PYZ74D';` > Configure StellarSdk to talk to the horizon instance hosted by Stellar.org To use the live network, set the hostname to 'horizon.stellar.org'. For now, we are working to contact **testnet**. `var server = new StellarSdk.Server('https://horizon-testnet.stellar.org');` <a name="gitignore"></a> Enter the following into your **.gitignore** file: TODO: see .gitignore references in [https://gist.github.com/kathyonu/c53943026d3e1ef0b129#configignore](https://gist.github.com/kathyonu/c53943026d3e1ef0b129#configignore) <a name="slugignore"></a> #####[.slugignore](https://devcenter.heroku.com/articles/slug-compiler) Enter the following in your **.slugignore** file: <pre> <code> *.psd *.pdf /test /spec - - - </code> </pre> <a name="awssdk"></a> ##### [Getting Started with the AWS SDK for JavaScript in Node.js](http://aws.amazon.com/developers/getting-started/nodejs/) > Download the Sample Project > > git clone https://github.com/awslabs/aws-nodejs-sample.git > > Install the SDK and Dependencies > > From the aws-nodejs-sample directory, run: > > npm install > > Configure the Access Keys > > Create your credentials file at ~/.aws/credentials (C:\Users\USER_NAME\.aws\credentials for Windows users) > and save the following lines after replacing the underlined values with your own. > > [default] > > aws_access_key_id = YOUR_ACCESS_KEY_ID > > aws_secret_access_key = YOUR_SECRET_ACCESS_KEY > > Run the Sample > > node sample.js > > About the Sample > > This sample application is designed to show you how to: > > > Declare a dependency on the AWS SDK for JavaScript in Node.js. > > Read access keys from environment variables. > > Instantiate an Amazon Simple Storage Service (Amazon S3) client. > > Interact with Amazon S3 in various ways, such as creating a bucket and uploading a file. > > The project's README file contains more information about this sample code. > If you have trouble getting set up or have other feedback about this sample, let us know on GitHub. > Additional Resources > > For in-depth user guides, API documentation, developer forums, and other developer resources, > see the AWS SDK for JavaScript in Node.js page. > end of file reference : [Getting Started with the AWS SDK for JavaScript in Node.js ](http://aws.amazon.com/developers/getting-started/nodejs/) Next step ? Also, I noticed an oddity in the `js-stellar-sdk` page, under [Quick Start](https://github.com/stellar//js-stellar-sdk#quick-start). The note says: "Using **npm** to include **js-stellar-sdk** in your own project:" The command says: `npm install --save stellar-sdk` Query : 20160206 : Where is the stellar/stellar-sdk repository ? Answer : Verified the above is the command to run. : Reference for [npm install --save stellar-sdk](https://www.npmjs.com/package/stellar-sdk). : "**stellar-sdk**" is a library for working with the Stellar Horizon server : At the above link, read the **[js-stellar-sdk](https://www.npmjs.com/package/stellar-sdk)** vs **[js-stellar-base](https://github.com/stellar/ruby-stellar-base)** info. : **stellar-sdk** is installed by `npm` : **js-stellar-sdk** is installed by Bower. : [horizon](https://github.com/stellar/horizon) 15 : [js-stellar-sdk](https://github.com/stellar/js-stellar-sdk) 6 : [stellar-core](https://github.com/stellar/stellar-core) 69 : [ruby-stellar-sdk](https://github.com/stellar/ruby-stellar-sdk) 1 : [stellar-ruby-base](https://github.com/stellar/ruby-stellar-base) 3 : [stellar-wallet](https://github.com/stellar/stellar-wallet) 24 : [stellar-wallet-js-sdk](https://github.com/stellar/stellar-wallet-js-sdk) 2 : [interstellar](https://github.com/stellar/interstellar) 5 : [interstellar-network](https://github.com/stellar/interstellar-network) 0 : [interstellar-sessions](https://github.com/stellar/interstellar-sessions) 1 : [interstellar-wallet](https://github.com/stellar/interstellar-wallet) 1 : [stellar tutorials](https://github.com/stellar/stellar-tutorials) 0 : [federation server](https://github.com/stellar/federation) 3 : [horizon](https://github.com/stellar/horizon) 15 : [gateway-server](https://github.com/stellar/gateway-server) 2 : [bower-js-stellar-sdk](https://github.com/stellar/bower-js-stellar-sdk) 0 : [java-stellar-sdk](java-stellar-sdk) we will not be using this 1 : [metalsmith](https://github.com/stellar/metalsmith) 364 : [docs](https://github.com/stellar/docs) 42 : [stories](https://github.com/stellar/stories) 2 : Philosopnical note on the above: :: In all the world, 69 developers have forked `stellar-core` :: 15 developers have forked the `horizon` :: 6 developers have forked `js-stellar-sdk` :: 24 have forked the `stellar-wallet-js-sdk` :: 2 have forked the `stellar-wallet-js-sdk` :: 5 have forked `insterstellar` :: 3 forked the `federation serve` :: 364 forked `metalsmith` :: From this, I can say Stellar is a young platform .. :: with incomplete developer tools, and :: What the heck is [metalsmith](https://github.com/stellar/metalsmith) ! break Before we install `stellar sdk` we want to create our `~/package.json` file. Terminal will tell you so when you run the command without one. Open a new Terminal if need be: Run: `cd ~/` `touch package.json` `open -e package.json` Insert the contents of the [https://github.com/creationix/nvm/blob/master/package.json](https://github.com/creationix/nvm/blob/master/package.json) file in the new `~/package.json` file. **stellar-sdk** is installed by `npm`: `npm install --save stellar-sdk` You can see the results of this command being run in the **[Installation Commands with Results](#results)**. Our system is now ready to build a `js-stellar-sdk` project using `go` and `gb`. How shall we begin ? Where do we begin ? See [Building a Project](#buildingprojects) The above concludes the `brew` `cask` `node` `nvm` `npm` `yo` `go` `gulp` workspace. $ `echo $GOPATH` On the Ruby on Rails path, we are also ready to open our Rails app and begin working with `gem "stellar"`. [Stellar Data Flow reference](https://www.stellar.org/developers/stellar-core/learn/core-data-flow.pdf) Define: XDR : **E**xternal **D**ata **R**epresentation Define: SQL: : **S**tructured **D**ata **L**angauge End of `stellar-sdk` section. <a name="rubystellarsdk"></a> ###### ruby-stellar-sdk The scope of this Gist has been accomplished. The `stellar-sdk` and the `ruby-stellar-sdk` material will become another Gist. End of Ruby on Rails and `ruby-stellar-sdk` notes. break All of this building of `nvm` and friends, is so we can use the Stellar platform. continuing along that thought .. **THE STELLAR SDK's** I am going to take a few sentences from the [Stellar Developers](https://www.stellar.org/developers/js-stellar-sdk/learn/index.html) page, and translate them for Ruby. "The **JavaScript** Stellar SDK facilitates client integration with the Stellar Horizon API server .." "The **Ruby** Stellar SDK facilitates client integration with the Stellar Horizon API server .." [Building and installing js-stellar-sdk](https://github.com/stellar/js-stellar-sdk) [Building and installing ruby-stellar-sdk](https://github.com/stellar/ruby-stellar-sdk) > Note from Stellar: "Stellar.org only maintains the JavaScript SDK. We are looking for maintainers for other languages. For example, a few Stellar community members are building a Python library. Contributions are welcome." > > Because we are working to build the [ruby-stellar-sdk](https://github.com/stellar/ruby-stellar-sdk) for our use, it seems we are on our own ! [Examples of using js-stellar-sdk](https://github.com/stellar/js-stellar-sdk) [Examples of using ruby-stellar-sdk](https://github.com/stellar/ruby-stellar-sdk/blob/master/examples) "js-stellar-sdk gives you access to all the endpoints exposed by Horizon." "ruby-stellar-sdk gives you access to all the endpoints exposed by Horizon." "js-stellar-sdk uses the [Builder pattern](https://en.wikipedia.org/wiki/Builder_pattern) to create the requests to send to Horizon." "ruby-stellar-sdk uses the Builder pattern to create the requests to send to Horizon." See the [Horizon Reference Overview](https://www.stellar.org/developers/reference/) "Tests are also run on the Travis CI [js-stellar-base](https://github.com/stellar/js-stellar-base) project automatically." "Tests are also run on the Travis CI ruby-stellar-base project automatically." ?? Where are we ? We have to arrive at the point where we can access the [https://horizon-testnet.stellar.org/](https://horizon-testnet.stellar.org/) server. Reference is [stellar/horizon docs](https://github.com/stellar/horizon/tree/master/docs). Still keeping our eye on the **[ruby-stellar-sdk](https://github.com/stellar/ruby-stellar-sdk)** goal, I noticed this sentence: "You can interact directly with horizon via curl or a web browser but SDF provides a [JavaScript SDK](https://www.stellar.org/developers/js-stellar-sdk/learn/) for clients to use to interact with Horizon." I change the ending to: a Ruby SDK for clients to use to interact with Horizon. It seems to me, we can use the JavaScript SDK as a model to create the Ruby SDK. *****Connecting with the Server The **server** object handles a network connection to a Horizon **server**. The **server** object provides methods that makes requests to that Horizon server easy. It is important to note that **server** methods query [Horizon endpoints](https://www.stellar.org/developers/reference/). **CallBuilder** [JS Stellar SDK] > [CallBuilder](https://www.stellar.org/developers/js-stellar-sdk/reference/call_builder.html) is a class that allows specificity and flexibility when querying the Horizon server. By using the Builder Pattern, CallBuilder provides methods that can be chained together to generate a query. The reference shows five **server.methods** are available: `limit`, `cursor`, `order`, `call`, `stream`. We will cover all of these, but for now, I focus on `call` and `stream`. > `call()` > > Triggers a HTTP Request to the Horizon server based on the builder's current configuration. Returns a [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) that resolves to the server's response. > > The **Promise **object is used for deferred and asynchronous computations. A **Promise** represents an operation that hasn't completed yet, but is expected in the future. A Promise is in one of these states: 1. **pending**: initial state, not fulfilled or rejected. 2. **fulfilled**: meaning that the operation completed successfully. 3. **rejected**: meaning that the operation failed. > > > > The **Promise** has Properties and Methods, please see [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise). > `stream({options})` > > Creates an [EventSource](https://developer.mozilla.org/en-US/docs/Web/API/EventSource) that listens for incoming messages from the **server**. URL based on builder's current configuration. > `stream({options})` > > Has a Param Type of **object of properties**. Please see the [stream properties](https://developer.mozilla.org/en-US/docs/Web/API/EventSource#Properties) information. You will see there are five properties associated with **EventSource** A quick look at **EventSource**: > The **EventSource** interface is used to receive server-sent events. It connects to a **server** over HTTP and receives events in **text/event-stream** format without closing the connection. > > > **Properties** > > This interface also inherits properties from its parent, [EventTarget](https://developer.mozilla.org/en-US/docs/Web/API/EventTarget). > > **EventSource.onerror** > > Is an EventHandler being called when an error occurs and the error event is dispatched on this object. > > **EventSource.onmessage** > > Is an EventHandler being called when a message event is received, that is when a message is coming from the source. > > **EventSource.onopen** > > Is an EventHandler being called when an open event is received, that is when the connection was just opened. > > **EventSource.readyState** : Read only > > An unsigned short representing the state of the connection. Possible values are CONNECTING (0), OPEN (1), or CLOSED (2). > > **EventSource.url** : Read only > > A DOMString representing the URL of the source. > > > **Methods** > > "This interface also inherits properties from its parent, [EventTarget](https://developer.mozilla.org/en-US/docs/Web/API/EventTarget)." > > **EventSource.close()** > > Closes the connection, if any, and sets the readyState attribute to CLOSED. If the connection is already closed, the method does nothing. A quick look at **[EventTarget](https://developer.mozilla.org/en-US/docs/Web/API/EventTarget)**: > **EventTarget** is an interface implemented by objects that can receive events and may have listeners for them. > > **Methods** > > **EventTarget.addEventListener()** Register an event handler of a specific event type on the EventTarget. > > > > **EventTarget.removeEventListener()** Removes an event listener from the EventTarget. > > > > **EventTarget.dispatchEvent()** Dispatch an event to this EventTarget. There is more to kmow about the **[EventTarget](https://developer.mozilla.org/en-US/docs/Web/API/EventTarget)**, please read the source link. this goes in after Yo and Gulp are installed : Now we use `npm` to install others: `npm install --save stellar-sdk` : '**stellar-sdk** is installed by `npm`' <pre> <code> will-i-am:~ William$ npm install --save stellar-sdk npm WARN deprecated [email protected]: package renamed to "urijs" (lower-case), please update accordingly > [email protected] install /Users/William/node_modules/stellar-base/node_modules/ed25519 > node-gyp rebuild xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance CC(target) Release/obj.target/ed25519/src/ed25519/keypair.o CC(target) Release/obj.target/ed25519/src/ed25519/sign.o CC(target) Release/obj.target/ed25519/src/ed25519/open.o CC(target) Release/obj.target/ed25519/src/ed25519/crypto_verify_32.o CC(target) Release/obj.target/ed25519/src/ed25519/ge_double_scalarmult.o CC(target) Release/obj.target/ed25519/src/ed25519/ge_frombytes.o CC(target) Release/obj.target/ed25519/src/ed25519/ge_scalarmult_base.o CC(target) Release/obj.target/ed25519/src/ed25519/ge_precomp_0.o CC(target) Release/obj.target/ed25519/src/ed25519/ge_p2_0.o CC(target) Release/obj.target/ed25519/src/ed25519/ge_p2_dbl.o CC(target) Release/obj.target/ed25519/src/ed25519/ge_p3_0.o CC(target) Release/obj.target/ed25519/src/ed25519/ge_p3_dbl.o CC(target) Release/obj.target/ed25519/src/ed25519/ge_p3_to_p2.o CC(target) Release/obj.target/ed25519/src/ed25519/ge_p3_to_cached.o CC(target) Release/obj.target/ed25519/src/ed25519/ge_p3_tobytes.o CC(target) Release/obj.target/ed25519/src/ed25519/ge_madd.o CC(target) Release/obj.target/ed25519/src/ed25519/ge_add.o CC(target) Release/obj.target/ed25519/src/ed25519/ge_msub.o CC(target) Release/obj.target/ed25519/src/ed25519/ge_sub.o CC(target) Release/obj.target/ed25519/src/ed25519/ge_p1p1_to_p3.o CC(target) Release/obj.target/ed25519/src/ed25519/ge_p1p1_to_p2.o CC(target) Release/obj.target/ed25519/src/ed25519/ge_tobytes.o CC(target) Release/obj.target/ed25519/src/ed25519/fe_0.o CC(target) Release/obj.target/ed25519/src/ed25519/fe_1.o CC(target) Release/obj.target/ed25519/src/ed25519/fe_cmov.o CC(target) Release/obj.target/ed25519/src/ed25519/fe_copy.o CC(target) Release/obj.target/ed25519/src/ed25519/fe_neg.o CC(target) Release/obj.target/ed25519/src/ed25519/fe_add.o CC(target) Release/obj.target/ed25519/src/ed25519/fe_sub.o CC(target) Release/obj.target/ed25519/src/ed25519/fe_mul.o CC(target) Release/obj.target/ed25519/src/ed25519/fe_sq.o CC(target) Release/obj.target/ed25519/src/ed25519/fe_sq2.o CC(target) Release/obj.target/ed25519/src/ed25519/fe_invert.o CC(target) Release/obj.target/ed25519/src/ed25519/fe_tobytes.o CC(target) Release/obj.target/ed25519/src/ed25519/fe_isnegative.o CC(target) Release/obj.target/ed25519/src/ed25519/fe_isnonzero.o CC(target) Release/obj.target/ed25519/src/ed25519/fe_frombytes.o CC(target) Release/obj.target/ed25519/src/ed25519/fe_pow22523.o CC(target) Release/obj.target/ed25519/src/ed25519/sc_reduce.o CC(target) Release/obj.target/ed25519/src/ed25519/sc_muladd.o CXX(target) Release/obj.target/ed25519/src/ed25519.o SOLINK_MODULE(target) Release/ed25519.node npm WARN saveError ENOENT: no such file or directory, open '/Users/William/package.json' /Users/William └─┬ [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├─┬ [email protected] │ └─┬ [email protected] │ └─┬ [email protected] │ ├── [email protected] │ └── [email protected] ├─┬ [email protected] (git://github.com/jsdoc3/jsdoc.git#3dbb94f157290e8a0cbc79cb3580130e8e2c4534) │ ├── [email protected] │ ├── [email protected] │ ├─┬ [email protected] │ │ └─┬ [email protected] │ │ └── [email protected] │ ├── [email protected] │ ├── [email protected] │ ├── [email protected] │ ├── [email protected] │ ├─┬ [email protected] │ │ └── [email protected] │ ├── [email protected] │ ├── [email protected] │ ├── [email protected] │ └── [email protected] ├── [email protected] ├─┬ [email protected] │ ├─┬ [email protected] │ │ └── [email protected] │ ├── [email protected] │ ├── [email protected] │ ├── [email protected] │ ├─┬ [email protected] │ │ ├── [email protected] │ │ └── [email protected] │ ├─┬ [email protected] │ │ ├─┬ [email protected] │ │ │ └── [email protected] │ │ ├── [email protected] │ │ ├── [email protected] │ │ └── [email protected] │ ├── [email protected] │ ├─┬ [email protected] │ │ └── [email protected] │ └── [email protected] ├─┬ [email protected] │ ├── [email protected] │ ├── [email protected] │ ├─┬ [email protected] │ │ └── [email protected] │ ├── [email protected] │ ├─┬ [email protected] │ │ ├── [email protected] │ │ ├─┬ [email protected] │ │ │ └── [email protected] │ │ └─┬ [email protected] │ │ └── [email protected] │ ├── [email protected] │ ├── [email protected] │ ├── [email protected] │ ├── [email protected] │ ├─┬ [email protected] │ │ ├── [email protected] │ │ ├── [email protected] │ │ ├── [email protected] │ │ └── [email protected] │ └── [email protected] ├── [email protected] └── [email protected] npm WARN enoent ENOENT: no such file or directory, open '/Users/William/package.json' npm WARN William No description npm WARN William No repository field. npm WARN William No README data npm WARN William No license field. will-i-am:~ William$ </code> </pre> What command caused the above results ? `npm install --save stellar-sdk` The fact that this shows as missing, is important: **/Users/William/package.json** This command solves the problem: `npm install -g mime --save` Reference for the command is [Installing NPM packages conflicting with Node.js 5.0.0](http://stackoverflow.com/questions/33650906/installing-npm-packages-conflicting-with-node-js-5-0-0). Run: `npm install -g mime --save` TODO: what is the `mime` that is being installed and saved ? Answer : `npm home mime` will inform you : "A super simple utility library for dealing with mime-types" Bonus : `npm run test` we run the above and see that `npm` will now test our system <pre> <code> will-i-am:~ William$ npm install -g mime --save /usr/local/Cellar/nvm/HEAD/versions/node/v5.5.0/bin/mime -> /usr/local/Cellar/nvm/HEAD/versions/node/v5.5.0/lib/node_modules/mime/cli.js /usr/local/Cellar/nvm/HEAD/versions/node/v5.5.0/lib └── [email protected] will-i-am:~ William$ </code> </pre> That did not solve the problem, we have to create a `~/package.json` file. We can find the nvm/package.json template here: [https://github.com/creationix/nvm/blob/master/package.json](https://github.com/creationix/nvm/blob/master/package.json) Run: `touch package.json` `open -e package.json` Insert the contents of the [https://github.com/creationix/nvm/blob/master/package.json](https://github.com/creationix/nvm/blob/master/package.json) file in the new `~/package.json` file. Uninstall and reinstall `stellar-sdk`: `npm uninstall stellar-sdk` <pre> <code> will-i-am:~ William$ npm uninstall stellar-sdk - [email protected] node_modules/stellar-sdk - [email protected] node_modules/async - [email protected] node_modules/axios - [email protected] node_modules/bluebird - [email protected] node_modules/catharsis - [email protected] node_modules/combined-stream - [email protected] node_modules/component-emitter - [email protected] node_modules/cookiejar - [email protected] node_modules/core-util-is - [email protected] node_modules/debug - [email protected] node_modules/delayed-stream - [email protected] node_modules/es6-promise - [email protected] node_modules/escape-string-regexp - [email protected] node_modules/espree - [email protected] node_modules/event-source-polyfill - [email protected] node_modules/eventsource - [email protected] node_modules/extend - [email protected] node_modules/form-data - [email protected] node_modules/form-data/node_modules/async - [email protected] node_modules/formidable - [email protected] node_modules/inherits - [email protected] node_modules/isarray - [email protected] node_modules/js2xmlparser - [email protected] node_modules/jsdoc - [email protected] node_modules/jsdoc/node_modules/bluebird - [email protected] node_modules/lodash - [email protected] node_modules/marked - [email protected] node_modules/methods - [email protected] node_modules/mime - [email protected] node_modules/mime-db - [email protected] node_modules/mime-types - [email protected] node_modules/ms - [email protected] node_modules/original - [email protected] node_modules/qs - [email protected] node_modules/querystringify - [email protected] node_modules/readable-stream - [email protected] node_modules/reduce-component - [email protected] node_modules/requires-port - [email protected] node_modules/requizzle - [email protected] node_modules/requizzle/node_modules/underscore - [email protected] node_modules/stellar-base - [email protected] node_modules/stellar-base/node_modules/babel-runtime - [email protected] node_modules/stellar-base/node_modules/babel-runtime/node_modules/core-js - [email protected] node_modules/stellar-base/node_modules/base32.js - [email protected] node_modules/stellar-base/node_modules/bignumber.js - [email protected] node_modules/stellar-base/node_modules/crc - [email protected] node_modules/stellar-base/node_modules/ed25519 - [email protected] node_modules/stellar-base/node_modules/ed25519/node_modules/bindings - [email protected] node_modules/stellar-base/node_modules/ed25519/node_modules/nan - [email protected] node_modules/stellar-base/node_modules/js-xdr - [email protected] node_modules/stellar-base/node_modules/js-xdr/node_modules/babel-runtime - [email protected] node_modules/stellar-base/node_modules/js-xdr/node_modules/babel-runtime/node_modules/core-js - [email protected] node_modules/stellar-base/node_modules/js-xdr/node_modules/cursor - [email protected] node_modules/stellar-base/node_modules/js-xdr/node_modules/long - [email protected] node_modules/stellar-base/node_modules/js-xdr/node_modules/sequencify - [email protected] node_modules/stellar-base/node_modules/lodash - [email protected] node_modules/stellar-base/node_modules/sha.js - [email protected] node_modules/stellar-base/node_modules/sha.js/node_modules/inherits - [email protected] node_modules/stellar-base/node_modules/tweetnacl - [email protected] node_modules/string_decoder - [email protected] node_modules/strip-json-comments - [email protected] node_modules/superagent - [email protected] node_modules/taffydb - [email protected] node_modules/toml - [email protected] node_modules/underscore - [email protected] node_modules/underscore-contrib - [email protected] node_modules/underscore-contrib/node_modules/underscore - [email protected] node_modules/URIjs - [email protected] node_modules/url-parse - [email protected] node_modules/wrench </code> </pre> TODO: 20160211 : truncate the above list .. i leave it for now as i like seeing what is available. Reinstall: `npm install --save stellar-sdk` <pre> <code> will-i-am:~ William$ npm install --save stellar-sdk npm WARN deprecated [email protected]: package renamed to "urijs" (lower-case), please update accordingly npm WARN prefer global [email protected] should be installed with -g > [email protected] install /Users/William/node_modules/stellar-base/node_modules/ed25519 > node-gyp rebuild xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance CC(target) Release/obj.target/ed25519/src/ed25519/keypair.o CC(target) Release/obj.target/ed25519/src/ed25519/sign.o CC(target) Release/obj.target/ed25519/src/ed25519/open.o CC(target) Release/obj.target/ed25519/src/ed25519/crypto_verify_32.o CC(target) Release/obj.target/ed25519/src/ed25519/ge_double_scalarmult.o CC(target) Release/obj.target/ed25519/src/ed25519/ge_frombytes.o CC(target) Release/obj.target/ed25519/src/ed25519/ge_scalarmult_base.o CC(target) Release/obj.target/ed25519/src/ed25519/ge_precomp_0.o CC(target) Release/obj.target/ed25519/src/ed25519/ge_p2_0.o CC(target) Release/obj.target/ed25519/src/ed25519/ge_p2_dbl.o CC(target) Release/obj.target/ed25519/src/ed25519/ge_p3_0.o CC(target) Release/obj.target/ed25519/src/ed25519/ge_p3_dbl.o CC(target) Release/obj.target/ed25519/src/ed25519/ge_p3_to_p2.o CC(target) Release/obj.target/ed25519/src/ed25519/ge_p3_to_cached.o CC(target) Release/obj.target/ed25519/src/ed25519/ge_p3_tobytes.o CC(target) Release/obj.target/ed25519/src/ed25519/ge_madd.o CC(target) Release/obj.target/ed25519/src/ed25519/ge_add.o CC(target) Release/obj.target/ed25519/src/ed25519/ge_msub.o CC(target) Release/obj.target/ed25519/src/ed25519/ge_sub.o CC(target) Release/obj.target/ed25519/src/ed25519/ge_p1p1_to_p3.o CC(target) Release/obj.target/ed25519/src/ed25519/ge_p1p1_to_p2.o CC(target) Release/obj.target/ed25519/src/ed25519/ge_tobytes.o CC(target) Release/obj.target/ed25519/src/ed25519/fe_0.o CC(target) Release/obj.target/ed25519/src/ed25519/fe_1.o CC(target) Release/obj.target/ed25519/src/ed25519/fe_cmov.o CC(target) Release/obj.target/ed25519/src/ed25519/fe_copy.o CC(target) Release/obj.target/ed25519/src/ed25519/fe_neg.o CC(target) Release/obj.target/ed25519/src/ed25519/fe_add.o CC(target) Release/obj.target/ed25519/src/ed25519/fe_sub.o CC(target) Release/obj.target/ed25519/src/ed25519/fe_mul.o CC(target) Release/obj.target/ed25519/src/ed25519/fe_sq.o CC(target) Release/obj.target/ed25519/src/ed25519/fe_sq2.o CC(target) Release/obj.target/ed25519/src/ed25519/fe_invert.o CC(target) Release/obj.target/ed25519/src/ed25519/fe_tobytes.o CC(target) Release/obj.target/ed25519/src/ed25519/fe_isnegative.o CC(target) Release/obj.target/ed25519/src/ed25519/fe_isnonzero.o CC(target) Release/obj.target/ed25519/src/ed25519/fe_frombytes.o CC(target) Release/obj.target/ed25519/src/ed25519/fe_pow22523.o CC(target) Release/obj.target/ed25519/src/ed25519/sc_reduce.o CC(target) Release/obj.target/ed25519/src/ed25519/sc_muladd.o CXX(target) Release/obj.target/ed25519/src/ed25519.o SOLINK_MODULE(target) Release/ed25519.node [email protected] /Users/William └─┬ [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├─┬ [email protected] │ └─┬ [email protected] │ └─┬ [email protected] │ ├── [email protected] │ └── [email protected] ├─┬ [email protected] (git://github.com/jsdoc3/jsdoc.git#3dbb94f157290e8a0cbc79cb3580130e8e2c4534) │ ├── [email protected] │ ├── [email protected] │ ├─┬ [email protected] │ │ └─┬ [email protected] │ │ └── [email protected] │ ├── [email protected] │ ├── [email protected] │ ├── [email protected] │ ├── [email protected] │ ├─┬ [email protected] │ │ └── [email protected] │ ├── [email protected] │ ├── [email protected] │ ├── [email protected] │ └── [email protected] ├── [email protected] ├─┬ [email protected] │ ├─┬ [email protected] │ │ └── [email protected] │ ├── [email protected] │ ├── [email protected] │ ├── [email protected] │ ├─┬ [email protected] │ │ ├── [email protected] │ │ └── [email protected] │ ├─┬ [email protected] │ │ ├─┬ [email protected] │ │ │ └── [email protected] │ │ ├── [email protected] │ │ ├── [email protected] │ │ └── [email protected] │ ├── [email protected] │ ├─┬ [email protected] │ │ └── [email protected] │ └── [email protected] ├─┬ [email protected] │ ├── [email protected] │ ├── [email protected] │ ├─┬ [email protected] │ │ └── [email protected] │ ├── [email protected] │ ├─┬ [email protected] │ │ ├── [email protected] │ │ ├─┬ [email protected] │ │ │ └── [email protected] │ │ └─┬ [email protected] │ │ └── [email protected] │ ├── [email protected] │ ├── [email protected] │ ├── [email protected] │ ├── [email protected] │ ├─┬ [email protected] │ │ ├── [email protected] │ │ ├── [email protected] │ │ ├── [email protected] │ │ └── [email protected] │ └── [email protected] ├── [email protected] └── [email protected] will-i-am:~ William$ </code> </pre> `stellar-sdk` is now installed. TODO: 20160211 : How do I prove it is installed ? Proof: 20160211 : from above results .. > [email protected] /Users/William └─┬ [email protected] and .. > ├── [email protected] ├─┬ [email protected] Some notes to attend to. This line tells me where the **stellar-base** is installed : **[email protected] install /Users/William/node_modules/stellar-base/node_modules/ed25519** Most excellent. We now have a toe in the waters of the stellar realms. end of this one Question: 20160213 : If I want to make sure stellar-base is using the latest `lodash`, what do I do ? Answer : 20160214 : Answer : 20160213 ? Perhaps the better question would be, why is `observatory` set to old lodash versions ? --- To install **Go**, we will run: `brew install go`. To install **Yo**, we will run: `npm install -g yo`. To install **gulp**, we will run: `npm install -g gulp` # TODO : 20160211 : verify this is the command TODO: 20160215: WHERE IS THE FIRST AND SECOND OF THESE ^^^^^^^^ To install **Grunt**, we will run: `npm install -g grunt-cli` To install **Bower**, we will run: `npm install -g bower` To which I respond .. Yo, Let us define Go and the others, and see how they relate, if at all, to Rails and the [ruby-stellar-sdk](https://github.com/stellar/ruby-stellar-sdk). `nvm` is installed by `brew` `nvm` is required to install `npm` `npm` is a **N**ode **P**ackage **M**anager `npm` is installed by `nvm` `npm` is used to install others, such as `yo` `grunt` is a compliler of files, and more. `gulp` is a streaming workflow space ? TODO: find best definition `yo` is short for Yeoman, requires `node` be installed `node` is **Node.js**, installed as `node`. > `io.js` "is a fork of Joyent's Node.js" We will not be using `io.js` and that quote is from: [Install Node.js or io.js with nvm, by Fernan Morales : 03 Feb 2015](https://keymetrics.io/2015/02/03/installing-node-js-and-io-js-with-nvm/). Another quote: "... everything written here is also clearly explained by Creationix in the Readme from the [NVM repo](https://github.com/creationix/nvm). Also, executing `nvm` alone or `nvm help` will display a comprehensive list of all the commands along with a brief description. Good to know. --- 201602181620 <pre> <code> ? Would you like to include jQuery? (Y/n) ? Would you like to include jQuery? Yes create bower.json conflict package.json ? Overwrite package.json? (Ynaxdh) </code> </pre> > Answerng with the letter `d` will show you the differences. Seeing the addition to be made, I chose Y, for Yes. QUESTION: Now what ? And how do we tie all this in to the [ruby-stellar-sdk](https://github.com/stellar/ruby-stellar-sdk) ? Answer : Because we intend to work with the Stellar SDK, we make sure `gem "stellar"` is in our Gemfile. Then we run: `bundle` Now, let's update **brew**: <pre> <code> will-i-am:~ William$ brew update Checking out files: 100% (220/220), done. Updated Homebrew from 468f0d9 to 6322c47. </code> </pre> --- - - 201602181640 <a name="testings"></a> ##### Tests and Testings [Interstellar](https://github.com/stellar/interstellar) : easy to buiild a web app on the Stellar network. [Interstellar Client](https://github.com/stellar/interstellar-client) : for developer exploration, These matters call for [Urchin](https://github.com/tlevine/urchin). Study well. I have not begun tests yet. [js-stellar-sdk/test/integration](https://github.com/stellar/js-stellar-sdk/tree/master/test/integration) [js-stellar-sdk/test/integration/server_test.js](https://github.com/stellar/js-stellar-sdk/blob/master/test/integration/server_test.js) [js-stellar-sdk/test/](https://github.com/stellar/js-stellar-sdk/tree/master/test) [js-stellar-sdk/test/unit/](https://github.com/stellar/js-stellar-sdk/tree/master/test/unit) [js-stellar-sdk/test/unit/browser_test.js](https://github.com/stellar/js-stellar-sdk/blob/master/test/unit/browser_test.js) [js-stellar-sdk/website](https://github.com/stellar/js-stellar-sdk/tree/master/website) End of testings. End of installation commands being run. <a name="installations"></a> ##### Installation Instructions The following will be a full installation of all that is required to work with **Node.js** and its supporting tools to build websites and API's. We are building this because we want to be able to make use of the `js-stellar-sdk` and eventually, the `ruby-stellar-sdk`. I have removed all further mention of the Stellar materials into a new Gist as yet incomplete, doing so for clarity and simplicity in this getting ready Gist. You do not need to care about using the [Stellar.org](https://stellar.org) platform to use these instructions to easily install your tools, just ignore the Stellar mentions. Below these **Stellar** references, you will find explanations we used to meet the requirements to be able to work with Stellar's platform, and I hope, further develop **[ruby-stellar-sdk](https://github.com/stellar/ruby-stellar-sdk)**. Below that, you will find the [commands and their results](#results) after being run. After we install `nvm` and `npm` and `yo` and others .. all installations are extremely easy .. After that I will be sharing the commands and references I used to install Stellar, and all that is required for its use and testing of the **[ruby-stellar-sdk](https://github.com/stellar/ruby-stellar-sdk)** with Ruby on Rails and RSpec. You can safely ignore all references and links to the `stellar-sdk` and certainly too, the `ruby-stellar-sdk`. Doing so, you will find the complete instructions for how to install `nvm`, with Homebrew's lovely `brew install` command. Also, we found Homebrew-Cask while doing this, so we bring that wonderful tool into the mix, too. > So as to be crystal clear, we are going to be installing `nvm` and `npm` and all that is required to run the `js-stellar-sdk` and from that, learn how to write the **[ruby-stellar-sdk](https://github.com/stellar/ruby-stellar-sdk)** Today, it barely exists. > > Before we arrive at the full `stellar-sdk` instructions, we will have a complete `gulp` installation ready to build websites. Before we leave this `stellar-sdk` ignore notice, I provide a few links, a deeper understanding of how I arrived at how I installed `nvm` and `node` and other tools: A Brief Philosophical Discussion: Doing the normal Rails thing, I place the Stellar gem into our Gemfile: `gem "stellar"` and run `bundle` As the Stellar.org documents note, the **[ruby-stellar-sdk](https://github.com/stellar/ruby-stellar-sdk)** is not ready for Prime Time in production. It is incomplete and the examples do not yet work. I do not know if the **gem "stellar"** will one day encompass all that is required to interact with the Stellar platform. I do know the non-profit org I am coding this for intends to be an exchange node on the Stellar systems, and so I continue to study and learn and code. Being conversant with Javascript and jQuery, I see the [js-stellar-sdk](https://github.com/stellar//js-stellar-sdk) from the `stellar` materials and take a look at it. I see this note: > "**js-stellar-sdk** is a client-side Stellar Javascript library for communicating with a [Stellar Horizon server](https://github.com/stellar/horizon). It is used for building Stellar apps either on Node.js or in the browser." (with [Bower](http://bower.io/)) Stellar Note from the Horizon link: "Note this code is beta. It is not ready yet for production." Okay ! Now I know something worth knowing. If the `js-stellar-sdk` uses EITHER Node.js OR Bower, and after further study, we chose to use Node.js and so `node` it is. Node.js is installed as `node`. [Horizon](https://github.com/stellar/horizon) is the client facing API server for the Stellar ecosystem. Horizon requires `go` 1.5 or higher to build. This is the reason a Ruby on Rails developer is installing `nvm`, `npm` and family. See [https://golang.org/doc/install](https://golang.org/doc/install) for `go` Install instructions. We will be covering the `go` install instructions here. "`go` is an open source programming language that makes it easy to build simple, reliable, and efficient software." To install `go`, we will be using [Homebrew](http://brew.sh/). Do not run this just yet, the command will be `brew install go`. `go` uses `gb` to build your projects. Point being, grow to love `gb`. **gb** from [https://getgb.io/](https://getgb.io/) is used for building Horizon. **gb** from [https://github.com/constabulary/gb](https://github.com/constabulary/gb) is the project based build tool for Go See [https://getgb.io/about/](https://getgb.io/about/) for more info. So, we now know that we will be installing `gb` AFTER we install `go` AND we have to install `nvm` BEFORE `go`. We will be getting to that. To install [gb](https://getgb.io/docs/install/) .. We will be using : `go get github.com/constabulary/gb/...` To upgrade [gb](https://getgb.io/docs/install/) We will use : `go get -u github.com/constabulary/gb/...` Later, after it is installed, [Learn to Understand `gb` Projects](https://getgb.io/docs/project/). > Regarding the **Bower** link telling me it is 'a package manager' system for the web. > > "Using Bower, you assemble the packages needed for your system." You will also see, "Bower requires `node`, `npm` and `git`." At the time of this writing, Bower's page is showing, "Latest release: v1.7.2" . > [Why my team uses npm instead of bower](https://medium.com/@nickheiner/why-my-team-uses-npm-instead-of-bower-eecfe1b9afcb) will sway you to choose `npm` and the reason for me is, **Bower** adds its own complexities to keeping everything in sync. Late note: I have now written into the instructions how we will be installing `nvm` and `node`, both installed by Homebrew using Homebrew-Cask. Bower will be used as a tool of other installations, perhaps managing jQuery and Bookstrap. I do not know yet, but I do know we will be installing Bower as part of another installation, and we will be using `nvm` and `npm` as our prime package manager first, not Bower. Also, in my studies I came across the name, [CommonJS](http://requirejs.org/docs/commonjs.html). My understanding right now is `nvm` is our path, and **CommonJS** is used internally by other parts of the build process, we will not be installing **CommonJs** directly. As Rails developer, my study of Stellar so far leads me to see the need to install `nvm` and `npm`, and `go` and `yo` and `gb` and `gulp` and/or `grunt`. > May I recommend you read this article, [Gulp vs Grunt. Why one? Why the Other?](https://medium.com/@preslavrachev/gulp-vs-grunt-why-one-why-the-other-f5d3b398edc4#.tbnwmem97). It appears it is a case of `gulp` or `grunt`. That being said, while we will be using `gulp`, other parts of the build process do use `grunt`. > Late note: In my study I came across [go-start](https://github.com/ungerik/go-start). It looks like something useful. Look at how easy it will be, when we are done, to install it and learn about it and, use it .. `go get github.com/ungerik/go-start`. [go-start documentation](https://godoc.org/github.com/ungerik/go-start). Oh my gosh, `go-start` looks beautiful, and so easy to read and write, I think I may have found my `go-start` go-to-tool. End of late note. Regarding `npm`: [npm software](https://en.wikipedia.org/wiki/Npm_%28software%29) wiki, a quote: > "npm, the **N**ode **P**ackage **M**anager, is the default package manager for the JavaScript runtime environment Node.js." Another quote from the same source: > Overview: As of Node.js version 0.6.3, `npm` is bundled and installed automatically with the environment. `npm` runs through the command line and manages dependencies for an application. It also allows users to install Node.js applications that are available on the `npm` registry. `npm` is written entirely in JavaScript and was developed by Isaac Z. Schlueter as a result of the frustrations he had experienced while working with CommonJS . . . That one line catches my eye .. '`npm` allows users to install **Node.js** applications that are available on the `npm` registry.' Our tools so far definitely include `nvm` and `npm` and `node`, and `yo` and `go`, and `gb` and `git` and `grunt` and `grunt-cli`, `gulp` and now, `go-stripe` and more I am sure as I learn my way around moreso. Is there a `go-stellar` yet ? `npm search stellar` \/ just below /\ What is [nvm](https://keymetrics.io/2015/02/03/installing-node-js-and-io-js-with-nvm/) : **N**ode **V**ersion **M**anager What is [npm](https://en.wikipedia.org/wiki/Npm_%28software%29) : **N**ode **P**ackage **M**anager. What is [go](http://brewformulas.org/Go) : "`go` is an open source programming language that makes it easy to build simple, reliable, and efficient software." What is [Yo](http://junereycasuga.github.io/blog/2014/11/19/how-to-install-yeoman/) : **Yo** is the tool to use for running Yeoman generators. > Yeoman Now that we have **Node.js** installed on our machine, we are now ready to install Yeoman. Yeoman is using 3 core tools. These core tools are composed by Yo, Grunt, and Bower. So we will install them one by one using `npm` which came with **Node.js** when we installed `node`. What is [gb](https://getgb.io/docs/install/). What is [grunt](http://gruntjs.com/) : **grunt** is the task-manager. See a great explanation a bit further below. What is [Bower](http://junereycasuga.github.io/blog/2014/11/19/how-to-install-yeoman/) : Bower is a package manager. A note about **Yo** from their link: > "We now have the core tools needed for Yeoman to work, but there is one more thing we need to do. That is to install the generator we want to use. If you want to create a basic webapp, you just need to run `npm install -g generator-webapp` or if you want to work on AngularJS, just run `npm install -g generator-angular`. (Do not run the command yet.) > We now have all the things needed, and you can now kickstart your project by running `yo webapp` or `yo angular`. To install **Go**, we will run: `brew install go`. To install **Yo**, we will run: `npm install -g yo`. To install **gulp**, we will run: `npm install -g gulp` # TODO : 20160211 : verify this is the command TODO: 20160215: WHERE IS THE FIRST AND SECOND OF THESE ^^^^^^^^ To install **Grunt**, we will run: `npm install -g grunt-cli` To install **Bower**, we will run: `npm install -g bower` > `io.js` "is a fork of Joyent's Node.js" We will not be using `io.js` and that quote is from: [Install Node.js or io.js with nvm, by Fernan Morales : 03 Feb 2015](https://keymetrics.io/2015/02/03/installing-node-js-and-io-js-with-nvm/). Another quote: "... everything written here is also clearly explained by Creationix in the Readme from the [NVM repo](https://github.com/creationix/nvm). Also, executing `nvm` alone or `nvm help` will display a comprehensive list of all the commands along with a brief description. Good to know. A great explanation of **[Grunt](http://gruntjs.com/getting-started)** from [Treehouse.com](http://blog.teamtreehouse.com/install-node-js-npm-mac): > " . . because Node.js can be used on your desktop computer, programmers have created useful Node-based tools that help with the process of building web sites. For example, Grunt is a popular tool used to automate common tasks like compiling Sass files to CSS, making JavaScript files smaller so they load in less time, and compressing images to smaller file size. While these tools run through the **Node.js** environment, you’ll use another tool, **NPM**, to install them. **NPM** is what’s called a “package manager.” **NPM** makes installing a tool like [Grunt](http://gruntjs.com/getting-started) easy as `npm install -g grunt` followed by `npm install -g grunt-cli`. > Other tools you may run across: [gulp](https://github.com/gulpjs/gulp) : A streaming build system, the g is capitalized only in the gulp logo. [gulp faq](https://github.com/gulpjs/gulp/blob/master/docs/FAQ.md) [gulp js](https://github.com/gulpjs) Place this : <a name="developernotice"></a> **[Important Notice for Developers](http://stellarorg.tumblr.com/post/138109479981/important-notice-for-developers)** > If you are actively developing on the Stellar network, please subscribe to the official [Stellar.org releases mailing list](https://www.freelists.org/list/sdf-releases) to make sure you receive future update notices. > > Due to a few recent updates, you will need upgrade your JavaScript libraries to `stellar-sdk 0.4.0` and to `stellar-base 0.5.0` as soon as possible. Please note that transactions built by older versions of js sdks may fail. > > These releases also remove the following deprecated methods: > > Account.isValidAddress (replaced by Account.isValidAccountId) > Account.getSequenceNumber (replaced by Account.sequenceNumber) > Keypair.address (replaced by Keypair.accountId) > Network.usePublicNet (now Network.usePublicNetwork) > Network.useTestNet (now Network.useTestNetwork) > Removed TransactionBuilder.addSigner (use Transaction.sign) > > Please make sure to update your code before deploying an updated version. > Thank you, and apologies for any inconvenience, > > Team Stellar What version are we running ? How do I find out ? `npm list` : will show you all packages installed. Also, you can open your /package.json file, it will show there. <pre> <code> ├─┬ [email protected] │ ├─┬ [email protected] </code> </pre> <pre> <code> will-i-am:node_modules William$ npm list ├─┬ [email protected] │ ├─┬ [email protected] . . truncated . . </code> </pre> <a name="yeomanassert"></a> ##### [yeoman-assert reference](https://www.npmjs.com/package/yeoman-assert) First I learn it .. then I use it. The following is from the reference: Assert utility from yeoman yeoman-assert is extending the native Node assert module. Every method in assert also is available with yeoman-assert, plus some code scaffolding related assertion helpers. **Install** > `npm install --save yeoman-assert` > > How does Heroku recommend we install ? > > This : `npm install --save yeoman-assert` : becomes this: > > `npm install --save --save-exact yeoman-assert` > > and so I do .. `npm install --save --save-exact yeoman-assert` TODO: 20160225 : finish this **Usage** `var assert = require('yeoman-assert');` `assert(true);` `assert.equal(1, 1);` **assert.file()** > path (String|Array) Path to a file. Assert that a file exists. `assert.file('templates/user.hbs');` Assert that each files in the array exists. `assert.file(['templates/user.hbs', 'templates/user/edit.hbs']);` **assert.noFile()** > path (String|Array) Path to a file. Assert that a file doesn't exists. `assert.noFile('templates/user.hbs');` Assert that each of an array of files doesn't exist. `assert.noFile(['templates/user.hbs', 'templates/user/edit.hbs']);` **assert.fileContent()** > file (String|Array) Path to a file. > reg (Regex|String) Regex or string that will be used to search the file. Assert that a file's content matches a string. `assert.fileContent('models/user.js', 'App.User = DS.Model.extend');` Assert that a file's content matches a regex. `assert.fileContent('models/user.js', /App\.User = DS\.Model\.extend/);` Assert that each of an array of files content matches a regex or string. `assert.fileContent([` ` ['models/user.js', 'App.User = DS.Model.extend'],` ` ['controllers/user.js', /App\.UserController = Ember\.ObjectController\.extend/]` `]);` **assert.noFileContent()** > file (String|Array) Path to a file. > reg (Regex|String) Regex or string that will be used to search the file. Assert that a file's content does not match a string. `assert.noFileContent('models/user.js', 'App.User = DS.Model.extend');` Assert that a file's content does not match a regex. `assert.noFileContent('models/user.js', /App\.User = DS\.Model\.extend/);` Assert that each of an array of files content does not match a regex or string. `assert.noFileContent([` ` ['models/user.js', 'App.User = DS.Model.extend'],` ` ['controllers/user.js', /App\.UserController = Ember\.ObjectController\.extend/]` `]);` **assert.textEqual()** > value (String) A string. > expected (String) The expected value of the string. Assert that two strings are equal after standardization of newlines. `assert.textEqual('I have a yellow cat', 'I have a yellow cat');` **assert.implement()** > subject (Object) Subject implementing the façade. > methods (Object|Array) A façace, hash or array of keys to be implemented. Assert an Object implements an interface. `assert.implement(fs, ['readFile']);` **assert.notImplement()** > subject (Object) Subject not implementing the methods. > methods (Object|Array) Hash or array of method names to be implemented. Assert an Object doesn't implements any method of an interface. `assert.notImplement(fs, ['foo']);` **assert.objectContent()** Assert an object contains at least a set of keys `var anObject = {a: 1};` `assert.objectContent(anObject, {a: 2});` **assert.JSONFileContent()** Assert a JSON file contains at least a set of keys (rely of assert.objectContent()) `assert.JSONFileContent('path/to/file.json', {a: 2});` End of [yeoman-assert reference](https://www.npmjs.com/package/yeoman-assert) Now, how do I use it ? Right this moment, I haven't a clue. Let's take a look. Run `home` on it and arrive at the [Yeoman Home Page](http://yeoman.io/). `npm home yeoman-assert` This gives us an excellent description of **Yeoman** and what it does. <a name="stellarmethods"></a> ##### [Stellar Methods]() Account.isValidAccountId : replaces : Account.isValidAddress Account.sequenceNumber : replaces : Account.getSequenceNumber Keypair.accountId : replaces : Keypair.address Network.usePublicNetwork : replaces : Network.usePublicNet Network.useTestNetwork : replaces : Network.useTestNet Transaction.sign : replaces : TransactionBuilder.addSigner We are not done yet. As of 20160225, we have not made contact with the steller testnet server. Authored by [This Gister](https://github.com/kathyonu)