aurora-is-near/aurora-engine
About
⚙️ Aurora Engine implements an Ethereum Virtual Machine (EVM) on the NEAR Protocol.
Developer ToolsMeasured star growth
- in 24h
- 0
- in 7 days
- -1
- in 15 days
- Collecting history
- in 1 month
- Collecting history
Net star changes over overlapping periods, not daily totals. Missing measurements are left blank. Stars measure attention, not software quality.
README.md
OriginalAurora Engine
Aurora Engine implements an Ethereum Virtual Machine (EVM) on the NEAR Protocol. See doc.aurora.dev for additional documentation.
Deployments
| Network | Contract ID | Chain ID |
|---|---|---|
| Mainnet | aurora |
1313161554 |
| Testnet | aurora |
1313161555 |
| Local | aurora.test.near |
1313161556 |
Development
Prerequisites
- Node.js (v18+)
- cargo-make
- wasm-opt
cargo install --force cargo-make
Prerequisites for Development
- Node.js (v18+)
- Docker
- cargo-make
- wasm-opt
Prerequisite wasm-opt
For WebAssembly optimization we use wasm-opt from the Binaryen toolchain for WebAssembly.
We recommend installing the release: https://github.com/WebAssembly/binaryen/releases/tag/version_133
wasm-opt command should be available for the build process.
WASM build tasks check that it is available on PATH before compiling.
Verify version:
$ wasm-opt --version
wasm-opt version 133 (version_133)
Please be aware that you don't need to run wasm-opt explicitly, The wasm-opt runs automatically
when you run cargo make build-* and cargo make test commands.
Development
Branches
masteris the current stable branch. It must be ready, at all times, to be deployed on chain at a moment's notice.developis our bleeding-edge development branch. In general, kindly target all pull requests to this branch.
Building the engine and contracts
There are several commands that can be used to build the binaries. The currently supported parameters
for the task field are listed below:
default: does not need to be specified, runsbuild.build: builds included solidity contracts in the engine contract and engine smart contract itself and produces the fileaurora-engine.wasmin thebinfolder.build-test: builds the engine contract which is used in the integration tests and produces theaurora-engine-test.wasmfile in thebinfolder.build-contracts: builds all the solidity contracts.build-docker: builds theaurora-engine.wasmin thebinfolder using docker build environment. The purpose of this task is to produce reproducible binaries.
For example, the following will build the mainnet debug binary:
cargo make build
Verifying binary hash
To verify that a deployed binary matches the source code, you may want to build it reproducibly and then verify that the SHA256 hash matches that of the deployed binary. The motivation behind this is to prevent malicious code from being deployed.
Run these commands to produce the binary hash:
cargo make build-docker
shasum -a 256 bin/aurora-engine.wasm
Running unit & integration tests
To run tests, there are a few cargo make tasks we can run:
test-workspace: tests only the cargo workspace.test-workspace-refund: tests the workspace witherror_refundenabled in both native code and the test WASM.test-xcc-routerandtest-xcc-router-all-features: run the separate router's unit tests.test-contracts: tests only the contracts.test: tests the whole cargo workspace, solidity contracts, XCC router and runs modexp benchmarks.test-flow: tests the whole cargo workspace, solidity contracts and both XCC router feature sets.bench-modexp: runs modexp benchmarks.
For example, the following will test the whole workspace and solidity contracts:
cargo make test
Use cargo make test-workspace-refund instead of passing --features error_refund
to test-workspace. Both test modes write bin/aurora-engine-test.wasm, so run
them sequentially. Native-only options such as --features skip-bls-tests can
still be passed directly to either task.
Running checks and lints
The following tasks are available to run lints and checks:
check: checks the format, clippy and solidity contracts.check-contractsruns yarn lints on the solidity contracts.check-fmt: checks Rust formatting in the workspace and XCC router.clippy: checks the Rust workspace with clippy only.
For example, the following command will run the checks. here:
cargo make check
Running WebAssembly optimization
In common cases, you don't need to run wasm-opt manually, because it's part of builds and tests.
But for development reasons only you can run:
wasm-opt, runs WebAssembly optimization for pre-build wasm files.
For example, the following will run wasm-opt for pre-build mainnet binary:
cargo make wasm-opt
Cleanup
The following tasks are available to clean up the workspace:
clean: cleans Cargo outputs, generated contract files, standalone test-contract targets, and built binaries.clean-cargo: cleans with cargo.clean-contracts: cleans generated Solidity files and standalone test-contract build outputs.clean-bin: cleans the binaries.
Additionally, there is also but not included in the clean task:
sweep: cleans up unused build files for a period of time provided in thetimeargument. Thetimeargument is set in the ENV variableSWEEP_DAYS, default to 30 days.
For example, the following command will clean everything.
cargo make clean
License
aurora-engine has multiple licenses:
- All crates except
engine-testhave CCO-1.0 license engine-testhas GPL-v3 license
Explore related projects
Loading…