Skip to content

Commit

Permalink
Merge pull request #28 from Agoric/arrange-tutorials
Browse files Browse the repository at this point in the history
Arrange tutorials and add nav links
  • Loading branch information
barbaraliau authored Oct 29, 2019
2 parents df80cb8 + 02d4e01 commit 33ecc70
Show file tree
Hide file tree
Showing 5 changed files with 63 additions and 33 deletions.
60 changes: 36 additions & 24 deletions main/.vuepress/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,36 @@ module.exports = {
// Links must be absolute with trailing slash '/guide/'
// Trailing slash implies it is looking for a .md file
sidebar: {
'/ertp/': [
{
title: 'ERTP Guide',
path: '/ertp/guide/',
collapsable: false,
sideBarDepth: 3,
children: [
'/ertp/guide/',
'/ertp/guide/getting-started',
'/ertp/guide/assays',
'/ertp/guide/default-configuration',
'/ertp/guide/contract-hosts'
]
},
{
title: 'ERTP API',
path: '/ertp/api/',
collapsable: false,
sideBarDepth: 3,
children: [
'/ertp/api/',
'/ertp/api/mint',
{
title: 'DescOps',
path: '/ertp/api/descOps'
}
]
}
],

'/zoe/': [
{
title: 'Zoe',
Expand All @@ -34,11 +64,10 @@ module.exports = {
},
{
title: 'Zoe Contracts',
path: '/zoe/guide/contracts/',
path: '/zoe/guide/contracts/autoswap',
collapsable: false,
sideBarDepth: 3,
children: [
'/zoe/guide/contracts/',
'/zoe/guide/contracts/autoswap',
'/zoe/guide/contracts/public-auction',
'/zoe/guide/contracts/public-swap'
Expand All @@ -51,32 +80,15 @@ module.exports = {
}
],

'/ertp/': [
{
title: 'ERTP Guide',
path: '/ertp/guide/',
collapsable: false,
sideBarDepth: 3,
children: [
'/ertp/guide/',
'/ertp/guide/getting-started',
'/ertp/guide/assays',
'/ertp/guide/default-configuration',
'/ertp/guide/contract-hosts'
]
},
'/smart-contracts-tutorials/': [
{
title: 'ERTP API',
path: '/ertp/api/',
title: 'Smart Contracts Tutorials',
path: '/smart-contracts-tutorials/guess37-one',
collapsable: false,
sideBarDepth: 3,
children: [
'/ertp/api/',
'/ertp/api/mint',
{
title: 'DescOps',
path: '/ertp/api/descOps'
}
'/smart-contracts-tutorials/guess37-one',
'/smart-contracts-tutorials/guess37-multiple'
]
}
]
Expand Down
21 changes: 20 additions & 1 deletion main/.vuepress/themeConfig/nav.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ module.exports = [
{
text: 'ERTP ', // spaces to add some distance to next link
ariaLabel: 'ERTP Menu',
link: '/ertp/guide/',
items: [
{
text: 'Guide',
Expand All @@ -29,6 +30,7 @@ module.exports = [
{
text: 'Zoe',
ariaLabel: 'Zoe Menu',
link: '/zoe/guide',
items: [
{
text: 'Guide',
Expand All @@ -38,7 +40,7 @@ module.exports = [
{
text: 'Contracts',
ariaLabel: 'Zoe Contracts Link',
link: '/zoe/guide/contracts'
link: '/zoe/guide/contracts/autoswap'
},
{
text: 'API',
Expand All @@ -52,6 +54,23 @@ module.exports = [
}
],
},
{
text: 'Tutorials',
ariaLabel: 'Tutorials Menu',
link: '/smart-contracts-tutorials/guess37-one',
items: [
{
text: 'Guess 37 - One Participant',
ariaLabel: 'Guess 37 - One Participant',
link: '/smart-contracts-tutorials/guess37-one'
},
{
text: 'Guess37 - Multiple Participants',
ariaLabel: 'Guess37 Multiple Participants',
link: '/smart-contracts-tutorials/guess37-multiple'
}
]
},
{
text: 'Learn More',
ariaLabel: 'Learn More Menu',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Guess37 multiple participants
# Guess37 - Multiple Participants

In the [previous step](./first-contract), we set up a contract and ran it and played the guess37 game

Expand Down Expand Up @@ -122,4 +122,4 @@ Thanks to the [ERTP framework](https://github.com/Agoric/ERTP) and the design of
All of this is assured even if the contract installer is malicious

Now that we've seen all the guarantees ERTP provide, let's make a more interesting contract than a game to guess a fixed number
In the next step, we'll see how to configure the contract and make bets
In the next step, we'll see how to configure the contract and make bets
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# Tutorial on creating and running the simplest Smart Contract
# Guess37 - One Participant

## Tutorial on creating and running the simplest Smart Contract

This first contract will be a one-player game where the player tries to guess a number. If they guess right, they win, otherwise, they lose. The game can be played any number of times and there is no actual stake. For the purpose of keeping things simple, the number is hardcoded to be `37`

Expand Down Expand Up @@ -119,7 +121,7 @@ seat~.guess(14)
seat~.guess(37)
```

### Commands breakdown
### Commands breakdown

The first `home` command shows what was defined in `lib/ag-solo/vats/vat-pixel.js` as return value of `createPixelBundle`
It is an object containing the properties `contractHost`, `handoffService` and `guess37ContractSource`
Expand Down Expand Up @@ -150,4 +152,4 @@ You've successfully written a smart contract in JavaScript and run it in a solo
In the next steps, [we'll discover how to make someone else play the `guess37` game](./guess37-multiple-participants)


`TODO : explain ~. syntax`
`TODO : explain ~. syntax`
3 changes: 0 additions & 3 deletions main/zoe/guide/contracts/README.md

This file was deleted.

0 comments on commit 33ecc70

Please sign in to comment.