Skip to content

Commit

Permalink
Update readme for POD name (#1583)
Browse files Browse the repository at this point in the history
* Update readme for POD name

* pod: Update go package name and related paths

---------

Co-authored-by: cdamian <[email protected]>
  • Loading branch information
Jeroen Offerijns and cdamian authored Mar 14, 2023
1 parent e09cce1 commit 4eb3f50
Show file tree
Hide file tree
Showing 284 changed files with 1,319 additions and 1,317 deletions.
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ FROM golang:1.18-buster as builder

RUN apt-get -y update && apt-get -y upgrade && apt-get -y install wget && apt-get install ca-certificates -y

ADD . /go/src/github.com/centrifuge/go-centrifuge
WORKDIR /go/src/github.com/centrifuge/go-centrifuge
ADD . /go/src/github.com/centrifuge/pod
WORKDIR /go/src/github.com/centrifuge/pod

RUN go install -ldflags "-X github.com/centrifuge/go-centrifuge/version.gitCommit=`git rev-parse HEAD`" ./cmd/centrifuge/...
RUN go install -ldflags "-X github.com/centrifuge/pod/version.gitCommit=`git rev-parse HEAD`" ./cmd/centrifuge/...

FROM debian:buster-slim
RUN apt-get -y update && apt-get -y upgrade && apt-get install ca-certificates -y
Expand Down
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ run-testworld-tests:
go test ./... -v -race -coverprofile=profile.out -covermode=atomic -tags=testworld -timeout 70m

install: ## Builds and Install binary
@go install -ldflags "-X github.com/centrifuge/go-centrifuge/version.gitCommit=`git rev-parse HEAD`" ./cmd/centrifuge/...
@go install -ldflags "-X github.com/centrifuge/pod/version.gitCommit=`git rev-parse HEAD`" ./cmd/centrifuge/...

IMAGE_NAME?=centrifugeio/go-centrifuge
IMAGE_NAME?=centrifugeio/pod
BRANCH=`git rev-parse --abbrev-ref HEAD`
GIT_SHORT_COMMIT=`git rev-parse --short HEAD`
TIMESTAMP=`date -u +%Y%m%d%H`
Expand All @@ -65,7 +65,7 @@ os?=`go env GOOS`
arch?=amd64
build-binary: install-deps
@echo "Building binary for ${os}-${arch}"
@GOOS=${os} GOARCH=${arch} go build -ldflags "-X github.com/centrifuge/go-centrifuge/version.gitCommit=`git rev-parse HEAD`" ./cmd/centrifuge/...
@GOOS=${os} GOARCH=${arch} go build -ldflags "-X github.com/centrifuge/pod/version.gitCommit=`git rev-parse HEAD`" ./cmd/centrifuge/...
@if [ -z `git tag --points-at HEAD` ]; then\
tar -zcf centrifuge-${os}-${arch}-${GIT_SHORT_COMMIT}.tar.gz ./centrifuge;\
else\
Expand All @@ -81,7 +81,7 @@ recreate_config?=false
start-local-node:
@echo "Building node..."
@go mod vendor
@go build -ldflags "-X github.com/centrifuge/go-centrifuge/version.gitCommit=`git rev-parse HEAD`" ./cmd/centrifuge/...
@go build -ldflags "-X github.com/centrifuge/pod/version.gitCommit=`git rev-parse HEAD`" ./cmd/centrifuge/...
@if [[ ! -f "${targetDir}"/config.yaml || "${recreate_config}" == "true" ]]; then \
rm -rf "${targetDir}"; \
echo "Creating local test config for the Node at ${targetDir}"; \
Expand Down
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Centrifuge P2P node
# Centrifuge POD (P2P Node)

[![Tests](https://github.com/centrifuge/go-centrifuge/actions/workflows/tests.yml/badge.svg?branch=develop)](https://github.com/centrifuge/go-centrifuge/actions/workflows/tests.yml)
[![GoDoc Reference](https://godoc.org/github.com/centrifuge/go-centrifuge?status.svg)](https://godoc.org/github.com/centrifuge/go-centrifuge)
[![codecov](https://codecov.io/gh/centrifuge/go-centrifuge/branch/develop/graph/badge.svg)](https://codecov.io/gh/centrifuge/go-centrifuge)
[![Go Report Card](https://goreportcard.com/badge/github.com/centrifuge/go-centrifuge)](https://goreportcard.com/report/github.com/centrifuge/go-centrifuge)
[![Tests](https://github.com/centrifuge/pod/actions/workflows/tests.yml/badge.svg?branch=develop)](https://github.com/centrifuge/pod/actions/workflows/tests.yml)
[![GoDoc Reference](https://godoc.org/github.com/centrifuge/pod?status.svg)](https://godoc.org/github.com/centrifuge/pod)
[![codecov](https://codecov.io/gh/centrifuge/pod/branch/main/graph/badge.svg)](https://codecov.io/gh/centrifuge/pod)
[![Go Report Card](https://goreportcard.com/badge/github.com/centrifuge/pod)](https://goreportcard.com/report/github.com/centrifuge/pod)

`go-centrifuge` is the go implementation of the Centrifuge P2P protocol. It connects to other nodes via libp2p2 and uses Centrifuge Chain for on-chain interactions.
This repository contains the Go implementation of the Centrifuge POD (Private Off-chain Data) protocol. It connects to other nodes via libp2p and uses [Centrifuge Chain](https://github.com/centrifuge/centrifuge-chain) for on-chain interactions.

**Getting help:** Head over to our documentation at [docs.centrifuge.io](http://docs.centrifuge.io) to learn how to setup a node and interact with it. If you have any questions, feel free to join our [discord](https://centrifuge.io/discord)

Expand All @@ -29,7 +29,7 @@ Ensure `GOBIN` is under `PATH` to call the binary globally.
There 4 different flavours of tests in the project
- Unit tests(unit)
- Integration tests(integration)
- Environment tests(testworld): spins up multiple go-centrifuge nodes and local ethereum and centrifuge chains
- Environment tests(testworld): spins up multiple PODs and local ethereum and centrifuge chains

To run all the tests:
- `make run-unit-tests`
Expand Down
44 changes: 22 additions & 22 deletions bootstrap/bootstrappers/bootstrapper.go
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
package bootstrappers

import (
"github.com/centrifuge/go-centrifuge/bootstrap"
"github.com/centrifuge/go-centrifuge/centchain"
"github.com/centrifuge/go-centrifuge/config"
"github.com/centrifuge/go-centrifuge/config/configstore"
"github.com/centrifuge/go-centrifuge/dispatcher"
"github.com/centrifuge/go-centrifuge/documents"
"github.com/centrifuge/go-centrifuge/documents/entity"
"github.com/centrifuge/go-centrifuge/documents/entityrelationship"
"github.com/centrifuge/go-centrifuge/documents/generic"
"github.com/centrifuge/go-centrifuge/http"
httpv2 "github.com/centrifuge/go-centrifuge/http/v2"
httpv3 "github.com/centrifuge/go-centrifuge/http/v3"
identityv2 "github.com/centrifuge/go-centrifuge/identity/v2"
"github.com/centrifuge/go-centrifuge/ipfs"
"github.com/centrifuge/go-centrifuge/jobs"
nftv3 "github.com/centrifuge/go-centrifuge/nft/v3"
"github.com/centrifuge/go-centrifuge/node"
"github.com/centrifuge/go-centrifuge/p2p"
"github.com/centrifuge/go-centrifuge/pallets"
"github.com/centrifuge/go-centrifuge/pending"
"github.com/centrifuge/go-centrifuge/storage/leveldb"
"github.com/centrifuge/go-centrifuge/version"
"github.com/centrifuge/pod/bootstrap"
"github.com/centrifuge/pod/centchain"
"github.com/centrifuge/pod/config"
"github.com/centrifuge/pod/config/configstore"
"github.com/centrifuge/pod/dispatcher"
"github.com/centrifuge/pod/documents"
"github.com/centrifuge/pod/documents/entity"
"github.com/centrifuge/pod/documents/entityrelationship"
"github.com/centrifuge/pod/documents/generic"
"github.com/centrifuge/pod/http"
httpv2 "github.com/centrifuge/pod/http/v2"
httpv3 "github.com/centrifuge/pod/http/v3"
identityv2 "github.com/centrifuge/pod/identity/v2"
"github.com/centrifuge/pod/ipfs"
"github.com/centrifuge/pod/jobs"
nftv3 "github.com/centrifuge/pod/nft/v3"
"github.com/centrifuge/pod/node"
"github.com/centrifuge/pod/p2p"
"github.com/centrifuge/pod/pallets"
"github.com/centrifuge/pod/pending"
"github.com/centrifuge/pod/storage/leveldb"
"github.com/centrifuge/pod/version"
log2 "github.com/ipfs/go-log"
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,8 @@ import (
"os/exec"
"time"

"github.com/centrifuge/go-centrifuge/testingutils/path"

gsrpc "github.com/centrifuge/go-substrate-rpc-client/v4"
"github.com/centrifuge/pod/testingutils/path"
logging "github.com/ipfs/go-log"
)

Expand Down
2 changes: 1 addition & 1 deletion bootstrap/bootstrappers/testlogging/test_bootstrapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ package testlogging
import (
"os"

"github.com/centrifuge/go-centrifuge/utils"
"github.com/centrifuge/pod/utils"
logging "github.com/ipfs/go-log"
gologging "github.com/whyrusleeping/go-logging"
)
Expand Down
8 changes: 4 additions & 4 deletions bootstrap/doc.go
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
/*
Package bootstrap maintains the bootstrapping interface design for go-centrifuge.
Package bootstrap maintains the bootstrapping interface design for the Centrifuge POD.
These interfaces are defined to enable decoupling between implementation of various implementation packages of
go-centrifuge and their runtime instantiation logic.
the Centrifuge POD and their runtime instantiation logic.
Why Bootstrapper interface was needed
Unlike a regular library, process runtime code has certain dependencies on a central instantiation
point in the software for it to be initialised properly. For go-centrifuge this made it difficult to
point in the software for it to be initialised properly. For the Centrifuge POD this made it difficult to
change instantiation logic based on the need(eg: commands vs daemon) because of cyclic dependencies or to reuse that logic for purposes of testing.
The use of global variables to access already initialised implementations meant that it was hard to identify the dependencies needed for each module to function properly.
Also this meant that instantiation logic got coupled to a particular implementation of a package interface. For example leveldb implementation of storage
Expand Down Expand Up @@ -57,6 +57,6 @@ After this a downstream package bootstrapped can use the context[storage.Bootstr
repo := NewDocRepository(ldb)
Check go-centrifuge/cmd package to see how the Bootstrapper interfaces are used to bootstrap go-centrifuge.
Check the cmd package to see how the Bootstrapper interfaces are used to bootstrap the Centrifuge POD.
*/
package bootstrap
20 changes: 10 additions & 10 deletions build/scripts/run_centrifuge_chain.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ fi
# Setup
PARENT_DIR=$(pwd)

mkdir -p /tmp/go-centrifuge/deps/res
cp "${PARENT_DIR}"/build/centrifuge-chain/docker-compose-local-relay.yml /tmp/go-centrifuge/deps/
cp "${PARENT_DIR}"/build/centrifuge-chain/docker-compose-local-chain.yml /tmp/go-centrifuge/deps/
cp "${PARENT_DIR}"/build/centrifuge-chain/res/rococo-local.json /tmp/go-centrifuge/deps/res/
mkdir -p /tmp/centrifuge-pod/deps/res
cp "${PARENT_DIR}"/build/centrifuge-chain/docker-compose-local-relay.yml /tmp/centrifuge-pod/deps/
cp "${PARENT_DIR}"/build/centrifuge-chain/docker-compose-local-chain.yml /tmp/centrifuge-pod/deps/
cp "${PARENT_DIR}"/build/centrifuge-chain/res/rococo-local.json /tmp/centrifuge-pod/deps/res/
docker network inspect docker_default
if [ $? -ne 0 ]; then
docker network create docker_default
Expand All @@ -32,17 +32,17 @@ fi
################## Run RelayChain #########################
cd "${PARENT_DIR}"/build/centrifuge-chain || exit
## Tweaking network
default_network=$(cat /tmp/go-centrifuge/deps/docker-compose-local-relay.yml | grep "name: docker_default")
default_network=$(cat /tmp/centrifuge-pod/deps/docker-compose-local-relay.yml | grep "name: docker_default")
if [[ $default_network == "" ]]; then
cat <<EOT >> /tmp/go-centrifuge/deps/docker-compose-local-relay.yml
cat <<EOT >> /tmp/centrifuge-pod/deps/docker-compose-local-relay.yml
networks:
default:
external:
name: docker_default
EOT
fi

docker-compose -f /tmp/go-centrifuge/deps/docker-compose-local-relay.yml up -d
docker-compose -f /tmp/centrifuge-pod/deps/docker-compose-local-relay.yml up -d

echo "Waiting for Relay Chain to Start Up ..."
maxCount=$(( CENT_CHAIN_DOCKER_START_TIMEOUT / CENT_CHAIN_DOCKER_START_INTERVAL ))
Expand All @@ -65,9 +65,9 @@ done
################## Run CentChain #########################
## Centrifuge Chain local Development testnet
## Tweaking network
default_network=$(cat /tmp/go-centrifuge/deps/docker-compose-local-chain.yml | grep "name: docker_default")
default_network=$(cat /tmp/centrifuge-pod/deps/docker-compose-local-chain.yml | grep "name: docker_default")
if [[ $default_network == "" ]]; then
cat <<EOT >> /tmp/go-centrifuge/deps/docker-compose-local-chain.yml
cat <<EOT >> /tmp/centrifuge-pod/deps/docker-compose-local-chain.yml
networks:
default:
external:
Expand All @@ -76,7 +76,7 @@ EOT
fi

PARA_CHAIN_SPEC=development-local \
docker-compose -f /tmp/go-centrifuge/deps/docker-compose-local-chain.yml up -d
docker-compose -f /tmp/centrifuge-pod/deps/docker-compose-local-chain.yml up -d

echo "Waiting for Centrifuge Chain to Start Up ..."
maxCount=$(( CENT_CHAIN_DOCKER_START_TIMEOUT / CENT_CHAIN_DOCKER_START_INTERVAL ))
Expand Down
6 changes: 3 additions & 3 deletions centchain/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ import (
"sync"
"time"

"github.com/centrifuge/go-centrifuge/contextutil"
"github.com/centrifuge/go-centrifuge/errors"
"github.com/centrifuge/go-centrifuge/jobs"
gsrpc "github.com/centrifuge/go-substrate-rpc-client/v4"
"github.com/centrifuge/go-substrate-rpc-client/v4/client"
"github.com/centrifuge/go-substrate-rpc-client/v4/signature"
"github.com/centrifuge/go-substrate-rpc-client/v4/types"
"github.com/centrifuge/go-substrate-rpc-client/v4/types/codec"
"github.com/centrifuge/gocelery/v2"
"github.com/centrifuge/pod/contextutil"
"github.com/centrifuge/pod/errors"
"github.com/centrifuge/pod/jobs"
"github.com/ethereum/go-ethereum/common/hexutil"
logging "github.com/ipfs/go-log"
)
Expand Down
29 changes: 14 additions & 15 deletions centchain/api_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,21 @@ import (
"os"
"testing"

genericUtils "github.com/centrifuge/go-centrifuge/testingutils/generic"

"github.com/centrifuge/go-centrifuge/bootstrap"
"github.com/centrifuge/go-centrifuge/bootstrap/bootstrappers/integration_test"
"github.com/centrifuge/go-centrifuge/bootstrap/bootstrappers/testlogging"
"github.com/centrifuge/go-centrifuge/centchain"
"github.com/centrifuge/go-centrifuge/config"
"github.com/centrifuge/go-centrifuge/config/configstore"
"github.com/centrifuge/go-centrifuge/contextutil"
"github.com/centrifuge/go-centrifuge/dispatcher"
v2 "github.com/centrifuge/go-centrifuge/identity/v2"
"github.com/centrifuge/go-centrifuge/jobs"
"github.com/centrifuge/go-centrifuge/pallets"
"github.com/centrifuge/go-centrifuge/storage/leveldb"
"github.com/centrifuge/go-centrifuge/testingutils/keyrings"
"github.com/centrifuge/go-substrate-rpc-client/v4/types"
"github.com/centrifuge/pod/bootstrap"
"github.com/centrifuge/pod/bootstrap/bootstrappers/integration_test"
"github.com/centrifuge/pod/bootstrap/bootstrappers/testlogging"
"github.com/centrifuge/pod/centchain"
"github.com/centrifuge/pod/config"
"github.com/centrifuge/pod/config/configstore"
"github.com/centrifuge/pod/contextutil"
"github.com/centrifuge/pod/dispatcher"
v2 "github.com/centrifuge/pod/identity/v2"
"github.com/centrifuge/pod/jobs"
"github.com/centrifuge/pod/pallets"
"github.com/centrifuge/pod/storage/leveldb"
genericUtils "github.com/centrifuge/pod/testingutils/generic"
"github.com/centrifuge/pod/testingutils/keyrings"
"github.com/stretchr/testify/assert"
)

Expand Down
16 changes: 8 additions & 8 deletions centchain/api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,17 @@ import (
"testing"
"time"

"github.com/centrifuge/go-centrifuge/config"
"github.com/centrifuge/go-centrifuge/contextutil"
"github.com/centrifuge/go-centrifuge/errors"
"github.com/centrifuge/go-centrifuge/jobs"
"github.com/centrifuge/go-centrifuge/testingutils"
testingcommons "github.com/centrifuge/go-centrifuge/testingutils/common"
"github.com/centrifuge/go-centrifuge/testingutils/keyrings"
"github.com/centrifuge/go-centrifuge/utils"
"github.com/centrifuge/go-substrate-rpc-client/v4/scale"
"github.com/centrifuge/go-substrate-rpc-client/v4/types"
"github.com/centrifuge/gocelery/v2"
"github.com/centrifuge/pod/config"
"github.com/centrifuge/pod/contextutil"
"github.com/centrifuge/pod/errors"
"github.com/centrifuge/pod/jobs"
"github.com/centrifuge/pod/testingutils"
testingcommons "github.com/centrifuge/pod/testingutils/common"
"github.com/centrifuge/pod/testingutils/keyrings"
"github.com/centrifuge/pod/utils"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/mock"
)
Expand Down
4 changes: 2 additions & 2 deletions centchain/bootstrapper.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package centchain

import (
"github.com/centrifuge/go-centrifuge/config"
"github.com/centrifuge/go-centrifuge/jobs"
gsrpc "github.com/centrifuge/go-substrate-rpc-client/v4"
"github.com/centrifuge/pod/config"
"github.com/centrifuge/pod/jobs"
)

// BootstrappedCentChainClient is a key to mapped client in bootstrap context.
Expand Down
2 changes: 1 addition & 1 deletion centchain/test_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ import (
"fmt"
"time"

"github.com/centrifuge/go-centrifuge/errors"
gsrpc "github.com/centrifuge/go-substrate-rpc-client/v4"
"github.com/centrifuge/go-substrate-rpc-client/v4/signature"
"github.com/centrifuge/go-substrate-rpc-client/v4/types"
"github.com/centrifuge/pod/errors"
)

type TestClient struct {
Expand Down
2 changes: 1 addition & 1 deletion cmd/centrifuge/create_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package main
import (
"os"

"github.com/centrifuge/go-centrifuge/cmd"
"github.com/centrifuge/pod/cmd"
"github.com/mitchellh/go-homedir"
"github.com/spf13/cobra"
)
Expand Down
2 changes: 1 addition & 1 deletion cmd/centrifuge/generate_signing_key.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package main

import (
"github.com/centrifuge/go-centrifuge/crypto"
"github.com/centrifuge/pod/crypto"
"github.com/spf13/cobra"
)

Expand Down
4 changes: 2 additions & 2 deletions cmd/centrifuge/migrate.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package main

import (
"github.com/centrifuge/go-centrifuge/config"
"github.com/centrifuge/go-centrifuge/migration"
"github.com/centrifuge/pod/config"
"github.com/centrifuge/pod/migration"
"github.com/spf13/cobra"
)

Expand Down
2 changes: 1 addition & 1 deletion cmd/centrifuge/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"
"os"

"github.com/centrifuge/go-centrifuge/utils"
"github.com/centrifuge/pod/utils"
"github.com/common-nighthawk/go-figure"
logging "github.com/ipfs/go-log"
"github.com/mitchellh/go-homedir"
Expand Down
2 changes: 1 addition & 1 deletion cmd/centrifuge/run.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package main

import (
"github.com/centrifuge/go-centrifuge/cmd"
"github.com/centrifuge/pod/cmd"
"github.com/spf13/cobra"
)

Expand Down
4 changes: 2 additions & 2 deletions cmd/centrifuge/sign_message.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package main
import (
"fmt"

"github.com/centrifuge/go-centrifuge/crypto"
"github.com/centrifuge/go-centrifuge/utils"
"github.com/centrifuge/pod/crypto"
"github.com/centrifuge/pod/utils"
"github.com/ethereum/go-ethereum/common/hexutil"
"github.com/spf13/cobra"
)
Expand Down
4 changes: 2 additions & 2 deletions cmd/centrifuge/verify_message.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package main
import (
"fmt"

"github.com/centrifuge/go-centrifuge/crypto"
"github.com/centrifuge/go-centrifuge/utils"
"github.com/centrifuge/pod/crypto"
"github.com/centrifuge/pod/utils"
"github.com/ethereum/go-ethereum/common/hexutil"
"github.com/spf13/cobra"
)
Expand Down
Loading

0 comments on commit 4eb3f50

Please sign in to comment.