Skip to content

Commit

Permalink
Merge branch 'development' into eclesio/renaming-to-dot-on-docs
Browse files Browse the repository at this point in the history
  • Loading branch information
noot authored May 17, 2021
2 parents f367941 + a1cd49a commit a973968
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 37 deletions.
44 changes: 26 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,41 +58,47 @@ build gossamer command:
make gossamer
```

### Run Default Node
### Run Development Node

To initialise a development node:

initialise default node:
```
./bin/gossamer --chain gssmr init
./bin/gossamer --chain dev init
```

start default node:
To start the development node:
```
./bin/gossamer --chain gssmr --key alice
./bin/gossamer --chain dev
```

The built-in keys available for the node are `alice`, `bob`, `charlie`, `dave`, `eve`, `ferdie`, `george`, and `ian`.
The development node is configured to produce a block every slot and to finalise a block every round (as there is only one authority, `alice`.)

The node will not build blocks every slot by default; it will appear that the node is doing nothing, but it is actually waiting for a slot to build a block. If you wish to force it to build blocks every slot, you update the `[core]` section of `chain/gssmr/config.toml` to the following:
### Run Gossamer Node

The gossamer node runs by default as an authority with 9 authorites set at genesis. The built-in keys, corresponding to the authorities, that are available for the node are `alice`, `bob`, `charlie`, `dave`, `eve`, `ferdie`, `george`, and `ian`.

To initialise a gossamer node:
```
[core]
roles = 4
babe-authority = true
grandpa-authority = true
babe-threshold-numerator = 1
babe-threshold-denominator = 1
./bin/gossamer --chain gssmr init
```

Then, re-run the above steps. NOTE: this feature is for testing only; if you wish to change the BABE block production parameters, you need to create a modified runtime.
To start the gossamer node:
```
./bin/gossamer --chain gssmr --key alice
```

Note: If you only run one gossamer node, the node will not build blocks every slot or finalize blocks; it will appear that the node is doing nothing, but it is actually waiting for a slot to build a block. This is because there are 9 authorities set, so at least 6 of the authorities should be run for a functional network. If you wish to reduce the number of authorities, you can modify the genesis file in `chain/gssmr/genesis-spec.json`.

### Run Kusama Node

initialise kusama node:
Kusama is currently supported as a **full node**, ie. it can sync the chain but not act as an authority.

To initialise a kusama node:
```
./bin/gossamer --chain kusama init
```

start kusama node:
To start the kusama node:
```
./bin/gossamer --chain kusama
```
Expand All @@ -108,12 +114,14 @@ After it's finished bootstrapping, the node should begin to sync.

### Run Polkadot Node

initialise polkadot node:
Polkadot is currently supported as a **full node**, ie. it can sync the chain but not act as an authority.

To initialise a polkadot node:
```
./bin/gossamer --chain polkadot init
```

start polkadot node:
To start the polkadot node:
```
./bin/gossamer --chain polkadot
```
Expand Down
31 changes: 18 additions & 13 deletions docs/docs/getting-started/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,31 +23,36 @@ Run the following command to build the Gossamer binary:
make gossamer
```

## Run a Gossamer Node
### Run Development Node

To initialise a development node:

To run default Gossamer node, first initialise the node. This writes the genesis state to the database.
```
./bin/gossamer --chain gssmr init
./bin/gossamer --chain dev init
```

The gossamer node runs as an authority by default. The built-in authorities are `alice`, `bob`, `charlie`, `dave`, `eve`, `ferdie`, `george`, and `ian`. To start the node as an authority, provide it with a built-in key:
To start the development node:
```
./bin/gossamer --chain gssmr --key alice
./bin/gossamer --chain dev
```

The development node is configured to produce a block every slot and to finalise a block every round (as there is only one authority, `alice`.)

The node will not build blocks every slot by default; it will appear that the node is doing nothing, but it is actually waiting for a slot to build a block. If you wish to force it to build blocks every slot, you update the `[core]` section of `chain/gssmr/config.toml` to the following:
### Run Gossamer Node

The gossamer node runs by default as an authority with 9 authorites set at genesis. The built-in keys, corresponding to the authorities, that are available for the node are `alice`, `bob`, `charlie`, `dave`, `eve`, `ferdie`, `george`, and `ian`.

To initialise a gossamer node:
```
[core]
roles = 4
babe-authority = true
grandpa-authority = true
babe-threshold-numerator = 1
babe-threshold-denominator = 1
./bin/gossamer --chain gssmr init
```

To start the gossamer node:
```
./bin/gossamer --chain gssmr --key alice
```

Then, re-run the above steps. NOTE: this feature is for testing only; if you wish to change the BABE block production parameters, you need to create a modified runtime.
Note: If you only run one gossamer node, the node will not build blocks every slot or finalize blocks; it will appear that the node is doing nothing, but it is actually waiting for a slot to build a block. This is because there are 9 authorities set, so at least 6 of the authorities should be run for a functional network. If you wish to reduce the number of authorities, you can modify the genesis file in `chain/gssmr/genesis-spec.json`.

If you wish to run the default node as a non-authority, you can specify `roles=1`:
```
Expand Down
7 changes: 1 addition & 6 deletions dot/core/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -284,12 +284,7 @@ func (s *Service) handleReceivedBlock(block *types.Block) (err error) {
return ErrNilBlockState
}

err = s.blockState.AddBlock(block)
if err != nil {
return err
}

logger.Debug("added block from BABE", "header", block.Header, "body", block.Body)
logger.Debug("got block from BABE", "header", block.Header, "body", block.Body)

msg := &network.BlockAnnounceMessage{
ParentHash: block.Header.ParentHash,
Expand Down
5 changes: 5 additions & 0 deletions lib/babe/babe.go
Original file line number Diff line number Diff line change
Expand Up @@ -505,6 +505,11 @@ func (b *Service) handleSlot(slotNum uint64) error {
logger.Info("built block", "hash", hash.String(), "number", block.Header.Number, "slot", slotNum)
logger.Debug("built block", "header", block.Header, "body", block.Body, "parent", parent.Hash())

err = b.blockState.AddBlock(block)
if err != nil {
return err
}

err = b.safeSend(*block)
if err != nil {
logger.Error("failed to send block to core", "error", err)
Expand Down

0 comments on commit a973968

Please sign in to comment.