|
|
# Part 1
|
|
|
To create your own side first you need to interact with our main smart contract [here](https://lition.io/sidechainmanager).
|
|
|
* For creating network please click on **Register new chain**.
|
|
|
# Contract interaction (register chain) - part 1
|
|
|
* Open [Lition sidechain manager](https://www.lition.io/sidechainmanager/#/) in your browser
|
|
|
* To create a new sidechain, creator must become also a validator
|
|
|
* For creating new sidechain please click on **Register new chain**
|
|
|
|
|
|
![1](uploads/fc6ee5f95e938bd42db721a183733f71/1.png)
|
|
|
![register-new-chain](uploads/1d800aa509029b64fce2d8a175fde6da/register-new-chain.png)
|
|
|
|
|
|
* First of all, you need to have some small amount of ETH and LIT tokens on your account. In case you are on testet, you can get ETH [here](https://faucet.metamask.io/) and you can mint new testing LIT tokens [here](https://www.lition.io/sidechainmanager/#/register/networks/ropsten/mint-test-tokens) (this step is just for Ropsten network) recommended amount is 15 000 LIT (10k for vesting & 5k for deposit). **Do not forget click on Mint!**
|
|
|
* Now you need to approve our main smart contract to use that amount of tokens, so please specify same amount as in step before an click on approve.
|
|
|
* Now you need to fill information about your side chain. **Be aware that except of description and endpoint you can not change those information later!**
|
|
|
* First of all, you need to have some small amount of ETH on your account. In case you are on testet, you can get ETH [here](https://faucet.metamask.io/)
|
|
|
* Please **skip steps** `Mint test tokens` and `Approve spender`. You can do it by leaving all input values empty and just click on buttons Mint test tokens and Approve spender. At the end you should get to the Register chain form.
|
|
|
* You need to fill information about your side chain. **Be aware that except of description and endpoint you can not change those information later!**
|
|
|
|
|
|
![register_chain](uploads/0a2b0674b75e99aef57cc5178828c584/register_chain.png)
|
|
|
![register-sidechain-4](uploads/2534fe7aa69381ab596224843afd0433/register-sidechain-4.png)
|
|
|
|
|
|
`@param description` Description of the chain (e.g name, short purpose description, etc...). Cannot be empty. Max num of characters is 200
|
|
|
|
|
|
`@param initEndpoint` Chain endpoint, might be a website with chain description, condition to join
|
|
|
and nodes ip:port addresses that can be used fo joining. Cannot be empty. Max num of characters is 100
|
|
|
|
|
|
`@param chainValidator` External validator contract, might imolement more sophisticated rules for joing the chain as validator or as user (e.g. accounts whitelisting, etc...). 0 means no external validator contract
|
|
|
`@param chainValidator (advanced)` External validator contract, might imolement more sophisticated rules for joing the chain as validator or as user (e.g. accounts whitelisting, etc...). 0 means no external validator contract
|
|
|
|
|
|
`@param minRequiredDeposit` Min.required deposit to become transactor (user). It must be some reasonable number as user should never be able to run out of tokens during notaryPeriod considering max. tx fee is fixed to 0.1 LIT tokens E.g. there is private chain with whitelisted users and user creator know they will send max. 100 000 txs / notaryPeriod. Min. required deposit should be then 10 000 LIT tokens. It is something like prebought credit for transactions that is required to have on your account before each notary. In fact, users will have to deposit more than minRequiredDeposit as they will be automatically blacklisted during the notary even if they sent only 1 tx, because their deposit balance would be < minRequiredDeposit before the next notary. On top of this condition, chain creator might implement more sophisticated condition in external validator contract. 0 means default (1000 LIT), otherwise must be >= 1000 LIT tokens
|
|
|
|
... | ... | @@ -31,34 +32,34 @@ and nodes ip:port addresses that can be used fo joining. Cannot be empty. Max nu |
|
|
|
|
|
`@param maxNumOfTransactors` Max. number of transactors/users (those who deposited. It is recommended to restrict this number as notary will not be able to process theoretically unlimited number of users. On top of this condition, chain creator might implement more sophisticated condition in external validator contract. 0 means unlimited
|
|
|
|
|
|
`@param involvedVestingNotaryCond` Flag, if 50% invloved vesting condition should be checked during notary. It means that vesting balances sum of those validators, who signed statistics sent to the notary must be > 50% of the sum of all active validators vesting balances on chain. At least one of the involvedVestingNotaryCond or
|
|
|
`@param involvedVestingNotaryCond (advanced)` Flag, if 50% invloved vesting condition should be checked during notary. It means that vesting balances sum of those validators, who signed statistics sent to the notary must be > 50% of the sum of all active validators vesting balances on chain. At least one of the involvedVestingNotaryCond or
|
|
|
participationNotaryCond must be specified
|
|
|
|
|
|
`@param participationNotaryCond` Flag, 2/3 + 1 participation condition should be checked during notary. It means that more or equal to 2/3+1 of all active validators on chain must sign statistics sent to the notary for notary to be accepted. At least one of the involvedVestingNotaryCond or participationNotaryCond must be specified
|
|
|
`@param participationNotaryCond (advanced)` Flag, 2/3 + 1 participation condition should be checked during notary. It means that more or equal to 2/3+1 of all active validators on chain must sign statistics sent to the notary for notary to be accepted. At least one of the involvedVestingNotaryCond or participationNotaryCond must be specified
|
|
|
|
|
|
|
|
|
* After the chain registration is confirmed on Ethereum, you can see nice summary of your freshly registered chain
|
|
|
|
|
|
![chain_created](uploads/610e1d49f9028458ac45292c359b50ce/chain_created.png)
|
|
|
![register-sidechain-5](uploads/769708f44c94c4c095dd63f2b1b7f176/register-sidechain-5.png)
|
|
|
|
|
|
* Please remember the `CHAIN ID` as you will need it later on
|
|
|
* **Now you need to become a validator to be able to start up your new sidechain.** in part 2
|
|
|
|
|
|
### Advanced
|
|
|
`Chain validator address` you can specify address of your own validator contract for more sophisticated validation of new validators and transactors, e.g. with different minimum vesting/deposit or specific users whitelist, etc...
|
|
|
# Contract interaction (become a validator) - part 2
|
|
|
**You must finish all the steps from part 1 before you can start with part 2**<br />
|
|
|
* To become a validator on your new chain, please follow instruction in [Join-Network-as-a-validator tutorial](Join-Network-as-a-validator) - **follow only instructions from Contract interaction - part 1 of this tutorial !!!**
|
|
|
* When you finish, come back here and start with part 3
|
|
|
|
|
|
### Notary conditions
|
|
|
`Involved vesting > 50%` your notary will be valid only if validators with more then 50% total vesting will confirm notary (recommended)
|
|
|
|
|
|
`2/3 + 1 Participation` your notary will be valid only if 2/3 + 1 of all validators will confirm notary
|
|
|
|
|
|
|
|
|
# Part 2
|
|
|
You need to follow those steps to finalize network creation:
|
|
|
* install docker `sudo apt install docker.io`
|
|
|
# Node start-up - part 3
|
|
|
**You must finish all the steps from part 2 before you can start with part 3**<br />
|
|
|
Follow these steps to setup your server and start up the node and finalize sidechain network creation:<br />
|
|
|
* install docker, you can follow this [tutorial](https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-on-ubuntu-18-04) for example, but feel free to install it any way you prefer.
|
|
|
* clone `master` branch of lition-maker `git clone https://gitlab.com/lition/lition-maker`
|
|
|
* go to lition maker folder `cd lition-maker`
|
|
|
* run setup script `./setup.sh` - our recommendation is to use screen or something similar to run your node
|
|
|
|
|
|
**Important !!!** You can also run a command with parameters instead of manually typing it, see [readme](https://gitlab.com/lition/lition-maker/blob/master/README.md) and example at the end of this part
|
|
|
|
|
|
Now you need to follow interactive setup of your node:
|
|
|
```
|
|
|
_ __ __
|
... | ... | @@ -86,11 +87,9 @@ Now you need to select number **1** |
|
|
```
|
|
|
Please select ethereum network: [Enter for default -> Ropsten]
|
|
|
1) Ropsten
|
|
|
2) Mainnet (not supported yet)
|
|
|
2) Mainnet
|
|
|
```
|
|
|
|
|
|
Right now we have just Ropsten version please select **1**
|
|
|
|
|
|
`Please enter IP Address of this node:` please specify IP address of your node
|
|
|
|
|
|
`Please enter existing chainId to connect to:` please specify chain ID you would like to connect to
|
... | ... | @@ -105,3 +104,25 @@ Please enter WS Port of this node[Default:22004]: |
|
|
|
|
|
You can use default values by pressing *Enter* or used ports that you would like to. **Warning please sure that you properly secure RPC Port and WS Port, so only you or your Dapp can connect to them!**
|
|
|
|
|
|
### Node setup by command example
|
|
|
* Instead of manually typing all the required information, you can run a command instead, see example below:
|
|
|
|
|
|
```bash
|
|
|
./setup.sh create -n DemoCreator ip <YOUR SERVER IP ADDRESS> -r 22000 -w 22001 -c 22002 --nm 22003 --ws 22004 -pk <YOUR MINING PRIVATE KEY> --ethnet ropsten --chainId 14 2>&1 | tee ~/log
|
|
|
```
|
|
|
|
|
|
## Node successful start-up
|
|
|
|
|
|
* After you run manually ./setup.sh or run it as a command, it automatically calls `startMining` on Lition Registry contract to let the other nodes know that your node is up and your are ready to take part in mining process.
|
|
|
* Please note that this might take quite some time as `startMining` is processed on Ethereum network so in edge cases it might take even few hours, but usually it is just a few minutes.
|
|
|
* Once you see message the **Node is running**, everything is setup and your node is running
|
|
|
|
|
|
# Node restart
|
|
|
|
|
|
* If you must shut down your node or it just crashed from some reason, do not use ./setup.sh script again to boot it up - it would override the saved state (blocks, your private keys in keystore if you added some, etc...)
|
|
|
* For restart, please enter the directory with saved state - it is the `Node name` parameter that you specified during setup and run ./start.sh script without any parameters. In case of this example it is **DemoCreator**
|
|
|
|
|
|
```bash
|
|
|
cd DemoCreator/
|
|
|
./start.sh
|
|
|
``` |
|
|
\ No newline at end of file |