By default LLVM and clang do not include the WASM build target, so you will have to build it yourself. Note that following these instructions will create a version of LLVM that can only build WASM targets.
By default LLVM and clang do not include the WASM build target, so you will have to build it yourself:
For a debug build, add `-DCMAKE_BUILD_TYPE=Debug`. Other common build types include `Release` and `RelWithDebInfo`.
To run the test suite after building, run the `chain_test` executable in the `tests` folder.
### Creating and launching a single-node testnet
After successfully building the project, the `eosd` binary should be present in the `programs/eosd` directory. Go ahead and run `eosd` -- it will probably exit with an error, but if not, close it immediately with Ctrl-C. Note that `eosd` will have created a directory named `data-dir` containing the default configuration (`config.ini`) and some other internals. This default data storage path can be overridden by passing `--data-dir /path/to/data` to `eosd`.
Edit the `config.ini` file, adding the following settings to the defaults already in place:
...
...
@@ -212,11 +246,36 @@ plugin = eos::http_plugin
Now it should be possible to run `eosd` and see it begin producing blocks. At present, the P2P code is not implemented, so only single-node configurations are possible. When the P2P networking is implemented, these instructions will be updated to show how to create an example multi-node testnet.
When running `eosd` you should get log messages similar to below. It means the blocks are successfully produced.
EOS comes with example contracts that can be uploaded and run for testing purposes. To upload and test them, please follow the steps below.
### Create accounts for your smart contracts
To publish sample smart contracts you need to create accounts for them.
At the moment for the testing purposes you need to run `eosd --skip-transaction-signatures` to successfully create accounts and run transactions.
At the moment for the testing purposes you need to run `eosd` with `--skip-transaction-signatures` flag to successfully create accounts and run transactions.
Run the node:
```commandline
cd ~/eos/build/programs/eosd/
./eosd --skip-transaction-signatures
```
First, generate public/private key pairs for the `owner_key` and `active_key`. We will need them to create an account:
...
...
@@ -238,26 +297,22 @@ Save the values for future reference.
Run `create` command where `PUBLIC_KEY_1` and `PUBLIC_KEY_2` are the values generated by the `create key` command: