diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 15e690cb80..59dd7cf9c0 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -1,26 +1,20 @@ -# Contributing +## Contributing -Thank you for considering to help out with the source code! We welcome -contributions from anyone on the internet, and are grateful for even the -smallest of fixes! +Thank you for considering to help out with the source code! We welcome contributions from +anyone on the internet, and are grateful for even the smallest of fixes! -If you'd like to contribute to swarm, please fork, fix, commit and send a -pull request for the maintainers to review and merge into the main code base. If -you wish to submit more complex changes though, please check up with the core -devs first on [our gitter channel](https://gitter.im/ethereum/swarm) to -ensure those changes are in line with the general philosophy of the project -and/or get some early feedback which can make both your efforts much lighter as -well as our review and merge procedures quick and simple. - -## Coding guidelines +If you'd like to contribute to Swarm, please fork, fix, commit and send a pull request +for the maintainers to review and merge into the main code base. If you wish to submit more +complex changes though, please check up with the core devs first on [our Swarm gitter channel](https://gitter.im/ethersphere/orange-lounge) +to ensure those changes are in line with the general philosophy of the project and/or get some +early feedback which can make both your efforts much lighter as well as our review and merge +procedures quick and simple. Please make sure your contributions adhere to our coding guidelines: - * Code must adhere to the official Go -[formatting](https://golang.org/doc/effective_go.html#formatting) guidelines -(i.e. uses [gofmt](https://golang.org/cmd/gofmt/)). - * Code must be documented adhering to the official Go -[commentary](https://golang.org/doc/effective_go.html#commentary) guidelines. + * Code must adhere to the official Go [formatting](https://golang.org/doc/effective_go.html#formatting) guidelines (i.e. uses [gofmt](https://golang.org/cmd/gofmt/)). + * Code must be documented adhering to the official Go [commentary](https://golang.org/doc/effective_go.html#commentary) guidelines. * Pull requests need to be based on and opened against the `master` branch. + * [Code review guidelines](https://github.com/ethersphere/swarm/blob/master/docs/Code-Review-Guidelines.md). * Commit messages should be prefixed with the package(s) they modify. - * E.g. "eth, rpc: make trace configs optional" + * E.g. "fuse: ignore default manifest entry" diff --git a/.travis.yml b/.travis.yml index c79a95f8b0..d07eb7fc58 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,19 +1,11 @@ language: go -go_import_path: github.com/ethereum/swarm +go_import_path: github.com/ethersphere/swarm sudo: false +branches: + only: + - master matrix: include: - - os: linux - dist: trusty - sudo: required - go: 1.10.x - script: - - sudo modprobe fuse - - sudo chmod 666 /dev/fuse - - sudo chown root:$USER /etc/fuse.conf - - go run build/ci.go install - - go run build/ci.go test -coverage $TEST_PACKAGES - - os: linux dist: trusty sudo: required @@ -159,9 +151,3 @@ matrix: - azure-purge script: - go run build/ci.go purge -store ethswarmstorage/builds -days 14 - - - name: Race Detector for Swarm - os: linux - dist: trusty - go: 1.12.x - script: ./build/travis_keepalive.sh go test -v -timeout 20m -race ./swarm... diff --git a/README.md b/README.md index 3cb6883429..d726812dcf 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ Swarm is a distributed storage platform and content distribution service, a nati ## Building the source -Building Swarm requires Go (version 1.10 or later). +Building Swarm requires Go (version 1.11 or later). go get -d github.com/ethersphere/swarm @@ -173,15 +173,15 @@ Swarm supports an InfluxDB exporter. Consult the help section to learn about the swarm --help | grep metrics ``` -We use Grafana and InfluxDB to visualise metrics reported by Swarm. We keep our Grafana dashboards under version control at `./swarm/grafana_dashboards`. You could use them or design your own. +We use Grafana and InfluxDB to visualise metrics reported by Swarm. We keep our Grafana dashboards under version control at https://github.com/ethersphere/grafana-dashboards. You could use them or design your own. -We have built a tool to help with automatic start of Grafana and InfluxDB and provisioning of dashboards at https://github.com/nonsense/stateth , which requires that you have Docker installed. +We have built a tool to help with automatic start of Grafana and InfluxDB and provisioning of dashboards at https://github.com/nonsense/stateth, which requires that you have Docker installed. Once you have `stateth` installed, and you have Docker running locally, you have to: 1. Run `stateth` and keep it running in the background ``` -stateth --rm --grafana-dashboards-folder $GOPATH/src/github.com/ethersphere/swarm/grafana_dashboards --influxdb-database metrics +stateth --rm --grafana-dashboards-folder $GOPATH/src/github.com/ethersphere/grafana-dashboards --influxdb-database metrics ``` 2. Run `swarm` with at least the following params: diff --git a/api/api.go b/api/api.go index 1487036d8f..fa6ad4f23a 100644 --- a/api/api.go +++ b/api/api.go @@ -38,10 +38,10 @@ import ( "time" "github.com/ethereum/go-ethereum/common" - "github.com/ethersphere/swarm/contracts/ens" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/metrics" "github.com/ethersphere/swarm/chunk" + "github.com/ethersphere/swarm/contracts/ens" "github.com/ethersphere/swarm/log" "github.com/ethersphere/swarm/spancontext" "github.com/ethersphere/swarm/storage" diff --git a/api/config.go b/api/config.go index 18d4070b63..d343c1c5be 100644 --- a/api/config.go +++ b/api/config.go @@ -25,10 +25,10 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/ethersphere/swarm/contracts/ens" "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/node" "github.com/ethereum/go-ethereum/p2p/enode" + "github.com/ethersphere/swarm/contracts/ens" "github.com/ethersphere/swarm/network" "github.com/ethersphere/swarm/pss" "github.com/ethersphere/swarm/services/swap" diff --git a/cmd/swarm/hash.go b/cmd/swarm/hash.go index e36d5d51da..52062c8ad3 100644 --- a/cmd/swarm/hash.go +++ b/cmd/swarm/hash.go @@ -25,8 +25,8 @@ import ( "github.com/ethereum/go-ethereum/cmd/utils" "github.com/ethereum/go-ethereum/common" - "github.com/ethersphere/swarm/contracts/ens" "github.com/ethersphere/swarm/chunk" + "github.com/ethersphere/swarm/contracts/ens" "github.com/ethersphere/swarm/storage" "gopkg.in/urfave/cli.v1" ) diff --git a/cmd/swarm/main.go b/cmd/swarm/main.go index 21be27ea08..a3d91a8a00 100644 --- a/cmd/swarm/main.go +++ b/cmd/swarm/main.go @@ -35,13 +35,13 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/console" "github.com/ethereum/go-ethereum/crypto" - "github.com/ethersphere/swarm/internal/debug" "github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/node" "github.com/ethereum/go-ethereum/p2p/enode" "github.com/ethereum/go-ethereum/rpc" "github.com/ethersphere/swarm" bzzapi "github.com/ethersphere/swarm/api" + "github.com/ethersphere/swarm/internal/debug" swarmmetrics "github.com/ethersphere/swarm/metrics" "github.com/ethersphere/swarm/storage/mock" mockrpc "github.com/ethersphere/swarm/storage/mock/rpc" diff --git a/cmd/swarm/run_test.go b/cmd/swarm/run_test.go index aec420de23..7234842df6 100644 --- a/cmd/swarm/run_test.go +++ b/cmd/swarm/run_test.go @@ -35,13 +35,13 @@ import ( "github.com/docker/docker/pkg/reexec" "github.com/ethereum/go-ethereum/accounts" "github.com/ethereum/go-ethereum/accounts/keystore" - "github.com/ethersphere/swarm/internal/cmdtest" "github.com/ethereum/go-ethereum/node" "github.com/ethereum/go-ethereum/p2p" "github.com/ethereum/go-ethereum/rpc" "github.com/ethersphere/swarm" "github.com/ethersphere/swarm/api" swarmhttp "github.com/ethersphere/swarm/api/http" + "github.com/ethersphere/swarm/internal/cmdtest" ) var loglevel = flag.Int("loglevel", 3, "verbosity of logs") diff --git a/contracts/chequebook/cheque.go b/contracts/chequebook/cheque.go index fba785f3ce..346e75cf6a 100644 --- a/contracts/chequebook/cheque.go +++ b/contracts/chequebook/cheque.go @@ -39,10 +39,10 @@ import ( "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/ethersphere/swarm/contracts/chequebook/contract" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/log" + "github.com/ethersphere/swarm/contracts/chequebook/contract" "github.com/ethersphere/swarm/services/swap/swap" ) diff --git a/contracts/chequebook/cheque_test.go b/contracts/chequebook/cheque_test.go index 717f07bc6d..ff5563911d 100644 --- a/contracts/chequebook/cheque_test.go +++ b/contracts/chequebook/cheque_test.go @@ -27,9 +27,9 @@ import ( "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/accounts/abi/bind/backends" "github.com/ethereum/go-ethereum/common" - "github.com/ethersphere/swarm/contracts/chequebook/contract" "github.com/ethereum/go-ethereum/core" "github.com/ethereum/go-ethereum/crypto" + "github.com/ethersphere/swarm/contracts/chequebook/contract" ) var ( diff --git a/contracts/chequebook/gencode.go b/contracts/chequebook/gencode.go index 9dd05ff577..c1b812e7e7 100644 --- a/contracts/chequebook/gencode.go +++ b/contracts/chequebook/gencode.go @@ -27,9 +27,9 @@ import ( "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/accounts/abi/bind/backends" - "github.com/ethersphere/swarm/contracts/chequebook/contract" "github.com/ethereum/go-ethereum/core" "github.com/ethereum/go-ethereum/crypto" + "github.com/ethersphere/swarm/contracts/chequebook/contract" ) var ( diff --git a/contracts/ens/ens.go b/contracts/ens/ens.go index 4f042c84ca..675fd9f42c 100644 --- a/contracts/ens/ens.go +++ b/contracts/ens/ens.go @@ -27,10 +27,10 @@ import ( "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" - "github.com/ethersphere/swarm/contracts/ens/contract" - "github.com/ethersphere/swarm/contracts/ens/fallback_contract" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/crypto" + "github.com/ethersphere/swarm/contracts/ens/contract" + "github.com/ethersphere/swarm/contracts/ens/fallback_contract" ) var ( diff --git a/contracts/ens/ens_test.go b/contracts/ens/ens_test.go index 2b4bf749cd..baefe9da68 100644 --- a/contracts/ens/ens_test.go +++ b/contracts/ens/ens_test.go @@ -23,10 +23,10 @@ import ( "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/accounts/abi/bind/backends" "github.com/ethereum/go-ethereum/common" - "github.com/ethersphere/swarm/contracts/ens/contract" - "github.com/ethersphere/swarm/contracts/ens/fallback_contract" "github.com/ethereum/go-ethereum/core" "github.com/ethereum/go-ethereum/crypto" + "github.com/ethersphere/swarm/contracts/ens/contract" + "github.com/ethersphere/swarm/contracts/ens/fallback_contract" ) var ( diff --git a/pss/client/client_test.go b/pss/client/client_test.go index 3cf65c0a25..5a26a14b82 100644 --- a/pss/client/client_test.go +++ b/pss/client/client_test.go @@ -34,10 +34,10 @@ import ( "github.com/ethereum/go-ethereum/p2p/simulations" "github.com/ethereum/go-ethereum/p2p/simulations/adapters" "github.com/ethereum/go-ethereum/rpc" + whisper "github.com/ethereum/go-ethereum/whisper/whisperv6" "github.com/ethersphere/swarm/network" "github.com/ethersphere/swarm/pss" "github.com/ethersphere/swarm/state" - whisper "github.com/ethereum/go-ethereum/whisper/whisperv6" ) type protoCtrl struct { diff --git a/pss/forwarding_test.go b/pss/forwarding_test.go index cba58644ee..c200c67cb4 100644 --- a/pss/forwarding_test.go +++ b/pss/forwarding_test.go @@ -10,9 +10,9 @@ import ( "github.com/ethereum/go-ethereum/p2p" "github.com/ethereum/go-ethereum/p2p/enode" "github.com/ethereum/go-ethereum/p2p/protocols" + whisper "github.com/ethereum/go-ethereum/whisper/whisperv6" "github.com/ethersphere/swarm/network" "github.com/ethersphere/swarm/pot" - whisper "github.com/ethereum/go-ethereum/whisper/whisperv6" ) type testCase struct { diff --git a/pss/keystore.go b/pss/keystore.go index df86f9d29c..3e0f7773b8 100644 --- a/pss/keystore.go +++ b/pss/keystore.go @@ -25,8 +25,8 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/metrics" - "github.com/ethersphere/swarm/log" whisper "github.com/ethereum/go-ethereum/whisper/whisperv6" + "github.com/ethersphere/swarm/log" ) type KeyStore struct { diff --git a/pss/notify/notify_test.go b/pss/notify/notify_test.go index c2ac1804b1..5bd028e7ad 100644 --- a/pss/notify/notify_test.go +++ b/pss/notify/notify_test.go @@ -16,10 +16,10 @@ import ( "github.com/ethereum/go-ethereum/p2p/enode" "github.com/ethereum/go-ethereum/p2p/simulations" "github.com/ethereum/go-ethereum/p2p/simulations/adapters" + whisper "github.com/ethereum/go-ethereum/whisper/whisperv6" "github.com/ethersphere/swarm/network" "github.com/ethersphere/swarm/pss" "github.com/ethersphere/swarm/state" - whisper "github.com/ethereum/go-ethereum/whisper/whisperv6" ) var ( diff --git a/pss/pss.go b/pss/pss.go index b3e2fd0180..0895f3b06e 100644 --- a/pss/pss.go +++ b/pss/pss.go @@ -34,11 +34,11 @@ import ( "github.com/ethereum/go-ethereum/p2p/enode" "github.com/ethereum/go-ethereum/p2p/protocols" "github.com/ethereum/go-ethereum/rpc" + whisper "github.com/ethereum/go-ethereum/whisper/whisperv6" "github.com/ethersphere/swarm/log" "github.com/ethersphere/swarm/network" "github.com/ethersphere/swarm/pot" "github.com/ethersphere/swarm/storage" - whisper "github.com/ethereum/go-ethereum/whisper/whisperv6" "golang.org/x/crypto/sha3" ) diff --git a/pss/pss_test.go b/pss/pss_test.go index 775a3f3253..a154127aef 100644 --- a/pss/pss_test.go +++ b/pss/pss_test.go @@ -45,10 +45,10 @@ import ( "github.com/ethereum/go-ethereum/p2p/simulations" "github.com/ethereum/go-ethereum/p2p/simulations/adapters" "github.com/ethereum/go-ethereum/rpc" + whisper "github.com/ethereum/go-ethereum/whisper/whisperv6" "github.com/ethersphere/swarm/network" "github.com/ethersphere/swarm/pot" "github.com/ethersphere/swarm/state" - whisper "github.com/ethereum/go-ethereum/whisper/whisperv6" ) var ( diff --git a/pss/types.go b/pss/types.go index edbc360dfc..ad68ade260 100644 --- a/pss/types.go +++ b/pss/types.go @@ -25,8 +25,8 @@ import ( "github.com/ethereum/go-ethereum/common/hexutil" "github.com/ethereum/go-ethereum/p2p" "github.com/ethereum/go-ethereum/rlp" - "github.com/ethersphere/swarm/storage" whisper "github.com/ethereum/go-ethereum/whisper/whisperv6" + "github.com/ethersphere/swarm/storage" ) const ( diff --git a/services/swap/swap.go b/services/swap/swap.go index 653fb5831b..22475d9005 100644 --- a/services/swap/swap.go +++ b/services/swap/swap.go @@ -29,10 +29,10 @@ import ( "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" - "github.com/ethersphere/swarm/contracts/chequebook" - "github.com/ethersphere/swarm/contracts/chequebook/contract" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/crypto" + "github.com/ethersphere/swarm/contracts/chequebook" + "github.com/ethersphere/swarm/contracts/chequebook/contract" "github.com/ethersphere/swarm/log" "github.com/ethersphere/swarm/services/swap/swap" ) diff --git a/swarm.go b/swarm.go index b0000a7e3c..7a91bba02f 100644 --- a/swarm.go +++ b/swarm.go @@ -37,8 +37,6 @@ import ( "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" - "github.com/ethersphere/swarm/contracts/chequebook" - "github.com/ethersphere/swarm/contracts/ens" "github.com/ethereum/go-ethereum/ethclient" "github.com/ethereum/go-ethereum/metrics" "github.com/ethereum/go-ethereum/p2p" @@ -47,6 +45,8 @@ import ( "github.com/ethereum/go-ethereum/rpc" "github.com/ethersphere/swarm/api" httpapi "github.com/ethersphere/swarm/api/http" + "github.com/ethersphere/swarm/contracts/chequebook" + "github.com/ethersphere/swarm/contracts/ens" "github.com/ethersphere/swarm/fuse" "github.com/ethersphere/swarm/log" "github.com/ethersphere/swarm/network"