Skip to content

Commit

Permalink
Merge pull request #1605 from oasisprotocol/matevz/docs/fix-anchors
Browse files Browse the repository at this point in the history
docs: Fix broken anchors and Cipher Oasis CLI usage
  • Loading branch information
matevz authored Jan 11, 2024
2 parents 0a8c744 + bb0e804 commit 385af35
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 22 deletions.
8 changes: 4 additions & 4 deletions docs/contract/confidential-smart-contract.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ Since the smart contracts store is public, uploading the Wasm code is
the same as for the non-confidential ones:

```shell
oasis contracts upload hello_world.wasm
oasis contract upload hello_world.wasm
```

<!-- markdownlint-disable line-length -->
Expand All @@ -86,7 +86,7 @@ oasis contracts upload hello_world.wasm

## Confidential Instantiation and Calling

To generate an encrypted transaction, the `oasis contracts` subcommand
To generate an encrypted transaction, the `oasis contract` subcommand
expects a `--encrypted` flag. The client (`oasis` command in our case) will
generate and use an ephemeral keypair for encryption. If the original
transaction was encrypted, the returned transaction result will also be
Expand Down Expand Up @@ -122,7 +122,7 @@ instantiate our smart contract above with a single write to the contract state,
we need to raise the gas limit to `60000`:

```shell
oasis contracts instantiate CODEID '{instantiate: {initial_counter: 42}}' --encrypted --gas-limit 60000
oasis contract instantiate CODEID '{instantiate: {initial_counter: 42}}' --encrypted --gas-limit 400000
```

:::danger
Expand All @@ -146,7 +146,7 @@ calls - in this case `300,000`.
Finally, we make a confidential call:

```shell
oasis contracts call INSTANCEID '{say_hello: {who: "me"}}' --encrypted --gas-limit 60000
oasis contract call INSTANCEID '{say_hello: {who: "me"}}' --encrypted --gas-limit 400000
```

:::tip Call Format
Expand Down
6 changes: 3 additions & 3 deletions docs/contract/hello-world.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ The first deployment step that needs to be performed only once for the given
binary is uploading the Wasm binary.

```
oasis contracts upload hello_world.wasm
oasis contract upload hello_world.wasm
```

After successful execution it will show the code ID that you need to use for any
Expand All @@ -143,7 +143,7 @@ arguments. Note that the arguments depend on the contract that is being deployed
and in our hello world case we are simply taking the initial counter value.

```
oasis contracts instantiate CODEID '{instantiate: {initial_counter: 42}}'
oasis contract instantiate CODEID '{instantiate: {initial_counter: 42}}'
```

<!-- TODO: Mention how to send tokens and change the upgrade policy. -->
Expand All @@ -152,7 +152,7 @@ After successful execution it shows the instance ID that you need for calling
the instantiated contract. Next, you can test calling the contract.

```
oasis contracts call INSTANCEID '{say_hello: {who: "me"}}'
oasis contract call INSTANCEID '{say_hello: {who: "me"}}'
```

:::info Example
Expand Down
4 changes: 3 additions & 1 deletion docs/contract/prerequisites.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ described steps you will be able to start building your first smart contract
on Oasis!

If you already have everything set up, feel free to skip to the [next
chapter](hello-world.md).
chapter].

[next chapter]: hello-world.md

## Environment Setup

Expand Down
35 changes: 23 additions & 12 deletions docs/runtime/minimal-runtime.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,16 @@ Since the Runtime SDK requires a nightly version of the Rust toolchain, you need
to specify a version to use by creating a special file called
`rust-toolchain.toml` containing the following information:

![code](../../examples/runtime-sdk/minimal-runtime/rust-toolchain.toml)
<!-- markdownlint-disable line-length -->
![code toml](../../examples/runtime-sdk/minimal-runtime/rust-toolchain.toml "rust-toolchain.toml")
<!-- markdownlint-enable line-length -->

Additionally, due to the requirements of some upstream dependencies, you need to
configure Cargo to always build with specific target CPU platform features
(namely AES-NI and SSE3) by creating a `.cargo/config` file with the following
content:

```toml
```toml title=".cargo/config"
[build]
rustflags = ["-C", "target-feature=+aes,+ssse3"]
rustdocflags = ["-C", "target-feature=+aes,+ssse3"]
Expand Down Expand Up @@ -199,7 +201,7 @@ Now, let's see, if the local network was correctly initialized and the runtime
is ready:

```bash
oasis inspect node-status --network localhost
oasis network status --network localhost
```

If everything is working correctly, you should see the `"status": "ready"`
Expand Down Expand Up @@ -229,8 +231,11 @@ Now, let's add `minimal` runtime to the wallet. By default, `oasis-net-runner`
assigns ID `8000000000000000000000000000000000000000000000000000000000000000`
to the first provided runtime.

```bash
```shell
oasis paratime add localhost minimal 8000000000000000000000000000000000000000000000000000000000000000
```

```
? Description: minimal
? Denomination symbol: TEST
? Denomination decimal places: 9
Expand All @@ -242,8 +247,11 @@ other test users (check the [oasis-sdk testing source] for a complete list).
You can access the accounts by prepending `test:` literal in front of the test
user's name, for example `test:alice`.

```bash
oasis accounts show test:alice --network localhost
```shell
oasis account show test:alice --network localhost
```

```
Address: oasis1qrec770vrek0a9a5lcrv0zvt22504k68svq7kzve
Nonce: 0
Expand All @@ -261,8 +269,11 @@ Balances for all denominations:
Sending some TEST in your runtime should also work. Let's send 0.1 TEST to
Bob's address.

```bash
oasis accounts transfer 0.1 test:bob --network localhost --account test:alice
```shell
oasis account transfer 0.1 test:bob --network localhost --account test:alice
```

```
Unlock your account.
? Passphrase:
You are about to sign the following transaction:
Expand Down Expand Up @@ -321,7 +332,7 @@ to submit some transactions and perform queries.

First, create a `tests` directory and move into it, creating a Go module:

```bash
```shell
go mod init example.com/oasisprotocol/minimal-runtime-client
go mod tidy
```
Expand All @@ -334,13 +345,13 @@ Then create a `test.go` file with the following content:

Fetch the dependencies:

```bash
```shell
go get
```

And build it:

```bash
```shell
go build
```

Expand All @@ -352,7 +363,7 @@ end it will again query and display the final balances of both accounts.

To run the built client do:

```bash
```shell
./minimal-runtime-client
```

Expand Down
5 changes: 3 additions & 2 deletions docs/runtime/prerequisites.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ This chapter will show you how to install the software required for developing
a runtime and client using the Oasis SDK. After successfully completing all the
described steps you will be able to start building your first runtime!

If you already have everything set up, feel free to skip to the [next
chapter](minimal-runtime.md).
If you already have everything set up, feel free to skip to the [next chapter].

[next chapter]: minimal-runtime.md

## Environment Setup

Expand Down

0 comments on commit 385af35

Please sign in to comment.