Skip to content

Commit

Permalink
Merge pull request #17 from Agoric/add-ertp-docs
Browse files Browse the repository at this point in the history
Initial setup for Agoric documentation site
  • Loading branch information
barbaraliau authored Oct 27, 2019
2 parents 95e37d2 + a4728dc commit 9040d9d
Show file tree
Hide file tree
Showing 16 changed files with 11,577 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules/
25 changes: 25 additions & 0 deletions deploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/usr/bin/env sh

# abort on errors
set -e

# build
npm run docs:build

# navigate into the build output directory
cd ertp/.vuepress/dist

# if you are deploying to a custom domain
echo 'agoric.com/Documentation' > CNAME

git init
git add -A
git commit -m 'deploy'

# if you are deploying to https://<USERNAME>.github.io
# git push -f [email protected]:<USERNAME>/<USERNAME>.github.io.git master

# if you are deploying to https://<USERNAME>.github.io/<REPO>
git push -f [email protected]:Agoric/Documentation.git master:gh-pages

cd -
69 changes: 69 additions & 0 deletions ertp/.vuepress/config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
module.exports = {
/* --- FOR DEPLOYEMENT TO GITHUB PAGES--- */
base: '/Documentation/', // name of the repo
/* --- HOME PAGE --- */
title: 'ERTP 0.x', // title for the site. prefix for all page titles and displayed in the navbar
description: 'Electronic Rights Transfer Protocol (ERTP). A smart contract framework for exchanging electronic rights', // desc for the site; rendered as a tag in the page HTML

/* --- THEME CONFIG --- */
// NOTES:
// Internal links: Must have a corresponding folder with a README.md file
// Links must be absolute with trailing slash '/guide/'
// Trailing slash implies it is looking for a .md file
themeConfig: {
/* --- NAVBAR (top) --- */
nav: [
{ text: 'Guide', link: '/guide/' },
{ text: 'API', link: '/api/' },
{ text: 'Agoric', link: 'https://agoric.com/' },
{ text: 'Github', link: 'https://github.com/Agoric/ERTP' }
],

/* --- SIDEBAR --- */
// This configuration displays different sidebars for different sections of
// content. Pages must be organized into directories for each desired
// section
sidebar: {
'/guide/': [
{
title: 'Guide',
path: '/guide/',
collapsable: false,
children: [
['/guide/', 'ERTP'], // [link, title]
'/guide/getting-started', // default, gets title from header
{ // usees an object to assign everything, including children
title: 'Concepts',
path: '/guide/issuers/',
collapsable: false,
children: [
'/guide/assays',
'/guide/contract-hosts'
]
}
]
}
],
'/api/': [
{
title: 'API',
path: '/api/',
collapsable: false,
sidebarDepth: 2,
children: [
{ title: 'Mint', path: '/api/mint' },
{ title: 'DescOps', path: '/api/descOps' },
{ title: '/util', path: '/api/utils' }
]
}
]
}
/* --- SEARCH --- */
// Comes with built-in search functionality which builds its index from the
// h1, h2, and h3 headers
// Disable search by uncommenting the following line:
// search: false
// Cusotmize how many suggestions will be shown with:
// searchMaxSuggestions: <numberOfSuggestions>
}
}
1 change: 1 addition & 0 deletions ertp/.vuepress/dist
Submodule dist added at c88ed7
68 changes: 68 additions & 0 deletions ertp/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
---
####
# YAML section setting up the home page
# run `npm run docs:dev` at any time to start local dev server and access website at
# localhost:8080 by default
####
home: true # use default home page layout (hero image with text, features section)
heroImage: https://agoric.com/assets/images/logo.svg
actionText: Get Started → # text that goes in the button
actionLink: /guide/ # go-to link when clicking on button
features:
- title: New Protocol
details: Bitcoin has unspent transactions. Ethereum has account balances. Agoric has ERTP.

- title: Familiarity of JavaScript
details: ERTP is a uniform way of transferring tokens and other digital assets in JavaScript.

- title: Securely Create and Transfer
details: All kinds of digital assets can be easily created, but importantly, they can be transferred in exactly the same ways, with exactly the same security properties.

footer: Apache-2.0 Licensed | Copyright © 2019-Agoric
---

## A quick tutorial

Let's look at an example. In ERTP, all digital assets, including fungible and
non-fungible tokens, are created by a `mint`. Having access to the mint
gives you the power to create more digital assets of the same type at
will. For instance, let's say we want to create a new community
currency called 'BaytownBucks':

```js
const baytownBucksMint = makeMint('BaytownBucks');
```

Great! Now let's use our mint to create 1000 new BaytownBucks.

```js
const purse = baytownBucksMint.mint(1000, 'community treasury');
```

The act of minting created 1000 BaytownBucks and stored them together in a
`purse`. Purses in ERTP only hold one type of digital asset, so this
purse can only ever hold BaytownBucks.

Let's distribute the BaytownBucks to members of the community. To send
money in ERTP, we withdraw `payments` from purses.

```js
const paymentForAlice = purse.withdraw(10, `alice's community money`);
```

Like our purse, this payment contains BaytownBucks, but unlike purses,
payments are used to represent tokens in transit. A payment can be
sent to someone else, a purse never should be.

Now let's send the payment to Alice as message:

```
alice.receivePayment(paymentForAlice);
```

This may seem strange, but ERTP is built on top of [an
infrastructure](https://github.com/Agoric/SwingSet) in which
everything is an object. In this example, we have a reference to the
object `alice`, and can call her `receivePayment` to ask her to
receive this payment. Alice's methods are entirely up to her, and are
not part of ERTP.
3 changes: 3 additions & 0 deletions ertp/api/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# API

All the API things go here
Loading

0 comments on commit 9040d9d

Please sign in to comment.