Skip to content

Commit 1e31ef7

Browse files
committed
chore(imports): fix imports post file moves
1 parent 4d45b88 commit 1e31ef7

File tree

340 files changed

+1170
-1156
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

340 files changed

+1170
-1156
lines changed

.github/PULL_REQUEST/pull_request.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77
"fmt"
88
"os"
99

10-
"github.com/ChainSafe/gossamer/lib/utils"
10+
"github.com/ChainSafe/gossamer/internal/lib/utils"
1111
)
1212

1313
func main() {

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ RUN wget -O /usr/local/bin/subkey https://chainbridge.ams3.digitaloceanspaces.co
1818
chmod +x /usr/local/bin/subkey
1919

2020
# Polkadot JS dependencies
21-
WORKDIR /go/src/github.com/ChainSafe/gossamer/tests/polkadotjs_test
22-
COPY tests/polkadotjs_test/package.json tests/polkadotjs_test/package-lock.json ./
21+
WORKDIR /go/src/github.com/ChainSafe/gossamer/internal/tests/polkadotjs_test
22+
COPY internal/tests/polkadotjs_test/package.json internal/tests/polkadotjs_test/package-lock.json ./
2323
RUN npm install
2424

2525
WORKDIR /go/src/github.com/ChainSafe/gossamer

Makefile

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ format:
3030

3131
proto:
3232
go install google.golang.org/protobuf/cmd/protoc-gen-go
33-
protoc -I=./dot/network/proto --go_out=./dot/network/proto dot/network/proto/api.v1.proto
33+
protoc -I=./internal/dot/network/proto --go_out=./internal/dot/network/proto dot/network/proto/api.v1.proto
3434

3535
## test: Runs `go test` on project test files.
3636
test:
@@ -47,28 +47,28 @@ it-stable:
4747
## it-stress: Runs Integration Tests stress mode
4848
it-stress: build
4949
@echo " > \033[32mRunning stress tests...\033[0m "
50-
HOSTNAME=0.0.0.0 MODE=stress go test ./tests/stress/... -timeout=15m -v -short -run TestSync_
50+
HOSTNAME=0.0.0.0 MODE=stress go test ./internal/tests/stress/... -timeout=15m -v -short -run TestSync_
5151

5252
it-grandpa: build
5353
@echo " > \033[32mRunning GRANDPA stress tests...\033[0m "
54-
HOSTNAME=0.0.0.0 MODE=stress go test ./tests/stress/... -timeout=12m -v -short -run TestStress_Grandpa_
54+
HOSTNAME=0.0.0.0 MODE=stress go test ./internal/tests/stress/... -timeout=12m -v -short -run TestStress_Grandpa_
5555

5656
it-rpc: build
5757
@echo " > \033[32mRunning Integration Tests RPC Specs mode...\033[0m "
58-
HOSTNAME=0.0.0.0 MODE=rpc go test ./tests/rpc/... -timeout=10m -v
58+
HOSTNAME=0.0.0.0 MODE=rpc go test ./internal/tests/rpc/... -timeout=10m -v
5959

6060
it-sync: build
6161
@echo " > \033[32mRunning Integration Tests sync mode...\033[0m "
62-
HOSTNAME=0.0.0.0 MODE=sync go test ./tests/sync/... -timeout=5m -v
62+
HOSTNAME=0.0.0.0 MODE=sync go test ./internal/tests/sync/... -timeout=5m -v
6363

6464
it-polkadotjs: build
6565
@echo " > \033[32mRunning Integration Tests polkadot.js/api mode...\033[0m "
66-
HOSTNAME=0.0.0.0 MODE=polkadot go test ./tests/polkadotjs_test/... -timeout=5m -v
66+
HOSTNAME=0.0.0.0 MODE=polkadot go test ./internal/tests/polkadotjs_test/... -timeout=5m -v
6767

6868
## test: Runs `go test -race` on project test files.
6969
test-state-race:
7070
@echo " > \033[32mRunning race tests...\033[0m "
71-
go test ./dot/state/... -short -race -timeout=5m
71+
go test ./internal/dot/state/... -short -race -timeout=5m
7272

7373
## deps: Install missing dependencies. Runs `go mod download` internally.
7474
deps:

cmd/gossamer/README.md

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ This is the default Gossamer execution method, which invokes the `gossamerAction
2020
blockchain client are [described below in the Client Components section](#client-components).
2121

2222
- `--basepath` - the path to the directory where Gossamer will store its data
23-
- `--chain` - specifies the [chain configuration](../../chain) that the
23+
- `--chain` - specifies the [chain configuration](../../internal/chain) that the
2424
[Gossamer host node](https://chainsafe.github.io/gossamer/getting-started/overview/host-architecture/) should load
2525
- `--key` - specifies a test keyring account to use (e.g. `--key=alice`)
2626
- `--log` - supports levels `crit` (silent), `error`, `warn`, `info`, `debug`, and `trce` (detailed), default is `info`
@@ -39,7 +39,7 @@ This subcommand accepts a genesis configuration file and uses it to initialise t
3939
The `account` subcommand provides the user with capabilities related to generating and using `ed25519`, `secp256k1`, and
4040
`sr25519` [account keys](https://wiki.polkadot.network/docs/learn-keys), and managing the keys present in the
4141
[Gossamer keystore](#keystore). The `accountAction` function is defined in [account.go](account.go); it is an interface
42-
to the capabilities defined in the [`lib/crypto`](../../lib/crypto) and [`lib/keystore`](../../lib/keystore) packages.
42+
to the capabilities defined in the [`lib/crypto`](../../internal/lib/crypto) and [`lib/keystore`](../../internal/lib/keystore) packages.
4343
This subcommand provides capabilities that are similar to
4444
[Parity's Subkey utility](https://docs.substrate.io/v3/tools/subkey).
4545

@@ -68,7 +68,7 @@ in [`main.go`](main.go).
6868

6969
### Import State Subcommand
7070

71-
The `import-state` subcommand allows a user to seed [Gossamer storage](../../dot/state) with key-value pairs in the form
71+
The `import-state` subcommand allows a user to seed [Gossamer storage](../../internal/dot/state) with key-value pairs in the form
7272
of a JSON file. The input for this subcommand can be retrieved from
7373
[the `state_getPairs` RPC endpoint](https://github.com/w3f/PSPs/blob/master/PSPs/drafts/psp-6.md#1114-state_getpairs).
7474
The `importStateAction` function is defined in [`main.go`](main.go).
@@ -86,7 +86,7 @@ The `importStateAction` function is defined in [`main.go`](main.go).
8686
The `export` subcommand transforms a genesis configuration and Gossamer state into a TOML configuration file. This
8787
subcommand invokes the `exportAction` function defined in [`export.go`](export.go).
8888

89-
- `--config` - path to a TOML configuration file (e.g. those defined in [the `chain` directory](../../chain))
89+
- `--config` - path to a TOML configuration file (e.g. those defined in [the `chain` directory](../../internal/chain))
9090
- `--basepath` - path to the Gossamer data directory that defines the state to export
9191

9292
## Client Components
@@ -96,8 +96,8 @@ In its default method of execution, Gossamer orchestrates a number of modular se
9696
a blockchain network. Alongside these services, Gossamer manages [a keystore](#keystore), [a runtime](#runtime), and
9797
[monitoring utilities](#monitoring), all of which are described in greater detail below. The entry point to the Gossamer
9898
blockchain client capabilities is the `gossamerAction` function that is defined in [main.go](main.go), which in turn
99-
invokes the `NewNode` function in [dot/node.go](../../dot/node.go). `NewNode` calls into functions that are defined in
100-
[dot/services.go](../../dot/services.go) and starts the services that power a Gossamer node.
99+
invokes the `NewNode` function in [dot/node.go](../../internal/dot/node.go). `NewNode` calls into functions that are defined in
100+
[dot/services.go](../../internal/dot/services.go) and starts the services that power a Gossamer node.
101101

102102
### Services & Capabilities
103103

@@ -108,60 +108,60 @@ What follows is a list that describes the services and capabilities that inform
108108
This service is a wrapper around an instance of [`chaindb`](https://github.com/ChainSafe/chaindb), a key-value database
109109
that is built on top of [BadgerDB](https://github.com/dgraph-io/badger) from [Dgraph](https://dgraph.io/). The state
110110
service provides storage capabilities for the other Gossamer services - each service is assigned a prefix that is added
111-
to its storage keys. The state service is defined in [dot/state/service.go](../../dot/state/service.go).
111+
to its storage keys. The state service is defined in [dot/state/service.go](../../internal/dot/state/service.go).
112112

113113
#### Network
114114

115-
The network service, which is defined in [dot/network/service.go](../../dot/network/service.go), is built on top of
115+
The network service, which is defined in [dot/network/service.go](../../internal/dot/network/service.go), is built on top of
116116
[the Go implementation](https://github.com/libp2p/go-libp2p) of [the `libp2p` protocol](https://libp2p.io/). This
117117
service manages a `libp2p` "host", a peer-to-peer networking term for a network participant that is providing both
118118
client _and_ server capabilities to a peer-to-peer network. Gossamer's network service manages the discovery of other
119119
hosts as well as the connections with these hosts that allow Gossamer to communicate with its network peers.
120120

121121
#### Digest Handler
122122

123-
The digest handler ([dot/digest/digest.go](../../dot/digest/digest.go)) manages the verification of the
123+
The digest handler ([dot/digest/digest.go](../../internal/dot/digest/digest.go)) manages the verification of the
124124
[digests](https://docs.substrate.io/v3/getting-started/glossary/#digest) that are present in block headers.
125125

126126
#### Consensus
127127

128128
The BABE and GRANDPA services work together to provide Gossamer with its
129129
[hybrid consensus](https://wiki.polkadot.network/docs/learn-consensus#hybrid-consensus) capabilities. The term "hybrid
130130
consensus" refers to the fact that block _production_ is decoupled from block _finalisation_. Block production is
131-
handled by the BABE service, which is defined in [lib/babe/babe.go](../../lib/babe/babe.go); block finalisation is
132-
handled by the GRANDPA service, which is defined in [lib/grandpa/grandpa.go](../../lib/grandpa/grandpa.go).
131+
handled by the BABE service, which is defined in [lib/babe/babe.go](../../internal/lib/babe/babe.go); block finalisation is
132+
handled by the GRANDPA service, which is defined in [lib/grandpa/grandpa.go](../../internal/lib/grandpa/grandpa.go).
133133

134134
#### Sync
135135

136136
This service is concerned with keeping Gossamer in sync with a blockchain - it implements a "bootstrap" mode, to
137137
download and verify blocks that are part of an existing chain's history, and a "tip-syncing" mode that manages the
138138
multiple candidate forks that may exist at the head of a live chain. The sync service makes use of
139-
[a block verification utility](../../lib/babe/verify.go) that implements BABE logic and is used by Gossamer to verify
139+
[a block verification utility](../../internal/lib/babe/verify.go) that implements BABE logic and is used by Gossamer to verify
140140
blocks that were produced by other other nodes in the network. The sync service is defined in
141-
[dot/sync/syncer.go](../../dot/sync/syncer.go).
141+
[dot/sync/syncer.go](../../internal/dot/sync/syncer.go).
142142

143143
#### RPC
144144

145-
This service, which is defined in [dot/rpc/service.go](../../dot/rpc/service.go), exposes a JSON-RPC interface that is
145+
This service, which is defined in [dot/rpc/service.go](../../internal/dot/rpc/service.go), exposes a JSON-RPC interface that is
146146
used by client applications like [Polkadot JS Apps UI](https://polkadot.js.org/apps/). The RPC interface is used to
147147
interact with Gossamer to perform administrative tasks such as key management, as well as for interacting with the
148148
runtime by querying storage and submitting transactions, and inspecting the chain's history.
149149

150150
#### System
151151

152-
The system service is defined in [dot/system/service.go](../../dot/system/service.go) and exposes metadata about the
152+
The system service is defined in [dot/system/service.go](../../internal/dot/system/service.go) and exposes metadata about the
153153
Gossamer system, such as the names and versions of the protocols that it implements.
154154

155155
#### Core
156156

157-
As its name implies, the core service ([dot/core/service.go](../../dot/core/service.go)) encapsulates a range of
157+
As its name implies, the core service ([dot/core/service.go](../../internal/dot/core/service.go)) encapsulates a range of
158158
capabilities that are central to the functioning of a Gossamer node. In general, the core service is a type of
159159
dispatcher that coordinates interactions between services, e.g. writing blocks to the database, reloading
160160
[the runtime](#runtime) when its definition is updated, etc.
161161

162162
### Keystore
163163

164-
The Gossamer keystore ([lib/keystore](../../lib/keystore)) is used for managing the public/private cryptographic key
164+
The Gossamer keystore ([lib/keystore](../../internal/lib/keystore)) is used for managing the public/private cryptographic key
165165
pairs that are used for participating in a blockchain network. Public keys are used to identify network participants;
166166
network participants use their private keys to sign messages in order to authorise privileged actions. In addition to
167167
informing the Gossamer blockchain client capabilities, the Gossamer keystore is accessible by way of the `account`
@@ -177,16 +177,16 @@ subcommand. The Gossamer keystore manages a number of key types, some of which a
177177

178178
In addition to the above-described services, Gossamer hosts a Wasm execution environment that is used to manage an
179179
upgradeable blockchain runtime. The runtime must be implemented in Wasm, and must expose an interface that is specified
180-
in [lib/runtime/interface.go](../../lib/runtime/interface.go). The runtime defines the blockchain's state transition
180+
in [lib/runtime/interface.go](../../internal/lib/runtime/interface.go). The runtime defines the blockchain's state transition
181181
function, and the various Gossamer services consume this capability in order to author blocks, as well as to verify
182182
blocks that were authored by network peers. The runtime is dependent on a
183183
[Wasm host interface](https://docs.wasmer.io/integrations/examples/host-functions), which Gossamer implements and is
184-
defined in [lib/runtime/wasmer/exports.go](../../lib/runtime/wasmer/exports.go).
184+
defined in [lib/runtime/wasmer/exports.go](../../internal/lib/runtime/wasmer/exports.go).
185185

186186
### Monitoring
187187

188188
Gossamer publishes telemetry data and also includes an embedded Prometheus server that reports metrics. The metrics
189-
capabilities are defined in the [dot/metrics](../../dot/metrics) package and build on
189+
capabilities are defined in the [dot/metrics](../../internal/dot/metrics) package and build on
190190
[the metrics library that is included with Go Ethereum](https://github.com/ethereum/go-ethereum/blob/master/metrics/README.md).
191191
The default port for Prometheus metrics is 9090, and Gossamer allows the user to configure this parameter with the
192192
`--metrics-port` command-line parameter. The Gossamer telemetry server publishes telemetry data that is compatible with

cmd/gossamer/account.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ import (
77
"fmt"
88
"strings"
99

10-
"github.com/ChainSafe/gossamer/lib/crypto"
11-
"github.com/ChainSafe/gossamer/lib/keystore"
12-
"github.com/ChainSafe/gossamer/lib/utils"
10+
"github.com/ChainSafe/gossamer/internal/lib/crypto"
11+
"github.com/ChainSafe/gossamer/internal/lib/keystore"
12+
"github.com/ChainSafe/gossamer/internal/lib/utils"
1313

1414
"github.com/urfave/cli"
1515
)

cmd/gossamer/account_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77
"fmt"
88
"testing"
99

10-
"github.com/ChainSafe/gossamer/lib/utils"
10+
"github.com/ChainSafe/gossamer/internal/lib/utils"
1111

1212
"github.com/stretchr/testify/require"
1313
)

cmd/gossamer/config.go

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -10,29 +10,29 @@ import (
1010
"strings"
1111
"time"
1212

13-
"github.com/ChainSafe/gossamer/chain/dev"
14-
"github.com/ChainSafe/gossamer/chain/gssmr"
15-
"github.com/ChainSafe/gossamer/dot"
16-
ctoml "github.com/ChainSafe/gossamer/dot/config/toml"
17-
"github.com/ChainSafe/gossamer/dot/state"
18-
"github.com/ChainSafe/gossamer/dot/state/pruner"
19-
"github.com/ChainSafe/gossamer/dot/types"
13+
"github.com/ChainSafe/gossamer/internal/chain/dev"
14+
"github.com/ChainSafe/gossamer/internal/chain/gssmr"
15+
"github.com/ChainSafe/gossamer/internal/dot"
16+
ctoml "github.com/ChainSafe/gossamer/internal/dot/config/toml"
17+
"github.com/ChainSafe/gossamer/internal/dot/state"
18+
"github.com/ChainSafe/gossamer/internal/dot/state/pruner"
19+
"github.com/ChainSafe/gossamer/internal/dot/types"
20+
"github.com/ChainSafe/gossamer/internal/lib/common"
21+
"github.com/ChainSafe/gossamer/internal/lib/genesis"
22+
"github.com/ChainSafe/gossamer/internal/lib/runtime/life"
23+
"github.com/ChainSafe/gossamer/internal/lib/runtime/wasmer"
24+
"github.com/ChainSafe/gossamer/internal/lib/utils"
2025
"github.com/ChainSafe/gossamer/internal/log"
21-
"github.com/ChainSafe/gossamer/lib/common"
22-
"github.com/ChainSafe/gossamer/lib/genesis"
23-
"github.com/ChainSafe/gossamer/lib/runtime/life"
24-
"github.com/ChainSafe/gossamer/lib/runtime/wasmer"
25-
"github.com/ChainSafe/gossamer/lib/utils"
2626
"github.com/urfave/cli"
2727
)
2828

2929
var (
3030
// DefaultCfg is the default configuration for the node.
3131
DefaultCfg = dot.GssmrConfig
32-
defaultGssmrConfigPath = "./chain/gssmr/config.toml"
33-
defaultKusamaConfigPath = "./chain/kusama/config.toml"
34-
defaultPolkadotConfigPath = "./chain/polkadot/config.toml"
35-
defaultDevConfigPath = "./chain/dev/config.toml"
32+
defaultGssmrConfigPath = "./internal/chain/gssmr/config.toml"
33+
defaultKusamaConfigPath = "./internal/chain/kusama/config.toml"
34+
defaultPolkadotConfigPath = "./internal/chain/polkadot/config.toml"
35+
defaultDevConfigPath = "./internal/chain/dev/config.toml"
3636

3737
gossamerName = "gssmr"
3838
kusamaName = "kusama"

cmd/gossamer/config_test.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@ import (
99
"testing"
1010
"time"
1111

12-
"github.com/ChainSafe/gossamer/chain/dev"
13-
"github.com/ChainSafe/gossamer/chain/gssmr"
14-
"github.com/ChainSafe/gossamer/dot"
15-
ctoml "github.com/ChainSafe/gossamer/dot/config/toml"
16-
"github.com/ChainSafe/gossamer/dot/state"
17-
"github.com/ChainSafe/gossamer/dot/types"
12+
"github.com/ChainSafe/gossamer/internal/chain/dev"
13+
"github.com/ChainSafe/gossamer/internal/chain/gssmr"
14+
"github.com/ChainSafe/gossamer/internal/dot"
15+
ctoml "github.com/ChainSafe/gossamer/internal/dot/config/toml"
16+
"github.com/ChainSafe/gossamer/internal/dot/state"
17+
"github.com/ChainSafe/gossamer/internal/dot/types"
18+
"github.com/ChainSafe/gossamer/internal/lib/genesis"
19+
"github.com/ChainSafe/gossamer/internal/lib/utils"
1820
"github.com/ChainSafe/gossamer/internal/log"
19-
"github.com/ChainSafe/gossamer/lib/genesis"
20-
"github.com/ChainSafe/gossamer/lib/utils"
2121

2222
"github.com/stretchr/testify/assert"
2323
"github.com/stretchr/testify/require"

cmd/gossamer/export.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ import (
77
"fmt"
88
"time"
99

10-
"github.com/ChainSafe/gossamer/dot"
11-
ctoml "github.com/ChainSafe/gossamer/dot/config/toml"
12-
"github.com/ChainSafe/gossamer/lib/utils"
10+
"github.com/ChainSafe/gossamer/internal/dot"
11+
ctoml "github.com/ChainSafe/gossamer/internal/dot/config/toml"
12+
"github.com/ChainSafe/gossamer/internal/lib/utils"
1313

1414
"github.com/urfave/cli"
1515
)

cmd/gossamer/export_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ import (
77
"io"
88
"testing"
99

10-
"github.com/ChainSafe/gossamer/chain/gssmr"
11-
"github.com/ChainSafe/gossamer/dot"
12-
"github.com/ChainSafe/gossamer/lib/utils"
10+
"github.com/ChainSafe/gossamer/internal/chain/gssmr"
11+
"github.com/ChainSafe/gossamer/internal/dot"
12+
"github.com/ChainSafe/gossamer/internal/lib/utils"
1313

14-
ctoml "github.com/ChainSafe/gossamer/dot/config/toml"
14+
ctoml "github.com/ChainSafe/gossamer/internal/dot/config/toml"
1515
"github.com/ChainSafe/gossamer/internal/log"
1616
"github.com/stretchr/testify/require"
1717
"github.com/urfave/cli"

0 commit comments

Comments
 (0)