Skip to content

Commit

Permalink
docs: update for latest features and system requirements (#205)
Browse files Browse the repository at this point in the history
* docs: update system requirements

* chore: update python version

* docs: update docs for latest features
  • Loading branch information
jrriehl authored Jan 18, 2023
1 parent b70e113 commit 78d6ecd
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 14 deletions.
8 changes: 4 additions & 4 deletions docs/add-contracts.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Once you have successfully created your project, you can add contract templates. You first need to navigate to your project's directory and run the following command:

```
jenesis add contract <TEMPLATE> <CONTRACT NAME>
jenesis add contract <template> <contract_name>
```
You can find all the contract templates available in [Jenesis Templates](https://github.com/fetchai/jenesis-templates).
An example of how to add the template **cw20-base** with the name `my_token` is given below:
Expand All @@ -11,9 +11,9 @@ An example of how to add the template **cw20-base** with the name `my_token` is
jenesis add contract cw20-base my_token
```

If you need multiple deployments of the same contract, you can use the `-d` flag to specify multiple deployments and name them.
If you need multiple deployments of the same contract, you can use the `--deployments` or `-d` flag to specify multiple deployments and name them.
```
jenesis add contract <TEMPLATE> <CONTRACT NAME> -d <DEPLOYMENTS>
jenesis add contract <template> <contract_name> [--deployments <deployments>]
```
Jenesis will add the deployments to all profiles for the specified contract.
In the example below, `token_1` and `token_2` deployments have been added. This will allow you to deploy `my_token` contract with two different configurations. You can add as many deployments as you wish.
Expand Down Expand Up @@ -112,4 +112,4 @@ To attach the contract, you will need to specify the deployment's name and addre
jenesis attach token_1 fetch18xs97q6h9zgh4sz730a42pp0dqa9sh4eef7eutfkv69q3v2y3x8s72pkua
```

This will add the relevant deployment information into a `jenesis.lock` file and you will now be able to interact with `token_1` using [contract interactions](use-contracts.md)
This will add the relevant deployment information into a `jenesis.lock` file and you will now be able to interact with `token_1` using [contract interactions](use-contracts.md).
4 changes: 2 additions & 2 deletions docs/compile-contracts.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ Compile your contracts by running the following command inside your
project directory:

```
jenesis compile
jenesis compile [--optimize] [--rebuild] [--no-log]
```
This will compile all packages in your project's contracts directory and output the wasm code under the artifacts directory. If using a cargo workspace, jenesis will automatically detect this and the compiled contracts will appear in the `contracts/artifacts/`. Otherwise, they will go to the `artifacts` directory under the individual contracts.

By default, the contracts are simply compiled and not optimized. For an optimized build, use the flag `--optimize` or `-o`. To force a rebuild, use the flag `--rebuild` or `-r`. To show contract compilation logs, use the flag `--log` or `-l`. In case of compilation failure, the logs will show by default.
By default, the contracts are simply compiled and not optimized. For an optimized build, use the flag `--optimize` or `-o`. To force a rebuild, use the flag `--rebuild` or `-r`. To suppress contract compilation logs, use the flag `--no-log`. In case of compilation failure, the logs will show by default.

> *Note: ```jenesis compile``` requires that docker is running and configured with permissions for your user.*
4 changes: 2 additions & 2 deletions docs/deploy-contracts.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ To deploy all the contracts inside a profile you have two options:
1. Fill the `deployer_key` field for each contract inside the `jenesis.toml` file (keys can be different for each contract) and run the following command:

```
jenesis deploy --profile profile_name
jenesis deploy [--profile profile_name]
```
Each contract inside the specified profile will be deployed with the specified key.

2. Simply specify a certain key as an argument of the deploy command:

```
jenesis deploy key_name --profile profile_name
jenesis deploy key_name [--profile profile_name]
```

The `deployer_key` field will be ignored in this case and all contracts inside the specified profile will be deployed using the key `key_name`.
Expand Down
36 changes: 30 additions & 6 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,24 @@
# Introduction

Jenesis is a command line tool for rapid contract and service development for the Fetch.ai blockchain ecosystem and other CosmWasm-enabled blockchains.

# System Requirements

Jenesis currently requires:
- OS: Linux, MacOS
- Python: 3.8 to 3.10
- Docker: 20.10.22 or higher recommended
- git: Any

# Installation

Install jenesis for Python 3.7 or newer via PyPI:
Install via PyPI:

```
pip install jenesis
```

# Getting Started
# Getting started
There are multiple commands integrated into jenesis that allow you to perform a variety of tasks these commands are:

- `new`
Expand All @@ -26,10 +36,10 @@ There are multiple commands integrated into jenesis that allow you to perform a
## Create a new project
Create a project using the ```new``` command
```
jenesis new my_project --profile my_profile
jenesis new my_project [--profile my_profile] [--network network_name]
```

This will create a new directory called `my_project`. You can use `--profile` and `--network` optional arguments, when they aren't used, profile and network will be set to `testing` and `fetchai-testnet` respectively. Inside this directory a `jenesis.toml` file will be created containing the following information:
This will create a new directory called `my_project`. You can use `--profile` and `--network` optional arguments; when they aren't used, profile and network will be set to `testing` and `fetchai-testnet` respectively. Inside this directory a `jenesis.toml` file will be created containing the following information:

```toml
[project]
Expand Down Expand Up @@ -60,7 +70,7 @@ An empty `contracts` folder will also be created inside `my_project` directory t
The ```init``` command is similar to the ```new``` command, but in this case, you won't need a project name argument since this command is intended to run inside an existing project directory.

```
jenesis init
jenesis init [--profile my_profile] [--network network_name]
```

This command will create the same files and folders inside your project directory as the ones described for the ```new``` command.
Expand Down Expand Up @@ -98,6 +108,8 @@ mnemonic = "gap bomb bulk border original scare assault pelican resemble found l
password = "12345678"
moniker = "test-node"
genesis_accounts = [ "fetch1vas6cc9650z0s08230ytqjphgzl5tcq9crqhhu",]
timeout_commit = "5s"
debug_trace = true
```
In particular, to fund some accounts for testing, replace the `genesis_accounts`
field with the addresses to be funded.
Expand All @@ -106,4 +118,16 @@ When running any of the commands `deploy`, `run`, `shell`, and `attach`,
jenesis will check for a currently running local node, and if there is none, a new one will be created in a docker container.
If you wish to keep a local node running, you need to set the `keep_running` parameter to `true`. Otherwise, nodes will be stopped after any of the command mentioned above finish running.

At any time, you can start or stop a local node by running `jenesis network start/stop --profile <PROFILE>`
At any time, you can start or stop a local node by running:
```
jenesis network start [--profile my_profile]
```
or
```
jenesis network stop [--profile my_profile]
```

To view the logs from the local node, run:
```
jenesis network logs [--profile my_profile]
```
5 changes: 5 additions & 0 deletions docs/use-contracts.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,4 +147,9 @@ jenesis run script.py

And you will observe the same output as before. You can also specify the profile as an optional argument using `--profile`.

Finally, you can pass arguments to the script just as you would to a standard python script by placing all the arguments to the script after the `--` delimiter:
```
jenesis run script.py [--profile profile_name] -- arg1 arg2 --key1 value1 --key2 value2
```

You can visit [CosmPy](https://docs.fetch.ai/CosmPy/) for more contract interaction examples.

0 comments on commit 78d6ecd

Please sign in to comment.