You can obtain the latest nearcore node release by cloning the repo and compiling
the binary yourself (use the command make neard), or by using nearup.
See the Near documentation for more information.
You can get the latest Aurora Engine Wasm artifact either from the GitHub releases
or by cloning the repo and compiling the binary yourself
(use the command cargo make --profile mainnet build). Note: if you want to be able to mint your own ETH tokens
directly in the EVM on your localnet then you will need to build the Engine yourself
(use the command cargo make --profile mainnet build-test).
From the root of this repository (aurora-cli-rs) run the command cargo build -r --no-default-features -F advanced.
This requires having Rust 1.68.0 or newer installed.
Choose any directory you like and set the NEARCORE_HOME environment variable. For example:
export NEARCORE_HOME=/home/$USER/.near/localnet/Using the neard binary you obtained in the prerequisites:
neard --home $NEARCORE_HOME localnet --validators 1Use the aurora-cli binary you built in the perquisites:
aurora-cli near init genesis --path $NEARCORE_HOME/node0/genesis.jsonUse the aurora-cli binary again:
aurora-cli near init local-config -n $NEARCORE_HOME/node0/config.json -a $NEARCORE_HOME/node0/aurora_key.jsonUsing the neard binary again:
nohup neard --home $NEARCORE_HOME/node0/ run > node.log &Note: this command assumes you have nohup installed. If you are working on a platform without this utility then
you can simply run the neard command in another terminal.
Note: if you are using nohup don't forget to kill the node when you are done with it using jobs and kill commands.
Suppose the Aurora Engine Wasm binary is located at a path given by the environment variable ENGINE_WASM_PATH.
Then we can use this CLI to deploy the engine:
aurora-cli near write engine-init -w $ENGINE_WASM_PATHAfter completing the setup above you can use this CLI to interact with it just like you would the testnet or mainnet.
For example, suppose you wanted to deploy a simple "Hello, World!" contract:
aurora-cli near \
write \
deploy-code \
$(cat docs/res/HelloWorld.hex)
Contact deployed to address: 0x592186c059e3d9564cac6b1ada6f2dc7ff1d78e9aurora-cli near \
read \
solidity -t 0x592186c059e3d9564cac6b1ada6f2dc7ff1d78e9 \
call-args-by-name \
--abi-path docs/res/HelloWorld.abi \
-m "greet" \
--arg '{}'
[String("Hello, World!")]