Skip to content

Commit f3f332f

Browse files
committed
import external repo readmes
1 parent 4ec25f7 commit f3f332f

File tree

10 files changed

+240
-122
lines changed

10 files changed

+240
-122
lines changed

.changeset/lovely-jobs-jam.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@kadena/docs': minor
3+
---
4+
5+
import docs from external repos

packages/apps/docs/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ src/pages/chainweb/node-client
1717
src/pages/chainweb/js-bindings
1818

1919

20+
.tempimport
2021
src/pages/docs
2122

2223
next-env.d.ts

packages/apps/docs/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@kadena/docs",
3-
"version": "0.4.1",
3+
"version": "0.4.2",
44
"private": true,
55
"scripts": {
66
"7d": "npx 7d pinecone-create-index --index kda-docs --environment asia-northeast1-gcp",

packages/apps/docs/src/pages/build/quickstart/index.md

+113-93
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
---
2-
title: 10 Minute Quickstart
3-
description: Learn Kadena’s core concepts & tools for development in 10 minutes
4-
menu: Quickstart
5-
label: 10 Minute Quickstart
6-
order: 1
2+
title: 10 minute quickstart with Kadena
3+
description: Kadena makes blockchain work for everyone.
4+
menu: undefined
5+
label: 10 minute quickstart with Kadena
6+
order: 0
7+
editLink: https://github.com/kadena-community/kadena.js/edit/main/packages/./.tempimport/kadena-community/getting-started/README.md
78
layout: full
8-
tags: [devnet, chainweaver, tutorial, docker, transactions]
9+
tags: [devnet,chainweaver,tutorial,docker,transactions]
10+
lastModifiedDate: Thu, 19 Oct 2023 13:23:55 GMT
911
---
10-
1112
# 10 minute quickstart with Kadena
1213

1314
Welcome to the world of Kadena, a powerful blockchain platform that combines
@@ -21,25 +22,25 @@ blockchain in 10 minutes
2122

2223
## Start fat-container `kadena/devnet`
2324

24-
1. Create docker volume
25+
1. Create docker volume
2526

26-
```shell
27-
docker volume create kadena_devnet
28-
```
27+
```shell
28+
docker volume create kadena_devnet
29+
```
2930

30-
2. start kadena-devnet fat-container
31+
2. start kadena-devnet fat-container
3132

32-
```shell
33-
docker run -it -p 8080:8080 -v kadena_devnet:/data --name devnet kadena/devnet
34-
# restart with
35-
docker start devnet
36-
```
33+
```shell
34+
docker run -it -p 8080:8080 -v kadena_devnet:/data --name devnet kadena/devnet
35+
# restart with
36+
docker start devnet
37+
```
3738

3839
## Monitor the blockchain
3940

4041
In the fat-container we expose an explorer that connects to the devnet
4142

42-
1. Go to http://localhost:8080/explorer/
43+
1. Go to http://localhost:8080/explorer/
4344

4445
Here you can see the blocks that are mined, and the transactions that are
4546
executed
@@ -49,28 +50,28 @@ workflow, the devnet mines a block in 5 seconds.
4950

5051
## Chainweaver wallet
5152

52-
1. Use Chainweaver
53-
1. Download and install from
54-
https://github.com/kadena-io/chainweaver/releases
55-
2. Or, use the web version: https://chainweaver.kadena.network
56-
2. Launch Chainweaver and create your mnemonic key
53+
1. Use Chainweaver
54+
1. Download and install from
55+
https://github.com/kadena-io/chainweaver/releases
56+
2. Or, use the web version: https://chainweaver.kadena.network
57+
2. Launch Chainweaver and create your mnemonic key
5758

5859
## Add devnet to Chainweaver
5960

60-
1. Click "Settings" tab in the bottom left
61-
2. Select "Network"
62-
3. Fill in the network name: "Devnet"
63-
4. Open the network you created "> Devnet"
64-
5. Add a node: "127.0.0.1:8080", the red dot on the right, should become green
65-
now.
61+
1. Click "Settings" tab in the bottom left
62+
2. Select "Network"
63+
3. Fill in the network name: "Devnet"
64+
4. Open the network you created "> Devnet"
65+
5. Add a node: "127.0.0.1:8080", the red dot on the right, should become green
66+
now.
6667

6768
## Create keys to sign transactions
6869

69-
1. Go to "Keys" on the left and click "+ Generate" on the top-right. This is
70-
your first key-pair.
71-
2. To show the balance of this account, click "Add k: Account".
72-
3. Go back to the "Accounts" tab on the left. Notice that the "Balance (KDA)"
73-
says "Does not exist".
70+
1. Go to "Keys" on the left and click "+ Generate" on the top-right. This is
71+
your first key-pair.
72+
2. To show the balance of this account, click "Add k: Account".
73+
3. Go back to the "Accounts" tab on the left. Notice that the "Balance (KDA)"
74+
says "Does not exist".
7475

7576
In Kadena, keys and accounts do not represent the same thing. An account needs
7677
to be created before it can be used.
@@ -82,8 +83,8 @@ to be created before it can be used.
8283
> [install with `n`](https://github.com/tj/n#readme)) and run `npm install` in
8384
> the root of this project
8485
>
85-
> 1. install nodejs
86-
> 2. run `npm install`
86+
> 1. install nodejs
87+
> 2. run `npm install`
8788

8889
Before we can create an account, you need to have KDA to pay for the gas-fees
8990
(transaction fee).
@@ -95,16 +96,28 @@ In this process, we’ll submit a transaction that creates an account based on t
9596
"keys" and "predicate" that you supply. The combination of `keys` + `predicate`
9697
makes a `keyset`, which is used to `guard` your account.
9798

98-
1. Send money from "sender00" to your account. Copy your account name from the
99-
"Accounts" tab and fill it in the command
99+
0. Clone the repository. It has scripts to make your life easier
100+
101+
```shell
102+
git clone https://github.com/kadena-community/getting-started.git
103+
# or
104+
git clone [email protected]:kadena-community/getting-started.git
105+
# and install dependencies (you need to have nodejs preinstalled)
106+
cd getting-started
107+
npm install
108+
```
109+
110+
1. Send money from "sender00" to your account. Copy your account name from the
111+
"Accounts" tab and fill it in the command
112+
113+
```shell
114+
npm run start -- fund --keys "<your-key>" --predicate "keys-all"
115+
```
100116

101-
```shell
102-
npm run start -- fund --keys "<your-key>" --predicate "keys-all"
103-
```
117+
2. Open the Block Explorer http://localhost:8080/explorer/ to monitor the
118+
transaction
104119

105-
2. Open the Block Explorer http://localhost:8080/explorer/ to monitor the
106-
transaction
107-
3. In Chainweaver, click "Refresh" to update the account balances
120+
3. In Chainweaver, click "Refresh" to update the account balances
108121

109122
## Deploy a contract
110123

@@ -126,21 +139,21 @@ run the following command. Make sure to have Chainweaver open, as it's required
126139
to sign with your private key.
127140
128141
**Important**: the web version of Chainweaver does not have an automated signing
129-
flow. Use the **Chainweaver Web** command. **_Follow the instructions in the
130-
terminal_**.
142+
flow. Use the **Chainweaver Web** command. ***Follow the instructions in the
143+
terminal***.
131144
132145
Once you run the command you'll see a modal open in Chainweaver. This modal
133146
shows a few things:
134147
135-
1. Transaction metadata like who pays for the transaction, etc.
136-
2. The "code" that's executed when the transaction
137-
3. The "data" that's available for the functions that are executed (in this case
138-
nothing)
139-
4. The "signers" needed to sign for the transaction
140-
In this example we have an "unscoped signer" as for deploying a smart
141-
contract, there are no "capabilities" that scope what your signature can be
142-
used for (read more about this in our
143-
[Step-By-Step Guide to Writing Smart Contracts](https://docs.kadena.io/build/guides#capabilitiesh-1323277354))
148+
1. Transaction metadata like who pays for the transaction, etc.
149+
2. The "code" that's executed when the transaction
150+
3. The "data" that's available for the functions that are executed (in this case
151+
nothing)
152+
4. The "signers" needed to sign for the transaction\
153+
In this example we have an "unscoped signer" as for deploying a smart
154+
contract, there are no "capabilities" that scope what your signature can be
155+
used for (read more about this in our
156+
[Step-By-Step Guide to Writing Smart Contracts](https://docs.kadena.io/build/guides/a-step-by-step-guide-to-writing-pact-smart-contract#capabilities))
144157
145158
```shell
146159
npm run start -- deploy --keys "<your-key>" --predicate "keys-all"
@@ -160,11 +173,11 @@ Now you can interact with the smart contract
160173
161174
## Interacting with a smart contract
162175
163-
1. Open Chainweaver
164-
2. Navigate to the "Contracts" on the left
165-
3. Open the "Module Explorer"-tab on the right
166-
4. Search in "Deployed Contracts" for the `hello-world` contract
167-
5. Click the "View" button to show details of the smart contract
176+
1. Open Chainweaver
177+
2. Navigate to the "Contracts" on the left
178+
3. Open the "Module Explorer"-tab on the right
179+
4. Search in "Deployed Contracts" for the `hello-world` contract
180+
5. Click the "View" button to show details of the smart contract
168181
169182
If everything went correctly, you should be able to see the smart contract and
170183
its details.
@@ -183,12 +196,12 @@ deployed. Write it in the left side of your Chainweaver inside "Contracts" page.
183196
(free.hello-world.say-hello "Albert")
184197
```
185198
186-
1. Click the "deploy" button on the top right.
187-
2. Click next twice
188-
3. You'll get an error "A 'Gas Payer' has not been selected for this
189-
transaction. Are you sure this is correct?", but you can ignore that since
190-
you're executing a read-only command.
191-
4. Scroll to the bottom. Here you'll see the "Raw Response"
199+
1. Click the "deploy" button on the top right.
200+
2. Click next twice
201+
3. You'll get an error "A 'Gas Payer' has not been selected for this
202+
transaction. Are you sure this is correct?", but you can ignore that since
203+
you're executing a read-only command.
204+
4. Scroll to the bottom. Here you'll see the "Raw Response"
192205
193206
> "Hello, Albert!"
194207
@@ -222,7 +235,7 @@ npm run start -- deploy \
222235
You'll walk through the same process as before in Chainweaver.
223236
224237
> Yes you read that correctly. **You can redeploy and update a smart
225-
> contract!**
238+
> contract!**\
226239
> This is one of the many cool features of Pact and Kadena, however, you cannot
227240
> change the schema (yet)
228241
@@ -250,19 +263,28 @@ We also created a function that allows you to write to the schema:
250263
251264
### Executing a write function
252265
253-
1. Go to the "contracts" page in Chainweaver
254-
2. Write the following snippet
255-
```lisp
256-
(free.hello-world.write-hello "Albert")
257-
```
258-
3. Click "Deploy"
259-
4. Select Chain ID "0"
260-
5. In "Transaction Sender" select "Account" that corresponds with the account
261-
that you funded. It should be `k:<public-key>`
262-
6. Other settings should be correctly filled in as default
263-
7. Click "next"
264-
8. In "Unrestricted Signing Keys" select the `public-key` of your account
265-
9. Click "next"
266+
1. Go to the "contracts" page in Chainweaver
267+
268+
2. Write the following snippet
269+
```lisp
270+
(free.hello-world.write-hello "Albert")
271+
```
272+
273+
3. Click "Deploy"
274+
275+
4. Select Chain ID "0"
276+
277+
5. In "Transaction Sender" select "Account" that corresponds with the account
278+
that you funded. It should be `k:<public-key>`
279+
280+
6. Other settings should be correctly filled in as default
281+
282+
7. Click "next"
283+
284+
8. In "Unrestricted Signing Keys" select the `public-key` of your account
285+
286+
9. Click "next"
287+
266288
10. You'll see a Notice:
267289
268290
> A 'Gas Payer' has not been selected for this transaction. Are you sure
@@ -281,26 +303,24 @@ Execute the following function, and deploy to read the keys from the table.
281303
> **Note:** this function costs a lot as this is not something you'd usually do
282304
> in a regular transaction.
283305
284-
1. Paste the snippet in the editor
285-
```lisp
286-
(map (read free.hello-world.hello-world-table) (keys free.hello-world.hello-world-table))
287-
```
288-
2. Click "deploy"
289-
3. Change the Chain ID to 0 (as we only deployed the contract on Chain 0)
290-
4. Change the gas limit to `99999`
291-
5. Click next to the end
292-
6. In "Raw Response" you should be able to see
293-
```
294-
[{"text": "Hello, Albert!"}]
295-
```
306+
1. Paste the snippet in the editor
307+
```lisp
308+
(map (read free.hello-world.hello-world-table) (keys free.hello-world.hello-world-table))
309+
```
310+
2. Click "deploy"
311+
3. Change the Chain ID to 0 (as we only deployed the contract on Chain 0)
312+
4. Change the gas limit to `99999`
313+
5. Click next to the end
314+
6. In "Raw Response" you should be able to see
315+
[{"text": "Hello, Albert!"}]
296316
297317
## Further reading
298318
299319
Get started with the basics of Pact by reading the
300320
[Welcome to Pact](https://docs.kadena.io/learn-pact/beginner/welcome-to-pact)
301321
docs.
302322
303-
[Reference documentation of Pact](/pact/reference)
323+
[Reference documentation of Pact](https://docs.kadena.io/pact/reference)
304324
305325
A very good and complete tutorial on learning pact, with real world scenario's,
306326
is the

packages/apps/docs/src/scripts/build.mjs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { createSitemap } from './createSitemap.mjs';
88
import { createSpecs } from './createSpec.mjs';
99
import { detectBrokenLinks } from './detectBrokenLinks.mjs';
1010
import { createDocsTree } from './getdocstree.mjs';
11-
import { importAllReadmes } from './importReadme.mjs';
11+
import { importAllReadmes } from './importReadme/index.mjs';
1212
import { Spinner } from './spinner.mjs';
1313

1414
const promiseExec = promisify(exec);

packages/apps/docs/src/scripts/getdocstree.mjs

+5-1
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,12 @@ const isMarkDownFile = (name) => {
2323
};
2424

2525
export const getLastModifiedDate = async (root) => {
26+
const rootArray = root.split('/');
27+
const filename = rootArray.pop();
28+
const newRoot = rootArray.join('/');
29+
2630
const { stdout } = await promiseExec(
27-
`git log -1 --pretty="format:%ci" ${root}`,
31+
`cd ${newRoot} && git log -1 --pretty="format:%ci" ${filename}`,
2832
);
2933

3034
const date = new Date(stdout);

0 commit comments

Comments
 (0)