What is a backend?
You can think of a backend as a target platform for your smart contract. This can be a piece of code allowing you to quickly check your code - like MockVM, or a complete virtual machine, spinning up a blockchain for you - like CasperVM.
Each backend has to come with two parts that Odra requires - the Contract Env and the Test Env.
Contract Env
The Contract Env is a simple interface that each backend needs to implement, exposing features of the blockchain from the perspective of the contract.
It gives Odra a set of functions, which allows implementing more complex concepts - for example, to implement Mapping, Odra requires some kind of storage integration. The exact implementation of those functions is a responsibility of a backend, making Odra and its user free to implement the contract logic, instead of messing with the blockchain internals.
Other functions from Contract Env include handling transfers, addresses, block time, errors and events.
Test Env
Similarly to the Contract Env, the Test Env exposes a set of functions that allows the communication with the backend from the outside world - really useful for implementing tests.
This ranges from interacting with the blockchain - like deploying and calling the contracts, to the more test-oriented - handling errors, forwarding the block time, etc.
What's next
We will take a look at backends Odra implements in more detail.