Skip to content

Instantly share code, notes, and snippets.

View EclesioMeloJunior's full-sized avatar
:octocat:
Always ready!

Eclésio Junior EclesioMeloJunior

:octocat:
Always ready!
View GitHub Profile
func TestVerifySR25519(t *testing.T) {
const pubhex = "0x..."
const sighex = "0x..."
const challenge = "..."
verifySR25519(
t,
pubhex,
sighex,
challenge,
)
// you must provide the account hex, signature hex and the message wrapped with <Bytes>...</Bytes>
// To get the hex from the account you can do:
// import { u8aToHex, u8aToU8a } from "@polkadot/util";
// const hexPublicKey = u8aToHex(decodeAddress(account.address));
func TestVerifySR25519(t *testing.T) {
const pubhex = "0xf84d048da2ddae2d9d8fd6763f469566e8817a26114f39408de15547f6d47805"
const sighex = "0x48ce2c90e08651adfc8ecef84e916f6d1bb51ebebd16150ee12df247841a5437951ea0f9d632ca165e6ab391532e75e701be6a1caa88c8a6bcca3511f55b4183"
const challenge = "<Bytes>message to sign</Bytes>"
go build -trimpath -o ./bin/gossamer ./cmd/gossamer
❯ ./bin/gossamer --config ./chain/dev/config.toml --bootnodes /ip4/127.0.0.1/tcp/30333/p2p/12D3KooWDpJ7As7BWAwRMfu1VU2WCqNjvq387JEYKDBj4kx6nXTN
2022-07-20T08:43:47-04:00 INFO loading toml configuration from ./chain/dev/config.toml... config.go:L50 pkg=cmd
2022-07-20T08:43:47-04:00 WARN overwriting default configuration with id with toml configuration values from ./chain/dev/config.toml config.go:L54 pkg=cmd
2022-07-20T08:43:47-04:00 INFO loaded package log configuration: core: INFO, digest: INFO, sync: INFO, network: INFO, rpc: INFO, state: INFO, runtime: INFO, block producer: INFO, finality gadget: DBUG config.go:L123 pkg=cmd
2022-07-20T08:43:47-04:00 INFO 🕸️ initialising node with name spin-tooth-53756, id gssmr, base path /Users/eclesiojunior/go/src/github.com/ChainSafe/gossamer/tmp/dev and genesis ./chain/dev/genesis.json... node.go:L128 pkg=dot
2022-07-20T08:43:48-04:00 INFO block state hash genesis hash: 0x588e9db899afbea5641b365fc750bcea90403573919f8
@EclesioMeloJunior
EclesioMeloJunior / alice_substrate.log
Created September 5, 2022 14:38
Gossamer Miss Behavior `Reason: Request refused` substrate log line 490
2022-09-05 10:24:36.804 INFO tokio-runtime-worker substrate_prometheus_endpoint: 〽️ Prometheus exporter started at 127.0.0.1:9615
2022-09-05 10:24:36.807 TRACE tokio-runtime-worker afg: Polling round 1, state = State { prevote_ghost: None, finalized: None, estimate: None, completable: false }, step = Some(Start)
2022-09-05 10:24:36.808 DEBUG tokio-runtime-worker sub-libp2p: Libp2p <= Starting random Kademlia request for PeerId("1AhPu5GhoNBUwW5QaV8rRGrn5gqR959BrQ3stvmWLMhLX1")
2022-09-05 10:24:36.808 TRACE tokio-runtime-worker sub-libp2p: Libp2p => Query for 0020a425b5d34413eb4c999446c928e421ecf8eea71001f8438d46f4639cbe4ec518 yielded 0 results
2022-09-05 10:24:36.809 INFO tokio-runtime-worker libp2p_mdns::behaviour::iface: creating instance on iface 192.168.88.7
2022-09-05 10:24:36.809 TRACE tokio-runtime-worker sub-libp2p: Libp2p => NewListenAddr(/ip4/127.0.0.1/tcp/30333)
2022-09-05 10:24:36.809 TRACE tokio-runtime-worker sub-libp2p: Libp2p => NewListenAddr(/ip6/::1/tcp/30333)
20
@EclesioMeloJunior
EclesioMeloJunior / gossamer logs
Created September 6, 2022 21:01
Spamming neighbor messages increase the peer reputation
2022-09-06T16:54:26-04:00 INFO loading toml configuration from ./chain/dev/config.toml... config.go:L49 pkg=cmd
2022-09-06T16:54:26-04:00 WARN overwriting default configuration with id with toml configuration values from ./chain/dev/config.toml config.go:L53 pkg=cmd
2022-09-06T16:54:26-04:00 INFO loaded package log configuration: core: INFO, digest: INFO, sync: INFO, network: TRACE, rpc: INFO, state: INFO, runtime: INFO, block producer: INFO, finality gadget: TRACE config.go:L122 pkg=cmd
2022-09-06T16:54:26-04:00 INFO 🕸️ initialising node with name trap-lobster-59216, id gssmr, base path /Users/eclesiojunior/go/src/github.com/ChainSafe/gossamer/tmp/bob and genesis ./chain/dev/genesis.json... node.go:L128 pkg=dot
2022-09-06T16:54:28-04:00 INFO block state hash genesis hash: 0x2d42e1c0b9e689cdf2b51a09621be564171bdde521fdb169fe538f69c0adb97a initialize.go:L109 pkg=state
2022-09-06T16:54:28-04:00 INFO node initialised with name trap-lobster-59216, id gssmr, base path /Users/eclesiojunior/
@EclesioMeloJunior
EclesioMeloJunior / config.toml
Created September 27, 2022 14:21
Reproduce a spamming Neighbor Message
[global]
basepath = "./tmp/dev"
log = "info"
metrics-address = ":9876"
[log]
core = ""
network = "trace"
rpc = ""
state = ""
2022-10-05 20:13:17.413 INFO main sc_cli::runner: Gossamer Test Node
2022-10-05 20:13:17.413 INFO main sc_cli::runner: ✌️ version 4.0.0-dev-4bac85c2774
2022-10-05 20:13:17.413 INFO main sc_cli::runner: ❤️ by ChainSafe <https://chainsafe.io>, 2017-2022
2022-10-05 20:13:17.413 INFO main sc_cli::runner: 📋 Chain specification: Gossamer Testnet [Dev]
2022-10-05 20:13:17.413 INFO main sc_cli::runner: 🏷 Node name: Alice
2022-10-05 20:13:17.413 INFO main sc_cli::runner: 👤 Role: AUTHORITY
2022-10-05 20:13:17.413 INFO main sc_cli::runner: 💾 Database: RocksDb at /var/folders/8h/102_dpq55wlf6831zfvspg600000gn/T/substrate7A0Gu2/chains/gssmr_test_dev/db/full
2022-10-05 20:13:17.413 INFO main sc_cli::runner: ⛓ Native runtime: gssmr-test-9280 (gssmr-test-0.tx12.au0)
2022-10-05 20:13:17.936 INFO main sc_service::client::client: 🔨 Initializing Genesis block/state (state: 0x48d5…a5df, header-hash: 0x3690…806b)
2022-10-05 20:13:17.939 INFO main afg: 👴 Loading GRANDPA authority se
@EclesioMeloJunior
EclesioMeloJunior / ALICE
Created October 6, 2022 19:53
Gossamer Miss Behavior `Reason: Genesis mismatch`
2022-10-06 11:19:49.152 INFO main sc_cli::runner: Gossamer Test Node
2022-10-06 11:19:49.152 INFO main sc_cli::runner: ✌️ version 4.0.0-dev-4bac85c2774
2022-10-06 11:19:49.152 INFO main sc_cli::runner: ❤️ by ChainSafe <https://chainsafe.io>, 2017-2022
2022-10-06 11:19:49.152 INFO main sc_cli::runner: 📋 Chain specification: Gossamer Testnet [Dev]
2022-10-06 11:19:49.152 INFO main sc_cli::runner: 🏷 Node name: Alice
2022-10-06 11:19:49.152 INFO main sc_cli::runner: 👤 Role: AUTHORITY
2022-10-06 11:19:49.152 INFO main sc_cli::runner: 💾 Database: RocksDb at /var/folders/8h/102_dpq55wlf6831zfvspg600000gn/T/substrateQQpEjt/chains/gssmr_test_dev/db/full
2022-10-06 11:19:49.152 INFO main sc_cli::runner: ⛓ Native runtime: gssmr-test-9280 (gssmr-test-0.tx12.au0)
2022-10-06 11:19:49.631 INFO main sc_service::client::client: 🔨 Initializing Genesis block/state (state: 0x48d5…a5df, header-hash: 0x3690…806b)
2022-10-06 11:19:49.632 INFO main afg: 👴 Loading GRANDPA authority se
@EclesioMeloJunior
EclesioMeloJunior / gossamer logs output
Created November 11, 2022 15:05
CRITICAL ERROR GOSSAMER
./bin/gossamer --config ./chain/westend-local/config.toml
2022-11-11T11:00:55-04:00 INFO loading toml configuration from ./chain/westend-local/config.toml... config.go:L49 pkg=cmd
2022-11-11T11:00:55-04:00 WARN overwriting default configuration with id with toml configuration values from ./chain/westend-local/config.toml config.go:L53 pkg=cmd
2022-11-11T11:00:55-04:00 INFO loaded package log configuration: core: INFO, digest: INFO, sync: TRACE, network: TRACE, rpc: INFO, state: INFO, runtime: INFO, block producer: INFO, finality gadget: INFO config.go:L122 pkg=cmd
2022-11-11T11:00:55-04:00 INFO 🕸️ initialising node services with global configuration name brain-long-6896, id westend_local_testnet and base path /Users/eclesiojunior/go/src/github.com/ChainSafe/gossamer/tmp/westend... node.go:L246 pkg=dot
2022-11-11T11:00:55-04:00 INFO created state service with head 0x18b801a8d7e7f3cfbf30d09a8761407ca9a103d5f549b32eeb47fe1743cd1e95, highest number 0 and genesis hash 0x18b801a8d7e7f3cfbf30d0
@EclesioMeloJunior
EclesioMeloJunior / gist:13fe5c6e829d1a20963eee44a32887b3
Created July 14, 2023 20:42
output `BlockBuilder_inherent_extrinsics`
==> 08280402000bf19322568901d105042d00000000bea4783f2363023d8db74d679b1e89fcad4adfef511dcc50072d51039f1be26b04046cc73a79cd3ef06c451f6388178370f7131c3cd8ea76138f9a8c20900b120ecd407d3a4683c82ca8529d1afcd8c414e3e2aec737494770e4ac4166b62b506e0c0642414245b50103000000007748c81000000000f8c9855a42b4963c4242776bd6e08a42fc6e5f37a0130225738faef675c962719383b0c8138dbfa2326902a669fe3c87af554c1cd4ca287fdc7a9dcb40b5bc0fd6d19fa168a2f3102997364425cf39ee5e334f854806f670fcaf03985ea52a05044241424529010104d43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d01000000000000000000000000000000000000000000000000000000000000000000000000000000054241424501013e74ca25106f0a77022fc2dcd33276b8cb48a9dfe5a1b28baa0147ec9d0aa24c5e17af6ddaf99c783e36c4ae19e73ae72cdb4b60f38717e9f7068f083d30d986
2023-07-14T16:40:54-04:00 WARN failed to handle slot 281561209: cannot build inherents: error applying inherent: transaction validity error: mandatory dispatch error pkg=babe