Coder Social home page Coder Social logo

sia-ant-farm's Introduction

sia-antfarm

Build Status

sia-antfarm is a collection of utilities for performing complex, end-to-end tests of the Sia platform. These test are long-running and offer superior insight into high-level network behaviour than Sia's existing automated testing suite.

Prerequisites

You must have siad installed. If it's outside of your path, provide its location using the -siad flag. For all flags, see sia-antfarm -h.

Install

make

Running a sia-antfarm

This repository contains one utility, sia-antfarm. sia-antfarm starts up a number of siad instances, using jobs and configuration options parsed from the input config.json. sia-antfarm takes on flag, -config, which is a path to a JSON file defining the ants and their jobs. See nebulous-configs/ for some examples that we use to test Sia.

An example config.json:

config.json:

{
	"antconfigs": 
	[ 
		{
			"jobs": [
				"gateway"
			]
		},
		{
			"jobs": [
				"gateway"
			]
		},
		{
			"jobs": [
				"gateway"
			]
		},
		{
			"jobs": [
				"gateway"
			]
		},
		{
			"apiaddr": "127.0.0.1:9980",
			"jobs": [
				"gateway",
				"mining"
			]
		}
	],
	"autoconnect": true
}

This config.json creates 5 ants, with four running the gateway job and one running a gateway and a mining job. If HostAddr, APIAddr, or RPCAddr are not specified, they will be set to a random port. If autoconnect is set to false, the ants will not automatically be made peers of eachother.

Available configuration options:

{
	'ListenAddress': the listen address that the `sia-antfarm` API listens on
	'AntConfigs': an array of `AntConfig` objects, defining the ants to run on this antfarm
	'AutoConnect': a boolean which automatically bootstraps the antfarm if provided
	'ExternalFarms': an array of strings, where each string is the api address of an external antfarm to connect to.
}

AntConfigs have the following options:

{
	'APIAddr': the api address for the ant to listen on, by default an unused localhost: bind address will be used.
	'RPCAddr': the RPC address for the ant to listen on, by default an unused bind address will be used.
	'HostAddr': the Host address for the ant to listen on, by default an unused bind address will be used.
	'SiaDirectory': the data directory to use for this ant, by default a unique directory in `./antfarm-data` will be generated and used.
	'SiadPath': the path to the `siad` binary, by default the `siad` in your path will be used.
	'Jobs': an array of jobs for this ant to run. available jobs include: ['miner', 'host', 'renter', 'gateway']
	'DesiredCurrency': a minimum (integer) amount of SiaCoin that this Ant will attempt to maintain by mining currency. This is mutually exclusive with the `miner` job.
}

License

The MIT License (MIT)

sia-ant-farm's People

Contributors

avahowell avatar lukechampine avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.