Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
96 commits
Select commit Hold shift + click to select a range
6b4deca
Pocket Network Consensus Module Specification - v1.0.1
Olshansk Jan 27, 2022
1f4d6d3
doc(p2p-spec): p2p spec in md
derrandz Jan 27, 2022
e32c3f1
doc(p2p-spec): add header
derrandz Jan 27, 2022
ea8020e
doc(p2p-spec): rename path
derrandz Jan 27, 2022
b6e5934
doc(p2p-spec): add assets
derrandz Jan 27, 2022
b535b2f
doc(p2p-spec): add extra details about the send/ack/readjust
derrandz Jan 27, 2022
6a37aa7
doc(p2p-spec): minor fixes to styling
Jan 27, 2022
dcf8d43
Moved consensus specification to it's own directory
luyzdeleon Jan 27, 2022
b6877c5
Added persistence specification
luyzdeleon Jan 27, 2022
09dccc8
Moved consensus documents to their own directory
luyzdeleon Jan 27, 2022
e939a47
Changed dissenting opinion title style
luyzdeleon Jan 27, 2022
4fcfbb6
Fixed bold words
luyzdeleon Jan 27, 2022
4424b09
Moved P2P into it's own directory
luyzdeleon Jan 27, 2022
ad123b2
Renamed p2p markdown file
luyzdeleon Jan 27, 2022
a8e6b5a
Added utility spec
luyzdeleon Jan 28, 2022
9231de0
Added root README and CONTRIBUTING documents
luyzdeleon Jan 28, 2022
7ebe5d0
Documentation root
luyzdeleon Jan 28, 2022
c696e67
Fixed logo image and specs link (#9)
luyzdeleon Jan 28, 2022
b8160a0
Friday night WIP for RainTree happy path no-tests on top of Pre2P - a…
Olshansk Apr 30, 2022
f5acc10
LocalNet is running but propagation isn't fully functional yet - only…
Olshansk Apr 30, 2022
0f45f5e
Almost working but not progressing on every height
Olshansk May 1, 2022
f01f894
Validator configuration improvements
Olshansk May 2, 2022
e227a1e
WIP
Olshansk May 2, 2022
3337417
Deleted prototype
Olshansk May 2, 2022
84464d7
Add prototype back
Olshansk May 2, 2022
7d1bbfe
Happy path ACTUALLY working now
Olshansk May 2, 2022
f2ca9bf
Added TransportLayerConn prior to writing tests
Olshansk May 3, 2022
0d6f49c
Replaced Accept w/ TCP in TransportLayerConn abstraction
Olshansk May 3, 2022
a31f4a0
Pipes are a difficult abstraction - going to try channels
Olshansk May 4, 2022
7e1e3a6
GOT A TEST WORKING - time to sleep
Olshansk May 4, 2022
f0f350c
Enforce the correct number of reads & writes
Olshansk May 4, 2022
68a5145
Fix race condition
Olshansk May 4, 2022
08208ed
Add proper demote logic and improve tests
Olshansk May 4, 2022
0c41b86
Small & Large RainTree test working consistenly
Olshansk May 5, 2022
f105bea
Cleanup - self review config changes
Olshansk May 5, 2022
b27d49d
Cleanup - replaced 'pipeConn' with 'emptyConn'
Olshansk May 5, 2022
b8bc437
Rename RawData to NetworkData
Olshansk May 5, 2022
0f81233
Remove unused function
Olshansk May 5, 2022
cd240b2
Cleanup - self review of raintree/network code
Olshansk May 5, 2022
78a268f
Cleanup - self review of raintree test
Olshansk May 5, 2022
231f387
Cleanup - removed and ignoring network_mock.go from git history
Olshansk May 5, 2022
90265c4
TODO to rename 'compose_and_watch'
Olshansk May 5, 2022
128e573
Fixed genesis configs tests
Olshansk May 5, 2022
cf89b0e
Fix LocalNet client broadcast
Olshansk May 5, 2022
b48df39
Fix raintree_test expected num reads & writes
Olshansk May 5, 2022
223348a
implemented the cleanup and redundancy layer happy paths
May 9, 2022
86ffa34
add victoria metrics and configure docker SD
okdas May 10, 2022
178f1e9
some onboarding changes + relabel configs
okdas May 10, 2022
31b59ba
module: add telemetry module with prometheus metrics sdk
derrandz May 11, 2022
2691f39
feat: track pre2p metrics
derrandz May 11, 2022
fbe3214
wip(bug): victoria-metrics fails to connect to nodes on 9000
derrandz May 11, 2022
845c198
listen on all interfaces
okdas May 11, 2022
5522bba
fix: expose http metrics endpoint on external net interface (docker)
derrandz May 11, 2022
2c7ac1f
add more metrics to track and allow switching telemetry on and off to…
derrandz May 11, 2022
a3b94d6
add more containers
okdas May 13, 2022
7c61206
chore: fix missing negation at if statement
derrandz May 13, 2022
244939f
Merge branch 'pre2p/raintree-metrics' of github.com:pokt-network/pock…
derrandz May 13, 2022
6da7027
add loki
okdas May 13, 2022
178cbcb
add common lable between metrics and logs
okdas May 13, 2022
1850417
add monitoring_start to makefile
okdas May 13, 2022
98329e5
add missing quotes to expose ports in docker-compose
derrandz May 14, 2022
e3cbf05
Merge branch 'milestone/v1-prototype' into pre2p/raintree-metrics
derrandz May 17, 2022
04e7e79
chore: move to laptop
derrandz May 19, 2022
b14a5ef
feat:
derrandz May 19, 2022
34308c6
fixup configs & cleanup
okdas May 26, 2022
1469a59
Fix scraping config regex
okdas May 26, 2022
1eac96a
reduce validators to 4 to let the blockchain go forward (bug?)
derrandz May 31, 2022
62a0b69
Fix make refresh command
Olshansk Jun 1, 2022
cca06d6
Workaroudns for grafana image
Olshansk Jun 1, 2022
33e8bf0
change machine, revert this commit
derrandz Jun 7, 2022
0b82ec2
Merge branch 'pre2p/raintree-metrics' of github.com:pokt-network/pock…
derrandz Jun 7, 2022
ee5671a
feat: use logging to track events, add grafana dashbaord to aggregate…
derrandz Jun 21, 2022
ce8e046
Merge branch 'milestone/v1-prototype'
derrandz Jun 21, 2022
d19b159
Merge branch 'main' of github.com:pokt-network/pocket
derrandz Jun 21, 2022
fb5e3e5
Merge branch 'main' into pre2p/raintree-metrics
derrandz Jun 21, 2022
4f6367b
chore: remove non-related changes
derrandz Jun 21, 2022
bfd2387
add back removed files
derrandz Jun 23, 2022
3936966
add back CONTRIBUTING.md
derrandz Jun 23, 2022
22ded10
implement requested changes
derrandz Jun 24, 2022
5e04507
fix any keyword syntax and upgrade docker image to 1.18
derrandz Jun 24, 2022
5395131
fix loginless grafana
okdas Jun 24, 2022
0b7091d
rm build/granafa/provisioning/datasources/datasource.yaml
okdas Jun 24, 2022
8e2df07
This config is actually also not in use.
okdas Jun 24, 2022
7b0c40a
add requested changes
derrandz Jun 28, 2022
348e2ee
Merge branch 'telemetry/add-telemetry-infrastructure' of github.com:p…
derrandz Jun 28, 2022
26097b8
chore: cleanup
derrandz Jun 22, 2022
2b35e98
chore: remove unrelated changes
derrandz Jun 22, 2022
6337350
update: keep raintree graphs only
derrandz Jun 22, 2022
db73d1b
correct rebase slip
derrandz Jun 29, 2022
8b72e8f
add back missing changes
derrandz Jun 29, 2022
6b926fa
add back missing changes
derrandz Jun 29, 2022
69f1ee4
chore: cleanup
derrandz Jun 22, 2022
6eefa84
feat: add timeseries metrics
derrandz Jun 22, 2022
16297dd
add back missing changes
derrandz Jun 29, 2022
5e4fffb
first iteration of the logging agent
derrandz Jun 29, 2022
1007d72
second iteration, rely on global loggers for non modules
derrandz Jul 1, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
## How to contribute

Pocket is an open source project, and as such we welcome any contribution from anyone on the internet.

Please fork, code and submit a Pull Request for the team to review and merge. We ask that you please follow the guidelines below in order to submit your contributions for review:

### High impact or architectural changes

Reach out to us on [Telegram](https://t.me/POKTnetwork) and start a discussion with the team regarding your change before you start working. Communication is key for open source projects and asynchronous contributions.

For an active research forum, checkout and post on [our forum](https://research.pokt.network).

### Coding style
- Code must adhere to the official Go formatting guidelines (i.e. uses [gofmt](https://golang.org/cmd/gofmt)).
- (Optional) Use [Editor Config](https://editorconfig.org) to help your Text Editor keep the same formatting used throughout the project.
- Code must be documented adhering to the official Go commentary guidelines.
- Pull requests need to be based on and opened against the `main` branch.
25 changes: 23 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,15 @@ go_staticcheck:
go_clean_deps:
go mod tidy && go mod vendor

.PHONY: refresh
## Removes vendor, installs deps, generates mocks and protobuf files. Perform after a new pull or a branch switch
refresh: go_clean_deps
go mod tidy && go mod vendor && make protogen_clean && make protogen_local

.PHONY: build_and_watch
## Continous build Pocket's main entrypoint as files change
build_and_watch:
/bin/sh ${PWD}/scripts/watch_build.sh
/bin/sh ${PWD}/build/scripts/watch_build.sh

.PHONY: client_start
## Run a client daemon which is only used for debugging purposes
Expand All @@ -59,9 +64,14 @@ client_connect:
# TODO(olshansky): Need to think of a Pocket related name for `compose_and_watch`, maybe just `pocket_watch`?
.PHONY: compose_and_watch
## Run a localnet composed of 4 consensus validators w/ hot reload & debugging
compose_and_watch: db_start
compose_and_watch: db_start monitoring_start
docker-compose -f build/deployments/docker-compose.yaml up --force-recreate node1.consensus node2.consensus node3.consensus node4.consensus

.PHONY: rebuild_and_compose_and_watch
## Rebuilds the container from scratch and launches compose_and_watch
rebuild_and_compose_and_watch: db_start monitoring_start
docker-compose -f build/deployments/docker-compose.yaml up --build --force-recreate node1.consensus node2.consensus node3.consensus node4.consensus

.PHONY: db_start
## Start a detached local postgres and admin instance (this is auto-triggered by compose_and_watch)
db_start:
Expand Down Expand Up @@ -106,6 +116,16 @@ docker_wipe: prompt_user
docker images -q | xargs -r -I {} docker rmi {}
docker volume ls -q | xargs -r -I {} docker volume rm {}

.PHONY: monitoring_start
## Start grafana, metrics and logging system (this is auto-triggered by compose_and_watch)
monitoring_start:
docker-compose -f build/deployments/docker-compose.yaml up --no-recreate -d grafana loki vm

.PHONY: make docker_loki_install
## Installs the loki docker driver
docker_loki_install:
docker plugin install grafana/loki-docker-driver:latest --alias loki --grant-all-permissions

.PHONY: mockgen
## Use `mockgen` to generate mocks used for testing purposes of all the modules.
mockgen:
Expand All @@ -115,6 +135,7 @@ mockgen:
mockgen --source=${modules_dir}/utility_module.go -destination=${modules_dir}/mocks/utility_module_mock.go -aux_files=github.com/pokt-network/pocket/${modules_dir}=${modules_dir}/module.go
mockgen --source=${modules_dir}/consensus_module.go -destination=${modules_dir}/mocks/consensus_module_mock.go -aux_files=github.com/pokt-network/pocket/${modules_dir}=${modules_dir}/module.go
mockgen --source=${modules_dir}/bus_module.go -destination=${modules_dir}/mocks/bus_module_mock.go -aux_files=github.com/pokt-network/pocket/${modules_dir}=${modules_dir}/module.go
mockgen --source=${modules_dir}/telemetry_module.go -destination=${modules_dir}/mocks/telemetry_module_mock.go -aux_files=github.com/pokt-network/pocket/${modules_dir}=${modules_dir}/module.go
echo "Mocks generated in ${modules_dir}/mocks"

$(eval p2p_types_dir = "p2p/pre2p/types")
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div align="center">
****<div align="center">
<a href="https://www.pokt.network">
<img src="https://user-images.githubusercontent.com/2219004/151564884-212c0e40-3bfa-412e-a341-edb54b5f1498.jpeg" alt="Pocket Network logo" width="340"/>
</a>
Expand Down
15 changes: 15 additions & 0 deletions app/client/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@ import (

"github.com/manifoldco/promptui"
"github.com/pokt-network/pocket/p2p/pre2p"
"github.com/pokt-network/pocket/shared"
"github.com/pokt-network/pocket/shared/config"
"github.com/pokt-network/pocket/shared/crypto"
"github.com/pokt-network/pocket/shared/modules"
"github.com/pokt-network/pocket/shared/telemetry"
"github.com/pokt-network/pocket/shared/types"
typesGenesis "github.com/pokt-network/pocket/shared/types/genesis"
"google.golang.org/protobuf/types/known/anypb"
Expand Down Expand Up @@ -51,6 +53,7 @@ func main() {
UseRainTree: true,
ConnectionType: config.TCPConnection,
},
EnableTelemetry: false,
}

// Initialize the state singleton
Expand All @@ -61,6 +64,18 @@ func main() {
log.Fatalf("[ERROR] Failed to create pre2p module: " + err.Error())
}

// This telemetry module instance will be NOOP
// because of the client config 'enable_telemetry' key that is set to false.
// Since this client mimics partial (networking only) functionality of a full node, some of the telemetry-related
// code paths are executed. To avoid those messages interfering with the data collected, a non-nil telemetry
// module that NOOPs (per the configs above) is injected.
telemetryMod, err := telemetry.Create(cfg)
if err != nil {
log.Fatalf("[ERROR] Failed to create NOOP telemetry module: " + err.Error())
}

_ = shared.CreateBusWithOptionalModules(nil, pre2pMod, nil, nil, telemetryMod)

for {
selection, err := promptGetInput()
if err == nil {
Expand Down
2 changes: 1 addition & 1 deletion build/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG GOLANG_IMAGE_VERSION=golang:1.17-rc-alpine3.14
ARG GOLANG_IMAGE_VERSION=golang:1.18.3-alpine3.16

FROM ${GOLANG_IMAGE_VERSION} AS builder

Expand Down
22 changes: 16 additions & 6 deletions build/config/config1.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@
"root_dir": "/go/src/github.com/pocket-network",
"genesis": "build/config/genesis.json",
"private_key": "2e00000000000000000000000000000000000000000000000000000000000000264a0707979e0d6691f74b055429b5f318d39c2883bb509310b67424252e9ef2",
"enable_telemetry": true,
"pre2p": {
"consensus_port": 8080,
"use_raintree": true,
"connection_type": "tcp"
"connection_type": "tcp",
"log_level": "debug"
},
"p2p": {
"protocol": "tcp",
Expand All @@ -16,7 +18,8 @@
"172.18.0.1:8082",
"172.18.0.1:8083",
"172.18.0.1:8084"
]
],
"log_level": "debug"
},
"consensus": {
"max_mempool_bytes": 500000000,
Expand All @@ -25,16 +28,23 @@
"timeout_msec": 5000,
"manual": true,
"debug_time_between_steps_msec": 1000
}
},
"log_level": "all"
},
"pre_persistence": {
"capacity": 99999,
"mempool_max_bytes": 99999,
"mempool_max_txs": 99999
"mempool_max_txs": 99999,
"log_level": "info"
},
"persistence": {
"postgres_url": "postgres://postgres:postgres@pocket-db:5432/postgres",
"schema": "node1"
"schema": "node1",
"log_level": "info"
},
"utility": {}
"utility": {},
"telemetry": {
"address": "0.0.0.0:9000",
"endpoint": "/metrics"
}
}
26 changes: 18 additions & 8 deletions build/config/config2.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,24 @@
"root_dir": "/go/src/github.com/pocket-network",
"genesis": "build/config/genesis.json",
"private_key": "2d00000000000000000000000000000000000000000000000000000000000000ee37d8c8e9cf42a34cfa75ff1141e2bc0ff2f37483f064dce47cb4d5e69db1d4",
"enable_telemetry": true,
"pre2p": {
"consensus_port": 8080,
"use_raintree": true,
"connection_type": "tcp"
"connection_type": "tcp",
"log_level": "all"
},
"p2p": {
"protocol": "tcp",
"address": "0.0.0.0:8084",
"external_ip": "172.18.0.1:8084",
"address": "0.0.0.0:8082",
"external_ip": "172.18.0.1:8082",
"peers": [
"172.18.0.1:8081",
"172.18.0.1:8082",
"172.18.0.1:8083",
"172.18.0.1:8084"
]
],
"log_level": "debug"
},
"consensus": {
"max_mempool_bytes": 500000000,
Expand All @@ -25,16 +28,23 @@
"timeout_msec": 5000,
"manual": true,
"debug_time_between_steps_msec": 1000
}
},
"log_level": "debug"
},
"pre_persistence": {
"capacity": 99999,
"mempool_max_bytes": 99999,
"mempool_max_txs": 99999
"mempool_max_txs": 99999,
"log_level": "info"
},
"persistence": {
"postgres_url": "postgres://postgres:postgres@pocket-db:5432/postgres",
"schema": "node2"
"schema": "node2",
"log_level": "info"
},
"utility": {}
"utility": {},
"telemetry": {
"address": "0.0.0.0:9000",
"endpoint": "/metrics"
}
}
26 changes: 18 additions & 8 deletions build/config/config3.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,24 @@
"root_dir": "/go/src/github.com/pocket-network",
"genesis": "build/config/genesis.json",
"private_key": "2b000000000000000000000000000000000000000000000000000000000000001ba66c6751506850ae0787244c69476b6d45fb857a914a5a0445a24253f7b810",
"enable_telemetry": true,
"pre2p": {
"consensus_port": 8080,
"use_raintree": true,
"connection_type": "tcp"
"connection_type": "tcp",
"log_level": "debug"
},
"p2p": {
"protocol": "tcp",
"address": "0.0.0.0:8082",
"external_ip": "172.18.0.1:8082",
"address": "0.0.0.0:8083",
"external_ip": "172.18.0.1:8083",
"peers": [
"172.18.0.1:8081",
"172.18.0.1:8082",
"172.18.0.1:8083",
"172.18.0.1:8084"
]
],
"log_level": "debug"
},
"consensus": {
"max_mempool_bytes": 500000000,
Expand All @@ -25,16 +28,23 @@
"timeout_msec": 5000,
"manual": true,
"debug_time_between_steps_msec": 1000
}
},
"log_level": "all"
},
"pre_persistence": {
"capacity": 99999,
"mempool_max_bytes": 99999,
"mempool_max_txs": 99999
"mempool_max_txs": 99999,
"log_level": "info"
},
"persistence": {
"postgres_url": "postgres://postgres:postgres@pocket-db:5432/postgres",
"schema": "node3"
"schema": "node3",
"log_level": "info"
},
"utility": {}
"utility": {},
"telemetry": {
"address": "0.0.0.0:9000",
"endpoint": "/metrics"
}
}
26 changes: 18 additions & 8 deletions build/config/config4.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,24 @@
"root_dir": "/go/src/github.com/pocket-network",
"genesis": "build/config/genesis.json",
"private_key": "2c00000000000000000000000000000000000000000000000000000000000000f868bcc508133899cc47b612e4f7d9d5dacc90ce1f28214a97b651baa00bf6e4",
"enable_telemetry": true,
"pre2p": {
"consensus_port": 8080,
"use_raintree": true,
"connection_type": "tcp"
"connection_type": "tcp",
"log_level": "debug"
},
"p2p": {
"protocol": "tcp",
"address": "0.0.0.0:8083",
"external_ip": "172.18.0.1:8083",
"address": "0.0.0.0:8084",
"external_ip": "172.18.0.1:8084",
"peers": [
"172.18.0.1:8081",
"172.18.0.1:8082",
"172.18.0.1:8083",
"172.18.0.1:8084"
]
],
"log_level": "debug"
},
"consensus": {
"max_mempool_bytes": 500000000,
Expand All @@ -25,16 +28,23 @@
"timeout_msec": 5000,
"manual": true,
"debug_time_between_steps_msec": 1000
}
},
"log_level": "all"
},
"pre_persistence": {
"capacity": 99999,
"mempool_max_bytes": 99999,
"mempool_max_txs": 99999
"mempool_max_txs": 99999,
"log_level": "info"
},
"persistence": {
"postgres_url": "postgres://postgres:postgres@pocket-db:5432/postgres",
"schema": "node4"
"schema": "node4",
"log_level": "info"
},
"utility": {}
"utility": {},
"telemetry": {
"address": "0.0.0.0:9000",
"endpoint": "/metrics"
}
}
Loading