diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 62496cc7a9..e83727fd4d 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -16,13 +16,14 @@ jobs: - uses: actions/checkout@master - uses: actions/setup-python@v3 with: - python-version: 3.7 + python-version: 3.9 - name: Install dependencies (ubuntu-latest) run: | sudo apt-get update --fix-missing + sudo apt-get install libmbedtls-dev sudo apt-get autoremove sudo apt-get autoclean - pip install pipenv + sudo pip install pipenv - name: Pipenv install requirements and check it can be locked run: | pipenv install --dev --skip-lock --clear @@ -61,6 +62,7 @@ jobs: - name: Install dependencies (ubuntu-latest) run: | sudo apt-get update --fix-missing + sudo apt-get install libmbedtls-dev sudo apt-get autoremove sudo apt-get autoclean pip install tox @@ -106,6 +108,7 @@ jobs: - name: Install dependencies (ubuntu-latest) run: | sudo apt-get update --fix-missing + sudo apt-get install libmbedtls-dev sudo apt-get autoremove sudo apt-get autoclean pip install tox @@ -128,6 +131,7 @@ jobs: - name: Install dependencies (ubuntu-latest) run: | sudo apt-get update --fix-missing + sudo apt-get install libmbedtls-dev sudo apt-get autoremove sudo apt-get autoclean pip install tox @@ -179,6 +183,7 @@ jobs: - name: Install dependencies (ubuntu-latest) run: | sudo apt-get update --fix-missing + sudo apt-get install libmbedtls-dev sudo apt-get autoremove sudo apt-get autoclean pip install tox @@ -196,7 +201,7 @@ jobs: strategy: matrix: os: [ubuntu-latest, macos-latest, windows-latest] - python_version: [3.6] + python_version: [3.7] timeout-minutes: 10 runs-on: ${{ matrix.os }} steps: @@ -204,6 +209,13 @@ jobs: - uses: actions/setup-python@v3 with: python-version: ${{ matrix.python_version }} + - if: matrix.os == 'ubuntu-latest' + name: Install dependencies (ubuntu-latest) + run: | + sudo apt-get update --fix-missing + sudo apt-get install libmbedtls-dev + sudo apt-get autoremove + sudo apt-get autoclean - name: Install tox run : | pip install tox @@ -226,7 +238,7 @@ jobs: - { os: windows-latest, shell: 'msys2 {0}' } - { os: ubuntu-latest, shell: bash } - { os: macos-latest, shell: bash } - python_version: [3.6] + python_version: [3.7] timeout-minutes: 10 steps: - uses: actions/checkout@master @@ -235,6 +247,13 @@ jobs: - uses: actions/setup-python@v3 with: python-version: ${{ matrix.python_version }} + - if: matrix.os == 'ubuntu-latest' + name: Install dependencies (ubuntu-latest) + run: | + sudo apt-get update --fix-missing + sudo apt-get install libmbedtls-dev + sudo apt-get autoremove + sudo apt-get autoclean - name: Install tox run : | pip install tox @@ -300,6 +319,7 @@ jobs: - name: Install dependencies (ubuntu-latest) run: | sudo apt-get update --fix-missing + sudo apt-get install libmbedtls-dev sudo apt-get autoremove sudo apt-get autoclean pip install tox @@ -368,7 +388,7 @@ jobs: strategy: matrix: os: [ubuntu-latest, macos-latest, windows-latest] - python_version: [3.6, 3.7, 3.8, 3.9, '3.10'] + python_version: [3.7, 3.8, 3.9, '3.10'] timeout-minutes: 90 steps: - uses: actions/checkout@master @@ -382,6 +402,7 @@ jobs: name: Install dependencies (ubuntu-latest) run: | sudo apt-get update --fix-missing + sudo apt-get install libmbedtls-dev sudo apt-get autoremove sudo apt-get autoclean pip install tox @@ -455,6 +476,7 @@ jobs: - name: Install dependencies (ubuntu-latest) run: | sudo apt-get update --fix-missing + sudo apt-get install libmbedtls-dev sudo apt-get autoremove sudo apt-get autoclean pip install tox @@ -519,6 +541,7 @@ jobs: - name: Install dependencies (ubuntu-latest) run: | sudo apt-get update --fix-missing + sudo apt-get install libmbedtls-dev sudo apt-get autoremove sudo apt-get autoclean sudo apt-get install make -y @@ -554,6 +577,7 @@ jobs: - name: Install dependencies (ubuntu-latest) run: | sudo apt-get update --fix-missing + sudo apt-get install libmbedtls-dev sudo apt-get autoremove sudo apt-get autoclean pip install tox diff --git a/HISTORY.md b/HISTORY.md index 654b770121..37df21b8fe 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -1,6 +1,19 @@ # Release History +## 1.2.1 (2022-07-12) + +AEA: +- Protocol generator uses int64 instead of int32 +- Dependencies versions updates + +Plugins: +- Upgrades fetchai plugin to use cosmpy>=0.5.0 +- Upgrades cosmos plugin to use cosmpy>=0.5.0 + +Packages: +- Fixes for skills to work with dorado testnet (tx fee adjusted) + ## 1.2.0 (2022-05-05) AEA: diff --git a/Pipfile b/Pipfile index 09cea963e3..77ded774f0 100644 --- a/Pipfile +++ b/Pipfile @@ -10,18 +10,18 @@ name = "test-pypi" [dev-packages] # we fix exact versions as it's sufficient to have at least one set of compatible dependencies for development -aiohttp = "==3.7.4" +aiohttp = ">=3.7.4,<3.8" asn1crypto = "==1.4.0" -aioprometheus = "==20.0.1" +aioprometheus = ">=20.0.0,<21.0.0" bandit = "==1.7.0" bech32 = "==1.2.0" black = "==19.10b0" bs4 = "==0.0.1" colorlog = "==4.1.0" -darglint = "==1.8.0" -defusedxml = "==0.6.0" +darglint = "==1.8.1" +defusedxml = "==0.7.1" docker = "==4.2.0" -ecdsa = ">=0.15" +ecdsa = "==0.17.0" eth-account = "==0.5.2" flake8 = "==3.7.9" flake8-bugbear = "==20.1.4" @@ -48,7 +48,7 @@ openapi-spec-validator = "==0.2.8" packaging = ">=20.4,<=21.5" pexpect = "==4.8.0" psutil = "==5.7.0" -pycryptodome = ">=3.10.1" +pycryptodome = "==3.15.0" pydoc-markdown = "==3.10.3" pydocstyle = "==3.0.0" pygments = "==2.7.4" @@ -65,13 +65,17 @@ safety = "==1.10.3" scikit-image = ">=0.17.2" sqlalchemy = "==1.4.17" temper-py = "==0.0.3" -tensorflow = "==2.8.0" +tensorflow = "==2.8.1" tox = "==3.15.1" vulture = "==2.3" isort = "==5.7.0" web3 = "==5.12.0" yoti = "==2.14.0" -cosmpy = ">=0.4.1,<0.5.0" +blspy = "==1.0.14" +bip-utils = "==2.5.1" +python-mbedtls = "==2.2.0" +py-sr25519-bindings = "==0.1.4" +cosmpy = ">=0.5.0,<0.6.0" [packages] # we don't specify dependencies for the library here for intallation as per: https://pipenv-fork.readthedocs.io/en/latest/advanced.html#pipfile-vs-setuppy diff --git a/aea/__version__.py b/aea/__version__.py index 59dfa971e9..a0ed0f4c39 100644 --- a/aea/__version__.py +++ b/aea/__version__.py @@ -22,7 +22,7 @@ __title__ = "aea" __description__ = "Autonomous Economic Agent framework" __url__ = "https://github.com/fetchai/agents-aea.git" -__version__ = "1.2.0" +__version__ = "1.2.1" __author__ = "Fetch.AI Limited" __license__ = "Apache-2.0" __copyright__ = "2022 Fetch.AI Limited" diff --git a/aea/protocols/generator/common.py b/aea/protocols/generator/common.py index f11b3fa8a3..7dd6681878 100644 --- a/aea/protocols/generator/common.py +++ b/aea/protocols/generator/common.py @@ -67,7 +67,7 @@ PYTHON_TYPE_TO_PROTO_TYPE = { "bytes": "bytes", - "int": "int32", + "int": "int64", "float": "float", "bool": "bool", "str": "string", diff --git a/docs/aggregation-demo.md b/docs/aggregation-demo.md index 750ea7464d..ebbe6d40bf 100644 --- a/docs/aggregation-demo.md +++ b/docs/aggregation-demo.md @@ -19,7 +19,7 @@ Repeat the following process four times in four different terminals (for each {` Fetch the aggregator AEA: ``` bash agent_name="agg$i" -aea fetch fetchai/simple_aggregator:0.5.0 --alias $agent_name +aea fetch fetchai/simple_aggregator:0.5.1 --alias $agent_name cd $agent_name aea install aea build @@ -34,15 +34,15 @@ Create the AEA. agent_name="agg$i" aea create agent_name cd agent_name -aea add connection fetchai/http_client:0.24.1 -aea add connection fetchai/http_server:0.23.1 -aea add connection fetchai/p2p_libp2p:0.27.0 -aea add connection fetchai/soef:0.27.1 -aea add connection fetchai/prometheus:0.9.1 -aea add skill fetchai/advanced_data_request:0.7.1 -aea add skill fetchai/simple_aggregation:0.3.1 - -aea config set agent.default_connection fetchai/p2p_libp2p:0.27.0 +aea add connection fetchai/http_client:0.24.2 +aea add connection fetchai/http_server:0.23.2 +aea add connection fetchai/p2p_libp2p:0.27.1 +aea add connection fetchai/soef:0.27.2 +aea add connection fetchai/prometheus:0.9.2 +aea add skill fetchai/advanced_data_request:0.7.2 +aea add skill fetchai/simple_aggregation:0.3.2 + +aea config set agent.default_connection fetchai/p2p_libp2p:0.27.1 aea install aea build ``` @@ -64,7 +64,7 @@ aea config set --type bool vendor.fetchai.skills.advanced_data_request.models.ad Set the cert requests for the peer-to-peer connection: ``` bash aea config set --type list vendor.fetchai.connections.p2p_libp2p.cert_requests \ -'[{"identifier": "acn", "ledger_id": "fetchai", "not_after": "2022-01-01", "not_before": "2021-01-01", "public_key": "fetchai", "message_format": "{public_key}", "save_path": ".certs/conn_cert.txt"}]' +'[{"identifier": "acn", "ledger_id": "fetchai", "not_after": "2023-01-01", "not_before": "2022-01-01", "public_key": "fetchai", "message_format": "{public_key}", "save_path": ".certs/conn_cert.txt"}]' ``` Match the agent index `i` to the `COIN_URL` and `JSON_PATH` below: @@ -126,8 +126,8 @@ aea config set vendor.fetchai.connections.http_server.config.port $((8000+i)) To publish the aggregated value to an oracle smart contract, add the ledger connection and simple oracle skill to one of the aggregators: ``` bash -aea add connection fetchai/ledger:0.21.0 -aea add skill fetchai/simple_oracle:0.16.0 +aea add connection fetchai/ledger:0.21.1 +aea add skill fetchai/simple_oracle:0.16.1 ``` Configure the simple oracle skill for the `fetchai` ledger: diff --git a/docs/aries-cloud-agent-demo.md b/docs/aries-cloud-agent-demo.md index d5c1b1311c..bee14d0135 100644 --- a/docs/aries-cloud-agent-demo.md +++ b/docs/aries-cloud-agent-demo.md @@ -180,7 +180,7 @@ Now you can create **Alice_AEA** and **Faber_AEA** in terminals 3 and 4 respecti In the third terminal, fetch **Alice_AEA** and move into its project folder: ``` bash -aea fetch fetchai/aries_alice:0.32.0 +aea fetch fetchai/aries_alice:0.32.1 cd aries_alice ``` @@ -191,11 +191,11 @@ The following steps create Alice_AEA from scratch: ``` bash aea create aries_alice cd aries_alice -aea add connection fetchai/p2p_libp2p:0.27.0 -aea add connection fetchai/soef:0.27.1 -aea add connection fetchai/http_client:0.24.1 -aea add connection fetchai/webhook:0.20.1 -aea add skill fetchai/aries_alice:0.26.1 +aea add connection fetchai/p2p_libp2p:0.27.1 +aea add connection fetchai/soef:0.27.2 +aea add connection fetchai/http_client:0.24.2 +aea add connection fetchai/webhook:0.20.2 +aea add skill fetchai/aries_alice:0.26.2 ```

