# gossamer
#### CSCON December 2021
#### Elizabeth github: @noot twitter: @elizabethereum
## 0. Introduction

### What is gossamer?
- Go implementation of the Polkadot Host
- substrate vs. polkadot
A Polkadot Host provides two main functions:
1. Import a runtime and easily launch a chain with custom logic
2. Create a Polkadot-compatible chain that could potentially become a parachain
### Current status of Gossamer:
- gossamer is able to act as a Polkadot/Kusama full node
- compatible with existing tooling such as polkadot.js and telemetry
- undergoing internal authority functionality testing by running an internal devnet
### Future plans for gossamer:
- interoperate with Polkadot as an authority node
- currently running internal gossamer devnet
- afterwards, we plan to run cross-client devnet to ensure interoperability between authority functionality
A Polkadot Host cannot become a parachain on its own; it requires an additional library which connects the chain to the relay chain.
- cumulus: https://github.com/paritytech/cumulus
- in the future: go-cumulus! https://medium.com/chainsafe-systems/building-parachains-with-go-cumulus-9998735fa5a4
### Gossamer project goals
- become a modular blockchain framework on-par with substrate
- eg. modular consensus, trie implementation, database, etc.
- increase client diversity in the Polkadot ecosystem
### Agenda
1. How to run a Polkadot/Kusama full node
2. How to run a gossamer development node
3. Using the substrate front end with gossamer
#### Workshop prerequisities
- go 1.17
- node.js
## Building gossamer
```
git clone https://github.com/ChainSafe/gossamer
cd gossamer
make gossamer
```
This places the gossamer binary in `./bin/`.
## 1. Running a polkadot/kusama full node
```
./bin/gossamer --chain kusama
```
```
./bin/gossamer --chain polkadot
```
you can check out the node on telemetry: https://telemetry.polkadot.io/#/0x91b171bb158e2d3848fa23a9f1c25182fb8e20313b2c1eb49219da7a70ce90c3
## 2. Running a gossamer development node
You can run a development node that builds a block every slot (3s) by using the `--chain dev` flag:
```
./bin/gossamer --chain dev init
./bin/gossamer --chain dev --wsport 9944
```
We also set the websockets server port to `9944` for the front-end.
## 3. Front end
```
git clone https://github.com/substrate-developer-hub/substrate-front-end-template
cd substrate-front-end-template
nvm use 14.11.0 // or any version higher
yarn install
yarn start
```
`substrate-front-end-template/src/config/development.json` contains the websockets port the front end will try to connect to.
Gossamer implements the JSON-RPC interface that substrate implements, so to the front-end the node looks the same as a substrate node.
then, the front end should open in your browser, and you can submit extrinsics, query pallets, and make RPC calls.
- show transfers
- show pallet querues
- show pallet query for constants (eg. `system.version`)
- show rpc calls
- show runtime upgrade

Note: to build the substrate runtime:
```
rustup update
rustup default nightly-2021-11-24
rustup target add wasm32-unknown-unknown
cd substrate/bin/node/runtime
cargo build
```
update runtime version:
```
/// Runtime version.
#[sp_version::runtime_version]
pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("node"),
impl_name: create_runtime_str!("gossamer-node"),
authoring_version: 10,
// Per convention: if the runtime behavior changes, increment spec_version
// and set impl_version to 0. If only runtime
// implementation changes and behavior does not, then leave spec_version as
// is and increment impl_version.
spec_version: 267,
impl_version: 1,
apis: RUNTIME_API_VERSIONS,
transaction_version: 2,
};
```
## Extra resources
https://hackmd.io/PxWqhPUUQLOxjMJVNYTNYg - my polkadot decoded talk/demo, has more information on how to configure the node genesis/runtime and use polkadot.js