Helios is a fully trustless, efficient, and portable Ethereum light client written in Rust.
Helios converts an untrusted centralized RPC endpoint into a safe unmanipulable local RPC for its users. It syncs in seconds, requires no storage, and is lightweight enough to run on mobile devices.
This Swift Package is a wrapper around Helios’ Rust library.
Installation
Add the package declaration to your project’s manifest dependencies array:
To shutdown your client gracefully, use the shutdown() method:
await Helios.shared.shutdown()
Logging
You may enable logging of the Rust lib with an environment var at runtime (RUST_LOG). The library uses Rust’s env_logger framework, so you may set the desired levels accordingly.
Building locally
There is a build_xcframework.sh script in the repo which can be used to build the xcframework for the helios rust library, this will create the XCFramework and place it (along with the Swift bridging files and checksum) in the .build/helios-rs/build directory. You may specify which version you would like to build and provide an additional parameter to the script to build a debug or release framework.
> zsh build_xcframework.sh 0.1.3 debug # .build/helios-rs/build/0.1.3/debug/helios.xcframework
> zsh build_xcframework.sh 0.1.3 # .build/helios-rs/build/0.1.3/debug/helios.xcframework
> zsh build_xcframework.sh debug # No version specified, defaults to latest
> zsh build_xcframework.sh # No version specified, defaults to latest
Running the test target
To be able to compile the test target you must create a Config.swift file (you can just copy and rename Config.swift.example) and add the RPC URL you have for mainnet.
You may optionaly provide a rawTransaction data to test sendRawTransaction(_:).
HeliosKit
Helios is a fully trustless, efficient, and portable Ethereum light client written in Rust.
Helios converts an untrusted centralized RPC endpoint into a safe unmanipulable local RPC for its users. It syncs in seconds, requires no storage, and is lightweight enough to run on mobile devices.
This Swift Package is a wrapper around Helios’ Rust library.
Installation
Add the package declaration to your project’s manifest dependencies array:
Usage
You can start a client with:
Have in mind that only one client can be running at all times.
Once the client is up and running you can start doing RPC calls to it, it will be listening to
127.0.0.1:8545
.You may also use the library to call methods from the RPC with:
To shutdown your client gracefully, use the
shutdown()
method:Logging
You may enable logging of the Rust lib with an environment var at runtime (
RUST_LOG
). The library uses Rust’senv_logger
framework, so you may set the desired levels accordingly.Building locally
There is a
build_xcframework.sh
script in the repo which can be used to build thexcframework
for the helios rust library, this will create the XCFramework and place it (along with the Swift bridging files and checksum) in the.build/helios-rs/build
directory. You may specify which version you would like to build and provide an additional parameter to the script to build adebug
orrelease
framework.Running the test target
To be able to compile the test target you must create a
Config.swift
file (you can just copy and renameConfig.swift.example
) and add the RPC URL you have for mainnet.You may optionaly provide a
rawTransaction
data to testsendRawTransaction(_:)
.