Skip to content

Commit

Permalink
Updated theme to the latest version (cosmos#224)
Browse files Browse the repository at this point in the history
* Updated theme to the latest version

* Import local code

* Reverted back to local code import
  • Loading branch information
fadeev authored and tac0turtle committed Jan 19, 2020
1 parent 61cacb9 commit 3642198
Show file tree
Hide file tree
Showing 19 changed files with 2,201 additions and 1,087 deletions.
95 changes: 88 additions & 7 deletions .vuepress/config.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
module.exports = {
theme: 'cosmos',
markdown: {
anchor: {
permalinkSymbol: ''
}
},
title: "Cosmos SDK Tutorials",
themeConfig: {
// if your docs are in a different repo from your main project:
docsRepo: 'cosmos/sdk-tutorials',
Expand All @@ -16,7 +12,7 @@ module.exports = {
{
title: 'Hellochain',
path: '/hellochain/tutorial/',
directory: true,
directory: true,
},
{
title: 'Nameservice',
Expand All @@ -25,7 +21,92 @@ module.exports = {
}
]
}
]
],
footer: {
logo: "/logo-bw.svg",
textLink: {
text: "cosmos.network",
url: "https://cosmos.network"
},
services: [
{
service: "medium",
url: "https://blog.cosmos.network/"
},
{
service: "twitter",
url: "https://twitter.com/cosmos"
},
{
service: "linkedin",
url: "https://www.linkedin.com/company/tendermint/"
},
{
service: "reddit",
url: "https://reddit.com/r/cosmosnetwork"
},
{
service: "telegram",
url: "https://t.me/cosmosproject"
},
{
service: "youtube",
url: "https://www.youtube.com/c/CosmosProject"
}
],
smallprint:
"This website is maintained by Tendermint Inc. The contents and opinions of this website are those of Tendermint Inc.",
links: [
{
title: "Documentation",
children: [
{
title: "Cosmos SDK",
url: "https://cosmos.network/docs"
},
{
title: "Cosmos Hub",
url: "https://hub.cosmos.network/"
},
{
title: "Tendermint Core",
url: "https://docs.tendermint.com/"
}
]
},
{
title: "Community",
children: [
{
title: "Cosmos blog",
url: "https://blog.cosmos.network/"
},
{
title: "Forum",
url: "https://forum.cosmos.network/"
},
{
title: "Chat",
url: "https://riot.im/app/#/room/#cosmos-sdk:matrix.org"
}
]
},
{
title: "Contributing",
children: [
{
title: "Contributing to the docs",
url:
"https://github.com/cosmos/cosmos-sdk/blob/master/docs/DOCS_README.md"
},
{
title: "Source code on GitHub",
url: "https://github.com/cosmos/cosmos-sdk/"
}
]
}
]
}
},
plugins: [
[
Expand Down
Binary file added .vuepress/public/favicon.ico
Binary file not shown.
6 changes: 6 additions & 0 deletions .vuepress/styles/index.styl
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
:root
--accent-color #5064fb
--background #161931

.content__default p img
width 200px
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ Translations:

- [中文](./nameservice/README_cn.md)

## [Slides](https://docs.google.com/presentation/d/1aCMAdkVY-gfgnGNPTygwVk3o68czPQ_VYfvdMy9Ek5Q/edit?usp=sharing)
## [Slides](https://docs.google.com/presentation/d/1aCMAdkVY-gfgnGNPTygwVk3o68czPQ_VYfvdMy9Ek5Q/edit?usp=sharing)
2 changes: 1 addition & 1 deletion hellochain/tutorial/03-types.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ define this struct and other necessary components in a types file.

Save this to `x/greeter/internal/types/types.go`

<<< @/hellochain/x/greeter/internal/types/types.go
<<< @/hellochain/x/greeter/internal/types/types.go
2 changes: 1 addition & 1 deletion hellochain/tutorial/15-full-app.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ and add greeter's AppModuleBasic and AppModule alongside the other modules.

Update your `app.go` to look like the following

<<< @/hellochain/app.go{12,25,26,33,36,39,44,45,49,50,53}
<<< @/hellochain/app.go
2 changes: 1 addition & 1 deletion nameservice/tutorial/03-types.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@ Each name will have three pieces of data associated with it.

To start your SDK module, define your `nameservice.Whois` struct in the `./x/nameservice/internal/types/types.go` file:

<<<@/nameservice/x/nameservice/internal/types/types.go
<<< @/nameservice/x/nameservice/internal/types/types.go

As mentioned in the [Design doc](./app-design.md), if a name does not already have an owner, we want to initialize it with some MinPrice.
2 changes: 1 addition & 1 deletion nameservice/tutorial/05-errors.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ order: 5

Start by navagating to the `errors.go` file within the types folder. Within your `errors.go` file, define errors that are custom to your module along with their codes.

<<<@/nameservice/x/nameservice/internal/types/errors.go
<<< @/nameservice/x/nameservice/internal/types/errors.go

You must also add the corresponding method that'll be called at the time of error handling. For instance, let's say we try to delete a name that is not present in the store. In this case, an error should be thrown as the name does not exist.

Expand Down
2 changes: 1 addition & 1 deletion nameservice/tutorial/11-queriers.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ order: 11

Start by navigating to `./x/nameservice/internal/types/querier.go` file. This is where you will define your querier types.

<<<@/nameservice/x/nameservice/internal/types/querier.go
<<< @/nameservice/x/nameservice/internal/types/querier.go

## Querier

Expand Down
2 changes: 1 addition & 1 deletion nameservice/tutorial/12-alias.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ First start by importing the "types" folder you have created.
- A variable, which you will define to contain information such as your messages.
- A type, here you will define the types you have created in the types folder.

<<<@/nameservice/x/nameservice/alias.go
<<< @/nameservice/x/nameservice/alias.go

Now you have aliased your needed constants, variables, and types. We can move forward with the creation of the module.

Expand Down
2 changes: 1 addition & 1 deletion nameservice/tutorial/13-codec.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ order: 13

To [register your types with Amino](https://github.com/tendermint/go-amino#registering-types) so that they can be encoded/decoded, there is a bit of code that needs to be placed in `./x/nameservice/internal/types/codec.go`. Any interface you create and any struct that implements an interface needs to be declared in the `RegisterCodec` function. In this module the three `Msg` implementations (`SetName`, `BuyName` and `DeleteName`) need to be registered, but your `Whois` query return type does not. In addition, we define a module specific codec for use later.

<<<@/nameservice/x/nameservice/internal/types/codec.go
<<< @/nameservice/x/nameservice/internal/types/codec.go

### Next you need to define CLI interactions with your module.
4 changes: 2 additions & 2 deletions nameservice/tutorial/14-cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ The Cosmos SDK uses the [`cobra`](https://github.com/spf13/cobra) library for CL

Start in `query.go`. Here, define `cobra.Command`s for each of your modules `Queriers` (`resolve`, and `whois`):

<<<@/nameservice/x/nameservice/client/cli/query.go
<<< @/nameservice/x/nameservice/client/cli/query.go

Notes on the above code:

Expand All @@ -30,7 +30,7 @@ Now that the query interactions are defined, it is time to move on to transactio

> _*NOTE*_: Your application needs to import the code you just wrote. Here the import path is set to this repository (`github.com/cosmos/sdk-tutorials/nameservice/x/nameservice`). If you are following along in your own repo you will need to change the import path to reflect that (`github.com/{ .Username }/{ .Project.Repo }/x/nameservice`).
<<<@/nameservice/x/nameservice/client/cli/tx.go
<<< @/nameservice/x/nameservice/client/cli/tx.go

Notes on the above code:

Expand Down
4 changes: 2 additions & 2 deletions nameservice/tutorial/15-rest.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ First create a `query.go` file to place all your querys in.

Next, its time to define the handlers mentioned above. These will be very similar to the CLI methods defined earlier. Start with the queries `whois` and `resolve`:

<<<@/nameservice/x/nameservice/client/rest/query.go
<<< @/nameservice/x/nameservice/client/rest/query.go

Notes on the above code:

Expand All @@ -66,7 +66,7 @@ First define a `tx.go` file to hold all your tx rest endpoints.

Now define the `buyName`, `setName` and `deleteName` transaction routes. Notice these aren't actually sending the transactions to buy, set and delete names. That would require sending a password along with the request which would be a security issue. Instead these endpoints build and return each specific transaction which can then be signed in a secure manner and afterwards broadcast to the network using a standard endpoint like `/txs`.

<<<@/nameservice/x/nameservice/client/rest/tx.go
<<< @/nameservice/x/nameservice/client/rest/tx.go

Notes on the above code:

Expand Down
2 changes: 1 addition & 1 deletion nameservice/tutorial/16-module.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Start by opening two new files, `module.go` and `genesis.go`. We will implement

Lets start with adding the following code to `module.go`. The scaffolding tool has already filled in all the functions with the data that is needed but there are still a couple of to-dos. You will have to add the modules that this module depends on in the `AppModule` type.

<<<@/nameservice/x/nameservice/module.go
<<< @/nameservice/x/nameservice/module.go

To see more examples of AppModule implementation, check out some of the other modules in the SDK such as [x/staking](https://github.com/cosmos/cosmos-sdk/blob/master/x/staking/genesis.go)

Expand Down
4 changes: 2 additions & 2 deletions nameservice/tutorial/17-genesis.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ The AppModule interface includes a number of functions for use in initializing a

Go to `x/nameservice/genesis.go` and you will see that a few things are missing. We have to fill them in according to the needs of the module. Below you will see what is missing:

<<<@/nameservice/x/nameservice/genesis.go
<<< @/nameservice/x/nameservice/genesis.go

Next we will define what the genesis state will be, the default genesis and a way to validate it so we don't run into any errors when we start the chain with preexisting state.

<<<@/nameservice/x/nameservice/internal/types/genesis.go
<<< @/nameservice/x/nameservice/internal/types/genesis.go

A few notes about the above code:

Expand Down
4 changes: 2 additions & 2 deletions nameservice/tutorial/19-entrypoint.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Start by adding the following code to `cmd/nsd/main.go`:

> _*NOTE*_: Your application needs to import the code you just wrote. Here the import path is set to this repository (`github.com/cosmos/sdk-tutorials/nameservice`). If you are following along in your own repo you will need to change the import path to reflect that (`github.com/{ .Username }/{ .Project.Repo }`).
<<<@/nameservice/cmd/nsd/main.go
<<< @/nameservice/cmd/nsd/main.go

Notes on the above code:

Expand All @@ -32,7 +32,7 @@ Finish up by building the `nscli` command:

> _*NOTE*_: Your application needs to import the code you just wrote. Here the import path is set to this repository (`github.com/cosmos/sdk-tutorials/nameservice`). If you are following along in your own repo you will need to change the import path to reflect that (`github.com/{ .Username }/{ .Project.Repo }`).
<<<@/nameservice/cmd/nscli/main.go
<<< @/nameservice/cmd/nscli/main.go

Note:

Expand Down
8 changes: 4 additions & 4 deletions nameservice/tutorial/20-gomod-makefile.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,19 @@ Help users build your application by writing a `./Makefile` in the root director

> _*NOTE*_: The below Makefile contains some of same commands as the Cosmos SDK and Tendermint Makefiles.
<<<@/nameservice/Makefile
<<< @/nameservice/Makefile

### How about including Ledger Nano S support?

This requires a few small changes:

- Create a file `Makefile.ledger` with the following content:

<<<@/nameservice/Makefile.ledger
<<< @/nameservice/Makefile.ledger

- Add `include Makefile.ledger` at the beginning of the Makefile:

<<<@/nameservice/Makefile
<<< @/nameservice/Makefile

## `go.mod`

Expand All @@ -33,7 +33,7 @@ Golang has a few dependency management tools. In this tutorial you will be using
- You will have to run `go get ./...` to get all the modules the application is using. This command will get the dependency version stated in the `go.mod` file.
- If you would like to use a specific version of a dependency then you have to run `go get github.com/<github_org>/<repo_name>@<version>`

<<<@/nameservice/go.mod
<<< @/nameservice/go.mod

## Building the app

Expand Down
Loading

0 comments on commit 3642198

Please sign in to comment.