Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial setup for ERTP documentation #17

Merged
merged 28 commits into from
Oct 27, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
feb0f39
Bones for ERTP documentation built with VuePress
barbaraliau Oct 1, 2019
a2d7443
Update npm run scripts to state docs-ertp instead of just docs
barbaraliau Oct 1, 2019
25efe34
Update sidebar order
barbaraliau Oct 9, 2019
998d0f1
Update to new naming, fix formatting
barbaraliau Oct 9, 2019
1fadcc5
Update config for new paths
barbaraliau Oct 18, 2019
117b0a6
Change naming to match mint.js change
barbaraliau Oct 18, 2019
9a5f6bd
Spacing
barbaraliau Oct 18, 2019
18dab26
Delete old file
barbaraliau Oct 18, 2019
0781c25
Add .gitignore
barbaraliau Oct 18, 2019
ea2885d
Add package-lock.json
barbaraliau Oct 18, 2019
66925fc
adding some examples to descOps.md
dominiquejane Oct 18, 2019
af5b7a8
add comment in example
dominiquejane Oct 21, 2019
4dfe099
Added more examples to descOps.md and some comments. In red. In H1. S…
dominiquejane Oct 21, 2019
a55f448
Rearrange order with Mint first; add examples
barbaraliau Oct 22, 2019
5739ed7
Merge branch 'add-ertp-docs' of github.com:Agoric/Documentation into …
barbaraliau Oct 22, 2019
14959f1
add assay examples in mint.md
dominiquejane Oct 24, 2019
d67dfaa
Adds purse examples to mint.md
dominiquejane Oct 24, 2019
9dfbdc7
Adds payment examples to mint.md
dominiquejane Oct 24, 2019
99ee4db
Adds examples for extentOps to mint.md
dominiquejane Oct 24, 2019
cc1da44
Adds missing semicolons to descOps.md and mint.md
dominiquejane Oct 24, 2019
fbd1c3f
Rewrite comment explanation
dominiquejane Oct 24, 2019
c98aa41
Rewrite comment explanation
dominiquejane Oct 24, 2019
30c74d0
Remove -ertp marker from npm doc scripts
barbaraliau Oct 26, 2019
2c0454b
Updates Extent explanation, moves all descriptions to top. Resolves s…
barbaraliau Oct 27, 2019
8dffea5
Display config defaults as lists
barbaraliau Oct 27, 2019
95db965
Delete old file
barbaraliau Oct 27, 2019
c491047
Fix empty paths
barbaraliau Oct 27, 2019
a4728dc
Update deploy.sh script
barbaraliau Oct 27, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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