@@ -257,14 +257,14 @@ Finally run **Alice_AEA**: aea run ``` -Once you see a message of the form `To join its network use multiaddr 'SOME_ADDRESS'` take note of the address. (Alternatively, use `aea get-multiaddress fetchai -c -i fetchai/p2p_libp2p:0.27.0 -u public_uri` to retrieve the address.) We will refer to this as **Alice_AEA's P2P address**. +Once you see a message of the form `To join its network use multiaddr 'SOME_ADDRESS'` take note of the address. (Alternatively, use `aea get-multiaddress fetchai -c -i fetchai/p2p_libp2p:0.27.1 -u public_uri` to retrieve the address.) We will refer to this as **Alice_AEA's P2P address**. ### Faber_AEA In the fourth terminal, fetch **Faber_AEA** and move into its project folder: ``` bash -aea fetch fetchai/aries_faber:0.32.0 +aea fetch fetchai/aries_faber:0.32.1 cd aries_faber ``` @@ -275,11 +275,11 @@ The following steps create Faber_AEA from scratch: ``` bash aea create aries_faber cd aries_faber -aea add connection fetchai/p2p_libp2p:0.27.0 -aea add connection fetchai/soef:0.27.1 -aea add connection fetchai/http_client:0.24.1 -aea add connection fetchai/webhook:0.20.1 -aea add skill fetchai/aries_faber:0.24.0 +aea add connection fetchai/p2p_libp2p:0.27.1 +aea add connection fetchai/soef:0.27.2 +aea add connection fetchai/http_client:0.24.2 +aea add connection fetchai/webhook:0.20.2 +aea add skill fetchai/aries_faber:0.24.1 ```

diff --git a/docs/assets/logo.webp b/docs/assets/logo.webp new file mode 100644 index 0000000000..a76f255cf4 Binary files /dev/null and b/docs/assets/logo.webp differ diff --git a/docs/build-aea-programmatically.md b/docs/build-aea-programmatically.md index e5795ede3e..177f1111b3 100644 --- a/docs/build-aea-programmatically.md +++ b/docs/build-aea-programmatically.md @@ -62,7 +62,7 @@ We will use the stub connection to pass envelopes in and out of the AEA. Ensure ``` ## Initialise the AEA -We use the `AEABuilder` to readily build an AEA. By default, the `AEABuilder` adds the `fetchai/default:1.1.1`, `fetchai/state_update:1.1.1` and `fetchai/signing:1.1.1` protocols. +We use the `AEABuilder` to readily build an AEA. By default, the `AEABuilder` adds the `fetchai/default:1.1.2`, `fetchai/state_update:1.1.2` and `fetchai/signing:1.1.2` protocols. ``` python # Instantiate the builder and build the AEA # By default, the default protocol, error skill and stub connection are added diff --git a/docs/car-park-skills.md b/docs/car-park-skills.md index 26128f3117..977c0dcb18 100644 --- a/docs/car-park-skills.md +++ b/docs/car-park-skills.md @@ -57,9 +57,9 @@ Install the AEA ManagerDorado block explorer and request some test tokens via `Get Funds`. @@ -97,7 +97,7 @@ Follow the Preliminaries and =1.0.0"} }' -aea config set agent.default_connection fetchai/p2p_libp2p:0.27.0 +aea config set agent.default_connection fetchai/p2p_libp2p:0.27.1 aea config set --type dict agent.default_routing \ '{ - "fetchai/ledger_api:1.1.1": "fetchai/ledger:0.21.0", - "fetchai/oef_search:1.1.1": "fetchai/soef:0.27.1" + "fetchai/ledger_api:1.1.2": "fetchai/ledger:0.21.1", + "fetchai/oef_search:1.1.2": "fetchai/soef:0.27.2" }' aea install aea build @@ -135,7 +135,7 @@ aea build Then, fetch the car data client AEA: ``` bash -aea fetch fetchai/car_data_buyer:0.33.0 +aea fetch fetchai/car_data_buyer:0.33.1 cd car_data_buyer aea install aea build @@ -148,19 +148,19 @@ The following steps create the car data client from scratch: ``` bash aea create car_data_buyer cd car_data_buyer -aea add connection fetchai/p2p_libp2p:0.27.0 -aea add connection fetchai/soef:0.27.1 -aea add connection fetchai/ledger:0.21.0 -aea add skill fetchai/carpark_client:0.27.1 +aea add connection fetchai/p2p_libp2p:0.27.1 +aea add connection fetchai/soef:0.27.2 +aea add connection fetchai/ledger:0.21.1 +aea add skill fetchai/carpark_client:0.27.2 aea config set --type dict agent.dependencies \ '{ "aea-ledger-fetchai": {"version": "<2.0.0,>=1.0.0"} }' -aea config set agent.default_connection fetchai/p2p_libp2p:0.27.0 +aea config set agent.default_connection fetchai/p2p_libp2p:0.27.1 aea config set --type dict agent.default_routing \ '{ - "fetchai/ledger_api:1.1.1": "fetchai/ledger:0.21.0", - "fetchai/oef_search:1.1.1": "fetchai/soef:0.27.1" + "fetchai/ledger_api:1.1.2": "fetchai/ledger:0.21.1", + "fetchai/oef_search:1.1.2": "fetchai/soef:0.27.2" }' aea install aea build @@ -225,7 +225,7 @@ First, run the car data seller AEA: aea run ``` -Once you see a message of the form `To join its network use multiaddr 'SOME_ADDRESS'` take note of the address. (Alternatively, use `aea get-multiaddress fetchai -c -i fetchai/p2p_libp2p:0.27.0 -u public_uri` to retrieve the address.) +Once you see a message of the form `To join its network use multiaddr 'SOME_ADDRESS'` take note of the address. (Alternatively, use `aea get-multiaddress fetchai -c -i fetchai/p2p_libp2p:0.27.1 -u public_uri` to retrieve the address.) This is the entry peer address for the local agent communication network created by the car data seller. Then, in the car data buyer, run this command (replace `SOME_ADDRESS` with the correct value as described above): diff --git a/docs/cli-vs-programmatic-aeas.md b/docs/cli-vs-programmatic-aeas.md index e386cf8136..d1e8f3e230 100644 --- a/docs/cli-vs-programmatic-aeas.md +++ b/docs/cli-vs-programmatic-aeas.md @@ -33,7 +33,7 @@ If you want to create the weather station AEA step by step you can follow this g Fetch the weather station AEA with the following command : ``` bash -aea fetch fetchai/weather_station:0.32.0 +aea fetch fetchai/weather_station:0.32.1 cd weather_station aea install aea build diff --git a/docs/config.md b/docs/config.md index 62e3132244..253681caec 100644 --- a/docs/config.md +++ b/docs/config.md @@ -24,10 +24,10 @@ connections: # The list of connection public - fetchai/stub:0.21.1 contracts: [] # The list of contract public ids the AEA project depends on (each public id must satisfy PUBLIC_ID_REGEX). protocols: # The list of protocol public ids the AEA project depends on (each public id must satisfy PUBLIC_ID_REGEX). -- fetchai/default:1.1.1 +- fetchai/default:1.1.2 skills: # The list of skill public ids the AEA project depends on (each public id must satisfy PUBLIC_ID_REGEX). -- fetchai/error:0.18.1 -default_connection: fetchai/p2p_libp2p:0.27.0 # The default connection used for envelopes sent by the AEA (must satisfy PUBLIC_ID_REGEX). +- fetchai/error:0.18.2 +default_connection: fetchai/p2p_libp2p:0.27.1 # The default connection used for envelopes sent by the AEA (must satisfy PUBLIC_ID_REGEX). default_ledger: fetchai # The default ledger identifier the AEA project uses (must satisfy LEDGER_ID_REGEX) required_ledgers: [fetchai] # the list of identifiers of ledgers that the AEA project requires key pairs for (each item must satisfy LEDGER_ID_REGEX) default_routing: {} # The default routing scheme applied to envelopes sent by the AEA, it maps from protocol public ids to connection public ids (both keys and values must satisfy PUBLIC_ID_REGEX) diff --git a/docs/connect-a-frontend.md b/docs/connect-a-frontend.md index f82d2d7877..60c81f4846 100644 --- a/docs/connect-a-frontend.md +++ b/docs/connect-a-frontend.md @@ -3,7 +3,7 @@ This page lays out two options for connecting a front-end to an AEA. The followi How to connect front-end to your AEA ## Case 1 -The first option is to create a `HTTP Server` connection that handles incoming requests from a REST API. In this scenario, the REST API communicates with the AEA and requests are handled by the `HTTP Server` connection package. The REST API should send CRUD requests to the `HTTP Server` connection (`fetchai/http_server:0.23.1`) which translates these into Envelopes to be consumed by the correct skill. +The first option is to create a `HTTP Server` connection that handles incoming requests from a REST API. In this scenario, the REST API communicates with the AEA and requests are handled by the `HTTP Server` connection package. The REST API should send CRUD requests to the `HTTP Server` connection (`fetchai/http_server:0.23.2`) which translates these into Envelopes to be consumed by the correct skill. ## Case 2 -The second option is to create a front-end comprising a stand-alone `Multiplexer` with a `P2P` connection (`fetchai/p2p_libp2p:0.27.0`). In this scenario the Agent Communication Network can be used to send Envelopes from the AEA to the front-end. \ No newline at end of file +The second option is to create a front-end comprising a stand-alone `Multiplexer` with a `P2P` connection (`fetchai/p2p_libp2p:0.27.1`). In this scenario the Agent Communication Network can be used to send Envelopes from the AEA to the front-end. \ No newline at end of file diff --git a/docs/connection.md b/docs/connection.md index f760b1e3ec..109ccf71e9 100644 --- a/docs/connection.md +++ b/docs/connection.md @@ -36,7 +36,7 @@ The developer needs to implement four public coroutines: - The `receive` coroutine is continuously called by the AEA framework. It either returns `None` or an envelope. The `receive` coroutine must implement the logic of data being received by the agent, and if necessary, its translation into a relevant protocol. -The framework provides a demo `stub` connection which implements an I/O reader and writer to send and receive messages between the agent and a local file. To gain inspiration and become familiar with the structure of connection packages, you may find it useful to check out `fetchai/stub:0.21.1`, `fetchai/http_server:0.23.1` or `fetchai/http_client:0.24.1` connections. The latter two connections are for external clients to connect with an agent, and for the agent to connect with external servers, respectively. +The framework provides a demo `stub` connection which implements an I/O reader and writer to send and receive messages between the agent and a local file. To gain inspiration and become familiar with the structure of connection packages, you may find it useful to check out `fetchai/stub:0.21.1`, `fetchai/http_server:0.23.2` or `fetchai/http_client:0.24.2` connections. The latter two connections are for external clients to connect with an agent, and for the agent to connect with external servers, respectively. ### Primary methods to develop - sync connection interface diff --git a/docs/contract.md b/docs/contract.md index 8b92e03799..8bdda15625 100644 --- a/docs/contract.md +++ b/docs/contract.md @@ -18,9 +18,9 @@ Interacting with contracts in almost all cases requires network access. Therefor Message flow for contract and ledger interactions -In particular, the `fetchai/ledger:0.21.0` connection can be used to execute contract related logic. The skills communicate with the `fetchai/ledger:0.21.0` connection via the `fetchai/contract_api:1.0.0` protocol. This protocol implements a request-response pattern to serve the four types of methods listed above: +In particular, the `fetchai/ledger:0.21.1` connection can be used to execute contract related logic. The skills communicate with the `fetchai/ledger:0.21.1` connection via the `fetchai/contract_api:1.0.0` protocol. This protocol implements a request-response pattern to serve the four types of methods listed above: -- the `get_deploy_transaction` message is used to request a deploy transaction for a specific contract. For instance, to request a deploy transaction for the deployment of the smart contract wrapped in the `fetchai/erc1155:0.23.1` package, we send the following message to the `fetchai/ledger:0.21.0`: +- the `get_deploy_transaction` message is used to request a deploy transaction for a specific contract. For instance, to request a deploy transaction for the deployment of the smart contract wrapped in the `fetchai/erc1155:0.23.1` package, we send the following message to the `fetchai/ledger:0.21.1`: ``` python contract_api_msg = ContractApiMessage( @@ -37,7 +37,7 @@ contract_api_msg = ContractApiMessage( Any additional arguments needed by the contract's constructor method should be added to `kwargs`. -This message will be handled by the `fetchai/ledger:0.21.0` connection and then a `raw_transaction` message will be returned with the matching raw transaction. To send this transaction to the ledger for processing, we first sign the message with the decision maker and then send the signed transaction to the `fetchai/ledger:0.21.0` connection using the `fetchai/ledger_api:1.0.0` protocol. For details on how to implement the message handling, see the handlers in the `erc1155_deploy` skill. +This message will be handled by the `fetchai/ledger:0.21.1` connection and then a `raw_transaction` message will be returned with the matching raw transaction. To send this transaction to the ledger for processing, we first sign the message with the decision maker and then send the signed transaction to the `fetchai/ledger:0.21.1` connection using the `fetchai/ledger_api:1.0.0` protocol. For details on how to implement the message handling, see the handlers in the `erc1155_deploy` skill.

