/lotus-devnet

Contanerized Lotus devnet using a mocked sectorbuilder

Primary LanguageGo

Lotus Devnet

Runs a Lotus Devnet using a mocked sectorbuilder which can be accesed as a real Lotus node through the API. The devnet code is always tried to be update with Lotus latest master tag.

Compile & Run

make clean
CGO_CFLAGS="-D__BLST_PORTABLE__" make
go build -o lotus-devnet main.go
./lotus-devnet

The devnet supports the following configuration:

  • -speed: Time in milliseconds that blocks are mined. Default is 100ms.
  • -numminers: Number of miners. Default is 1. (Note: higher values is an experimental feature)
  • -bigsectors: Miners will use 512Gib sector sizes. Default is true, if set to false miners will use 2Kib sectors
  • -ipfsaddr: IPFS multiaddr to allow the client be connected to an IPFS node as a blockstorage.

All flags can be specified by environment variables using the TEXLOTUSDEVNET_ prefix. e.g: TEXLOTUSDEVNET_SPEED=1000

Important: The API will be listening on port 7777 (not in 1234 which is the usual default).

Docker

The Lotus Devnet was originally thought for integration tests in CI pipelines.

Build locally

You can build the Docker image by running docker build ..

Public images

A public Docker image is hosted in DockerHub on every master commit. Refer to textile/lotus-devnet.

For example, running a Lotus Devnet with 1.5s block generation speed:

docker run -e TEXLOTUSDEVNET_SPEED=1500 textile/lotus-devnet

Contributing

This project is a work in progress. As such, there's a few things you can do right now to help out:

  • Ask questions! We'll try to help. Be sure to drop a note (on the above issue) if there is anything you'd like to work on and we'll update the issue to let others know. Also get in touch on Slack.
  • Open issues, file issues, submit pull requests!
  • Perform code reviews. More eyes will help a) speed the project along b) ensure quality and c) reduce possible future bugs.
  • Take a look at the code. Contributions here that would be most helpful are top-level comments about how it should look based on your understanding. Again, the more eyes the better.
  • Add tests. There can never be enough tests.

Before you get started, be sure to read our contributors guide and our contributor covenant code of conduct.

Changelog

Changelog is published to Releases.

License

MIT