fboucquez / symbol-bootstrap

A tool that allows you to quickly configure and setup Symbol testnets and nodes.
Apache License 2.0
47 stars 28 forks source link

symbol-bootstrap

Symbol CLI tool that allows you creating, configuring and running Symbol blockchain complete networks or nodes to be sync with existing networks.

oclif Version Downloads/week License Build Coverage Status Api Doc

Key features:

Concepts

Preset:

Yaml files that define the configuration and layout of the network and nodes. It defines how many nodes, database, rest gateways, the modes, keys, etc.

Presets are defined at 4 levels from general to specific:

Properties in each file override the previous values (by object deep merge).

Network Presets:

Assemblies:

Custom preset:

It's the way you can tune the network without modifying the code. It's a yml file (--customPreset param) that could override some or all properties in the out-of-the-box presets.

Custom presets give Symbol Bootstrap its versatility. Check out the custom preset guides!

Target:

The folder where the generated config, docker files and data are stored.

The folder structure is:

Note: The target folder should not be manually modified. This tool may override any file in the target folder when doing upgrades. Any custom configuration should be provided via a custom preset. Check out the custom preset guides!

Requirements

Check your user can run docker without sudo:

docker run hello-world

If you see an error like:

Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock

Please follow this guide.

Installation

It's recommended to run the commands from en empty working dir.

The network configuration, data and docker files will be created inside the target folder ('./target') by default.

mkdir my-networks
cd my-networks

Once in the working dir:

$ npm install -g symbol-bootstrap
$ symbol-bootstrap COMMAND
running command...
$ symbol-bootstrap (-v|--version|version)
symbol-bootstrap/1.1.7 linux-x64 node-v12.22.10
$ symbol-bootstrap --help [COMMAND]
USAGE
  $ symbol-bootstrap COMMAND
...

Validate your environment by running:

symbol-bootstrap verify

The general usage would be:

symbol-bootstrap config -p testnet -a dual
symbol-bootstrap compose
symbol-bootstrap run

You can aggregate all these commands with this one liner:

symbol-bootstrap start -p testnet -a dual

If you need to start fresh, you many need to sudo remove the target folder (docker volumes dirs may be created using sudo). Example:

sudo rm -rf ./target

Examples

Network presets and assemblies can be combined to generate different types of nodes. Some examples:

Although some combinations can be done, they may not be really useful. Examples that are NOT useful:

A custom network preset file can also be provided. This is useful when you have your own custom Symbol network, and you want other nodes to join. For this case, you provide your own networkPreset.yml and nemesis feed folder. The node admin can then run:

The demo assemblies starts a local Explorer http://localhost:90 and Faucet http://localhost:100.

Wizard

If this is your first time creating a node, it's recommended to use the Wizard. Just follow the instructions:

symbol-bootstrap wizard

Development

If you want to contribute to this tool, clone this repo and run:

npm install -g

Then, symbol-bootstrap runs from the source code. You can now try your features after changing the code.

Pull Requests are appreciated! Please follow the contributing guidelines.

Note: cloning this repo is only for people that want to tune the tool in a way it cannot be configured. If this is your case, please provide a feature request. General users should install this tool like any other node module.

Code style

To format the source code, verify/fix lint issues, and generate the commands docs, run:

npm run style:fix

Support

Symbol Bootstrap is a personal project maintained on my free time.

If you like it, please consider supporting it by delegating your Symbol account to my node:

name: symbol-node-dual-1.tawa.solutions
publicKey: 6DB275B83F4839768821FF621DD90358F99A84EC61EB7DE1F6947E5B0926B9BB

If you don't like it, let me know by creating issues on GitHub. Pull Requests are welcome!

Command Topics