Inspiration

As a firm believer in tooling, I'm always on the lookout for ways to simplify and enhance the developer experience, especially in projects that could use a little more polish. When I discovered Electroneum, I was struck by the fact that while the project was solid, it lacked a quick, straightforward way to launch a local node for testing and development — something that would be a game-changer for both newcomers and seasoned developers alike.

Apparently, the primary way to install an Electroneum node involved building Go from source. While not difficult, this process is time-consuming and can be a hassle, especially for newcomers who just want to get started quickly. I saw this as a missed opportunity to make development smoother and more accessible.

What it does

Enter etnsc-bootstrap - a command-line utility to start a configurable Electroneum node for development in two simple commands. All you need is Docker and Docker Compose, and you're good to go.

The node is essentially indistinguishable from etn-sc --dev running somewhere on the local machine (for example, can be connected to Remix with default settings).

One command is better than a thousand of words, so...

npx etnsc-bootstrap init && npx etnsc-bootstrap start

Notable Features

  • No more go build hassle and local filesystem management!
  • Start, stop and recreate the node in one command.
  • Pre-seed accounts when node is launched - no need to do it manually.
  • All your team members will run exactly the same reproducible setup.
  • Forget about long builds and setups: runs in your favorite CI provider as well!
  • Install from npm - no need to configure unfamiliar build tools and compilers.

How we built it

I initially decided to go with the most cross-platform solution possible: docker compose. This ensures that anyone with docker installed can access the application. However, this still did not provide sufficiently good developer experience and involved manual copy-pasting of files and quite lengthy commands. As a result, I ended up writing a CLI wrapper in rust that encapsulates all those steps.

Challenges we ran into

npm was an obvious choice as a distribution method: most blockchain developers should already have node ecosystem installed and configured. Unfortunately, npm does not support architecture-specific binaries, and I ended up publishing multiple packages for every popular operating system and architecture. However, that means long and unreadable package names, so another layer was needed: a "wrapper" package that selects one of those depending on user's platform.

Another problem is that github actions only support running linux-based docker images on Ubuntu. Unfortunately, both MacOS (ARM-based) and Windows runners lack the necessary capabilities to start them, and this is a fundamental limitation (confirmed by GitHub team). For now I went with renting a cloud-based Mac and Windows instances to test the deployment manually, but it would be great to expand the automated testing suite in future.

Accomplishments that we're proud of

I'm especially proud of building a tool that can be used anywhere and by anyone - frontend developers, backend developers and even CI environments. By leveraging multiple layers of encapsulation I was able to mount all the inherent complexity of building and launching a node with appropriate flags into a simple CLI command.

What's next for etnsc-bootstrap

I hope to continue development of this project as there's a lot more functionality to add. Since I'm already providing a CLI tool for node management, it would be nice to have:

  • Github action to start and stop the node in CI
  • Additional actions to add accounts, query balances and transactions and perform other simple actions without resorting to other commands - etnsc-bootstrap can become a multitool to solve most of trivial problems that would otherwise require writing more code or installing other third-party tools.

Built With

Share this project:

Updates