Skip to content

Commit

Permalink
[FAB-16789] per PR feedback, fixed sentence about peer pulling block …
Browse files Browse the repository at this point in the history
…from orderer on joining channel

Signed-off-by: Sijo Cherian <sijo@ibm.com>
  • Loading branch information
Sijo Cherian authored and denyeart committed Jun 26, 2020
1 parent 34cea91 commit 701bf56
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 19 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ BASE_VERSION = 2.2.0

# 3rd party image version
# These versions are also set in the runners in ./integration/runners/
COUCHDB_VER ?= 2.3
COUCHDB_VER ?= 3.1
KAFKA_VER ?= 5.3.1
ZOOKEEPER_VER ?= 5.3.1

Expand Down
4 changes: 2 additions & 2 deletions core/ledger/kvledger/tests/v1x_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -381,8 +381,8 @@ func startCouchDBWithV13Data(t *testing.T, ledgerFSRoot string) (*ledger.CouchDB
// set required config data to use state couchdb
couchdbConfig := &ledger.CouchDBConfig{
Address: couchAddress,
Username: "",
Password: "",
Username: "admin",
Password: "adminpw",
MaxRetries: 3,
MaxRetriesOnStartup: 3,
RequestTimeout: 10 * time.Second,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,8 @@ func (env *CouchDBTestEnv) Init(t testing.TB) {
StateDatabase: "CouchDB",
CouchDB: &ledger.CouchDBConfig{
Address: env.couchAddress,
Username: "",
Password: "",
Username: "admin",
Password: "adminpw",
MaxRetries: 3,
MaxRetriesOnStartup: 20,
RequestTimeout: 35 * time.Second,
Expand Down
17 changes: 8 additions & 9 deletions core/ledger/kvledger/txmgmt/statedb/statecouchdb/couchdb_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ var assetJSON = []byte(`{"asset_name":"marble1","color":"blue","size":"35","owne
func testConfig() *ledger.CouchDBConfig {
return &ledger.CouchDBConfig{
Address: "",
Username: "",
Password: "",
Username: "admin",
Password: "adminpw",
MaxRetries: 3,
MaxRetriesOnStartup: 20,
RequestTimeout: 35 * time.Second,
Expand All @@ -52,8 +52,8 @@ func testConfig() *ledger.CouchDBConfig {
func TestDBBadConnectionDef(t *testing.T) {
config := &ledger.CouchDBConfig{
Address: badParseConnectURL,
Username: "",
Password: "",
Username: "admin",
Password: "adminpw",
MaxRetries: 3,
MaxRetriesOnStartup: 3,
RequestTimeout: 35 * time.Second,
Expand Down Expand Up @@ -114,8 +114,8 @@ func TestBadCouchDBInstance(t *testing.T) {
badCouchDBInstance := couchInstance{
conf: &ledger.CouchDBConfig{
Address: badParseConnectURL,
Username: "",
Password: "",
Username: "admin",
Password: "adminpw",
MaxRetries: 3,
MaxRetriesOnStartup: 10,
RequestTimeout: 30 * time.Second,
Expand Down Expand Up @@ -319,8 +319,8 @@ func TestDBBadConnection(t *testing.T) {
//Limit the maxRetriesOnStartup to 3 in order to reduce time for the failure
config := &ledger.CouchDBConfig{
Address: badConnectURL,
Username: "",
Password: "",
Username: "admin",
Password: "adminpw",
MaxRetries: 3,
MaxRetriesOnStartup: 3,
RequestTimeout: 35 * time.Second,
Expand Down Expand Up @@ -854,7 +854,6 @@ func TestCouchDBVersion(t *testing.T) {

err = checkCouchDBVersion("0.0.0.0")
require.Error(t, err, "Error should have been thrown for invalid version")

}

func TestIndexOperations(t *testing.T) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ func (env *testVDBEnv) init(t *testing.T, sysNamespaces []string) {
}
config := &ledger.CouchDBConfig{
Address: env.couchDBEnv.couchAddress,
Username: "",
Password: "",
Username: "admin",
Password: "adminpw",
InternalQueryLimit: 1000,
MaxBatchUpdateSize: 1000,
MaxRetries: 3,
Expand Down Expand Up @@ -1122,6 +1122,8 @@ func testFormatCheck(t *testing.T, dataFormat string, dataExists bool, expectedE
defer os.RemoveAll(redoPath)
config := &ledger.CouchDBConfig{
Address: vdbEnv.couchDBEnv.couchAddress,
Username: "admin",
Password: "adminpw",
MaxRetries: 3,
MaxRetriesOnStartup: 20,
RequestTimeout: 35 * time.Second,
Expand Down
2 changes: 2 additions & 0 deletions integration/nwo/network.go
Original file line number Diff line number Diff line change
Expand Up @@ -1212,6 +1212,8 @@ func (n *Network) PeerRunner(p *Peer, env ...string) *ginkgomon.Runner {
commands.NodeStart{PeerID: p.ID()},
"",
fmt.Sprintf("FABRIC_CFG_PATH=%s", n.PeerDir(p)),
fmt.Sprintf("CORE_LEDGER_STATE_COUCHDBCONFIG_USERNAME=admin"),
fmt.Sprintf("CORE_LEDGER_STATE_COUCHDBCONFIG_PASSWORD=adminpw"),
)
cmd.Env = append(cmd.Env, env...)

Expand Down
12 changes: 9 additions & 3 deletions integration/runner/couchdb.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ import (
"github.com/tedsuo/ifrit"
)

const CouchDBDefaultImage = "couchdb:2.3"
const CouchDBDefaultImage = "couchdb:3.1"
const CouchDBUsername = "admin"
const CouchDBPassword = "adminpw"

// CouchDB manages the execution of an instance of a dockerized CounchDB
// for tests.
Expand Down Expand Up @@ -96,7 +98,11 @@ func (c *CouchDB) Run(sigCh <-chan os.Signal, ready chan<- struct{}) error {
Name: c.Name,
Config: &docker.Config{
Image: c.Image,
Env: []string{"_creator=" + c.creator},
Env: []string{
fmt.Sprintf("_creator=%s", c.creator),
fmt.Sprintf("COUCHDB_USER=%s", CouchDBUsername),
fmt.Sprintf("COUCHDB_PASSWORD=%s", CouchDBPassword),
},
},
HostConfig: hostConfig,
},
Expand Down Expand Up @@ -174,8 +180,8 @@ func endpointReady(ctx context.Context, url string) bool {

func (c *CouchDB) ready(ctx context.Context, addr string) <-chan struct{} {
readyCh := make(chan struct{})
url := fmt.Sprintf("http://%s/", addr)
go func() {
url := fmt.Sprintf("http://%s:%s@%s/", CouchDBUsername, CouchDBPassword, addr)
ticker := time.NewTicker(100 * time.Millisecond)
defer ticker.Stop()
for {
Expand Down

0 comments on commit 701bf56

Please sign in to comment.