You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: docs/add-contracts.md
+15-5
Original file line number
Diff line number
Diff line change
@@ -11,23 +11,23 @@ An example of how to add the template **starter** with the name `my_first_contra
11
11
jenesis add contract starter my_first_contract
12
12
```
13
13
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.
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.
26
26
27
27
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.
info = {performance = {max_speed = 200, unit = kph}, fuel = {consumption = 7, unit = kmpl}}
40
40
```
41
41
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.
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)
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.
Copy file name to clipboardexpand all lines: docs/deploy-contracts.md
+7-6
Original file line number
Diff line number
Diff line change
@@ -2,30 +2,31 @@
2
2
3
3
> *NOTE: ```deploy``` command is still under active development and currently only supported in MacOS*
4
4
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.
6
6
7
7
> *Note: `jenesis deploy` currently requires that each contract's directory name matches the `.wasm` file name under the `artifacts` directory.
8
8
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:
10
10
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:
12
12
13
13
```
14
-
jenesis alpha deploy profile_name
14
+
jenesis alpha deploy --profile profile_name
15
15
```
16
16
Each contract inside the specified profile will be deployed with the specified key.
17
17
18
18
2. Simply specify a certain key as an argument of the deploy command:
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`.
25
25
26
26
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
Copy file name to clipboardexpand all lines: docs/index.md
+53-10
Original file line number
Diff line number
Diff line change
@@ -14,6 +14,7 @@ There are multiple commands integrated into jenesis that allow you to perform a
14
14
-`new`
15
15
-`init`
16
16
-`add`
17
+
-`attach`
17
18
-`compile`
18
19
-`keys` (alpha)
19
20
-`deploy` (alpha)
@@ -25,23 +26,30 @@ There are multiple commands integrated into jenesis that allow you to perform a
25
26
## Create a new project
26
27
Create a project using the ```new``` command
27
28
```
28
-
jenesis new my_project
29
+
jenesis new my_project --profile my_profile
29
30
```
30
31
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:
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.
45
53
46
54
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.
47
55
@@ -52,3 +60,38 @@ jenesis init
52
60
```
53
61
54
62
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:
0 commit comments