Skip to content

Commit

Permalink
chore(release): release v0.4.0 (#1513)
Browse files Browse the repository at this point in the history
* feat: cmd: implement import-runtime subcommand (#1483)

* fix(lib/crypto/ed25519): update ed25519 to use go-schnorrkel bip39 derivation (#1488)

* fix(state) : Update StorageState to load storage from database. (#1486)

* fix(dot/state): fix usage of trie.Snapshot (#1489)

* fix(dot/state,dot/network): improve memory usage when syncing (#1491)

* fix(dot/network): update notificationsProtocol handshakeData to sync.Map (#1492)

* remove log (#1493)

* feat(dot/network): request block justifications when near head (#1499)

* chore(cmd): rename genesis-raw flag and files to genesis, allow raw and human-readable genesis to be passed to it (#1500)

* refactor: docs: Docs Overhaul (#1438)

* Beginning new docs

* Theming set up

* General layouts n links sorted

* Cleaned up

* Updated Commandline

* Cleaned a bit

* Minor cleaning

* Removed todo

* Config page

* Connect to Polkadotjs

* Fixed dev resources

* New categories sorted

* Updated permalink

* Corrected contributor doc

* Removed unused partials

* Tidying

* Removed offical nodes page

* Amended with feed back

* Resolved a majority of feedback

* Ammeded workflows

* Feedback

* Added diagram

* Recent feedback

* Test package content

* Removed comment

* Debugging page

* Block production expansion

* Typos

* Host spec link

Co-authored-by: noot <36753753+noot@users.noreply.github.com>

* chore(codeowners): update codeowners file (#1505)

* fix: cmd/gossamer: Generate random name if --name flag not set (#1506)

* generate random name if --name flag not set

* update tests with name flag to handle random names

* update tests that reference name cfg

* chore(release): Automated release using semantic-release. (#1503)

* feat: dot/telemetry: Implement basic telemetry connection (#1497)

* implement telemetry connection server

* add telemetry for import block

* setup telemetry to use node name from Global config

* init telemetry connections based on genesis.json values

* fix error message formatting

* add tests for telemetry

* implement no-telemetry cli flag

* fix typos

* cleanup error check

* create TelemetryEndpoint struct

* created connection data struct to hold connection data

* make TelemetryEndpoints a pointer reference

* add tests for interfaceToTelemetryEndpoint

* update test to fix random name

* fix: fix edit link (#1507)

* chore(readme): Fix broken image link (#1509)

Co-authored-by: Arijit Das <arijit@chainsafe.io>

* fix(dot/network): fix justification request at head logic (#1510)

* feat(dot/network): implement persistent peers functionality (#1512)

* chore(release): Update name in package.json. (#1514)

* Update package.json.

* Disable package publish to npm.

* Add support to skip a release.

* feat(dot/network): Add cache for network message. (#1511)

* Add cache for network message.

* chore(release): Fix Deepsource error on development branch. (#1516)

* Fix Deepsource error.

* Fix lint issues.

Co-authored-by: noot <36753753+noot@users.noreply.github.com>
Co-authored-by: Ryan Noble <ryanjnoble@gmail.com>
Co-authored-by: Dustin Brickwood <dustinbrickwood204@gmail.com>
Co-authored-by: Edward Mack <ed@edwardmack.com>
  • Loading branch information
5 people authored Apr 13, 2021
1 parent b8c4dd7 commit d53e245
Show file tree
Hide file tree
Showing 189 changed files with 3,478 additions and 2,015 deletions.
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# CODEOWNERS: https://help.github.com/articles/about-codeowners/

# Primary repo maintainers
* @noot @arijitAD @edwardmack @RyRy79261
* @noot @arijitAD @edwardmack
2 changes: 1 addition & 1 deletion .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ $ git remote -v (you should see myrepo and gossamer in the list of remotes)

To start, check out our open issues. We recommend starting with an [issue labeled `Good First Issue`](https://github.com/ChainSafe/gossamer/issues?q=is%3Aopen+is%3Aissue+label%3A%22Good+First+Issue%22). Leave a comment to let us know that you would like to work on it.

Another option is to improve gossamer where you see fit based on your evaluation of our code. In order to best faciliate collabration, please create an issue before you start working on it.
Another option is to improve gossamer where you see fit based on your evaluation of our code. In order to best faciliate collaboration, please create an issue before you start working on it.

**6. Make improvements to the code.**

Expand Down
61 changes: 13 additions & 48 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -1,56 +1,21 @@
name: docs

name: Publish docs via GitHub Pages
on:
push:
branches:
- development

env:
RUBY_VERSION: 2.7
BUNDLE_GEMFILE: docs/Gemfile

jobs:
deploy_docs:
runs-on: 'ubuntu-latest'
build:
name: Deploy docs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-ruby@v1
with:
ruby-version: ${{ env.RUBY_VERSION }}
- name: Setup cache for Bundler
id: cache
uses: actions/cache@v2
with:
path: vendor/bundle
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: |
${{ runner.os }}-gems-
- name: Set up dependencies
run: |
bundle install --path=vendor/bundle --jobs 4 --retry 3
bundle clean
- name: Clone target branch
run: |
REMOTE_BRANCH="${REMOTE_BRANCH:-gh-pages}"
REMOTE_REPO="https://${GITHUB_ACTOR}:${{ secrets.GITHUB_TOKEN }}@github.com/${GITHUB_REPOSITORY}.git"
echo "Publishing to ${GITHUB_REPOSITORY} on branch ${REMOTE_BRANCH}"
rm -rf docs/_site/
git clone --depth=1 --branch="${REMOTE_BRANCH}" --single-branch --no-checkout \
"${REMOTE_REPO}" docs/_site/
- name: Build site
run: bundle exec jekyll build --source docs --destination docs/_site --verbose --trace
- name: Checkout main
uses: actions/checkout@v2

- name: Deploy docs
uses: mhausenblas/mkdocs-deploy-gh-pages@master
env:
# For jekyll-github-metadata
JEKYLL_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Deploy to GitHub Pages
run: |
SOURCE_COMMIT="$(git log -1 --pretty="%an: %B" "$GITHUB_SHA")"
pushd docs/_site &>/dev/null
: > .nojekyll
git add --all
git -c user.name="${GITHUB_ACTOR}" -c user.email="${GITHUB_ACTOR}@users.noreply.github.com" \
commit --quiet \
--message "Deploy docs from ${GITHUB_SHA}" \
--message "$SOURCE_COMMIT"
git push
popd &>/dev/null
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CUSTOM_DOMAIN: gossamer.chainsafe.io
CONFIG_FILE: docs/mkdocs.yml
EXTRA_PACKAGES: build-base
26 changes: 26 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Release
on:
push:
branches: [main, development]

jobs:
release:
if: "!contains(github.event.head_commit.message, 'skip ci')"
name: Release
runs-on: ubuntu-18.04
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: 12
- name: Install dependencies
run: npm install @semantic-release/changelog @semantic-release/git @semantic-release/changelog @semantic-release/commit-analyzer @semantic-release/exec @semantic-release/git semantic-release/release-notes-generator
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npx semantic-release
32 changes: 32 additions & 0 deletions .releaserc
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"branches": ["+([0-9])?(.{+([0-9]),x}).x", "main", "next"],
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
[
"@semantic-release/changelog",
{
"changelogFile": "CHANGELOG.md",
"changelogTitle": "# Semantic Versioning Changelog"
}
],
[
"@semantic-release/git",
{
"assets": [
"CHANGELOG.md"
]
}
],
[
"@semantic-release/github",
{
"assets": [
{
"path": "dist/**"
}
]
}
]
]
}
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ build-debug:

## init: Initialize gossamer using the default genesis and toml configuration files
init:
./bin/gossamer --key alice init --genesis-raw chain/gssmr/genesis-raw.json --force
./bin/gossamer --key alice init --genesis chain/gssmr/genesis.json --force

## init-repo: Set initial configuration for the repo
init-repo:
Expand Down Expand Up @@ -126,4 +126,4 @@ gossamer: clean

## install: install the gossamer binary in $GOPATH/bin
install:
GOBIN=$(GOPATH)/bin go run scripts/ci.go install
GOBIN=$(GOPATH)/bin go run scripts/ci.go install
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div align="center">
<img alt="Gossamer logo" src="/docs/assets/img/gossamer_banner.png" width="600" />
<img alt="Gossamer logo" src="/docs/docs/assets/img/gossamer_banner.png" width="600" />
</div>
<div align="center">
<a href="https://www.gnu.org/licenses/gpl-3.0">
Expand Down
2 changes: 1 addition & 1 deletion chain/gssmr/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ grandpa = ""
sync = ""

[init]
genesis-raw = "./chain/gssmr/genesis-raw.json"
genesis = "./chain/gssmr/genesis.json"

[account]
key = ""
Expand Down
4 changes: 2 additions & 2 deletions chain/gssmr/defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ var (

// InitConfig

// DefaultGenesisRaw Default genesis configuration path
DefaultGenesisRaw = string("./chain/gssmr/genesis-raw.json")
// DefaultGenesis is the default genesis configuration path
DefaultGenesis = string("./chain/gssmr/genesis.json")

// AccountConfig

Expand Down
43 changes: 0 additions & 43 deletions chain/gssmr/genesis-raw.json

This file was deleted.

140 changes: 140 additions & 0 deletions chain/gssmr/genesis-spec.json

Large diffs are not rendered by default.

181 changes: 42 additions & 139 deletions chain/gssmr/genesis.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion chain/kusama/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ grandpa = ""
sync = ""

[init]
genesis-raw = "./chain/kusama/genesis-raw.json"
genesis = "./chain/kusama/genesis.json"

[account]
key = ""
Expand Down
4 changes: 2 additions & 2 deletions chain/kusama/defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ var (

// InitConfig

// DefaultGenesisRaw Default genesis configuration path
DefaultGenesisRaw = string("./chain/kusama/genesis-raw.json")
// DefaultGenesis is the default genesis configuration path
DefaultGenesis = string("./chain/kusama/genesis.json")

// AccountConfig

Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion chain/polkadot/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ grandpa = ""
sync = ""

[init]
genesis-raw = "./chain/polkadot/genesis-raw.json"
genesis = "./chain/polkadot/genesis.json"

[account]
key = ""
Expand Down
4 changes: 2 additions & 2 deletions chain/polkadot/defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ var (

// InitConfig

// DefaultGenesisRaw Default genesis configuration path
DefaultGenesisRaw = string("./chain/polkadot/genesis-raw.json")
// DefaultGenesis is the default genesis configuration path
DefaultGenesis = string("./chain/polkadot/genesis.json")

// AccountConfig

Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion cmd/gossamer/account.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ func getKeystorePassword(ctx *cli.Context) []byte {
// unlockKeystore compares the length of passwords to the length of accounts,
// prompts the user for a password if no password is provided, and then unlocks
// the accounts within the provided keystore
func unlockKeystore(ks keystore.Keystore, basepath string, unlock string, password string) error {
func unlockKeystore(ks keystore.Keystore, basepath, unlock, password string) error {
var passwords []string

if password != "" {
Expand Down
48 changes: 30 additions & 18 deletions cmd/gossamer/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
package main

import (
"encoding/binary"
"fmt"
"strconv"
"strings"
Expand All @@ -32,6 +33,7 @@ import (
"github.com/ChainSafe/gossamer/lib/runtime/life"
"github.com/ChainSafe/gossamer/lib/runtime/wasmer"
"github.com/ChainSafe/gossamer/lib/runtime/wasmtime"
"github.com/cosmos/go-bip39"

log "github.com/ChainSafe/log15"
"github.com/urfave/cli"
Expand Down Expand Up @@ -368,18 +370,18 @@ func setLogConfig(ctx *cli.Context, cfg *ctoml.Config, globalCfg *dot.GlobalConf

// setDotInitConfig sets dot.InitConfig using flag values from the cli context
func setDotInitConfig(ctx *cli.Context, tomlCfg ctoml.InitConfig, cfg *dot.InitConfig) {
if tomlCfg.GenesisRaw != "" {
cfg.GenesisRaw = tomlCfg.GenesisRaw
if tomlCfg.Genesis != "" {
cfg.Genesis = tomlCfg.Genesis
}

// check --genesis-raw flag and update init configuration
if genesis := ctx.String(GenesisRawFlag.Name); genesis != "" {
cfg.GenesisRaw = genesis
// check --genesis flag and update init configuration
if genesis := ctx.String(GenesisFlag.Name); genesis != "" {
cfg.Genesis = genesis
}

logger.Debug(
"init configuration",
"genesis-raw", cfg.GenesisRaw,
"genesis", cfg.Genesis,
)
}

Expand All @@ -405,9 +407,17 @@ func setDotGlobalConfig(ctx *cli.Context, tomlCfg *ctoml.Config, cfg *dot.Global
cfg.MetricsPort = tomlCfg.Global.MetricsPort
}

// TODO: generate random name if one is not assigned (see issue #1496)
// check --name flag and update node configuration
if name := ctx.GlobalString(NameFlag.Name); name != "" {
cfg.Name = name
} else {
// generate random name
entropy, _ := bip39.NewEntropy(128)
randomNamesString, _ := bip39.NewMnemonic(entropy)
randomNames := strings.Split(randomNamesString, " ")
number := binary.BigEndian.Uint16(entropy)
cfg.Name = randomNames[0] + "-" + randomNames[1] + "-" + fmt.Sprint(number)
}

// check --basepath flag and update node configuration
Expand All @@ -433,6 +443,8 @@ func setDotGlobalConfig(ctx *cli.Context, tomlCfg *ctoml.Config, cfg *dot.Global
cfg.MetricsPort = uint32(metricsPort)
}

cfg.NoTelemetry = ctx.Bool("no-telemetry")

logger.Debug(
"global configuration",
"name", cfg.Name,
Expand Down Expand Up @@ -550,6 +562,7 @@ func setDotNetworkConfig(ctx *cli.Context, tomlCfg ctoml.NetworkConfig, cfg *dot
cfg.NoMDNS = tomlCfg.NoMDNS
cfg.MinPeers = tomlCfg.MinPeers
cfg.MaxPeers = tomlCfg.MaxPeers
cfg.PersistentPeers = tomlCfg.PersistentPeers

// check --port flag and update node configuration
if port := ctx.GlobalUint(PortFlag.Name); port != 0 {
Expand Down Expand Up @@ -581,6 +594,10 @@ func setDotNetworkConfig(ctx *cli.Context, tomlCfg ctoml.NetworkConfig, cfg *dot
cfg.NoMDNS = true
}

if len(cfg.PersistentPeers) == 0 {
cfg.PersistentPeers = []string(nil)
}

logger.Debug(
"network configuration",
"port", cfg.Port,
Expand All @@ -590,6 +607,7 @@ func setDotNetworkConfig(ctx *cli.Context, tomlCfg ctoml.NetworkConfig, cfg *dot
"nomdns", cfg.NoMDNS,
"minpeers", cfg.MinPeers,
"maxpeers", cfg.MaxPeers,
"persistent-peers", cfg.PersistentPeers,
)
}

Expand Down Expand Up @@ -687,21 +705,20 @@ func updateDotConfigFromGenesisJSONRaw(tomlCfg ctoml.Config, cfg *dot.Config) {
cfg.Core.BabeAuthority = tomlCfg.Core.Roles == types.AuthorityRole
cfg.Core.GrandpaAuthority = tomlCfg.Core.Roles == types.AuthorityRole

// use default genesis-raw file if genesis configuration not provided, for example,
// if we load a toml configuration file without a defined genesis-raw init value or
// if we pass an empty string as the genesis init value using the --geneis-raw flag
if cfg.Init.GenesisRaw == "" {
cfg.Init.GenesisRaw = DefaultCfg().Init.GenesisRaw
// use default genesis file if genesis configuration not provided, for example,
// if we load a toml configuration file without a defined genesis init value or
// if we pass an empty string as the genesis init value using the --genesis flag
if cfg.Init.Genesis == "" {
cfg.Init.Genesis = DefaultCfg().Init.Genesis
}

// load Genesis from genesis configuration file
gen, err := genesis.NewGenesisFromJSONRaw(cfg.Init.GenesisRaw)
gen, err := genesis.NewGenesisFromJSONRaw(cfg.Init.Genesis)
if err != nil {
logger.Error("failed to load genesis from file", "error", err)
return // exit
}

cfg.Global.Name = gen.Name
cfg.Global.ID = gen.ID
cfg.Network.Bootnodes = gen.Bootnodes
cfg.Network.ProtocolID = gen.ProtocolID
Expand Down Expand Up @@ -735,11 +752,6 @@ func updateDotConfigFromGenesisData(ctx *cli.Context, cfg *dot.Config) error {
return fmt.Errorf("failed to load genesis data: %s", err)
}

// check genesis name and use genesis name if --name flag not set
if !ctx.GlobalIsSet(NameFlag.Name) {
cfg.Global.Name = gen.Name
}

// check genesis id and use genesis id if --chain flag not set
if !ctx.GlobalIsSet(ChainFlag.Name) {
cfg.Global.ID = gen.ID
Expand Down
Loading

0 comments on commit d53e245

Please sign in to comment.