fboucquez
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Make a copy
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Make a copy Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    # How to create a symbol testnet network ## Introduction **Experimental/Draft!** There are several articles about how to create Symbol nodes connecting to Symbol Testnet or Mainnet networks. But, what if you want to create your own fully decentralized symbol network for fun/testing? If you want to test a symbol network locally you can just use symbol-bootstrap. Run: ```bash= symbol-bootstrap start -p bootstrap ``` This command will create a symbol network bundled in a unique docker-compose. The compose runs 2 peers nodes, 1 API node, and a rest gateway. This private network is great when testing new features, like a new transaction or new rest endpoint before the feature is deployed into a shared testnet. Private local networks are also great for e2e testing, when you want to start a network in a given or "empty" state, run some operations, assert the new states and reset the network. A local private network is not production-ready. Running multiple symbol nodes in one machine is not recommended, it's not decentralized, other people cannot connect to the network easily. In this guide, I'm going to explain how you can create your symbol network, how you can create multiple 'seed' nodes, and how you can share the network configuration so other people can connect to it. The name of this testnet is **Fernet**. This guide uses an experimental version of [`symbol-bootstrap`](https://github.com/symbol/symbol-bootstrap) and a new cli tool called [`symbol-network`](https://github.com/fboucquez/symbol-network). The `symbol-network` cli scales `symbol-bootstrap` to create and manage multiple nodes, for new or existing networks. ## Installation Before starting, let's install the required tooling. The tolling required is the same as the standard `symbol-bootstrap` but the experimental distribution (for now) and `symbol-network`. This guide assumes an Ubuntu distribution, other OSs would be similar. 1) Node, Docker, and Compose ```bash= curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash - apt-get update apt-cache policy docker-ce apt-get install -y unzip gcc g++ make nodejs unzip docker.io docker --version curl -L "https://github.com/docker/compose/releases/download/1.27.4/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose chmod +x /usr/local/bin/docker-compose docker-compose --version ``` 2) Install the experimental symbol-bootstrap ```bash= npm install -g symbol-bootstrap@network symbol-bootstrap version symbol-bootstrap verify ``` 3) Install the experimental symbol-network ```bash= npm install -g symbol-network@network symbol-network version symbol-network verify ``` ## Network Layout Before running symbol-network, it's good to think about the network layout we want initially for our network. The **Fernet** network would be: * Based on Symbol Tesnet * Single currency, named, `fernet.branca`, same initial supply. * Network domain `fernet.wtf`. No hostname prefix. * Network Type `Testnet` * Explorer, Web Wallet and Faucet * HTTP and HTTPS nodes * 2 Voting Peers - 3M balance * 1 Voting Dual - 3M balance * 2 Harvesting Dual Nodes - 1M balance ## Network Configuration Now that we know how the network should look, let's run the tool! ### Init: The first step is the init wizard: ```bash= mkdir symbol-fernet symbol-network init --ready ``` The first questions are about the basic network configuration. These questions are the most common, advance tunning can be manually done later by changing the yml files this command creates. ![symbol-network init network config](https://i.imgur.com/DdCqkNY.png) This command asks for a 'master' password. The master password is used to encrypt the generated network and node keys. The command skips this section if you are creating nodes for an existing network. For example, you want to create and maintain dozens of testnet/mainnet nodes. The second part asks how many nodes you want to create for a new or existing network. We are going to fill in the numbers defined above. ![symbol-network init node layout](https://i.imgur.com/du3ETJl.png) Once the `init` command finishes, you can see that 3 files have been created: - **network-input.yml**: the not-expanded network layout. It defines how many of each node we want. If you pre-create this file, `symbol-network init` won't ask you any questions and just run. - **key-store.yml**: The file that contains the network keys, nodes keys, and voting files the tool generates. The private values are encrypted using the provided `master` password. You can decrypt the file using `symbol-bootstrap decrypt` command. - **custom-network-preset.yml**: The network preset your nodes would use when running. These files are like the '-p mainnet' and `-p bootstrap` for your network. This is NOT the custom preset of a given node. You can tweak it, for example, change the network supply or inflation. The cli tool will recommend the different commands you can run next to continue the network creation process. ### Expand nodes: The second automatic step 'expands' the nodes so each node can be customized independently. ```bash= symbol-network expandNodes ``` This command creates the following file: - network.yml: It contains each node configuration, including their custom preset. It's possible to tune it by changing the default hostnames, friendly names or adding new custom preset properties like `logLevel: Debug` ### Nemesis generation: The third automatic step is to 'generate' the nemesis block for your new network. The nemesis block includes all the seed nodes accounts, link transactions, faucet, and 'founder' accounts. The founder account is the account that keeps the remaining supply after the node and faucet account distribution. All these accounts can be found encrypted in the **key-store.yml**. ```bash= symbol-network generateNemesis ``` This command generates: - nemesis-seed: a folder containing the nemesis block of your network. - nemesis-target: a folder containing a temporary node used to generate the nemesis block The `nemesis-seed` block along the `custom-network-preset.yml` could be shared so other people can connect to the network after launch. ### Try the Nemesis Node: Before creating the nodes to be published in your VPC infrastructure, you can try how everything looks by running: ```bash= symbol-bootstrap start -t nemesis-target --noPassword --detached --healthCheck --report ``` Go to the local explorer at `http://localhost:90`. Explorer shows the nemesis block, the seed accounts, the nodes' link transaction, etc. ![Explorer demo block 1](https://i.imgur.com/SkgCcfA.png) ![Explorer demo accounts](https://i.imgur.com/JFHVyh2.png) ![Explorer demo transactions](https://i.imgur.com/CvF0gTj.png) Once you are happy, stop the node: ```bash= symbol-bootstrap stop -t nemesis-target ``` ### Node configuration: Finally, to create the nodes' target folders and zip distributions ready to be deployed in your infrastructure, run: ```bash= symbol-network configureNodes --offline --zip ``` This command will ask for a new password, the 'node' password. The node password is used to encrypt each node individually. It's the password symbol-bootstrap asks when running the different commands. Use a different password than the master password. This last command generates: - nodes: the folders ready to use for each node - distribution: the zips of the node ready to be pushed to the VPC machine. ### Configuration backups: It's recommended you version the different created files. I use git to commit and backup the files. ```bash= git init ``` My .gitignore file: ``` nemesis-target/databases/ nemesis-target/nodes/node/logs/ nemesis-target/nodes/node/data/ nemesis-target/gateways/rest-gateway/logs/ logs.log ``` Then commit all the other files for future reference. You may or may not want to backup in a remote github repository. Node and network private keys are encrypted in the `key-store.yml` file. ## Network Deployment The `symbol-network` doesn't handle the deployment. It is outside the current scope of the tool. The possible infrastructures, cloud providers, and options are limitless. This is up to the developer to script it. You can use bash and scp, you can use terraform and s3 buckets or ansible scripts, etc. The required process is fairly simple though: - Install symbol-bootstrap@network and its dependencies on each node VPC. - SCP or Pull the zip to each node VPC, unzip. - Update firewalls opening ports 80, 7900, 3000, 3001, 443 depending on the node type. - Update the DNS values linking nodes' hostnames with the VPC IPs. The deployment process is similar to this [guide](https://dev.to/fboucquez/the-23-symbol-node-3c41) although the zips for all the nodes are precreated, you just need to deploy and `symbol-bootstrap run -d` them. ### Network launch: To run the network, connect to each box and run: ```bash= symbol-bootstrap run -d ``` ### Node update: The general process to upgrade a node is installing a new version of the `symbol-bootstrap`, and probably a `custom-network-preset.yml` (global change) or a `custom-preset.yml` (node change) upgrade. Then run: ```bash= symbol-bootstrap stop symbol-bootstrap start -c custom-preset.yml --upgrade ``` ### Allow new nodes to connect: If you want another person to connect to your network, share with him the `custom-network-preset.yml` and `nemesis-seed` folder. Then this person can run: ```bash= symbol-bootstrap start -p custom-network-preset.yml -a dual -c my-new-node-custom-preset.yml ``` Note that official Symbol networks have the network preset and seed bundled on `symbol-bootstrap`. That's why you can just run `-p testnet` or `-p mainnet`. The process for the custom testnet network is the same, just that the network prest and nemesis seed are externally provided. ### Contabo deployment I have deploed FerNet to [contabo's](https://contabo.com/) VPCs. These are the running nodes and services: - [dual-001.fernet.wtf](https://dual-001.fernet.wtf:3001/chain/info) - [dual-002.fernet.wtf](https://dual-002.fernet.wtf:3001/chain/info) - [dual-003.fernet.wtf](https://dual-003.fernet.wtf:3001/chain/info) - beacon-001.fernet.wtf - beacon-002.fernet.wtf - [Faucet](https://faucet.fernet.wtf) - [Explorer](https://explorer.fernet.wtf) Contabo [costs](https://contabo.com/en/vps) around 12 USD per node. The cost is quite lower than [Hetzner](https://www.hetzner.com/cloud) although Contabo's console is not nearly as nice. You may need to upgrade storage or processing power depending on how much the network is used. ## Conclusion I've created Symbol Network from our experience creating the initial Mainnet and current Testnet nodes. It bundles the original private tooling in a user-friendly and open-source cli that uses and scales Symbol Bootstrap. This new cli tool allows you to create and maintain new Symbol networks quickly as well as nodes for existing networks without losing the configurability Have a try! Feedback is always appreciated! ## TODOs - Remove the 'experimental' flag from the CLIs! There are still some features to be reviewed and merged before getting there. - Add Statistic Service to the `demo` assembly. This Statistic Service wouldn't be production-ready as it doesn't have HA. It could be good enough for different Testnets though. - Explain how to add additional accounts at nemesis block (duable, just need to explain and maybe update the wizard). - Update Explorer, Faucet to the latest with Statistic Service. It may not be trivial as the statistic service is essentially empty when launching a new network. These services may need to fall back initially to a static list? - Add a `services` assembly. An assembly without a symbol node that includes Explorer, Faucet, Statistic Service (and Web Wallet?) fully HTTPS 443 support. I have created this manually (for gurush.dev), I need to bundle it in a `symbol-bootstrap` assembly and `symbol-network` node type. - Add nemesis block multisig modification to symbol-network, so nodes' Mainnet accounts, faucet, and founder accounts are multisig from block 1. I had that for Mainnet/Testnet configuration, but I need to make it nice for the cli tool. This feature depends on `symbol-signer-cli` to create, cosign and merge them into nemesis block transactions. Of course, multisig can be done after network launches too!

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully