Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(release): release v0.4.0 #1513

Merged
merged 21 commits into from
Apr 13, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
d82b2da
feat: cmd: implement import-runtime subcommand (#1483)
noot Mar 23, 2021
dfb95d2
fix(lib/crypto/ed25519): update ed25519 to use go-schnorrkel bip39 de…
noot Mar 24, 2021
4529aee
fix(state) : Update StorageState to load storage from database. (#1486)
arijitAD Mar 24, 2021
3880a40
fix(dot/state): fix usage of trie.Snapshot (#1489)
noot Mar 25, 2021
3b2ad8d
fix(dot/state,dot/network): improve memory usage when syncing (#1491)
noot Mar 25, 2021
22f7269
fix(dot/network): update notificationsProtocol handshakeData to sync.…
noot Mar 25, 2021
a6e0bd0
remove log (#1493)
noot Mar 26, 2021
ae7012b
feat(dot/network): request block justifications when near head (#1499)
noot Apr 5, 2021
f5de11e
chore(cmd): rename genesis-raw flag and files to genesis, allow raw a…
noot Apr 5, 2021
976f53a
refactor: docs: Docs Overhaul (#1438)
RyRy79261 Apr 6, 2021
6e4298e
chore(codeowners): update codeowners file (#1505)
dutterbutter Apr 6, 2021
3c05a88
fix: cmd/gossamer: Generate random name if --name flag not set (#1506)
edwardmack Apr 6, 2021
b7df8ed
chore(release): Automated release using semantic-release. (#1503)
arijitAD Apr 6, 2021
fcb4159
feat: dot/telemetry: Implement basic telemetry connection (#1497)
edwardmack Apr 7, 2021
5089327
fix: fix edit link (#1507)
RyRy79261 Apr 7, 2021
9453957
chore(readme): Fix broken image link (#1509)
dutterbutter Apr 7, 2021
98d1413
fix(dot/network): fix justification request at head logic (#1510)
noot Apr 7, 2021
7850532
feat(dot/network): implement persistent peers functionality (#1512)
noot Apr 8, 2021
271f92e
chore(release): Update name in package.json. (#1514)
arijitAD Apr 9, 2021
accaf69
feat(dot/network): Add cache for network message. (#1511)
arijitAD Apr 13, 2021
558b9b3
chore(release): Fix Deepsource error on development branch. (#1516)
arijitAD Apr 13, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This indicates that when we merge to either main or development the release workflow is triggered. Don't we just want this to be main ? @arijitAD

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The job will be triggered but it won't trigger a release. I will fix this after this release is done.


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