Skip to content

Commit 0db80ac

Browse files
committed
Removed legacy --config in readme and updated developing folder for learn
1 parent fab9ff6 commit 0db80ac

14 files changed

+2117
-709
lines changed

README.md

Lines changed: 26 additions & 122 deletions
Original file line numberDiff line numberDiff line change
@@ -109,16 +109,34 @@ The following blockchain libraries (generated by Telescope) are available via np
109109

110110
## Quickstart
111111

112-
Follow the instructions below to generate a new Typescript package that you can publish to npm.
112+
Follow the instructions below to generate a new Typescript package that you can publish to npm. You can also follow the video: https://youtu.be/iQf6p65fbdY
113113

114-
First, install `telescope` and `create-cosmos-app`
114+
First, install `telescope`
115+
```sh
116+
npm install -g @cosmology/telescope
117+
```
115118

119+
then install either
120+
121+
`create-interchain-app`
116122
```sh
117-
npm install -g @cosmology/telescope create-cosmos-app
123+
npm install -g create-interchain-app
124+
```
125+
Or
126+
`create-cosmos-app`
127+
```sh
128+
npm install -g create-cosmos-app
118129
```
119130

120131
### Generate
121132

133+
Use the [`create-interchain-app`](https://github.com/hyperweb-io/create-interchain-app/) command to create a new package from the `telescope` boilerplate.
134+
135+
```sh
136+
cia --boilerplate telescope
137+
138+
or
139+
122140
Use the [`create-cosmos-app`](https://github.com/hyperweb-io/create-cosmos-app/) command to create a new package from the `telescope` boilerplate.
123141

124142
```sh
@@ -127,87 +145,23 @@ cca --boilerplate telescope
127145

128146
Then, you'll navigate into `./your-project/packages/telescope` package for the next steps.
129147
130-
You can also use `telescope generate` command to generate package according to the prompt or terminal command params such as:
131-
`telescope generate --access public --userfullname testname --useremail [email protected] --module-desc test --username salkfl --license MIT --module-name test --chain-name cosmos --use-npm-scoped`
132-
133-
The available options are:
134-
`--userfullname` `--useremail` `--module-desc` `--username` `--module-name` `--chain-name` `--access` `--use-npm-scoped` `--license`
135-
136148
If some required options are missing, it will prompt to ask for the info.
137149
138-
To be noted, `--use-npm-scoped` only works when `--access` is `public`
150+
For detailed cli `generate` commands, please check our docs and learn directories.
139151
140-
### Download protos with CLI
152+
### Download protos
141153
142154
The old ` telescope install ` command has been deprecated
143155
144-
You can use our CLI to download protos by using `download` command.
156+
You can use our script to download protos by using `download-protos`command in the boilerplate.
145157
146158
```sh
147-
telescope download
159+
yarn download-protos
148160
```
149161
150162
You should now see some repos cloned in `./git-modules` and proto files generated in `./protos`. These are the proto files downloaded according to your config.
151163
152-
Examples:
153-
154-
```sh
155-
# Telescope will do the download according to .json file of --config
156-
# Telescope will put proto into location specified by --out
157-
telescope download --config ./protod.config.json --out ./git-modules
158-
```
159-
160-
```sh
161-
# Telescope download from target repo according to --git-repo
162-
# in format of (i.e. <owner>/<repository> or <owner>/<repository>/<branch>)
163-
# <branch> can be empty, it will use main as default
164-
# Also --targets is required to specify the targets to download
165-
# in format like cosmos/auth/v1beta1/auth.proto
166-
telescope download --git-repo target-repo --targets target-proto
167-
```
168-
169-
```sh
170-
# ssh arg is optional, default is false
171-
telescope download --config ./protod.config.json --out ./git-modules --ssh true
172-
```
173-
174-
175-
```js
176-
// .protod.config.json example
177-
//
178-
// `repos` are the repository it's going to clone
179-
// in format of (i.e. { "owner": <owner>, "repo": <repo> } or { "owner": <owner>, "repo": <repo>, "branch": <branch> })
180-
// <branch> can be empty, it will use main as default
181-
//
182-
// `protoDirMapping` is the directory of repo specified if the proto is not under repo's root directory ./protos
183-
// in format of (i.e. <owner>/<repository> or <owner>/<repository>/<branch>)
184-
// <branch> can be empty, it will use main as default
185-
//
186-
// `outDir` is where the output proto will be put
187-
//
188-
// `targets` are the target proto to download
189-
// `targets` can be patterns like:
190-
// "cosmos/bank/v1beta1/tx.proto",
191-
// "cosmos/gov/**/*.proto",
192-
// "cosmos/authz/**/*.proto",
193-
{
194-
"repos": [
195-
{ "owner": "cosmos", "repo": "cosmos-sdk" },
196-
...
197-
],
198-
"protoDirMapping": {
199-
"gogo/protobuf/master": ".",
200-
...
201-
},
202-
"outDir": "protos",
203-
"ssh": true,
204-
"tempRepoDir": "git-modules",
205-
"targets": [
206-
"cosmos/auth/v1beta1/auth.proto",
207-
...
208-
]
209-
}
210-
```
164+
For detailed cli `download` commands, please check our docs and learn directories.
211165
212166
### Transpile
213167
@@ -217,56 +171,6 @@ To create the Typescript files for your chain, run the `yarn codegen` command in
217171
yarn codegen
218172
```
219173
220-
### Transpile with CLI
221-
222-
Less recommended, but you can also use our CLI for transpilation. To create the Typescript files with the `cli`, run the `transpile` command.
223-
224-
```sh
225-
telescope transpile
226-
```
227-
228-
You should now see some `.ts` files generated in `./src`. These are the real source files used in your application.
229-
230-
Examples:
231-
232-
```sh
233-
# Telescope takes chain1 folder as input,
234-
# and generate files in 'gen/src' folder.
235-
telescope transpile --protoDirs ../../__fixtures__/chain1 --outPath gen/src
236-
```
237-
238-
```sh
239-
# Telescope takes chain1 folder as input,
240-
# and generate files in 'gen/src' folder using default telescope options.
241-
telescope transpile --protoDirs ../../__fixtures__/chain1 --outPath gen/src --useDefaults
242-
```
243-
244-
```sh
245-
# Telescope takes chain1 folder(from args) and chain2 folder(from config) as input,
246-
# and generate files in 'gen/src'(defined in the config file, will override outPath in args) folder using a config file.
247-
# Note: --config will override --useDefaults.
248-
telescope transpile --protoDirs ../../__fixtures__/chain1 --config .telescope.json
249-
```
250-
251-
```sh
252-
# Telescope takes more than one config. The config afterward will override those in front. In this case values in .telescope-ext.json will override those in .telescope.json.
253-
telescope transpile --config .telescope.json --config .telescope-ext.json
254-
```
255-
256-
```js
257-
//.telescope.json
258-
{
259-
"protoDirs": [
260-
"../../fixtures/chain2"
261-
],
262-
"outPath": "gen/src",
263-
"options": {
264-
// telescope options
265-
...
266-
}
267-
}
268-
```
269-
270174
### Build
271175
272176
Finally, run `install` and `build` to generate the JS and types for publishing your module to npm.

0 commit comments

Comments
 (0)