Skip to content

Commit dd95b39

Browse files
docs: jenesis v2 updates (#67)
* docs: jenesis v2 updates * docs: small fix * docs: small update * docs: minor changes * docs: contract profile updates * docs: minor attach text change * docs: fix quote typo Co-authored-by: James Riehl <[email protected]>
1 parent 19c932a commit dd95b39

File tree

5 files changed

+97
-21
lines changed

5 files changed

+97
-21
lines changed

docs/add-contracts.md

+15-5
Original file line numberDiff line numberDiff line change
@@ -11,23 +11,23 @@ An example of how to add the template **starter** with the name `my_first_contra
1111
jenesis add contract starter my_first_contract
1212
```
1313

14-
This ```add contract``` command will add a contract template to your jenesis project inside `contracts/my_first_contract/` folder. It will also update the `jenesis.toml` configuration file with the contract information:
14+
This ```add contract``` command will add a contract template to your jenesis project inside `contracts/my_first_contract/` folder. It will also update the `jenesis.toml` configuration file with the contract information under all existing profiles.
1515

1616
```
17-
[profile.testing.contracts.my_first_contract]
17+
[profile.my_profile.contracts.my_first_contract]
1818
contract = "my_first_contract"
1919
network = "fetchai-testnet"
2020
deployer_key = ""
2121
22-
[profile.testing.contracts.my_first_contract.init]
22+
[profile.my_profile.contracts.my_first_contract.init]
2323
count = ""
2424
```
2525
The `deployer_key` field can be manually specified, you can choose any private key locally available to deploy any specific contract. You can also leave this field empty since the ```deploy``` command has an optional argument to deploy all contracts inside a specified profile with the same key, overriding this `deployer_key` argument in the `jenesis.toml` file. See [deploy contracts](deploy-contracts.md) for more information.
2626

2727
Finally, the `init` section contains the parameters needed in the instantiation message for this contract to be deployed. The required parameters are taken from the `instantiate_msg.json` file inside the `contracts` directory. You will need to manually add the values for these parameters in their correct variable type, which are listed in `contracts/my_first_contract/schema/instantiate_msg.json`. For this contract **my_first_contract** we need to add an integer value to the `count` field.
2828

2929
```
30-
[profile.testing.contracts.my_first_contract.init]
30+
[profile.my_profile.contracts.my_first_contract.init]
3131
count = 10
3232
```
3333

@@ -39,4 +39,14 @@ price = {amount = 1000, denom = DLS}
3939
info = {performance = {max_speed = 200, unit = kph}, fuel = {consumption = 7, unit = kmpl}}
4040
```
4141

42-
You can also add contracts manually by copying and pasting the contract directory from another project you may have, however, they need to follow the same directory structure as the **starter** template mentioned above. If you add a contract manually, you will need to run ```jenesis init``` again to update the `jenesis.toml` configuration file.
42+
You can also add contracts manually by copying and pasting the contract directory from another project you may have, however, they need to follow the same directory structure as the **starter** template mentioned above.
43+
44+
# Attach deployed contracts
45+
46+
If you have added a contract into the project's contract folder that has already been deployed in the network, you can attach it to your project for future interaction using the ```attach``` command. You will need to specify the contract's name and deployment address. You can optionally specify the profile where you wish to insert the contract into. If this is not specified, the deployment will be attached to the default profile, which is the first profile created in your project, unless the `default` settings are manually changed.
47+
48+
```
49+
jenesis attach my_first_contract fetch18xs97q6h9zgh4sz730a42pp0dqa9sh4eef7eutfkv69q3v2y3x8s72pkua
50+
```
51+
52+
This will add the relevant deployment information into a `jenesis.lock` file and you will now be able to interact with `my_first_contract` using [contract interactions](use-contracts.md)

docs/add-profile.md

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
You can add more profiles than the one specified using the ```new``` command by running the following ```add profile``` command:
2+
3+
```
4+
jenesis add profile my_second_profile
5+
```
6+
By default, the profile's network will be set to `fetchai-testnet`, but you can specify it using the `--network` optional argument. The following will be added to the existing information in your `jenesis.toml` file:
7+
8+
```toml
9+
[profile.my_second_profile.network]
10+
name = "fetchai-testnet"
11+
chain_id = "dorado-1"
12+
fee_minimum_gas_price = 5000000000
13+
fee_denomination = "atestfet"
14+
staking_denomination = "atestfet"
15+
url = "grpc+https://grpc-dorado.fetch.ai"
16+
faucet_url = "https://faucet-dorado.fetch.ai"
17+
is_local = false
18+
19+
[profile.my_second_profile.contracts]
20+
```
21+
If there are existing contracts in your project, all of them will be added to the new profile.

docs/deploy-contracts.md

+7-6
Original file line numberDiff line numberDiff line change
@@ -2,30 +2,31 @@
22

33
> *NOTE: ```deploy``` command is still under active development and currently only supported in MacOS*
44
5-
Once you have successfully compiled your contracts, make sure to fill out the necessary instantiation message information under the `init` field in the `jenesis.toml` file.
5+
Once you have successfully compiled your contracts, make sure to fill out the necessary instantiation message information under the `init` field in the `jenesis.toml` file, you can deploy your contracts.
66

77
> *Note: `jenesis deploy` currently requires that each contract's directory name matches the `.wasm` file name under the `artifacts` directory.
88
9-
To deploy all the contracts inside a certain profile you have two options:
9+
To deploy all the contracts inside a profile you have two options:
1010

11-
1. Fill the `deployer_key` field for each contract (they can be different) and run the following command:
11+
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:
1212

1313
```
14-
jenesis alpha deploy profile_name
14+
jenesis alpha deploy --profile profile_name
1515
```
1616
Each contract inside the specified profile will be deployed with the specified key.
1717

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

2020
```
21-
jenesis alpha deploy profile_name key_name
21+
jenesis alpha deploy key_name --profile profile_name
2222
```
2323

2424
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`.
2525

2626
After running either of the commands mentioned above, all the deployment information will be saved in the `jenesis.lock` file inside your project's directory
2727

28-
```
28+
29+
```toml
2930
[profile.testing.my_first_contract]
3031
checksum = "ecf640a7512be3777c72ec42aff01fdb22897b71953011af3c41ee5dbf3d3bc5"
3132
digest = "be4a4bdfeb4ed8f504c7b7ac84e31ad3876627398a6586b49cac586633af8b85"

docs/index.md

+53-10
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ There are multiple commands integrated into jenesis that allow you to perform a
1414
- `new`
1515
- `init`
1616
- `add`
17+
- `attach`
1718
- `compile`
1819
- `keys` (alpha)
1920
- `deploy` (alpha)
@@ -25,23 +26,30 @@ There are multiple commands integrated into jenesis that allow you to perform a
2526
## Create a new project
2627
Create a project using the ```new``` command
2728
```
28-
jenesis new my_project
29+
jenesis new my_project --profile my_profile
2930
```
3031

31-
This will create a new directory called `my_project`. Inside this directory a `jenesis.toml` file will be created containing the following information:
32+
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:
3233

33-
```
34+
```toml
3435
[project]
3536
name = "my_project"
36-
authors = [Alice Tyler <[email protected]>]
37-
38-
[profile.testing]
39-
network = "fetchai-testnet"
40-
41-
[profile.testing.contracts]
37+
authors = [ "Alice Tyler <[email protected]>",]
38+
39+
[profile.my_profile.network]
40+
name = "fetchai-testnet"
41+
chain_id = "dorado-1"
42+
fee_minimum_gas_price = 5000000000
43+
fee_denomination = "atestfet"
44+
staking_denomination = "atestfet"
45+
url = "grpc+https://grpc-dorado.fetch.ai"
46+
faucet_url = "https://faucet-dorado.fetch.ai"
47+
is_local = false
48+
49+
[profile.my_profile.contracts]
4250
```
4351

44-
The project name is the argument passed to the ```new``` command while the authors field is populated by querying the user's GitHub username and email address. The profile network is automatically set to `fetchai-testnet`. The contracts field will remain empty until new contracts are added.
52+
The project name is the argument passed to the ```new``` command while the authors field is populated by querying the user's GitHub username and email address. The profile's network will be filled with the relevant configuration variables. The contracts field will remain empty until new contracts are added.
4553

4654
An empty `contracts` folder will also be created inside `my_project` directory that will eventually contain all the information needed to compile and deploy the desired contracts.
4755

@@ -52,3 +60,38 @@ jenesis init
5260
```
5361

5462
This command will create the same files and folders inside your project directory as the ones described for the ```new``` command.
63+
64+
## Configure a network
65+
66+
By default, jenesis will configure the project to run on the latest stable Fetch.ai testnet. To test on a local node instead, pass the argument `--network fetchai-localnode` when creating a project:
67+
```
68+
jenesis new my_project --network fetchai-localnode
69+
```
70+
or
71+
```
72+
jenesis init --network fetchai-localnode
73+
```
74+
75+
The configuration can be found under the `network` heading in the `jenesis.toml` file and can be changed as desired:
76+
77+
```toml
78+
[profile.testing.network]
79+
name = "fetchai-localnode"
80+
chain_id = "localnode"
81+
fee_minimum_gas_price = 5000000000
82+
fee_denomination = "atestfet"
83+
staking_denomination = "atestfet"
84+
url = "grpc+http://127.0.0.1:9090/"
85+
is_local = true
86+
cli_binary = "fetchd"
87+
validator_key_name = "validator"
88+
mnemonic = "gap bomb bulk border original scare assault pelican resemble found laptop skin gesture height inflict clinic reject giggle hurdle bubble soldier hurt moon hint"
89+
password = "12345678"
90+
moniker = "test-node"
91+
genesis_accounts = [ "fetch1vas6cc9650z0s08230ytqjphgzl5tcq9crqhhu",]
92+
```
93+
In particular, to fund some accounts for testing, replace the `genesis_accounts`
94+
field with the addresses to be funded.
95+
96+
When running any of the commands `deploy`, `run`, `shell`, and `attach`,
97+
jenesis will check for a currently running local node, and if there is none, a new one will be created in a docker container.

mkdocs.yml

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ site_author: [email protected]
88
nav:
99
- Getting started: 'index.md'
1010
- Working with contracts:
11+
- Add profiles: 'add-profile.md'
1112
- Add contracts: 'add-contracts.md'
1213
- Compile contracts: 'compile-contracts.md'
1314
- Deploy contracts: 'deploy-contracts.md'

0 commit comments

Comments
 (0)