From 99c7cbfa9fdae2ebdcb4e17c87170f69374c3fbf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Bylica?= Date: Fri, 5 Oct 2018 16:21:09 +0200 Subject: [PATCH 1/3] CI: Tweak codespell - Do not explicitly skip .git dir, all . files are ignored by default. - Set quiet level mask to 4 to ignore misspells that are disabled for automatic correction. In this case we want to allow "uint". --- circle.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/circle.yml b/circle.yml index ee97a36..240b3cc 100644 --- a/circle.yml +++ b/circle.yml @@ -16,7 +16,7 @@ jobs: command: | sudo pip3 install --upgrade pip setuptools sudo pip3 install codespell - codespell --skip=".git" --ignore-words=./.codespell-whitelist + codespell --quiet-level=4 --ignore-words=./.codespell-whitelist build: &build docker: From 18fb4fc6b1c5cf85fc191f1658ac813f1f552109 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Bylica?= Date: Fri, 5 Oct 2018 15:57:39 +0200 Subject: [PATCH 2/3] docs: Host Implementation Guide --- docs/Host_Guide.md | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 docs/Host_Guide.md diff --git a/docs/Host_Guide.md b/docs/Host_Guide.md new file mode 100644 index 0000000..f0124ad --- /dev/null +++ b/docs/Host_Guide.md @@ -0,0 +1,43 @@ +# EVMC Host Implementation Guide {#hostguide} + +> How to bring EVMC support to Your Ethereum Client. + +## Host interface + +First of all, you have to implement the Host interface. The Host interface +allows VMs to query and modify Ethereum state during the execution. + +The implementation can be done in object-oriented manner. +The ::evmc_host_interface lists the methods any Host must implement. + +Moreover, each of the methods has a pointer to ::evmc_context +as a parameter. The context is owned entirely by the Host allowing a Host instance +to behave as an object with data. + +## VM usage + +When Host implementation is ready it's time to start using EVMC VMs. + +1. Firstly, create a VM instance. You need to know what is the name of the "create" + function in particular VM implementation. The EVMC recommends to name the + function by the VM codename, e.g. ::evmc_create_examplevm(). + Invoking the create function will give you the VM instance (::evmc_instance). + It is recommended to create the VM instance once. + +2. If you are interested in loading VMs dynamically (i.e. to use DLLs) + check out the [EVMC Loader](@ref loader) library. + +3. The ::evmc_instance contains information about the VM like + name (::evmc_instance::name) or ABI version (::evmc_instance::abi_version) + and methods. + +4. To execute code in the VM use the "execute()" method (::evmc_instance::execute). + You will need: + - the code to execute, + - the message (::evmc_message) object that describes the execution context, + - the Host instance, passed as ::evmc_context pointer. + +5. When execution finishes you will receive ::evmc_result object that describes + the results of the execution. + +Have fun! \ No newline at end of file From 765bafb1159726a4cd4af4c1cf5df8fad105eec6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Bylica?= Date: Fri, 5 Oct 2018 16:28:32 +0200 Subject: [PATCH 3/3] docs: List guides on the main page --- docs/EVMC.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/EVMC.md b/docs/EVMC.md index aa3d3e1..2d249a8 100644 --- a/docs/EVMC.md +++ b/docs/EVMC.md @@ -6,6 +6,11 @@ On the Client-side it defines the interface for EVM implementations to access Ethereum environment and state. +# Guides + +- [Host Implementation Guide](@ref hostguide) + + # Versioning {#versioning} The EVMC project uses [Semantic Versioning](https://semver.org).