-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: link README to ash.center (#61)
- Loading branch information
Showing
8 changed files
with
9 additions
and
362 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,52 +1 @@ | ||
# ash.avalanche filters | ||
|
||
The collection provides the following filters: | ||
|
||
- [ash.avalanche.convert](#ashavalancheconvert): convert an amount between AVAX units | ||
- [ash.avalanche.XXX_to_XXX](#ashavalanchexxx_to_xxx): convert a string between encodings | ||
|
||
## ash.avalanche.convert | ||
|
||
### Usage | ||
|
||
This filter is useful to submit transactions without errors in the number of zeros: | ||
|
||
```yaml | ||
ash.avalanche.tx: | ||
... | ||
params: | ||
... | ||
amount: "{{ 25 | ash.avalanche.convert('AVAX', 'nAVAX') | int }}" | ||
``` | ||
### Supported units | ||
| Unit | Amount in wei | | ||
| ----------------- | ------------------------------ | | ||
| `wei` | `1` | | ||
| `gwei` or `navax` | `1e9` (`1000000000`) | | ||
| `avax` or `eth` | `1e18` (`1000000000000000000`) | | ||
|
||
**Note:** The filter is not case sensitive: `ash.avalanche.convert('AVAX', 'nAVAX')` is the same as `ash.avalanche.convert('avax', 'navax')` | ||
|
||
## ash.avalanche.XXX_to_XXX | ||
|
||
### Usage | ||
|
||
This is useful to convert string between different encodings, e.g. from hexadecimal to [CB58](https://support.avax.network/en/articles/4587395-what-is-cb58). | ||
|
||
```yaml | ||
# Example of cb58_to_hex conversion | ||
- name: Convert NodeID to hexadecimal | ||
set_fact: | ||
node_id_hex: |- | ||
{{ (get_node_id_res.json.result.nodeID | split('-'))[1] | ||
| ash.avalanche.cb58_to_hex }} | ||
``` | ||
|
||
### Supported conversions | ||
|
||
- `cb58_to_hex` | ||
- `cb58_to_bytes` | ||
- `hex_to_cb58` | ||
- `hex_to_bytes` | ||
See [Filters](https://ash.center/docs/toolkit/ansible-avalanche-collection/reference/filters) for reference. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,80 +1 @@ | ||
# ash.avalanche modules | ||
|
||
The collection provides the following modules: | ||
|
||
- [ash.avalanche.tx](#ashavalanchetx) (alias: `ash.avalanche.transaction`): submit a transaction to an Avalanche network | ||
- [ash.avalanche.eth_call](#ashavalancheeth_call): `eth_call` a smart contract's function on an EVM Avalanche network | ||
|
||
## ash.avalanche.tx | ||
|
||
### Supported API methods | ||
|
||
- [Platform Chain (P-Chain) API](https://docs.avax.network/build/avalanchego-apis/p-chain): all the methods that create a transaction | ||
- [Exchange Chain (X-Chain) API](https://docs.avax.network/build/avalanchego-apis/x-chain): all the methods that create a transaction | ||
- [Contract Chain (C-Chain) API](https://docs.avax.network/build/avalanchego-apis/c-chain): only **Avalanche specific methods** (see [Avalanche Specific APIs](https://docs.avax.network/build/avalanchego-apis/c-chain/#avalanche-specific-apis)) that create a transaction | ||
|
||
**Note:** You can identify transaction methods by looking at its signature: **it returns a `txID`**. E.g. for the `avm.import` method of the X-Chain: | ||
|
||
```cpp | ||
avm.import({ | ||
to: string, | ||
sourceChain: string, | ||
username: string, | ||
password: string, | ||
}) -> { | ||
txID: string // This tells us that avm.import() creates a transaction | ||
} | ||
``` | ||
|
||
### Module arguments | ||
|
||
| Argument | Required | Type | Default value | Comment | | ||
| ----------------------- | -------- | ------ | ------------- | -------------------------------------------------------------------------------------------------------- | | ||
| `blockchain` or `chain` | Yes | `str` | `None` | Blockchain to query. Can be `P`, `X` or `C/avax` | | ||
| `method` | Yes | `str` | `None` | API method to call | | ||
| `username` | Yes | `str` | `None` | Username of the user that will pay the transaction fees (and owns addresses in case of send transaction) | | ||
| `password` | Yes | `str` | `None` | Password of the user. It is recommended to store the password in an Ansible vault. | | ||
| `params` | Yes | `raw` | `None` | Parameters of the method (except `username` and `password`) | | ||
| `http_host` | No | `str` | `'127.0.0.1'` | IP address that exposes the JSON RPC API | | ||
| `http_port` | No | `str` | `9650` | Port that exposes the JSON RPC API | | ||
| `protocol` | No | `str` | `'http'` | `http` or `https` | | ||
| `retry_if_unknown` | No | `bool` | `True` | Retry to submit the transaction in case the transaction's status is `Unknown` | | ||
| `max_retries` | No | `int` | `5` | Maximum number of retries in case the transaction's status is `Unknown` | | ||
| `wait_validation` | No | `bool` | `False` | Wait for the transaction to be validated by the network | | ||
| `wait_timeout` | No | `int` | `300` | Timeout when waiting for the transaction's validation | | ||
|
||
**Note:** `username` and `password` are not redacted in the module output (replaced by `VALUE_SPECIFIED_IN_NO_LOG_PARAMETER`). | ||
|
||
### JSON RPC endpoint construction | ||
|
||
The JSON RPC endpoint used for the API calls is constructed as follows: | ||
|
||
```jinja | ||
{{ protocol }}://{{ http_host }}:{{ http_port }}/ext/bc/{{ blockchain }} | ||
``` | ||
|
||
Some blockchains, like the C-Chain, have multiple RPC endpoints (see [Contract Chain (C-Chain) API](https://docs.avax.network/build/avalanchego-apis/c-chain/)). You have to specify the desired endpoint to use with the `blockchain` argument, e.g.: | ||
|
||
```yaml | ||
blockchain: C/avax | ||
``` | ||
### Example playbook | ||
The playbook [ash.avalanche.transfer_avax](../../playbooks/transfer_avax.yml) is provided as an example of how to use the `ash.avalanche.tx` module. See [ansible-avalanche-getting-started](https://github.com/AshAvalanche/ansible-avalanche-getting-started) for more. | ||
|
||
## ash.avalanche.eth_call | ||
|
||
### Module arguments | ||
|
||
| Argument | Required | Type | Default value | Comment | | ||
| --------------- | -------- | ----- | ------------- | --------------------------------------------------------------------------------------- | | ||
| `rpc_url` | Yes | `str` | `None` | RPC endpoint to call | | ||
| `contract_addr` | Yes | `str` | `None` | Address of the smart contract to query (in `0x...` format) | | ||
| `abi` | Yes | `str` | `None` | JSON ABI of the smart contract. Can be retrieved from [Snowtrace](https://snowtrace.io) | | ||
| `function_sig` | Yes | `str` | `None` | Signature of the function to call. Looks like `foo(uint32,bool)` | | ||
| `parameters` | Yes | `raw` | `None` | List of parameters of the functions. | | ||
|
||
### Example playbook | ||
|
||
The playbook [ash.avalanche.node/ash-node](../../roles/node/tasks/ash-node.yml) makes use of this plugin to enrich the node configuration with on-chain data. | ||
See [Modules](https://ash.center/docs/toolkit/ansible-avalanche-collection/reference/modules) for reference. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1 @@ | ||
# ash.avalanche.blockchain | ||
|
||
This Ansible role allows to create an Avalanche blockchain. | ||
|
||
## Role variables | ||
|
||
| Variable | Comment | Default value | | ||
| --------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------- | | ||
| `avalanchego_http_host` | [--http-host](https://docs.avax.network/build/references/avalanchego-config-flags#--http-host-string) argument | `127.0.0.1` | | ||
| `avalanchego_http_port` | [--http-port](https://docs.avax.network/build/references/avalanchego-config-flags#--http-port-int) argument | `9650` | | ||
| `avalanchego_https_enabled` | Whether the HTTP API endpoints are using TLS or not | `false` | | ||
| `subnet_id` | | `aUC7SX8QGVwsbwS4YNuavVTbinjJLrPjNNjdpZbbcFZZFSxFd` | | ||
| `subnet_control_username` | | `ewoq` | | ||
| `subnet_control_password` | | `I_l1ve_@_Endor` | | ||
| `blockchain_vm` | The VM used by the blockchain. See [Available VMs and AvalancheGo compatibility](../node/README.md#available-vms-and-avalanchego-compatibility) for the names to use. | `timestampvm` | | ||
| `blockchain_name` | The blockchain name. | `Timestamp Chain` | | ||
| `blockchain_aliases` | The aliases to be linked to this blockchain. See [VM Configs](https://docs.avax.network/build/references/avalanchego-config-flags#vm-configs). | `['timestamp']` | | ||
| `blockchain_genesis_params` | The params passed to the gensis function of the VM to build the blockchain genesis state. See [Create the Genesis Data](https://docs.avax.network/build/tutorials/platform/subnets/create-custom-blockchain#create-the-genesis-data). | `{'data': 'Hello world'}` | | ||
|
||
## Inventory requirements | ||
|
||
- **The node used to make API calls** have to be in the `subnet_control_node` group. | ||
- **The Subnet validators** have to be in the `subnet_validators` group. The Ansible host has to be able to connect to those nodes via SSH (to create blockchain aliases. | ||
|
||
## How to? | ||
|
||
See [ansible-avalanche-getting-started](https://github.com/AshAvalanche/ansible-avalanche-getting-started) for how to create a blockchain. | ||
See [ash.avalanche.blockchain](https://ash.center/docs/toolkit/ansible-avalanche-collection/reference/roles/avalanche-blockchain) for reference. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
See [ash.avalanche.blockscout](https://ash.center/docs/toolkit/ansible-avalanche-collection/reference/roles/avalanche-blockscout) for reference. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1 @@ | ||
# ash.avalanche.faucet | ||
|
||
This Ansible role allows to deploy the [Avalanche Faucet](https://github.com/ava-labs/avalanche-faucet) as a Docker service. | ||
|
||
| Variable | Comment | Default value | | ||
| -------------------------------- | -------------------------------------------------------------------------------------------------------------------- | ----------------------------------- | | ||
| `avalanche_faucet_image` | Base image of the Avalanche faucet | `ghcr.io/ashavalanche/faucet-image` | | ||
| `avalanche_faucet_image_version` | Tag to be used | `disable-captcha-variable` | | ||
| `avalanche_faucet_conf_dir` | Where to store the faucet config files | `/etc/avalanche/faucet/conf` | | ||
| `avalanche_faucet_log_dir` | Where to store the faucet logs | `/var/log/avalanche/faucet` | | ||
| `avalanche_faucet_user` | User that will run the faucet | `faucet` | | ||
| `avalanche_faucet_group` | Group of the user running the faucet | `faucet` | | ||
| `avalanche_faucet_docker_group` | Docker group of the target host | `docker` | | ||
| `avalanche_faucet_port` | Port on which the faucet will attach on the target host | `8000` | | ||
| `avalanche_faucet_chains` | Config file for the faucet (see [docs](https://github.com/ava-labs/avalanche-faucet#setup-evm-chain-configurations)) | NA | | ||
| `avalanche_faucet_env` | Env file for the faucet (see [docs](https://github.com/ava-labs/avalanche-faucet#setup-environment-variables)) | NA | | ||
|
||
## Inventory requirements | ||
|
||
- The host on which to install the faucet have to be in the `faucet` group. | ||
|
||
## How to? | ||
|
||
See the [Subnet faucet](https://docs.ash.center/docs/tools/ansible-avalanche-collection/tutorials/subnet-faucet) tutorial to learn how to deploy the Avalanche Faucet. | ||
See [ash.avalanche.faucet](https://ash.center/docs/toolkit/ansible-avalanche-collection/reference/roles/avalanche-faucet) for reference. |
Oops, something went wrong.