CosmWasm based smart contract deployments

@@ -45,7 +45,7 @@ This message will be handled by the `fetchai/ledger:0.21.0` connection and then

-- the `get_raw_transaction` message is used to request any transaction for a specific contract which changes state in the contract. For instance, to request a transaction for the creation of token in the deployed `erc1155` smart contract wrapped in the `fetchai/erc1155:0.23.1` package, we send the following message to the `fetchai/ledger:0.21.0`: +- the `get_raw_transaction` message is used to request any transaction for a specific contract which changes state in the contract. For instance, to request a transaction for the creation of token in the deployed `erc1155` smart contract wrapped in the `fetchai/erc1155:0.23.1` package, we send the following message to the `fetchai/ledger:0.21.1`: ``` python contract_api_msg = ContractApiMessage( @@ -64,9 +64,9 @@ contract_api_msg = ContractApiMessage( ) ``` -This message will be handled by the `fetchai/ledger:0.21.0` connection and then a `raw_transaction` message will be returned with the matching raw transaction. For this to be executed correctly, the `fetchai/erc1155:0.23.1` contract package needs to implement the `get_create_batch_transaction` method with the specified key word arguments (see example in *Deploy your own*, below). Similarly to above, to send this transaction to the ledger for processing, we first sign the message with the decision maker and then send the signed transaction to the `fetchai/ledger:0.21.0` connection using the `fetchai/ledger_api:1.0.0` protocol. +This message will be handled by the `fetchai/ledger:0.21.1` connection and then a `raw_transaction` message will be returned with the matching raw transaction. For this to be executed correctly, the `fetchai/erc1155:0.23.1` contract package needs to implement the `get_create_batch_transaction` method with the specified key word arguments (see example in *Deploy your own*, below). Similarly to above, to send this transaction to the ledger for processing, we first sign the message with the decision maker and then send the signed transaction to the `fetchai/ledger:0.21.1` connection using the `fetchai/ledger_api:1.0.0` protocol. -- the `get_raw_message` message is used to request any contract method call for a specific contract which does not change state in the contract. For instance, to request a call to get a hash from some input data in the deployed `erc1155` smart contract wrapped in the `fetchai/erc1155:0.23.1` package, we send the following message to the `fetchai/ledger:0.21.0`: +- the `get_raw_message` message is used to request any contract method call for a specific contract which does not change state in the contract. For instance, to request a call to get a hash from some input data in the deployed `erc1155` smart contract wrapped in the `fetchai/erc1155:0.23.1` package, we send the following message to the `fetchai/ledger:0.21.1`: ``` python contract_api_msg = ContractApiMessage( @@ -89,10 +89,10 @@ contract_api_msg = ContractApiMessage( ), ) ``` -This message will be handled by the `fetchai/ledger:0.21.0` connection and then a `raw_message` message will be returned with the matching raw message. For this to be executed correctly, the `fetchai/erc1155:0.23.1` contract package needs to implement the `get_hash_single` method with the specified key word arguments. We can then send the raw message to the `fetchai/ledger:0.21.0` connection using the `fetchai/ledger_api:1.0.0` protocol. In this case, signing is not required. +This message will be handled by the `fetchai/ledger:0.21.1` connection and then a `raw_message` message will be returned with the matching raw message. For this to be executed correctly, the `fetchai/erc1155:0.23.1` contract package needs to implement the `get_hash_single` method with the specified key word arguments. We can then send the raw message to the `fetchai/ledger:0.21.1` connection using the `fetchai/ledger_api:1.0.0` protocol. In this case, signing is not required. -- the `get_state` message is used to request any contract method call to query state in the deployed contract. For instance, to request a call to get the balances in the deployed `erc1155` smart contract wrapped in the `fetchai/erc1155:0.23.1` package, we send the following message to the `fetchai/ledger:0.21.0`: +- the `get_state` message is used to request any contract method call to query state in the deployed contract. For instance, to request a call to get the balances in the deployed `erc1155` smart contract wrapped in the `fetchai/erc1155:0.23.1` package, we send the following message to the `fetchai/ledger:0.21.1`: ``` python contract_api_msg = ContractApiMessage( @@ -107,7 +107,7 @@ contract_api_msg = ContractApiMessage( ), ) ``` -This message will be handled by the `fetchai/ledger:0.21.0` connection and then a `state` message will be returned with the matching state. For this to be executed correctly, the `fetchai/erc1155:0.23.1` contract package needs to implement the `get_balance` method with the specified key word arguments. We can then send the raw message to the `fetchai/ledger:0.21.0` connection using the `fetchai/ledger_api:1.0.0` protocol. In this case, signing is not required. +This message will be handled by the `fetchai/ledger:0.21.1` connection and then a `state` message will be returned with the matching state. For this to be executed correctly, the `fetchai/erc1155:0.23.1` contract package needs to implement the `get_balance` method with the specified key word arguments. We can then send the raw message to the `fetchai/ledger:0.21.1` connection using the `fetchai/ledger_api:1.0.0` protocol. In this case, signing is not required. ## Developing your own @@ -180,6 +180,6 @@ class MyContract(Contract): tx = cls._try_estimate_gas(ledger_api, tx) return tx ``` -Above, we implement a method to create a transaction, in this case a transaction to create a batch of tokens. The method will be called by the framework, specifically the `fetchai/ledger:0.21.0` connection once it receives a message (see bullet point 2 above). The method first gets the latest transaction nonce of the `deployer_address`, then constructs the contract instance, then uses the instance to build the transaction and finally updates the gas on the transaction. +Above, we implement a method to create a transaction, in this case a transaction to create a batch of tokens. The method will be called by the framework, specifically the `fetchai/ledger:0.21.1` connection once it receives a message (see bullet point 2 above). The method first gets the latest transaction nonce of the `deployer_address`, then constructs the contract instance, then uses the instance to build the transaction and finally updates the gas on the transaction. -It helps to look at existing contract packages, like `fetchai/erc1155:0.23.1`, and skills using them, like `fetchai/erc1155_client:0.11.0` and `fetchai/erc1155_deploy:0.31.1`, for inspiration and guidance. +It helps to look at existing contract packages, like `fetchai/erc1155:0.23.1`, and skills using them, like `fetchai/erc1155_client:0.11.0` and `fetchai/erc1155_deploy:0.31.2`, for inspiration and guidance. diff --git a/docs/core-components-1.md b/docs/core-components-1.md index ff20120f3e..ccbf040e23 100644 --- a/docs/core-components-1.md +++ b/docs/core-components-1.md @@ -34,7 +34,7 @@ An `Envelope` is the core object * `Dialogues`, which define rules over `Message` sequences. -The framework provides one default `Protocol`, called `default` (current version `fetchai/default:1.1.1`). This `Protocol` provides a bare-bones implementation for an AEA `Protocol` which includes a `DefaultMessage` class and associated `DefaultSerializer` and `DefaultDialogue` classes. +The framework provides one default `Protocol`, called `default` (current version `fetchai/default:1.1.2`). This `Protocol` provides a bare-bones implementation for an AEA `Protocol` which includes a `DefaultMessage` class and associated `DefaultSerializer` and `DefaultDialogue` classes. Additional `Protocols`, for new types of interactions, can be added as packages. For more details on `Protocols` you can read the protocol guide. To learn how you can easily automate protocol definition, head to the guide for the protocol generator. diff --git a/docs/erc1155-skills.md b/docs/erc1155-skills.md index 20942227c0..fd4a62b234 100644 --- a/docs/erc1155-skills.md +++ b/docs/erc1155-skills.md @@ -25,7 +25,7 @@ The scope of this guide is demonstrating how you can deploy a smart contract and Fetch the AEA that will deploy the contract: ``` bash -aea fetch fetchai/erc1155_deployer:0.34.0 +aea fetch fetchai/erc1155_deployer:0.34.1 cd erc1155_deployer aea install aea build @@ -39,25 +39,25 @@ Create the AEA that will deploy the contract. ``` bash aea create erc1155_deployer cd erc1155_deployer -aea add connection fetchai/p2p_libp2p:0.27.0 -aea add connection fetchai/soef:0.27.1 -aea add connection fetchai/ledger:0.21.0 -aea add skill fetchai/erc1155_deploy:0.31.1 +aea add connection fetchai/p2p_libp2p:0.27.1 +aea add connection fetchai/soef:0.27.2 +aea add connection fetchai/ledger:0.21.1 +aea add skill fetchai/erc1155_deploy:0.31.2 aea config set --type dict agent.dependencies \ '{ "aea-ledger-fetchai": {"version": "<2.0.0,>=1.0.0"}, "aea-ledger-ethereum": {"version": "<2.0.0,>=1.0.0"}, "aea-ledger-cosmos": {"version": "<2.0.0,>=1.0.0"} }' -aea config set agent.default_connection fetchai/p2p_libp2p:0.27.0 +aea config set agent.default_connection fetchai/p2p_libp2p:0.27.1 aea config set --type dict agent.default_routing \ '{ - "fetchai/contract_api:1.1.1": "fetchai/ledger:0.21.0", - "fetchai/ledger_api:1.1.1": "fetchai/ledger:0.21.0", - "fetchai/oef_search:1.1.1": "fetchai/soef:0.27.1" + "fetchai/contract_api:1.1.2": "fetchai/ledger:0.21.1", + "fetchai/ledger_api:1.1.2": "fetchai/ledger:0.21.1", + "fetchai/oef_search:1.1.2": "fetchai/soef:0.27.2" }' aea config set --type list vendor.fetchai.connections.p2p_libp2p.cert_requests \ -'[{"identifier": "acn", "ledger_id": "ethereum", "not_after": "2022-01-01", "not_before": "2021-01-01", "public_key": "fetchai", "save_path": ".certs/conn_cert.txt"}]' +'[{"identifier": "acn", "ledger_id": "ethereum", "not_after": "2023-01-01", "not_before": "2022-01-01", "public_key": "fetchai", "save_path": ".certs/conn_cert.txt"}]' aea install aea build ``` @@ -95,7 +95,7 @@ aea issue-certificates In another terminal, fetch the client AEA which will receive some tokens from the deployer. ``` bash -aea fetch fetchai/erc1155_client:0.34.0 +aea fetch fetchai/erc1155_client:0.34.1 cd erc1155_client aea install aea build @@ -109,25 +109,25 @@ Create the AEA that will get some tokens from the deployer. ``` bash aea create erc1155_client cd erc1155_client -aea add connection fetchai/p2p_libp2p:0.27.0 -aea add connection fetchai/soef:0.27.1 -aea add connection fetchai/ledger:0.21.0 -aea add skill fetchai/erc1155_client:0.29.1 +aea add connection fetchai/p2p_libp2p:0.27.1 +aea add connection fetchai/soef:0.27.2 +aea add connection fetchai/ledger:0.21.1 +aea add skill fetchai/erc1155_client:0.29.2 aea config set --type dict agent.dependencies \ '{ "aea-ledger-fetchai": {"version": "<2.0.0,>=1.0.0"}, "aea-ledger-ethereum": {"version": "<2.0.0,>=1.0.0"}, "aea-ledger-cosmos": {"version": "<2.0.0,>=1.0.0"} }' -aea config set agent.default_connection fetchai/p2p_libp2p:0.27.0 +aea config set agent.default_connection fetchai/p2p_libp2p:0.27.1 aea config set --type dict agent.default_routing \ '{ - "fetchai/contract_api:1.1.1": "fetchai/ledger:0.21.0", - "fetchai/ledger_api:1.1.1": "fetchai/ledger:0.21.0", - "fetchai/oef_search:1.1.1": "fetchai/soef:0.27.1" + "fetchai/contract_api:1.1.2": "fetchai/ledger:0.21.1", + "fetchai/ledger_api:1.1.2": "fetchai/ledger:0.21.1", + "fetchai/oef_search:1.1.2": "fetchai/soef:0.27.2" }' aea config set --type list vendor.fetchai.connections.p2p_libp2p.cert_requests \ -'[{"identifier": "acn", "ledger_id": "ethereum", "not_after": "2022-01-01", "not_before": "2021-01-01", "public_key": "fetchai", "save_path": ".certs/conn_cert.txt"}]' +'[{"identifier": "acn", "ledger_id": "ethereum", "not_after": "2023-01-01", "not_before": "2022-01-01", "public_key": "fetchai", "save_path": ".certs/conn_cert.txt"}]' aea install aea build ``` @@ -199,7 +199,7 @@ aea run Once you see a message of the form `To join its network use multiaddr 'SOME_ADDRESS'` take note of this address. -Alternatively, use `aea get-multiaddress fetchai -c -i fetchai/p2p_libp2p:0.27.0 -u public_uri` to retrieve the address. The output will be something like `/dns4/127.0.0.1/tcp/9000/p2p/16Uiu2HAm2JPsUX1Su59YVDXJQizYkNSe8JCusqRpLeeTbvY76fE5`. +Alternatively, use `aea get-multiaddress fetchai -c -i fetchai/p2p_libp2p:0.27.1 -u public_uri` to retrieve the address. The output will be something like `/dns4/127.0.0.1/tcp/9000/p2p/16Uiu2HAm2JPsUX1Su59YVDXJQizYkNSe8JCusqRpLeeTbvY76fE5`. This is the entry peer address for the local agent communication network created by the deployer. diff --git a/docs/generic-skills-step-by-step.md b/docs/generic-skills-step-by-step.md index ab77745487..1865affdd9 100644 --- a/docs/generic-skills-step-by-step.md +++ b/docs/generic-skills-step-by-step.md @@ -11,16 +11,16 @@ Follow the Preliminaries and Preliminaries and =1.0.0"} }' -aea config set agent.default_connection fetchai/p2p_libp2p:0.27.0 +aea config set agent.default_connection fetchai/p2p_libp2p:0.27.1 aea config set --type dict agent.default_routing \ '{ - "fetchai/ledger_api:1.1.1": "fetchai/ledger:0.21.0", - "fetchai/oef_search:1.1.1": "fetchai/soef:0.27.1" + "fetchai/ledger_api:1.1.2": "fetchai/ledger:0.21.1", + "fetchai/oef_search:1.1.2": "fetchai/soef:0.27.2" }' aea install aea build @@ -96,7 +96,7 @@ aea build Then, in another terminal fetch the buyer AEA: ``` bash -aea fetch fetchai/generic_buyer:0.30.0 --alias my_buyer_aea +aea fetch fetchai/generic_buyer:0.30.1 --alias my_buyer_aea cd my_buyer_aea aea install aea build @@ -109,19 +109,19 @@ The following steps create the buyer from scratch: ``` bash aea create my_buyer_aea cd my_buyer_aea -aea add connection fetchai/p2p_libp2p:0.27.0 -aea add connection fetchai/soef:0.27.1 -aea add connection fetchai/ledger:0.21.0 -aea add skill fetchai/generic_buyer:0.27.1 +aea add connection fetchai/p2p_libp2p:0.27.1 +aea add connection fetchai/soef:0.27.2 +aea add connection fetchai/ledger:0.21.1 +aea add skill fetchai/generic_buyer:0.27.2 aea config set --type dict agent.dependencies \ '{ "aea-ledger-fetchai": {"version": "<2.0.0,>=1.0.0"} }' -aea config set agent.default_connection fetchai/p2p_libp2p:0.27.0 +aea config set agent.default_connection fetchai/p2p_libp2p:0.27.1 aea config set --type dict agent.default_routing \ '{ - "fetchai/ledger_api:1.1.1": "fetchai/ledger:0.21.0", - "fetchai/oef_search:1.1.1": "fetchai/soef:0.27.1" + "fetchai/ledger_api:1.1.2": "fetchai/ledger:0.21.1", + "fetchai/oef_search:1.1.2": "fetchai/soef:0.27.2" }' aea install aea build @@ -219,7 +219,7 @@ models: latitude: 51.5194 longitude: 0.127 max_negotiations: 1 - max_tx_fee: 1 + max_tx_fee: 3550000000000000 max_unit_price: 20 search_query: constraint_type: == @@ -252,7 +252,7 @@ First, run the seller AEA: aea run ``` -Once you see a message of the form `To join its network use multiaddr 'SOME_ADDRESS'` take note of this address. (Alternatively, use `aea get-multiaddress fetchai -c -i fetchai/p2p_libp2p:0.27.0 -u public_uri` to retrieve the address.) +Once you see a message of the form `To join its network use multiaddr 'SOME_ADDRESS'` take note of this address. (Alternatively, use `aea get-multiaddress fetchai -c -i fetchai/p2p_libp2p:0.27.1 -u public_uri` to retrieve the address.) This is the entry peer address for the local agent communication network created by the seller. Then, configure the buyer to connect to this same local ACN by running the following command in the buyer terminal, replacing `SOME_ADDRESS` with the value you noted above: diff --git a/docs/gym-skill.md b/docs/gym-skill.md index a44364c3fe..edfd7d9ba8 100644 --- a/docs/gym-skill.md +++ b/docs/gym-skill.md @@ -1,4 +1,4 @@ -The AEA gym skill demonstrates how a custom Reinforcement Learning agent, that uses OpenAI's gym library, may be embedded into an AEA skill and connection. +The AEA gym skill demonstrates how a custom Reinforcement Learning agent, that uses OpenAI's gym library, may be embedded into an AEA skill and connection. ### Discussion @@ -12,6 +12,19 @@ The example decouples the RL agent from the `gym.Env` allowing them to run in se Follow the Preliminaries and Installation sections from the AEA quick start. +Download the necessary directories into your working directory: + +``` bash +mkdir gym_skill_agent +svn export https://github.com/fetchai/agents-aea.git/trunk/examples +``` + +Install the `gym` and `numpy` library. + +``` bash +pip install numpy gym +``` + ## Demo instructions @@ -19,7 +32,7 @@ Follow the Preliminaries and It MUST implement protocols according to their specification (see here for details). -
  • It SHOULD implement the fetchai/default:1.1.1 protocol which satisfies the following protobuf schema: +
  • It SHOULD implement the fetchai/default:1.1.2 protocol which satisfies the following protobuf schema: ``` proto syntax = "proto3"; @@ -121,7 +121,7 @@ message DefaultMessage{
  • It MUST have an identity in the form of, at a minimum, an address derived from a public key and its associated private key (where the elliptic curve must be of type SECP256k1).
  • -
  • It SHOULD implement handling of errors using the fetchai/default:1.1.1 protocol. The protobuf schema is given above. +
  • It SHOULD implement handling of errors using the fetchai/default:1.1.2 protocol. The protobuf schema is given above.
  • It MUST implement the following principles when handling messages: