Showing preview only (2,522K chars total). Download the full file or copy to clipboard to get everything.
Repository: berty/weshnet
Branch: main
Commit: b4bab092a97a
Files: 353
Total size: 2.3 MB
Directory structure:
gitextract_xdu0swom/
├── .codecov.yml
├── .dockerignore
├── .editorconfig
├── .gitattributes
├── .github/
│ ├── ISSUE_TEMPLATE/
│ │ ├── bug_template.yml
│ │ ├── feature_template.yml
│ │ └── question_template.yml
│ ├── dependabot.yml
│ ├── pull_request_template.md
│ ├── weekly-digest.yml
│ └── workflows/
│ ├── benchmark.yml
│ ├── buf-push.yml
│ ├── cancel.yml
│ ├── codeql-analysis.yml
│ ├── dependent-issues.yml
│ ├── go.yml
│ ├── protobuf.yml
│ ├── release.yml
│ ├── ssh-runner.yml
│ └── utils/
│ └── variables.json
├── .gitignore
├── .golangci.yml
├── .tool-versions
├── COPYRIGHT
├── INSTALL.md
├── LICENSE-APACHE
├── LICENSE-MIT
├── Makefile
├── README.md
├── account_export.go
├── account_export_test.go
├── api/
│ ├── go-internal/
│ │ ├── buf.yaml
│ │ ├── handshake/
│ │ │ └── handshake.proto
│ │ └── tinder/
│ │ └── records.proto
│ └── protocol/
│ ├── buf.yaml
│ ├── errcode/
│ │ └── errcode.proto
│ ├── outofstoremessagetypes/
│ │ └── outofstoremessage.proto
│ ├── protocoltypes.proto
│ ├── replicationtypes/
│ │ └── bertyreplication.proto
│ └── verifiablecredstypes/
│ └── bertyverifiablecreds.proto
├── api_app.go
├── api_client.go
├── api_contact.go
├── api_contact_request_test.go
├── api_contactrequest.go
├── api_debug.go
├── api_event.go
├── api_group.go
├── api_multimember.go
├── api_replication.go
├── api_verified_credentials.go
├── blackbox_test.go
├── buf.gen.tag.yaml
├── buf.gen.yaml
├── connectedness_manager.go
├── consts.go
├── contact_request_manager.go
├── contact_request_manager_test.go
├── deactivate_test.go
├── doc.go
├── docs/
│ ├── CONTRIBUTING.md
│ ├── Makefile
│ ├── apis/
│ │ ├── protocoltypes.md
│ │ └── protocoltypes.swagger.json
│ ├── architecture/
│ │ ├── 2020-11-27-adr-berty-grpc-bridge.txt
│ │ ├── 2020-11-27-adr-gomobile-ipfs.md
│ │ ├── README.md
│ │ └── messenger-mvp/
│ │ ├── README.md
│ │ └── contact-request.mermaid
│ ├── buf-doc.gen.yaml
│ ├── gen.sum
│ ├── ideas/
│ │ ├── distributed-entropy.md
│ │ └── entropy-pool.md
│ └── protocol/
│ └── README.md
├── events.go
├── events_sig_checkers.go
├── gen.sum
├── go.mod
├── go.sum
├── group.go
├── group_context.go
├── iface_account.go
├── infra/
│ ├── .gitignore
│ ├── README.md
│ ├── rdvp/
│ │ ├── .env
│ │ ├── Makefile
│ │ └── docker-compose.yml
│ └── relay/
│ ├── Dockerfile
│ ├── Makefile
│ ├── config.json
│ └── docker-compose.yml
├── internal/
│ ├── benchmark/
│ │ └── benchmark_test.go
│ ├── bertyversion/
│ │ ├── example_test.go
│ │ └── version.go
│ ├── datastoreutil/
│ │ ├── consts.go
│ │ └── datastore_namespaced.go
│ ├── handshake/
│ │ ├── doc.go
│ │ ├── handshake.go
│ │ ├── handshake.pb.go
│ │ ├── handshake_test.go
│ │ ├── handshake_util_test.go
│ │ ├── request.go
│ │ └── response.go
│ ├── notify/
│ │ ├── notify.go
│ │ └── notify_test.go
│ ├── queue/
│ │ ├── metrics.go
│ │ ├── priority.go
│ │ ├── simple.go
│ │ └── simple_test.go
│ ├── sysutil/
│ │ ├── sysutil.go
│ │ ├── sysutil_unix.go
│ │ └── sysutil_unsupported.go
│ └── tools/
│ ├── example_test.go
│ ├── tools.go
│ └── tools_untool.go
├── message_marshaler.go
├── message_marshaler_test.go
├── orbitdb.go
├── orbitdb_datastore_cache.go
├── orbitdb_many_adds_berty_test.go
├── orbitdb_many_adds_test.go
├── orbitdb_signed_entry_accesscontroller.go
├── orbitdb_signed_entry_identity_provider.go
├── orbitdb_signed_entry_keystore.go
├── orbitdb_test.go
├── orbitdb_utils_test.go
├── pkg/
│ ├── androidnearby/
│ │ ├── bridge_android.go
│ │ ├── bridge_unsupported.go
│ │ ├── const.go
│ │ ├── example_test.go
│ │ ├── init.go
│ │ └── multiaddr.go
│ ├── bertyvcissuer/
│ │ ├── client.go
│ │ ├── urls.go
│ │ └── verifiable_public_key_fetcher.go
│ ├── ble-driver/
│ │ ├── BertyDevice_darwin.h
│ │ ├── BertyDevice_darwin.m
│ │ ├── BleInterface_darwin.h
│ │ ├── BleInterface_darwin.m
│ │ ├── BleManager_darwin.h
│ │ ├── BleManager_darwin.m
│ │ ├── BleQueue.h
│ │ ├── BleQueue.m
│ │ ├── CircularQueue.h
│ │ ├── CircularQueue.m
│ │ ├── ConnectedPeer.h
│ │ ├── ConnectedPeer.m
│ │ ├── CountDownLatch_darwin.h
│ │ ├── CountDownLatch_darwin.m
│ │ ├── Logger.h
│ │ ├── Logger.m
│ │ ├── PeerManager.h
│ │ ├── PeerManager.m
│ │ ├── TaskDelay.h
│ │ ├── TaskDelay.m
│ │ ├── WriteDataCache.h
│ │ ├── WriteDataCache.m
│ │ ├── bridge_android.go
│ │ ├── bridge_darwin.go
│ │ ├── bridge_unsupported.go
│ │ ├── const.go
│ │ ├── example_test.go
│ │ ├── init.go
│ │ └── multiaddr.go
│ ├── cryptoutil/
│ │ ├── cryptoutil.go
│ │ ├── cryptoutil_test.go
│ │ ├── doc.go
│ │ └── signer_wrapper.go
│ ├── errcode/
│ │ ├── doc.go
│ │ ├── errcode.pb.go
│ │ ├── error.go
│ │ ├── error_test.go
│ │ └── stdproto.go
│ ├── grpcutil/
│ │ ├── buf_listener.go
│ │ ├── doc.go
│ │ ├── simple_auth.go
│ │ └── simple_auth_test.go
│ ├── ipfsutil/
│ │ ├── collector_bandwidth.go
│ │ ├── collector_host.go
│ │ ├── conn_logger.go
│ │ ├── conn_manager.go
│ │ ├── consts.go
│ │ ├── doc.go
│ │ ├── extended_core_api.go
│ │ ├── helpers.go
│ │ ├── helpers_test.go
│ │ ├── keystore_datastore.go
│ │ ├── lifecycle.go
│ │ ├── localrecord.go
│ │ ├── metrics.go
│ │ ├── mobile/
│ │ │ ├── host.go
│ │ │ ├── node.go
│ │ │ ├── repo.go
│ │ │ └── routing.go
│ │ ├── mobile.go
│ │ ├── peering.go
│ │ ├── pubsub_adaptater.go
│ │ ├── pubsub_api.go
│ │ ├── pubsub_monitor.go
│ │ ├── repo.go
│ │ ├── testing.go
│ │ └── util.go
│ ├── lifecycle/
│ │ ├── example_test.go
│ │ ├── manager.go
│ │ └── task.go
│ ├── logutil/
│ │ ├── crypto_utils.go
│ │ ├── encoders.go
│ │ ├── example_test.go
│ │ ├── file.go
│ │ ├── file_test.go
│ │ ├── grpc_logger.go
│ │ ├── logger_native.go
│ │ ├── logger_native_android.go
│ │ ├── logger_native_darwin.go
│ │ ├── logger_native_other.go
│ │ ├── logutil.go
│ │ ├── logutil_test.go
│ │ ├── private_field.go
│ │ └── stream.go
│ ├── multipeer-connectivity-driver/
│ │ ├── bridge_darwin.go
│ │ ├── bridge_unsupported.go
│ │ ├── const.go
│ │ ├── driver/
│ │ │ ├── Logger.h
│ │ │ ├── Logger.m
│ │ │ ├── MCManager.h
│ │ │ ├── MCManager.m
│ │ │ ├── cgo_bridge.go
│ │ │ ├── mc-driver.h
│ │ │ └── mc-driver.m
│ │ ├── example_test.go
│ │ ├── init.go
│ │ └── multiaddr.go
│ ├── netmanager/
│ │ ├── connectivity.go
│ │ ├── netmanager.go
│ │ ├── netmanager_noop.go
│ │ └── netmanager_test.go
│ ├── outofstoremessage/
│ │ ├── outofstoremessage_test.go
│ │ └── service_outofstoremessage.go
│ ├── outofstoremessagetypes/
│ │ ├── outofstoremessage.pb.go
│ │ ├── outofstoremessage.pb.gw.go
│ │ └── outofstoremessage_grpc.pb.go
│ ├── protocoltypes/
│ │ ├── contact.go
│ │ ├── doc.go
│ │ ├── events_account.go
│ │ ├── example_test.go
│ │ ├── group.go
│ │ ├── protocoltypes.pb.go
│ │ ├── protocoltypes.pb.gw.go
│ │ └── protocoltypes_grpc.pb.go
│ ├── protoio/
│ │ ├── full.go
│ │ ├── io.go
│ │ ├── uint32.go
│ │ └── varint.go
│ ├── proximitytransport/
│ │ ├── addr.go
│ │ ├── conn.go
│ │ ├── example_test.go
│ │ ├── listener.go
│ │ ├── mplex.go
│ │ ├── proximitydriver.go
│ │ ├── ringBuffer_map.go
│ │ └── transport.go
│ ├── rendezvous/
│ │ ├── emitterio_sync_client.go
│ │ ├── emitterio_sync_provider.go
│ │ ├── emitterio_sync_test.go
│ │ ├── rendezvous.go
│ │ ├── rendezvous_test.go
│ │ └── rotation.go
│ ├── replicationtypes/
│ │ ├── bertyreplication.pb.go
│ │ ├── bertyreplication.pb.gw.go
│ │ ├── bertyreplication_grpc.pb.go
│ │ ├── consts.go
│ │ └── models.go
│ ├── secretstore/
│ │ ├── chain_key.go
│ │ ├── datastore_keys.go
│ │ ├── device_keystore_wrapper.go
│ │ ├── device_keystore_wrapper_test.go
│ │ ├── doc.go
│ │ ├── keys_utils.go
│ │ ├── member_device.go
│ │ ├── secret_store.go
│ │ ├── secret_store_interfaces.go
│ │ ├── secret_store_messages.go
│ │ ├── secret_store_messages_test.go
│ │ └── secret_store_test.go
│ ├── testutil/
│ │ ├── doc.go
│ │ ├── example_test.go
│ │ ├── filters.go
│ │ ├── logging.go
│ │ ├── require.go
│ │ ├── skip.go
│ │ ├── skip_norace.go
│ │ ├── skip_race.go
│ │ └── skip_test.go
│ ├── tinder/
│ │ ├── driver.go
│ │ ├── driver_discovery.go
│ │ ├── driver_localdiscovery.go
│ │ ├── driver_localdiscovery_test.go
│ │ ├── driver_mock.go
│ │ ├── driver_mock_test.go
│ │ ├── driver_rdvp.go
│ │ ├── driver_service_test.go
│ │ ├── filter.go
│ │ ├── notify_network.go
│ │ ├── options.go
│ │ ├── peer_cache.go
│ │ ├── peer_cache_test.go
│ │ ├── records.pb.go
│ │ ├── service.go
│ │ ├── service_adaptater.go
│ │ ├── service_advertises.go
│ │ ├── service_mocked_test.go
│ │ ├── service_subscription.go
│ │ └── testing_test.go
│ ├── tyber/
│ │ ├── context.go
│ │ ├── format.go
│ │ ├── ipfs.go
│ │ ├── log.go
│ │ ├── section.go
│ │ ├── step.go
│ │ └── subscribe.go
│ ├── username/
│ │ ├── android.go
│ │ ├── example_test.go
│ │ ├── ios.go
│ │ ├── others.go
│ │ └── username.go
│ └── verifiablecredstypes/
│ └── bertyverifiablecreds.pb.go
├── scenario_test.go
├── service.go
├── service_client.go
├── service_group.go
├── store_message.go
├── store_message_metrics.go
├── store_message_queue.go
├── store_message_test.go
├── store_metadata.go
├── store_metadata_index.go
├── store_metadata_test.go
├── store_options.go
├── store_utils.go
├── testing.go
├── testing_test.go
├── tinder_swiper.go
├── tinder_swiper_test.go
├── tool/
│ ├── bench-cellular/
│ │ ├── .gitignore
│ │ ├── Makefile
│ │ ├── bench.go
│ │ ├── client.go
│ │ ├── go.mod
│ │ ├── go.sum
│ │ └── server.go
│ └── docker-protoc/
│ ├── Dockerfile
│ └── Makefile
└── tyber.go
================================================
FILE CONTENTS
================================================
================================================
FILE: .codecov.yml
================================================
codecov:
notify:
require_ci_to_pass: yes
coverage:
precision: 2
round: down
range: "1...100"
status:
project: no
patch: no
changes: no
ignore:
- "**/*.gen.go"
- "**/generated.go"
- "**/*.pb.go"
- "**/*.pb.gw.go"
- "**/gen/**"
flags:
go.unittests:
carryforward: true
js.unittests:
carryforward: true
================================================
FILE: .dockerignore
================================================
*#
*~
.#*
.DS_Store
.agignore
.env
.projectile
Dockerfile
core-sources.jar
coverage.txt
dist/
gen.sum.tmp
gin-bin
google-services.json
js/
out/
profile.out
vendor/
tool/
================================================
FILE: .editorconfig
================================================
root = true
[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
indent_style = space
indent_size = 4
[Makefile]
indent_style = tab
[*.go]
indent_style = tab
[*.proto]
indent_size = 2
[*.swift]
indent_size = 4
[*.tmpl]
indent_size = 2
[*.{js,jsx,ts,tsx}]
indent_size = 2
indent_style = tab
block_comment_start = /*
block_comment_end = */
[*.hbs]
indent_size = 4
indent_style = tab
block_comment_start = {{!
block_comment_end = }}
[*.html]
indent_size = 2
[*.bat]
end_of_line = crlf
[*.{json,yml}]
indent_size = 2
indent_style = space
[.{babelrc,eslintrc}]
indent_size = 2
[{Fastfile,.buckconfig,BUCK}]
indent_size = 2
[*.diff]
indent_size = 1
[*.m]
indent_size = 1
indent_style = space
block_comment_start = /**
block_comment = *
block_comment_end = */
[*.java]
indent_size = 4
indent_style = space
block_comment_start = /**
block_comment = *
block_comment_end = */
[js/packages/i18n/locale/**/*.{json,yml}]
indent_size = 2
indent_style = tab
================================================
FILE: .gitattributes
================================================
# Auto detect text files and perform LF normalization
* text=auto
# Collapse vendored files on GitHub
vendor/* linguist-vendored
*/vendor/* linguist-vendored
client/common/openssl/built/* linguist-vendored
# Collapse generated files on GitHub
gen.sum linguist-generated merge=ours -diff
*.gen.go linguist-generated merge=ours -diff
*.gen.graphql linguist-generated merge=ours -diff
*.gen.js linguist-generated merge=ours -diff
*.gen.json linguist-generated merge=ours -diff
*.gen.ts linguist-generated merge=ours -diff
*.gen.tsx linguist-generated merge=ours -diff
*.gen.yml linguist-generated merge=ours -diff
*.pb.d.ts linguist-generated merge=ours -diff
*.pb.go linguist-generated merge=ours -diff
*.pb.gw.go linguist-generated merge=ours -diff
*.pb.js linguist-generated merge=ours -diff
*pb_test.go linguist-generated merge=ours -diff
docs/apis/*types.md linguist-generated merge=ours -diff
*.swagger.json linguist-generated merge=ours -diff
api/*.yaml linguist-generated merge=ours -diff
/js/packages/store/protocol/grpc-web-gen/** linguist-generated merge=ours -diff
go.sum linguist-generated text
yarn.lock linguist-generated text -diff
Podfile.lock linguist-generated text -diff
package.json linguist-generated
go.mod text
# Collapse snapshot files on GitHub
*.snap linguist-generated
# Reduce conflicts on markdown files
*.md merge=union
# specific for windows script files
*.bat text eol=crlf
================================================
FILE: .github/ISSUE_TEMPLATE/bug_template.yml
================================================
# yamllint disable-line rule:document-start
name: "Bug report"
description: Report a bug found while using weshnet.
labels: ["bug"]
body:
- type: checkboxes
attributes:
label: Is there an existing issue for this?
description: >-
Please search to see if an issue already exists for the bug you
encountered.
options:
- label: I have searched the existing issues
required: true
- type: input
id: package-version
attributes:
label: Package version
description: What version of weshnet are you using?
placeholder: v1.0.3
validations:
required: true
- type: dropdown
id: os
attributes:
label: OS
description: What OS are you seeing the problem on?
options:
- iOS
- Android
- Linux
- macOS
- Windows
- Other
- type: input
id: language-version
attributes:
label: Language version and compiler version
description: What programming language version and compiler are you using?
placeholder: >-
go1.18.4, javac 11.0.12
validations:
required: true
- type: textarea
id: bug-description
attributes:
label: Bug description
description: Provide a bug description and a code snippet if applicable.
placeholder: |
1. Set up this environment ...
2. Add this code ...
3. Call this function ...
validations:
required: true
- type: textarea
id: current-behavior
attributes:
label: Current behavior
description: >-
Output after code execution including stack traces, debug logs, etc.
placeholder: Currently ...
validations:
required: true
- type: textarea
id: expected-behavior
attributes:
label: Expected behavior
description: Please provide what would be your expectation to happen.
placeholder: In this situation, weshnet should ...
validations:
required: true
- type: textarea
id: environment
attributes:
label: Environment
description: What is your development environment?
placeholder: macOS 13.1
validations:
required: true
- type: textarea
id: other
attributes:
label: Other
placeholder: Any other details?
================================================
FILE: .github/ISSUE_TEMPLATE/feature_template.yml
================================================
# yamllint disable-line rule:document-start
name: "Feature request"
description: Suggest an idea for this project.
labels: [":rocket: feature-request"]
body:
- type: checkboxes
attributes:
label: Is there an existing issue for this?
description: >-
Please search to see if an issue already exists for this feature
request.
options:
- label: I have searched the existing issues
required: true
- type: textarea
id: feature
attributes:
label: Feature request
description: >-
Provide a detailed description of the change or addition you are
proposing.
placeholder: There should be ...
validations:
required: true
- type: textarea
id: context
attributes:
label: Context
description: >-
Why is this change important to you? How would you use it? How can it
benefit other users?
placeholder: This feature request is important because ...
validations:
required: true
- type: textarea
id: implementation
attributes:
label: Possible implementation
description: >-
Not obligatory, but suggest an idea for implementing addition or change.
placeholder: This feature could be implemented by ...
================================================
FILE: .github/ISSUE_TEMPLATE/question_template.yml
================================================
# yamllint disable-line rule:document-start
name: "Question"
description: Ask a question about this project.
labels: ["question"]
body:
- type: checkboxes
attributes:
label: Asking a question, not reporting a bug
description: >-
If your question is "Why did I get this error?" and you think it is a
bug, then please open a Bug Report at
https://github.com/berty/weshnet/issues/new/
options:
- label: This question is not about a bug
required: true
- type: checkboxes
attributes:
label: Is there an existing issue for this?
description: >-
Please search to see if an issue already exists for your question.
options:
- label: I have searched the existing issues
required: true
- type: textarea
id: question
attributes:
label: Question
description: >-
Provide your question with enough detail that it is helpful to anyone
reading the question (maybe years later).
placeholder: How do I ...
validations:
required: true
- type: textarea
id: context
attributes:
label: Context
description: >-
Is it a general question about the design and goals of weshnet, or
about how to use it in an app (or some other context)?
placeholder: This is a question about ...
validations:
required: true
================================================
FILE: .github/dependabot.yml
================================================
version: 2
# @NOTE(gfanton): we use 0 as pull-request-limit to only enable security update.
# see: https://docs.github.com/en/code-security/dependabot/dependabot-security-updates/configuring-dependabot-security-updates#overriding-the-default-behavior-with-a-configuration-file
updates:
- package-ecosystem: docker
directory: "/tool/docker-protoc"
schedule:
interval: daily
# Disable version updates for docker dependencies (enable only security update)
open-pull-requests-limit: 0
labels:
- "security"
- "t/docker"
- "dependencies"
- package-ecosystem: github-actions
directory: "/"
schedule:
interval: daily
# Disable version updates for github dependencies (enable only security update)
open-pull-requests-limit: 0
labels:
- "security"
- "t/github-actions"
- "dependencies"
- package-ecosystem: gomod
directory: "/"
schedule:
interval: daily
# Disable version updates for gomod dependencies (enable only security update)
open-pull-requests-limit: 0
labels:
- "security"
- "t/golang"
- "dependencies"
================================================
FILE: .github/pull_request_template.md
================================================
<!-- Thank you for your contribution! ❤️ -->
================================================
FILE: .github/weekly-digest.yml
================================================
# Configuration for weekly-digest - https://github.com/apps/weekly-digest
publishDay: thu
canPublishIssues: true
canPublishPullRequests: true
canPublishContributors: true
canPublishStargazers: true
canPublishCommits: true
================================================
FILE: .github/workflows/benchmark.yml
================================================
name: Go benchmark
on:
push:
tags:
- v*
branches:
- main
paths:
- "**"
- "!**.md"
- "go.*"
- "**.go"
- ".github/workflows/benchmark.yml"
pull_request:
paths:
- "**"
- "!**.md"
- "go.*"
- "**.go"
- ".github/workflows/benchmark.yml"
jobs:
benchmark:
if: github.event_name == 'DISABLED'
name: Run benchmarks
runs-on: ubuntu-latest
steps:
- name: Setup asdf
uses: asdf-vm/actions/setup@9cd779f40fe38688dd19505ccbc4eaaf018b44e7
with:
asdf_version: 0.16.7
- name: Setup Graphviz
uses: ts-graphviz/setup-graphviz@v1
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 50 # this is to make sure we obtain the target base commit#
- name: Setup go
run: |
asdf plugin add golang
asdf install golang
echo "go_version=$(asdf current golang | xargs | cut -d ' ' -f 2)" >> $GITHUB_ENV
go install golang.org/x/perf/cmd/benchstat@latest
asdf reshim golang
- name: Cache go modules
uses: actions/cache@v4
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ env.go_version }}-${{ env.json_cache-versions_go }}-${{ hashFiles('**/go.sum') }}
restore-keys: ${{ runner.os }}-go-${{ env.go_version }}-${{ env.json_cache-versions_go }}-
- name: Run benchmark
run: make go.unittest | tee output_head.txt
working-directory: .
env:
TEST_SPEED: any
GO_TEST_PATH: ./internal/benchmark
GO_TEST_OPTS: -bench=. -test.benchmem -cpuprofile cpu_head.prof -memprofile mem_head.prof -test.timeout=1200s -count=5
- name: Checkout base commit
run: git checkout ${{ github.event.pull_request.base.sha }}
if: github.event_name == 'pull_request'
- name: Cache go modules (main)
uses: actions/cache@v4
if: github.event_name == 'pull_request'
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ env.go_version }}-${{ env.json_cache-versions_go }}-${{ hashFiles('**/go.sum') }}
restore-keys: ${{ runner.os }}-go-${{ env.go_version }}-${{ env.json_cache-versions_go }}-
- name: Run benchmark (main)
run: make go.unittest | tee output_base.txt
if: github.event_name == 'pull_request'
working-directory: .
env:
TEST_SPEED: any
GO_TEST_PATH: ./internal/benchmark
GO_TEST_OPTS: -bench=. -test.benchmem -cpuprofile cpu_base.prof -memprofile mem_base.prof -test.timeout=1200s -count=5
- name: Benchstat
id: benchstat-main
if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request'
run: |
echo 'Benchmark report' >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
benchstat output_head.txt >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
working-directory: .
- name: Benchstat PR
id: benchstat-pr
if: github.event_name == 'pull_request'
run: |
echo 'Benchmark report' >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
benchstat output_head.txt output_base.txt >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
working-directory: .
- name: Generate pprof html files
id: pprof-html-files-no-relative
working-directory: .
run: |
mkdir -p pprof_html/head/{cpu,mem}/{top,flamegraph,peek,source}
go tool pprof -http 0.0.0.0:9402 -no_browser ./cpu_head.prof < /dev/null & # https://github.com/google/pprof/issues/401#issuecomment-739576424
sleep 2
curl http://localhost:9402/ui/ > pprof_html/head/cpu/index.html
curl http://localhost:9402/ui/top > pprof_html/head/cpu/top/index.html
curl http://localhost:9402/ui/flamegraph > pprof_html/head/cpu/flamegraph/index.html
curl http://localhost:9402/ui/peek > pprof_html/head/cpu/peek/index.html
curl http://localhost:9402/ui/source > pprof_html/head/cpu/source/index.html
pkill pprof
sleep 2
go tool pprof -http 0.0.0.0:9402 -no_browser ./mem_head.prof < /dev/null &
sleep 2
curl http://localhost:9402/ui/ > pprof_html/head/mem/index.html
curl http://localhost:9402/ui/top > pprof_html/head/mem/top/index.html
curl http://localhost:9402/ui/flamegraph > pprof_html/head/mem/flamegraph/index.html
curl http://localhost:9402/ui/peek > pprof_html/head/mem/peek/index.html
curl http://localhost:9402/ui/source > pprof_html/head/mem/source/index.html
pkill pprof
sleep 2
cat << EOF > pprof_html/index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>pprof output</title>
</head>
<body>
<h2>CPU output</h2>
<ul>
<li><a href="./head/cpu/">Graph</a></li>
<li><a href="./head/cpu/top/">Top</a></li>
<li><a href="./head/cpu/flamegraph/">Flamegraph</a></li>
<li><a href="./head/cpu/peek/">Peek</a></li>
<li><a href="./head/cpu/source/">Source</a></li>
</ul>
<h2>Memory output</h2>
<ul>
<li><a href="./head/mem/">Graph</a></li>
<li><a href="./head/mem/top/">Top</a></li>
<li><a href="./head/mem/flamegraph/">Flamegraph</a></li>
<li><a href="./head/mem/peek/">Peek</a></li>
<li><a href="./head/mem/source/">Source</a></li>
</ul>
EOF
- name: Generate pprof html files (PR)
if: github.event_name == 'pull_request'
id: pprof-html-files-pr
working-directory: .
run: |
mkdir -p pprof_html/base_comp/{cpu,mem}
go tool pprof -http 0.0.0.0:9402 --diff_base=./cpu_base.prof -no_browser ./cpu_head.prof < /dev/null &
sleep 2
curl http://localhost:9402/ui/ > pprof_html/base_comp/cpu/index.html
pkill pprof
sleep 2
go tool pprof -http 0.0.0.0:9402 --diff_base=./mem_base.prof -no_browser ./mem_head.prof < /dev/null &
sleep 2
curl http://localhost:9402/ui/ > pprof_html/base_comp/mem/index.html
pkill pprof
sleep 2
cat << EOF >> pprof_html/index.html
<h2>CPU diff against ${{ github.event.pull_request.base.sha }}</h2>
<ul>
<li><a href="./base_comp/cpu/">Graph</a></li>
</ul>
<h2>Memory diff against ${{ github.event.pull_request.base.sha }}</h2>
<ul>
<li><a href="./base_comp/mem/">Graph</a></li>
</ul>
EOF
- name: Generate pprof html files (footer)
id: pprof-html-files-footer
working-directory: .
run: |
cat << EOF >> pprof_html/index.html
</body>
</html>
EOF
# upload arifacts
#
- name: upload artifact (main)
uses: actions/upload-artifact@v3
if: github.ref == 'refs/heads/main'
with:
name: "bench-main"
path: go/pprof_html
- name: upload artifact (PR)
uses: actions/upload-artifact@v3
if: github.event_name == 'pull_request'
with:
name: "bench-${{ github.event.pull_request.number }}"
path: go/pprof_html
================================================
FILE: .github/workflows/buf-push.yml
================================================
name: buf-push
on:
push:
branches:
- main
# from https://docs.buf.build/ci-cd/github-actions#buf-push
jobs:
buf-release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: bufbuild/buf-setup-action@v1
# @TODO(gfanton): enable this ?
# - uses: bufbuild/buf-lint-action@v1
# - uses: bufbuild/buf-breaking-action@v1
# with:
# # The 'main' branch of the GitHub repository that defines the module.
# against: "https://github.com/${GITHUB_REPOSITORY}.git#branch=main,ref=HEAD~1"
- uses: bufbuild/buf-push-action@v1
with:
input: "api/protocol"
buf_token: ${{ secrets.BUF_TOKEN }}
================================================
FILE: .github/workflows/cancel.yml
================================================
name: Cancel
on:
workflow_run:
workflows: [
"CodeQL",
"Dependent Issues",
"Go",
"Integration",
"macOS Release",
"Protobuf",
]
types:
- requested
jobs:
cancel_pr_prev_push:
name: Cancel previous runs on PR update
if: ${{ github.event_name == 'workflow_run' }}
runs-on: ubuntu-latest
steps:
- uses: styfle/cancel-workflow-action@0.11.0
with:
workflow_id: ${{ github.event.workflow.id }}
================================================
FILE: .github/workflows/codeql-analysis.yml
================================================
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"
on:
push:
branches: [ main ]
paths:
- '**'
- '!**.md'
- 'go.*'
- '**.go'
- '.github/workflows/codeql-analysis.yml'
pull_request:
# The branches below must be a subset of the branches above
branches: [ main ]
paths:
- '**'
- '!**.md'
- 'go.*'
- '**.go'
- '.github/workflows/codeql-analysis.yml'
schedule:
- cron: '28 12 * * 4'
jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
language: [ 'go' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
# Learn more:
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed
steps:
- name: Checkout repository
uses: actions/checkout@v3
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v2
# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language
#- run: |
# make bootstrap
# make release
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
================================================
FILE: .github/workflows/dependent-issues.yml
================================================
name: Dependent Issues
on:
issues:
types:
- opened
- edited
- reopened
pull_request_target:
types:
- opened
- edited
- reopened
- synchronize
schedule:
- cron: "42 2 * * *" # schedule daily check
jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: z0al/dependent-issues@v1.5.1
env:
# (Required) The token to use to make API calls to GitHub.
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
# (Optional) The label to use to mark dependent issues
label: dependent
# (Optional) Enable checking for dependencies in issues. Enable by
# setting the value to "on". Default "off"
check_issues: off
# (Optional) A comma-separated list of keywords. Default
# "depends on, blocked by"
keywords: depends on, blocked by
================================================
FILE: .github/workflows/go.yml
================================================
name: Go
on:
push:
tags:
- v*
branches:
- main
paths:
- "**"
- "!**.md"
- "go.*"
- "**.go"
- ".github/workflows/go.yml"
pull_request:
paths:
- "**"
- "!**.md"
- "go.*"
- "**.go"
- ".github/workflows/go.yml"
jobs:
golangci-lint:
name: Golangci-lint
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup asdf
uses: asdf-vm/actions/setup@9cd779f40fe38688dd19505ccbc4eaaf018b44e7
with:
asdf_version: 0.16.7
- name: Setup golang
run: |
asdf plugin add golang
asdf install golang
- name: Setup golangci-lint
run: |
asdf plugin add golangci-lint
asdf install golangci-lint
- name: Run golangci-lint
run: make lint
# this is not very common to have a job that checks the flappy tests.
#
# reason: some tests are flappy, they works, but not always;
# this job checks that they are working sometimes.
# if this job fails, then a test is "broken", not "flappy".
#
# summary: this job checks that "flappy tests" do not become "broken tests".
#
# we hope we can remove this job because all the tests are stable 100% of the time
flappy-tests:
name: Flappy tests (Linux)
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Load variables from file
uses: antifree/json-to-variables@v1.0.1
with:
filename: .github/workflows/utils/variables.json
- name: Setup asdf
uses: asdf-vm/actions/setup@9cd779f40fe38688dd19505ccbc4eaaf018b44e7
with:
asdf_version: 0.16.7
- name: Setup go
run: |
asdf plugin add golang
asdf install golang
echo "go_version=$(asdf current golang | xargs | cut -d ' ' -f 2)" >> $GITHUB_ENV
- name: Cache go modules
uses: actions/cache@v4
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ env.go_version }}-${{ env.json_cache-versions_go }}-${{ hashFiles('**/go.sum') }}
restore-keys: ${{ runner.os }}-go-${{ env.go_version }}-${{ env.json_cache-versions_go }}-
- name: Avoid triggering make generate
run: touch gen.sum
- name: Fetch go modules
run: go mod download
- name: Compile the testing binaries
run: |
pushd . && go test -c -o ./tests.bin . && popd
- name: Check go.mod and go.sum
run: |
go mod tidy -v
git --no-pager diff go.mod go.sum
git --no-pager diff --quiet go.mod go.sum
- name: Run fast flappy tests
env:
TEST_SPEED: fast
TEST_STABILITY: flappy
run: make go.flappy-tests
go-tests-on-linux:
name: Stable tests (Linux)
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Load variables from file
uses: antifree/json-to-variables@v1.0.1
with:
filename: .github/workflows/utils/variables.json
- name: Setup asdf
uses: asdf-vm/actions/setup@9cd779f40fe38688dd19505ccbc4eaaf018b44e7
with:
asdf_version: 0.16.7
- name: Setup go
run: |
asdf plugin add golang
asdf install golang
echo "go_version=$(asdf current golang | xargs | cut -d ' ' -f 2)" >> $GITHUB_ENV
- name: Cache go modules
uses: actions/cache@v4
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ env.go_version }}-${{ env.json_cache-versions_go }}-${{ hashFiles('**/go.sum') }}
restore-keys: ${{ runner.os }}-go-${{ env.go_version }}-${{ env.json_cache-versions_go }}-
- name: Check go.mod and go.sum
run: |
go mod tidy -v
git --no-pager diff go.mod go.sum
git --no-pager diff --quiet go.mod go.sum
- name: Run fast tests multiple times
env:
TEST_SPEED: fast
GO_TEST_OPTS: -test.timeout=600s -count 1
run: set -o pipefail; make go.unittest | tee test_log.txt
- name: Run all tests
env:
TEST_SPEED: any
GO_TEST_OPTS: -test.timeout=600s -count 1
run: make go.unittest
- name: Run all tests with race flag and generate coverage
env:
TEST_SPEED: any
GO_TEST_OPTS: -test.timeout=1200s -count=1 -race -cover -coverprofile=coverage.txt -covermode=atomic
run: make go.unittest
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3.1.1
env:
OS: ${{ runner.os }}
GOLANG: ${{ env.go_version }}
with:
file: ./go/coverage.txt
flags: go.unittests
env_vars: OS,GOLANG
name: codecov-umbrella
fail_ci_if_error: false
go-tests-on-windows:
name: Stable tests (Windows)
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Load variables from file
uses: antifree/json-to-variables@v1.0.1
with:
filename: .github/workflows/utils/variables.json
- name: Get go version
shell: bash
run: echo "go_version=$(cat .tool-versions | grep '^golang [0-9]\+\.[0-9]\+\.[0-9]\+.*$' | cut -d ' ' -f 2)" >> $GITHUB_ENV
- name: Setup go
uses: actions/setup-go@v3
with:
go-version: ${{ env.go_version }}
- name: Cache go modules
uses: actions/cache@v4
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ env.go_version }}-${{ env.json_cache-versions_go }}-${{ hashFiles('**/go.sum') }}
restore-keys: ${{ runner.os }}-go-${{ env.go_version }}-${{ env.json_cache-versions_go }}-
- name: Check go.mod and go.sum
run: |
go mod tidy -v
git --no-pager diff go.mod go.sum
git --no-pager diff --quiet go.mod go.sum
- name: Run fast tests multiple times
env:
TEST_SPEED: fast
run: go.exe test ./... -buildmode=exe -timeout=600s -count=5
- name: Run all tests
env:
TEST_SPEED: any
run: go.exe test ./... -buildmode=exe -timeout=600s -count=1
go-tests-on-macos:
name: Stable tests (macOS)
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Load variables from file
uses: antifree/json-to-variables@v1.0.1
with:
filename: .github/workflows/utils/variables.json
- name: Setup asdf
uses: asdf-vm/actions/setup@9cd779f40fe38688dd19505ccbc4eaaf018b44e7
with:
asdf_version: 0.16.7
- name: Setup go
run: |
asdf plugin add golang
asdf install golang
echo "go_version=$(asdf current golang | xargs | cut -d ' ' -f 2)" >> $GITHUB_ENV
- name: Cache go modules
uses: actions/cache@v4
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ env.go_version }}-${{ env.json_cache-versions_go }}-${{ hashFiles('**/go.sum') }}
restore-keys: ${{ runner.os }}-go-${{ env.go_version }}-${{ env.json_cache-versions_go }}-
- name: Check go.mod and go.sum
run: |
go mod tidy -v
git --no-pager diff go.mod go.sum
git --no-pager diff --quiet go.mod go.sum
- name: Run fast tests multiple times
env:
TEST_SPEED: fast
GO_TEST_OPTS: -test.timeout=600s -count 1
run: set -o pipefail; make go.unittest | tee test_log.txt
- name: Run all tests
env:
TEST_SPEED: any
GO_TEST_OPTS: -test.timeout=600s -count 1
run: make go.unittest
- name: Run all tests with race flag and generate coverage
env:
TEST_SPEED: any
GO_TEST_OPTS: -test.timeout=1200s -count=1 -race -cover -coverprofile=coverage.txt -covermode=atomic
run: make go.unittest
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3.1.1
env:
OS: ${{ runner.os }}
GOLANG: ${{ env.go_version }}
with:
file: ./go/coverage.txt
flags: go.unittests
env_vars: OS,GOLANG
name: codecov-umbrella
fail_ci_if_error: false
# TODO: consider adding various GOARCH check per OS.
# i.e., to validate that we build on 32/64bit.
================================================
FILE: .github/workflows/protobuf.yml
================================================
name: Protobuf
on:
push:
tags:
- v*
branches:
- main
paths:
- "api/**"
- "Makefile"
- "docs/Makefile"
- ".github/workflows/protobuf.yml"
- "**/gen.sum"
- "**.pb.go"
- "**.gen.go"
- "**.gen.graphql"
- "**.gen.yml"
- "**.pb.go"
- "**/pb_test.go"
- "**/docs/*/api.md"
- "**/go.mod"
- "**/go.sum"
pull_request:
paths:
- "api/**"
- "Makefile"
- "docs/Makefile"
- ".github/workflows/protobuf.yml"
- "**/gen.sum"
- "**.pb.go"
- "**.gen.go"
- "**.gen.graphql"
- "**.gen.yml"
- "**.pb.go"
- "**/pb_test.go"
- "**/docs/*/api.md"
- "**/go.mod"
- "**/go.sum"
jobs:
gen-go-and-docs:
if: github.event_name == 'DISABLED' # need to fix it by removing docker for generation
name: Generate go protobuf and docs
runs-on: ubuntu-latest
container: bertytech/buf:1
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Unshallow
run: git fetch --prune --unshallow
- name: Remove lock files
run: find . -name gen.sum -delete
- name: Load variables from file
uses: antifree/json-to-variables@v1.0.1
with:
filename: .github/workflows/utils/variables.json
- name: Setup asdf
uses: asdf-vm/actions/setup@9cd779f40fe38688dd19505ccbc4eaaf018b44e7
with:
asdf_version: 0.16.7
- name: Setup go
run: |
asdf plugin add golang
asdf install golang
echo "go_version=$(asdf current golang | xargs | cut -d ' ' -f 2)" >> $GITHUB_ENV
- name: Setup jq
run: |
asdf plugin add jq
asdf install jq
- name: Cache go modules
uses: actions/cache@v4
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ env.go_version }}-${{ env.json_cache-versions_go }}-${{ hashFiles('**/go.sum') }}
restore-keys: ${{ runner.os }}-go-${{ env.go_version }}-${{ env.json_cache-versions_go }}-
- name: Fetch go modules
run: go mod download
- name: Generate docs
working-directory: docs
run: make generate_local
- name: Generate go protobuf
run: |
make generate_local
git checkout go.mod go.sum
- name: Check diff
run: |
git status | cat
git diff -w | cat
git diff-index -w --quiet HEAD --
- name: Prepare openapi documentation
working-directory: docs
run: make openapi.prepare
- name: Setup apiary
run: apk --no-cache add ruby-dev g++ && gem install apiaryio
- name: Upload API docs to apiary.io
env:
APIARY_API_KEY: "${{ secrets.APIARY_API_KEY }}"
if: ${{ env.APIARY_API_KEY != 0 }}
run: |
apiary publish --api-name=bertyprotocol --path="docs/.tmp/openapi/bertyprotocol.swagger.json" || true
================================================
FILE: .github/workflows/release.yml
================================================
name: Release
on:
push:
branches:
- main
pull_request:
paths:
# Go
- "**"
- "!**.md"
- ".goreleaser"
- "go.*"
- "**.go"
# CI
- ".github/workflows/release.yml"
jobs:
semantic-release:
name: Semantic release
runs-on: ubuntu-latest
outputs:
new-release-published: ${{ steps.semantic-echo.outputs.new-release-published }}
release-version: ${{ steps.semantic-echo.outputs.release-version }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Unshallow
run: git fetch --prune --unshallow
- name: Run Semantic Release
id: semantic
uses: docker://ghcr.io/codfish/semantic-release-action:v1
with:
branches: |
['main']
plugins: |
[
'@semantic-release/commit-analyzer',
'@semantic-release/release-notes-generator',
'@semantic-release/github'
]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Export Semantic Release
id: semantic-echo
run: |
echo "::set-output name=new-release-published::${{steps.semantic.outputs.new-release-published}}"
echo "::set-output name=release-version::${{steps.semantic.outputs.release-version}}"
post-semantic-release:
needs: semantic-release
#if: needs.semantic-release.outputs.new-release-published == 'true'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Unshallow
run: git fetch --prune --unshallow
- name: Setup asdf
uses: asdf-vm/actions/setup@9cd779f40fe38688dd19505ccbc4eaaf018b44e7
with:
asdf_version: 0.16.7
- name: Setup go
run: |
asdf plugin add golang
asdf install golang
- name: Register version on pkg.go.dev
if: needs.semantic-release.outputs.new-release-published == 'true'
run: |
package=$(cat go.mod | grep ^module | awk '{print $2}')
version=v${{ needs.semantic-release.outputs.release-version }}
url=https://proxy.golang.org/${package}/@v/${version}.info
set -x +e
curl -i $url
================================================
FILE: .github/workflows/ssh-runner.yml
================================================
name: SSH on runner
on:
workflow_dispatch:
inputs:
os:
description: "Operating System"
required: true
default: ubuntu-latest
type: choice
options:
- ubuntu-latest
- macos-latest
- windows-latest
mod:
description: "Install Go/Node modules"
required: true
default: true
type: boolean
jobs:
setup-ssh:
name: Setup runner and open SSH endpoint
runs-on: ${{ github.event.inputs.os }}
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
persist-credentials: false
- name: Load variables from file
uses: antifree/json-to-variables@v1.0.1
with:
filename: .github/workflows/utils/variables.json
- name: Setup asdf
uses: asdf-vm/actions/setup@9cd779f40fe38688dd19505ccbc4eaaf018b44e7
with:
asdf_version: 0.16.7
- name: Setup go
if: runner.os != 'Windows'
run: |
asdf plugin add golang
asdf install golang
echo "go_version=$(asdf current golang | xargs | cut -d ' ' -f 2)" >> $GITHUB_ENV
- name: Cache go modules
if: github.event.inputs.mod == 'true' && runner.os != 'Windows'
uses: actions/cache@v4
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ env.go_version }}-${{ env.json_cache-versions_go }}-${{ hashFiles('**/go.sum') }}
restore-keys: ${{ runner.os }}-go-${{ env.go_version }}-${{ env.json_cache-versions_go }}-
- name: Fetch go modules
if: github.event.inputs.mod == 'true' && runner.os != 'Windows'
working-directory: .
run: go mod tidy
- name: Install emacs
shell: bash
run: |
if [ "$RUNNER_OS" == "Linux" ]; then
sudo apt-get install -y emacs
elif [ "$RUNNER_OS" == "Windows" ]; then
choco install emacs
else
echo "Already installed!"
fi
- name: Setup tmate session
uses: mxschmitt/action-tmate@v3
with:
limit-access-to-actor: true
================================================
FILE: .github/workflows/utils/variables.json
================================================
{
"cache-versions": {
"go": "1"
}
}
================================================
FILE: .gitignore
================================================
*#
*~
.#*
.DS_Store
.agignore
.env
.projectile
.tmp/
.idea/
*.bin
*.swp
.vscode
core-sources.jar
coverage.txt
dist/
gen.sum.tmp
gin-bin
out/
profile.out
vendor/
debug.log
benchmark_result.json
# Delve's binaries
*__debug_bin
# Dev dbs
/*gui.d
================================================
FILE: .golangci.yml
================================================
run:
deadline: 1m
tests: false
issues:
exclude-files:
- ".*\\.pb\\.go$"
- ".*\\.pb\\.gw\\.go$"
- ".*\\.gen\\.go$"
- "_test\\.go$"
- "testing.go$"
- ".*doc\\.go$"
linters-settings:
golint:
min-confidence: 0
maligned:
suggest-new: true
misspell:
locale: US
gci:
sections:
- standard
- default
- prefix(berty.tech)
# - prefix(github.com/libp2p)
# - prefix(github.com/ipfs)
linters:
disable-all: true
enable:
- asciicheck
- bodyclose
#- depguard
- dogsled
- errcheck
#- exhaustive # nice to have
- exportloopref
- gci
- gochecknoinits
#- gocognit # nice to have
#- goconst
- gocritic
#- godot # nice to have
#- goerr113 # nice to have
- gofmt
- gofumpt
- goimports
- revive
#- gomnd # nice to have
- gomodguard
- gosec
- gosimple
- govet
- ineffassign
- misspell
- nakedret
- noctx
#- nolintlint
- exportloopref
- staticcheck
- typecheck
- unconvert
- unparam
- unused
- whitespace
================================================
FILE: .tool-versions
================================================
# To see the date when a version was updated, use git blame:
# https://github.com/berty/weshnet/blame/main/.tool-versions
#-----
# This is simply the most recent version available to date of the lowest
# major version of Go which is allowed by kubo.
# There is no contraindication for updating it.
#-----
golang 1.22.5
#-----
# This is simply the most recent golangci-lint version available to date.
#-----
golangci-lint 1.59.1
#-----
# This is simply the most recent jq version available to date.
# There is no contraindication for updating it.
#-----
jq 1.6
#-----
# This is simply the most recent buf version available to date.
# There is no contraindication for updating it.
#-----
buf 1.39.0
================================================
FILE: COPYRIGHT
================================================
Copyright 2018-2023 Berty Technologies and other Berty Developers.
Intellectual Property Notice
----------------------------
Berty is licensed under the Apache License, Version 2.0
(see LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0) or
the MIT license (see LICENSE-MIT or http://opensource.org/licenses/MIT),
at your option.
Copyrights and patents in the Berty project are retained
by contributors.
No copyright assignment is required to contribute to Berty
SPDX-License-Identifier: (Apache-2.0 OR MIT)
SPDX usage
----------
Individual files may contain SPDX tags instead of the full license text.
This enables machine processing of license information based on the SPDX
License Identifiers that are available here: https://spdx.org/licenses/
================================================
FILE: INSTALL.md
================================================
# Build weshnet
These are instructions to build weshnet.
<!-- markdownlint-disable MD034 -->
## Prerequisites
* Required: asdf
* Required on macOS: Command Line Developer Tools
Following are the steps to install each prerequisite (if it's needed for your
build target).
### macOS 14, macOS 15 and macOS 26
To install the Command Line Developer Tools, in a terminal enter:
xcode-select --install
To install asdf using brew, follow instructions at https://asdf-vm.com . In short,
first install brew following the instructions at https://brew.sh . Then, in
a terminal enter:
brew install asdf gpg
If your terminal is zsh, enter:
echo -e "\n. $(brew --prefix asdf)/libexec/asdf.sh" >> ${ZDOTDIR:-~}/.zshrc
If your terminal is bash, enter:
echo -e "\n. \"$(brew --prefix asdf)/libexec/asdf.sh\"" >> ~/.bash_profile
Start a new terminal to get the changes to .zshrc .
### Ubuntu 18.04, 20.04, 22.04 and 24.04
To install asdf, follow instructions at https://asdf-vm.com . In short, in
a terminal enter:
sudo apt install curl git build-essential
git clone https://github.com/asdf-vm/asdf.git ~/.asdf
echo '. "$HOME/.asdf/asdf.sh"' >> ~/.bashrc
Start a new terminal to get the changes to .bashrc .
## Build
In a terminal, enter:
git clone https://github.com/berty/weshnet
cd weshnet
First time only (or after updating .tool-versions), enter:
make asdf.install_tools
To run the tests, enter:
make test
Or you can make other targets. See:
make help
================================================
FILE: LICENSE-APACHE
================================================
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright 2018-2021 Berty Technologies
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
================================================
FILE: LICENSE-MIT
================================================
Copyright (c) 2018-2021 Berty Technologies
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
================================================
FILE: Makefile
================================================
##
## Config
##
GO ?= go
GOPATH ?= $(HOME)/go
GO_TAGS ?= -tags ""
GO_TEST_OPTS ?= -test.timeout=300s -race -cover -coverprofile=coverage.txt -covermode=atomic $(GO_TAGS)
GO_TEST_PATH ?= ./...
GO_TEST_ENV ?=
CI ?= false
BUILD_DATE ?= `date +%s`
VCS_REF ?= `git rev-parse --short HEAD`
VERSION ?= `go run github.com/mdomke/git-semver/v5`
LDFLAGS ?= -ldflags="-X berty.tech/weshnet/internal/bertyversion.VcsRef=$(VCS_REF) -X berty.tech/weshnet/internal/bertyversion.Version=$(VERSION)"
# @FIXME(gfanton): on macOS Monterey (12.0.x) we currently need to set the
# environment variable `MallocNanoZone` to 0 to avoid a SIGABRT or SIGSEGV
# see https://github.com/golang/go/issues/49138
MACOS_VERSION=$(shell defaults read /System/Library/CoreServices/SystemVersion.plist 'ProductVersion' 2>/dev/null | sed 's/\.[0-9]$$//')
ifeq ($(MACOS_VERSION),12.0)
GO_TEST_ENV := MallocNanoZone=0 $(GO_TEST_ENV)
endif
ifeq ($(MACOS_VERSION),12.1)
GO_TEST_ENV := MallocNanoZone=0 $(GO_TEST_ENV)
endif
##
## General rules
##
all: help
.PHONY: all
help:
@echo "Available make commands:"
@cat Makefile | grep '^[a-z]' | grep -v '=' | cut -d: -f1 | sort | sed 's/^/ /'
.PHONY: help
test: unittest lint tidy
.PHONY: test
unittest: go.unittest
.PHONY: unittest
generate: pb.generate docs.generate
.PHONY: generate
regenerate: gen.clean docs.clean generate docs.generate
.PHONY: regenerate
clean: gen.clean docs.clean
rm -rf out/
.PHONY: clean
re: clean generate
.PHONY: re
tidy: go.tidy
.PHONY: tidy
lint: go.lint
.PHONY: lint
lint.fix: go.fmt
.PHONY: lint.fix
##
## Other rules
##
check-program = $(foreach exec,$(1),$(if $(shell PATH="$(PATH)" which $(exec)),,$(error "No $(exec) in PATH")))
go.tidy: pb.generate
$(call check-program, $(GO))
GO111MODULE=on $(GO) mod tidy
.PHONY: go.tidy
go.lint: pb.generate
$(call check-program, golangci-lint)
golangci-lint run --timeout=5m $(if $(filter $(CI), false), --verbose) ./...
.PHONY: go.lint
go.unittest: pb.generate
$(call check-program, $(GO))
$(GO_TEST_ENV) GO111MODULE=on $(GO) test $(GO_TEST_OPTS) $(GO_TEST_PATH)
.PHONY: go.unittest
go.flappy-tests: pb.generate
TEST_STABILITY=flappy go run moul.io/testman test -v -test.v -timeout=600s -retry=10 -run ^TestFlappy ./
TEST_STABILITY=flappy go run moul.io/testman test -v -test.v -timeout=600s -retry=10 -run ^TestScenario_ ./
TEST_STABILITY=flappy go run moul.io/testman test -v -test.v -timeout=600s -retry=10 -run ^TestFlappy ./pkg/tinder
# FIXME: run on other packages too
.PHONY: go.flappy-tests
go.broken-tests: pb.generate
TEST_STABILITY=broken go run moul.io/testman test -continue-on-error -timeout=1200s -test.timeout=60s -retry=5 -run ^TestScenario_ ./
.PHONY: go.broken-tests
print-%:
@echo $* = $($*)
minimum_go_minor_version = 14
validate-go-version:
@if [ ! "x`$(GO) version | cut -c 14- | cut -d' ' -f1 | cut -d'.' -f1`" = "x1" ]; then \
echo "error: Golang version should be \"1.x\". Please use 1.$(minimum_go_minor_version) or more recent."; \
exit 1; \
fi
@if [ `$(GO) version | cut -c 14- | cut -d' ' -f1 | cut -d'.' -f2` -lt $(minimum_go_minor_version) ]; then \
echo "error: Golang version is not supported. Please use 1.$(minimum_go_minor_version) or more recent."; \
exit 1; \
fi
.PHONY: validate-go-version
##
## Code gen
##
protos_src := $(wildcard ../api/*.proto) $(wildcard ../api/go-internal/*.proto)
gen_src := $(protos_src) Makefile
gen_sum := gen.sum
protoc_opts := -I ../api:`go list -m -mod=mod -f {{.Dir}} github.com/grpc-ecosystem/grpc-gateway`/third_party/googleapis:`go list -m -mod=mod -f {{.Dir}} github.com/gogo/protobuf`:/protobuf
pb.generate: gen.sum validate-go-version
$(gen_sum): $(gen_src)
$(call check-program, shasum docker $(GO))
@shasum $(gen_src) | sort -k 2 > $(gen_sum).tmp
@diff -q $(gen_sum).tmp $(gen_sum) || ( \
uid=`id -u`; \
set -xe; \
$(GO) mod download; \
docker run \
--user="$$uid" \
--volume="`go env GOPATH`/pkg/mod:/go/pkg/mod" \
--volume="$(PWD):/go/src/berty.tech/weshnet" \
--workdir="/go/src/berty.tech/weshnet" \
--entrypoint="sh" \
--rm \
bertytech/buf:5 \
-xec 'make generate_local'; \
$(MAKE) tidy \
)
.PHONY: pb.generate
generate_local:
go version
$(call check-program, shasum buf)
buf generate api/go-internal;
buf generate api/protocol;
buf generate --template buf.gen.tag.yaml api/go-internal;
buf generate --template buf.gen.tag.yaml api/protocol;
$(MAKE) go.fmt
shasum $(gen_src) | sort -k 2 > $(gen_sum).tmp
mv $(gen_sum).tmp $(gen_sum)
.PHONY: generate_local
go.fmt:
go run github.com/daixiang0/gci write . \
--skip-generated -s 'standard,default,prefix(berty.tech)'
go run mvdan.cc/gofumpt -w .
.PHONY: go.fmt
pkger.generate:
$(GO) run github.com/markbates/pkger/cmd/pkger -o go/pkg/assets/
.PHONY: pkger.generate
gen.clean:
rm -f gen.sum $(wildcard */*/*.pb.go) $(wildcard */*/*pb_test.go) $(wildcard */*/*pb.gw.go)
.PHONY: gen.clean
pb.push:
buf push api/protocol
##
## Docs gen
##
docs.generate:
cd docs; $(MAKE) generate
.PHONY: docs.generate
docs.clean:
cd docs; $(MAKE) clean
.PHONY: docs.generate
asdf.install_plugins:
$(call check-program, asdf)
@echo "Installing asdf plugins..."
@set -e; \
for PLUGIN in $$(cut -d' ' -f1 .tool-versions | grep "^[^\#]"); do \
asdf plugin add $$PLUGIN || [ $$?==2 ] || exit 1; \
done
.PHONY: asdf.install_plugins
asdf.install_tools: asdf.install_plugins
$(call check-program, asdf)
@echo "Installing asdf tools..."
@asdf install
.PHONY: asdf.install_tools
================================================
FILE: README.md
================================================
# Wesh Network Toolkit
[](https://pkg.go.dev/berty.tech/weshnet)
The Wesh network toolkit lets your application use the
[Wesh protocol](https://berty.tech/docs/protocol) to support privacy-based, off-grid, peer-to-peer communication.
Wesh powers [Berty Messenger](https://github.com/berty/berty#readme), and now you can use
the Wesh network toolkit directly.
Your application interfaces to Wesh based on [gRPC](https://grpc.io). So even though
the core Wesh code is written in Go, Wesh works with your application written in Go, Python
or [other languages](https://grpc.io/docs/languages) supported by gRPC.
For details, see the Wesh website at https://wesh.network .
The website includes [blog tutorials](https://wesh.network/blog) which introduce you to
Wesh and walk you through some example applications and background of the Wesh protocol.
## Usage
```go
import "berty.tech/weshnet"
```
Online API documentation is at https://buf.build/berty-technologies/weshnet .
## Get the code
To get the code and build, see the file
[INSTALL.md](https://github.com/berty/weshnet/blob/master/INSTALL.md).
## Feedback
For bug reports, feature requests or questions, please open a
[GitHub issue](https://github.com/berty/weshnet/issues/new/choose).
<!--
## Examples
_TODO: add links to internal examples + links to external repos using the protocol_
-->
================================================
FILE: account_export.go
================================================
package weshnet
import (
"archive/tar"
"bytes"
"context"
"encoding/base64"
"fmt"
"io"
"strings"
"github.com/ipfs/go-cid"
cbornode "github.com/ipfs/go-ipld-cbor"
coreiface "github.com/ipfs/kubo/core/coreiface"
mh "github.com/multiformats/go-multihash"
"go.uber.org/multierr"
"go.uber.org/zap"
"google.golang.org/protobuf/proto"
orbitdb "berty.tech/go-orbit-db"
"berty.tech/weshnet/v2/pkg/errcode"
"berty.tech/weshnet/v2/pkg/protocoltypes"
)
const (
exportAccountKeyFilename = "account.key"
exportAccountProofKeyFilename = "account_proof.key"
exportOrbitDBEntriesPrefix = "entries/"
exportOrbitDBHeadsPrefix = "heads/"
)
func (s *service) export(ctx context.Context, output io.Writer) error {
tw := tar.NewWriter(output)
defer tw.Close()
if err := s.exportAccountKeys(tw); err != nil {
return errcode.ErrCode_ErrInternal.Wrap(err)
}
s.lock.RLock()
groups := make([]*GroupContext, len(s.openedGroups))
i := 0
for _, gc := range s.openedGroups {
groups[i] = gc
i++
}
s.lock.RUnlock()
for _, gc := range groups {
if err := s.exportGroupContext(ctx, gc, tw); err != nil {
return errcode.ErrCode_ErrInternal.Wrap(err)
}
}
return nil
}
func (s *service) exportGroupContext(ctx context.Context, gc *GroupContext, tw *tar.Writer) error {
if err := s.exportOrbitDBStore(ctx, gc.metadataStore, tw); err != nil {
return errcode.ErrCode_ErrInternal.Wrap(err)
}
if err := s.exportOrbitDBStore(ctx, gc.messageStore, tw); err != nil {
return errcode.ErrCode_ErrInternal.Wrap(err)
}
metaRawHeads := gc.metadataStore.OpLog().RawHeads()
cidsMeta := make([]cid.Cid, metaRawHeads.Len())
for i, raw := range metaRawHeads.Slice() {
cidsMeta[i] = raw.GetHash()
}
messagesRawHeads := gc.messageStore.OpLog().RawHeads()
cidsMessages := make([]cid.Cid, messagesRawHeads.Len())
for i, raw := range messagesRawHeads.Slice() {
cidsMessages[i] = raw.GetHash()
}
if err := s.exportOrbitDBGroupHeads(gc, cidsMeta, cidsMessages, tw); err != nil {
return errcode.ErrCode_ErrInternal.Wrap(err)
}
return nil
}
func (s *service) exportOrbitDBStore(ctx context.Context, store orbitdb.Store, tw *tar.Writer) error {
allCIDs := store.OpLog().GetEntries().Keys()
if len(allCIDs) == 0 {
return nil
}
for _, idStr := range allCIDs {
if err := s.exportOrbitDBEntry(ctx, tw, idStr); err != nil {
if clErr := tw.Close(); clErr != nil {
err = multierr.Append(err, clErr)
}
return errcode.ErrCode_ErrInternal.Wrap(err)
}
}
return nil
}
func (s *service) exportAccountKeys(tw *tar.Writer) error {
accountPrivateKeyBytes, accountProofPrivateKeyBytes, err := s.secretStore.ExportAccountKeysForBackup()
if err != nil {
return errcode.ErrCode_ErrInternal.Wrap(err)
}
err = exportPrivateKey(tw, accountPrivateKeyBytes, exportAccountKeyFilename)
if err != nil {
return errcode.ErrCode_ErrStreamWrite.Wrap(err)
}
err = exportPrivateKey(tw, accountProofPrivateKeyBytes, exportAccountProofKeyFilename)
if err != nil {
return errcode.ErrCode_ErrStreamWrite.Wrap(err)
}
return nil
}
func (s *service) exportOrbitDBGroupHeads(gc *GroupContext, headsMetadata []cid.Cid, headsMessages []cid.Cid, tw *tar.Writer) error {
cidsMeta := make([][]byte, len(headsMetadata))
for i, id := range headsMetadata {
cidsMeta[i] = id.Bytes()
}
cidsMessages := make([][]byte, len(headsMessages))
for i, id := range headsMessages {
cidsMessages[i] = id.Bytes()
}
spk, err := gc.group.GetSigningPubKey()
if err != nil {
return errcode.ErrCode_ErrSerialization.Wrap(err)
}
spkBytes, err := spk.Raw()
if err != nil {
return errcode.ErrCode_ErrSerialization.Wrap(err)
}
linkKeyArr, err := gc.group.GetLinkKeyArray()
if err != nil {
return errcode.ErrCode_ErrSerialization.Wrap(err)
}
headsExport := &protocoltypes.GroupHeadsExport{
PublicKey: gc.group.PublicKey,
SignPub: spkBytes,
MetadataHeadsCids: cidsMeta,
MessagesHeadsCids: cidsMessages,
LinkKey: linkKeyArr[:],
}
entryName := base64.RawURLEncoding.EncodeToString(gc.group.PublicKey)
data, err := proto.Marshal(headsExport)
if err != nil {
return errcode.ErrCode_ErrSerialization.Wrap(err)
}
if err := tw.WriteHeader(&tar.Header{
Typeflag: tar.TypeReg,
Name: fmt.Sprintf("%s%s", exportOrbitDBHeadsPrefix, entryName),
Mode: 0o600,
Size: int64(len(data)),
}); err != nil {
return errcode.ErrCode_ErrStreamWrite.Wrap(err)
}
size, err := tw.Write(data)
if err != nil {
return errcode.ErrCode_ErrStreamWrite.Wrap(err)
}
if size != len(data) {
return errcode.ErrCode_ErrStreamWrite.Wrap(fmt.Errorf("wrote %d bytes instead of %d", size, len(data)))
}
return nil
}
func exportPrivateKey(tw *tar.Writer, marshalledPrivateKey []byte, filename string) error {
if err := tw.WriteHeader(&tar.Header{
Typeflag: tar.TypeReg,
Name: filename,
Mode: 0o600,
Size: int64(len(marshalledPrivateKey)),
}); err != nil {
return errcode.ErrCode_ErrStreamWrite.Wrap(err)
}
size, err := tw.Write(marshalledPrivateKey)
if err != nil {
return errcode.ErrCode_ErrStreamWrite.Wrap(err)
}
if size != len(marshalledPrivateKey) {
return errcode.ErrCode_ErrStreamWrite.Wrap(fmt.Errorf("wrote %d bytes instead of %d", size, len(marshalledPrivateKey)))
}
return nil
}
func (s *service) exportOrbitDBEntry(ctx context.Context, tw *tar.Writer, idStr string) error {
id, err := cid.Parse(idStr)
if err != nil {
return errcode.ErrCode_ErrSerialization.Wrap(err)
}
dagNode, err := s.ipfsCoreAPI.Dag().Get(ctx, id)
if err != nil {
return errcode.ErrCode_ErrInternal.Wrap(err)
}
dagNodeBytes := dagNode.RawData()
if err := tw.WriteHeader(&tar.Header{
Typeflag: tar.TypeReg,
Name: fmt.Sprintf("%s%s", exportOrbitDBEntriesPrefix, idStr),
Mode: 0o600,
Size: int64(len(dagNodeBytes)),
}); err != nil {
return errcode.ErrCode_ErrStreamWrite.Wrap(err)
}
size, err := tw.Write(dagNodeBytes)
if err != nil {
return errcode.ErrCode_ErrStreamWrite.Wrap(err)
}
if size != len(dagNodeBytes) {
return errcode.ErrCode_ErrStreamWrite.Wrap(fmt.Errorf("wrote %d bytes instead of %d", size, len(dagNodeBytes)))
}
return nil
}
func readExportSecretKeyFile(expectedSize int64, reader *tar.Reader) ([]byte, error) {
if expectedSize == 0 {
return nil, errcode.ErrCode_ErrInvalidInput.Wrap(fmt.Errorf("invalid expected key size"))
}
keyContents := new(bytes.Buffer)
size, err := io.Copy(keyContents, reader)
if err != nil {
return nil, errcode.ErrCode_ErrInternal.Wrap(fmt.Errorf("unable to read %d bytes: %w", expectedSize, err))
}
if size != expectedSize {
return nil, errcode.ErrCode_ErrInternal.Wrap(fmt.Errorf("unexpected file size"))
}
return keyContents.Bytes(), nil
}
func readExportOrbitDBGroupHeads(expectedSize int64, reader *tar.Reader) (*protocoltypes.GroupHeadsExport, []cid.Cid, []cid.Cid, error) {
if expectedSize == 0 {
return nil, nil, nil, errcode.ErrCode_ErrInvalidInput.Wrap(fmt.Errorf("invalid expected node size"))
}
nodeContents := new(bytes.Buffer)
size, err := io.Copy(nodeContents, reader)
if err != nil {
return nil, nil, nil, errcode.ErrCode_ErrInternal.Wrap(fmt.Errorf("unable to read %d bytes: %w", expectedSize, err))
}
if size != expectedSize {
return nil, nil, nil, errcode.ErrCode_ErrInternal.Wrap(fmt.Errorf("unexpected file size"))
}
groupHeads := &protocoltypes.GroupHeadsExport{}
if err := proto.Unmarshal(nodeContents.Bytes(), groupHeads); err != nil {
return nil, nil, nil, errcode.ErrCode_ErrDeserialization.Wrap(err)
}
messagesCIDs := make([]cid.Cid, len(groupHeads.MessagesHeadsCids))
for i, cidBytes := range groupHeads.MessagesHeadsCids {
messagesCIDs[i], err = cid.Parse(cidBytes)
if err != nil {
return nil, nil, nil, errcode.ErrCode_ErrDeserialization.Wrap(err)
}
}
metaCIDs := make([]cid.Cid, len(groupHeads.MetadataHeadsCids))
for i, cidBytes := range groupHeads.MetadataHeadsCids {
metaCIDs[i], err = cid.Parse(cidBytes)
if err != nil {
return nil, nil, nil, errcode.ErrCode_ErrDeserialization.Wrap(err)
}
}
return groupHeads, metaCIDs, messagesCIDs, nil
}
func readExportCBORNode(expectedSize int64, cidStr string, reader *tar.Reader) (*cbornode.Node, error) {
if expectedSize == 0 {
return nil, errcode.ErrCode_ErrInvalidInput.Wrap(fmt.Errorf("invalid expected node size"))
}
nodeContents := new(bytes.Buffer)
expectedCID, err := cid.Parse(cidStr)
if err != nil {
return nil, errcode.ErrCode_ErrDeserialization.Wrap(fmt.Errorf("unable to parse CID in filename"))
}
size, err := io.Copy(nodeContents, reader)
if err != nil {
return nil, errcode.ErrCode_ErrInternal.Wrap(fmt.Errorf("unable to read %d bytes: %w", expectedSize, err))
}
if size != expectedSize {
return nil, errcode.ErrCode_ErrInternal.Wrap(fmt.Errorf("unexpected file size"))
}
node, err := cbornode.Decode(nodeContents.Bytes(), mh.SHA2_256, -1)
if err != nil {
return nil, errcode.ErrCode_ErrDeserialization.Wrap(err)
}
if !node.Cid().Equals(expectedCID) {
return nil, errcode.ErrCode_ErrInvalidInput.Wrap(fmt.Errorf("entry CID doesn't match file CID"))
}
return node, nil
}
type RestoreAccountHandler struct {
Handler func(header *tar.Header, reader *tar.Reader) (bool, error)
PostProcess func() error
}
type restoreAccountState struct {
keys map[string][]byte
}
func (state *restoreAccountState) readKey(keyName string) RestoreAccountHandler {
return RestoreAccountHandler{
Handler: func(header *tar.Header, reader *tar.Reader) (bool, error) {
if header.Name != keyName {
return false, nil
}
if state.keys[keyName] != nil {
return false, errcode.ErrCode_ErrInternal.Wrap(fmt.Errorf("multiple keys found in archive"))
}
var err error
state.keys[keyName], err = readExportSecretKeyFile(header.Size, reader)
if err != nil {
return true, errcode.ErrCode_ErrInternal.Wrap(err)
}
return true, nil
},
}
}
func (state *restoreAccountState) restoreKeys(odb *WeshOrbitDB) RestoreAccountHandler {
return RestoreAccountHandler{
PostProcess: func() error {
if err := odb.secretStore.ImportAccountKeys(state.keys[exportAccountKeyFilename], state.keys[exportAccountProofKeyFilename]); err != nil {
return errcode.ErrCode_ErrInternal.Wrap(err)
}
return nil
},
}
}
func restoreOrbitDBEntry(ctx context.Context, coreAPI coreiface.CoreAPI) RestoreAccountHandler {
return RestoreAccountHandler{
Handler: func(header *tar.Header, reader *tar.Reader) (bool, error) {
if !strings.HasPrefix(header.Name, exportOrbitDBEntriesPrefix) {
return false, nil
}
cidStr := strings.TrimPrefix(header.Name, exportOrbitDBEntriesPrefix)
node, err := readExportCBORNode(header.Size, cidStr, reader)
if err != nil {
return true, errcode.ErrCode_ErrInternal.Wrap(err)
}
if err := coreAPI.Dag().Add(ctx, node); err != nil {
return true, errcode.ErrCode_ErrInternal.Wrap(err)
}
return true, nil
},
}
}
func restoreOrbitDBHeads(ctx context.Context, odb *WeshOrbitDB) RestoreAccountHandler {
return RestoreAccountHandler{
Handler: func(header *tar.Header, reader *tar.Reader) (bool, error) {
if !strings.HasPrefix(header.Name, exportOrbitDBHeadsPrefix) {
return false, nil
}
heads, metaCIDs, messageCIDs, err := readExportOrbitDBGroupHeads(header.Size, reader)
if err != nil {
return true, errcode.ErrCode_ErrInternal.Wrap(err)
}
if err := odb.setHeadsForGroup(ctx, &protocoltypes.Group{
PublicKey: heads.PublicKey,
SignPub: heads.SignPub,
LinkKey: heads.LinkKey,
}, metaCIDs, messageCIDs); err != nil {
return true, errcode.ErrCode_ErrOrbitDBAppend.Wrap(fmt.Errorf("error while restoring db head: %w", err))
}
return true, nil
},
}
}
func RestoreAccountExport(ctx context.Context, reader io.Reader, coreAPI coreiface.CoreAPI, odb *WeshOrbitDB, logger *zap.Logger, handlers ...RestoreAccountHandler) error {
tr := tar.NewReader(reader)
state := restoreAccountState{
keys: map[string][]byte{},
}
handlers = append(
[]RestoreAccountHandler{
state.readKey(exportAccountKeyFilename),
state.readKey(exportAccountProofKeyFilename),
state.restoreKeys(odb),
restoreOrbitDBEntry(ctx, coreAPI),
restoreOrbitDBHeads(ctx, odb),
},
handlers...,
)
for {
header, err := tr.Next()
if err == io.EOF {
break
} else if err != nil {
return errcode.ErrCode_ErrInternal.Wrap(err)
}
if header.Typeflag != tar.TypeReg {
logger.Warn("invalid entry type", zap.String("filename", header.Name), zap.Any("filename", header.Typeflag))
continue
}
notHandled := true
for _, h := range handlers {
if h.Handler == nil {
continue
}
handled, err := h.Handler(header, tr)
if err != nil {
return errcode.ErrCode_ErrInternal.Wrap(err)
}
if handled {
notHandled = false
break
}
}
if notHandled {
logger.Warn("unknown export entry", zap.String("filename", header.Name))
}
}
for _, h := range handlers {
if h.PostProcess == nil {
continue
}
if err := h.PostProcess(); err != nil {
return errcode.ErrCode_ErrInternal.Wrap(err)
}
}
return nil
}
================================================
FILE: account_export_test.go
================================================
package weshnet
import (
"archive/tar"
"context"
"io"
"os"
"testing"
"github.com/ipfs/go-cid"
ds "github.com/ipfs/go-datastore"
dsync "github.com/ipfs/go-datastore/sync"
mocknet "github.com/libp2p/go-libp2p/p2p/net/mock"
"github.com/stretchr/testify/require"
orbitdb "berty.tech/go-orbit-db"
"berty.tech/go-orbit-db/pubsub/pubsubraw"
"berty.tech/weshnet/v2/pkg/ipfsutil"
"berty.tech/weshnet/v2/pkg/protocoltypes"
"berty.tech/weshnet/v2/pkg/secretstore"
"berty.tech/weshnet/v2/pkg/testutil"
"berty.tech/weshnet/v2/pkg/tinder"
)
func Test_service_exportAccountKeys(t *testing.T) {
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
mn := mocknet.New()
defer mn.Close()
msrv := tinder.NewMockDriverServer()
dsA := dsync.MutexWrap(ds.NewMapDatastore())
nodeA, closeNodeA := NewTestingProtocol(ctx, t, &TestingOpts{
Mocknet: mn,
DiscoveryServer: msrv,
}, dsA)
defer closeNodeA()
// time.Sleep(time.Second * 5)
s, ok := nodeA.Service.(*service)
require.True(t, ok)
tmpFile, err := os.CreateTemp(os.TempDir(), "test-export-")
require.NoError(t, err)
defer os.Remove(tmpFile.Name())
tw := tar.NewWriter(tmpFile)
err = s.exportAccountKeys(tw)
require.NoError(t, err)
err = tw.Close()
require.NoError(t, err)
_, err = tmpFile.Seek(0, io.SeekStart)
require.NoError(t, err)
tr := tar.NewReader(tmpFile)
accountPrivateKey := getKeyFromTar(t, tr, exportAccountKeyFilename)
accountProofPrivateKey := getKeyFromTar(t, tr, exportAccountProofKeyFilename)
inStoreAccountPrivateKeyBytes, inStoreAccountProofPrivateKeyBytes, err := s.secretStore.ExportAccountKeysForBackup()
require.NoError(t, err)
require.NotNil(t, inStoreAccountPrivateKeyBytes)
require.NotNil(t, inStoreAccountProofPrivateKeyBytes)
require.Equal(t, accountPrivateKey, inStoreAccountPrivateKeyBytes)
require.Equal(t, accountProofPrivateKey, inStoreAccountProofPrivateKeyBytes)
}
func getKeyFromTar(t *testing.T, tr *tar.Reader, expectedFilename string) []byte {
header, err := tr.Next()
require.NoError(t, err)
require.Equal(t, expectedFilename, header.Name)
keyContents := make([]byte, header.Size)
size, err := tr.Read(keyContents)
require.Equal(t, int(header.Size), size)
return keyContents
}
func TestFlappyRestoreAccount(t *testing.T) {
testutil.FilterStability(t, testutil.Flappy)
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
logger, cleanup := testutil.Logger(t)
defer cleanup()
mn := mocknet.New()
defer mn.Close()
msrv := tinder.NewMockDriverServer()
tmpFile, err := os.CreateTemp(os.TempDir(), "test-export-")
require.NoError(t, err)
expectedMessages := map[cid.Cid][]byte{}
var nodeAInstanceConfig *protocoltypes.ServiceGetConfiguration_Reply
g, _, err := NewGroupMultiMember()
require.NoError(t, err)
defer os.Remove(tmpFile.Name())
{
dsA := dsync.MutexWrap(ds.NewMapDatastore())
nodeA, closeNodeA := NewTestingProtocol(ctx, t, &TestingOpts{
Mocknet: mn,
}, dsA)
serviceA, ok := nodeA.Service.(*service)
require.True(t, ok)
nodeAInstanceConfig, err = nodeA.Client.ServiceGetConfiguration(ctx, &protocoltypes.ServiceGetConfiguration_Request{})
require.NoError(t, err)
require.NotNil(t, nodeAInstanceConfig)
testPayload1 := []byte("testMessage1")
testPayload2 := []byte("testMessage2")
testPayload3 := []byte("testMessage3")
testPayload4 := []byte("testMessage4")
accountGroup := serviceA.getAccountGroup()
require.NotNil(t, accountGroup)
op, err := accountGroup.messageStore.AddMessage(ctx, testPayload1)
require.NoError(t, err)
expectedMessages[op.GetEntry().GetHash()] = testPayload1
op, err = accountGroup.messageStore.AddMessage(ctx, testPayload2)
require.NoError(t, err)
expectedMessages[op.GetEntry().GetHash()] = testPayload2
_, err = nodeA.Client.MultiMemberGroupJoin(ctx, &protocoltypes.MultiMemberGroupJoin_Request{Group: g})
require.NoError(t, err)
_, err = nodeA.Client.ActivateGroup(ctx, &protocoltypes.ActivateGroup_Request{GroupPk: g.PublicKey})
require.NoError(t, err)
op, err = serviceA.openedGroups[string(g.PublicKey)].messageStore.AddMessage(ctx, testPayload3)
require.NoError(t, err)
expectedMessages[op.GetEntry().GetHash()] = testPayload3
op, err = serviceA.openedGroups[string(g.PublicKey)].messageStore.AddMessage(ctx, testPayload4)
require.NoError(t, err)
expectedMessages[op.GetEntry().GetHash()] = testPayload4
require.NoError(t, serviceA.export(ctx, tmpFile))
closeNodeA()
require.NoError(t, dsA.Close())
}
_, err = tmpFile.Seek(0, io.SeekStart)
require.NoError(t, err)
{
dsB := dsync.MutexWrap(ds.NewMapDatastore())
secretStoreB, err := secretstore.NewSecretStore(dsB, nil)
require.NoError(t, err)
ipfsNodeB := ipfsutil.TestingCoreAPIUsingMockNet(ctx, t, &ipfsutil.TestingAPIOpts{
Mocknet: mn,
Datastore: dsB,
})
odb, err := NewWeshOrbitDB(ctx, ipfsNodeB.API(), &NewOrbitDBOptions{
NewOrbitDBOptions: orbitdb.NewOrbitDBOptions{
PubSub: pubsubraw.NewPubSub(ipfsNodeB.PubSub(), ipfsNodeB.MockNode().PeerHost.ID(), logger, nil),
Logger: logger,
},
Datastore: dsB,
SecretStore: secretStoreB,
})
require.NoError(t, err)
err = RestoreAccountExport(ctx, tmpFile, ipfsNodeB.API(), odb, logger)
require.NoError(t, err)
nodeB, closeNodeB := NewTestingProtocol(ctx, t, &TestingOpts{
Mocknet: mn,
DiscoveryServer: msrv,
SecretStore: secretStoreB,
CoreAPIMock: ipfsNodeB,
OrbitDB: odb,
}, dsB)
defer closeNodeB()
nodeBInstanceConfig, err := nodeB.Client.ServiceGetConfiguration(ctx, &protocoltypes.ServiceGetConfiguration_Request{})
require.NoError(t, err)
require.NotNil(t, nodeBInstanceConfig)
require.Equal(t, nodeAInstanceConfig.AccountPk, nodeBInstanceConfig.AccountPk)
require.NotEqual(t, nodeAInstanceConfig.DevicePk, nodeBInstanceConfig.DevicePk)
require.Equal(t, nodeAInstanceConfig.AccountGroupPk, nodeBInstanceConfig.AccountGroupPk)
accountGroup := nodeB.Service.(*service).getAccountGroup()
require.NotNil(t, accountGroup)
entries := accountGroup.messageStore.OpLog().GetEntries()
for _, evt := range entries.Slice() {
_, ok := expectedMessages[evt.GetHash()]
require.True(t, ok)
}
_, err = nodeB.Service.ActivateGroup(ctx, &protocoltypes.ActivateGroup_Request{GroupPk: g.PublicKey})
require.NoError(t, err)
for _, gPK := range [][]byte{nodeBInstanceConfig.AccountGroupPk, g.PublicKey} {
sub, err := nodeB.Client.GroupMessageList(
ctx,
&protocoltypes.GroupMessageList_Request{
GroupPk: gPK,
UntilNow: true,
},
)
require.NoError(t, err)
for {
evt, err := sub.Recv()
if err != nil {
require.Equal(t, io.EOF, err)
break
}
id, err := cid.Parse(evt.EventContext.Id)
require.NoError(t, err)
ref, ok := expectedMessages[id]
require.True(t, ok)
require.Equal(t, ref, evt.Message)
delete(expectedMessages, id)
}
}
require.Empty(t, expectedMessages)
}
// TODO: test account metadata entries
}
================================================
FILE: api/go-internal/buf.yaml
================================================
version: v2
name: buf.build/berty-technologies/weshnet
breaking:
use:
- FILE
lint:
use:
- DEFAULT
================================================
FILE: api/go-internal/handshake/handshake.proto
================================================
syntax = "proto3";
package handshake;
option go_package = "berty.tech/weshnet/v2/internal/handshake";
message BoxEnvelope {
bytes box = 1;
}
message HelloPayload {
bytes ephemeral_pub_key = 1;
}
message RequesterAuthenticatePayload {
bytes requester_account_id = 1;
bytes requester_account_sig = 2;
}
message ResponderAcceptPayload {
bytes responder_account_sig = 1;
}
message RequesterAcknowledgePayload {
bool success = 1;
}
================================================
FILE: api/go-internal/tinder/records.proto
================================================
syntax = "proto3";
package tinder;
option go_package = "berty.tech/weshnet/v2/pkg/tinder";
message Records {
repeated Record records = 1;
}
message Record {
string cid = 1;
int64 expire = 2;
}
================================================
FILE: api/protocol/buf.yaml
================================================
version: v2
name: buf.build/berty-technologies/weshnet
deps:
- buf.build/srikrsna/protoc-gen-gotag
breaking:
use:
- FILE
lint:
use:
- DEFAULT
================================================
FILE: api/protocol/errcode/errcode.proto
================================================
syntax = "proto3";
package weshnet.errcode;
option go_package = "berty.tech/weshnet/v2/pkg/errcode";
enum ErrCode {
//----------------
// Special errors
//----------------
Undefined = 0; // default value, should never be set manually
TODO = 666; // indicates that you plan to create an error later
ErrNotImplemented = 777; // indicates that a method is not implemented yet
ErrInternal = 888; // indicates an unknown error (without Code), i.e. in gRPC
//----------------
// Generic errors
//----------------
// Parameters and I/O errors
ErrInvalidInput = 100;
ErrInvalidRange = 101;
ErrMissingInput = 102;
ErrSerialization = 103;
ErrDeserialization = 104;
ErrStreamRead = 105;
ErrStreamWrite = 106;
ErrStreamTransform = 110;
ErrStreamSendAndClose = 111;
ErrStreamHeaderWrite = 112;
ErrStreamHeaderRead = 115;
ErrStreamSink = 113;
ErrStreamCloseAndRecv = 114;
ErrMissingMapKey = 107;
ErrDBWrite = 108;
ErrDBRead = 109;
ErrDBDestroy = 120;
ErrDBMigrate = 121;
ErrDBReplay = 122;
ErrDBRestore = 123;
ErrDBOpen = 124;
ErrDBClose = 125;
// Crypto errors
ErrCryptoRandomGeneration = 200;
ErrCryptoKeyGeneration = 201;
ErrCryptoNonceGeneration = 202;
ErrCryptoSignature = 203;
ErrCryptoSignatureVerification = 204;
ErrCryptoDecrypt = 205;
ErrCryptoDecryptPayload = 206;
ErrCryptoEncrypt = 207;
ErrCryptoKeyConversion = 208;
ErrCryptoCipherInit = 209;
ErrCryptoKeyDerivation = 210;
// Pattern errors
ErrMap = 300;
ErrForEach = 301;
// Keystore errors
ErrKeystoreGet = 400;
ErrKeystorePut = 401;
ErrNotFound = 404; // generic
//-----------------
// Specific errors
//-----------------
// OrbitDB errors
ErrOrbitDBInit = 1000;
ErrOrbitDBOpen = 1001;
ErrOrbitDBAppend = 1002;
ErrOrbitDBDeserialization = 1003;
ErrOrbitDBStoreCast = 1004;
// Handshake errors
ErrHandshakeOwnEphemeralKeyGenSend = 1100;
ErrHandshakePeerEphemeralKeyRecv = 1101;
ErrHandshakeRequesterAuthenticateBoxKeyGen = 1102;
ErrHandshakeResponderAcceptBoxKeyGen = 1103;
ErrHandshakeRequesterHello = 1104;
ErrHandshakeResponderHello = 1105;
ErrHandshakeRequesterAuthenticate = 1106;
ErrHandshakeResponderAccept = 1107;
ErrHandshakeRequesterAcknowledge = 1108;
// Contact Request errors
ErrContactRequestSameAccount = 1200;
ErrContactRequestContactAlreadyAdded = 1201;
ErrContactRequestContactBlocked = 1202;
ErrContactRequestContactUndefined = 1203;
ErrContactRequestIncomingAlreadyReceived = 1204;
// Group errors
ErrGroupMemberLogEventOpen = 1300;
ErrGroupMemberLogEventSignature = 1301;
ErrGroupMemberUnknownGroupID = 1302;
ErrGroupSecretOtherDestMember = 1303;
ErrGroupSecretAlreadySentToMember = 1304;
ErrGroupInvalidType = 1305;
ErrGroupMissing = 1306;
ErrGroupActivate = 1307;
ErrGroupDeactivate = 1308;
ErrGroupInfo = 1309;
ErrGroupUnknown = 1310;
ErrGroupOpen = 1311;
// Message key errors
ErrMessageKeyPersistencePut = 1500;
ErrMessageKeyPersistenceGet = 1501;
// Services Replication
ErrServiceReplication = 4100;
ErrServiceReplicationServer = 4101;
ErrServiceReplicationMissingEndpoint = 4102;
// Services Directory
ErrServicesDirectory = 4200;
ErrServicesDirectoryInvalidVerifiedCredentialSubject = 4201;
ErrServicesDirectoryExistingRecordNotFound = 4202;
ErrServicesDirectoryRecordLockedAndCantBeReplaced = 4203;
ErrServicesDirectoryExplicitReplaceFlagRequired = 4204;
ErrServicesDirectoryInvalidVerifiedCredential = 4205;
ErrServicesDirectoryExpiredVerifiedCredential = 4206;
ErrServicesDirectoryInvalidVerifiedCredentialID = 4207;
}
message ErrDetails { repeated ErrCode codes = 1; }
================================================
FILE: api/protocol/outofstoremessagetypes/outofstoremessage.proto
================================================
syntax = "proto3";
package weshnet.outofstoremessage.v1;
import "protocoltypes.proto";
option go_package = "berty.tech/weshnet/v2/pkg/outofstoremessagetypes";
// OutOfStoreMessageService is the service used to open out-of-store messages (e.g. push notifications)
// It is used to open messages with a lightweight protocol service for mobile backgroup processes.
service OutOfStoreMessageService {
// OutOfStoreReceive parses a payload received outside a synchronized store
rpc OutOfStoreReceive(weshnet.protocol.v1.OutOfStoreReceive.Request) returns (weshnet.protocol.v1.OutOfStoreReceive.Reply);
}
================================================
FILE: api/protocol/protocoltypes.proto
================================================
syntax = "proto3";
package weshnet.protocol.v1;
option go_package = "berty.tech/weshnet/v2/pkg/protocoltypes";
// ProtocolService is the top-level API to manage the Wesh protocol service.
// Each active Wesh protocol service is considered as a Wesh device and is associated with a Wesh user.
service ProtocolService {
// ServiceExportData exports the current data of the protocol service
rpc ServiceExportData (ServiceExportData.Request) returns (stream ServiceExportData.Reply);
// ServiceGetConfiguration gets the current configuration of the protocol service
rpc ServiceGetConfiguration (ServiceGetConfiguration.Request) returns (ServiceGetConfiguration.Reply);
// ContactRequestReference retrieves the information required to create a reference (ie. included in a shareable link) to the current account
rpc ContactRequestReference (ContactRequestReference.Request) returns (ContactRequestReference.Reply);
// ContactRequestDisable disables incoming contact requests
rpc ContactRequestDisable (ContactRequestDisable.Request) returns (ContactRequestDisable.Reply);
// ContactRequestEnable enables incoming contact requests
rpc ContactRequestEnable (ContactRequestEnable.Request) returns (ContactRequestEnable.Reply);
// ContactRequestResetReference changes the contact request reference
rpc ContactRequestResetReference (ContactRequestResetReference.Request) returns (ContactRequestResetReference.Reply);
// ContactRequestSend attempt to send a contact request
rpc ContactRequestSend (ContactRequestSend.Request) returns (ContactRequestSend.Reply);
// ContactRequestAccept accepts a contact request
rpc ContactRequestAccept (ContactRequestAccept.Request) returns (ContactRequestAccept.Reply);
// ContactRequestDiscard ignores a contact request, without informing the other user
rpc ContactRequestDiscard (ContactRequestDiscard.Request) returns (ContactRequestDiscard.Reply);
// ShareContact uses ContactRequestReference to get the contact information for the current account and
// returns the Protobuf encoding of a shareable contact which you can further encode and share. If needed, this
// will reset the contact request reference and enable contact requests. To decode the result, see DecodeContact.
rpc ShareContact (ShareContact.Request) returns (ShareContact.Reply);
// DecodeContact decodes the Protobuf encoding of a shareable contact which was returned by ShareContact.
rpc DecodeContact (DecodeContact.Request) returns (DecodeContact.Reply);
// ContactBlock blocks a contact from sending requests
rpc ContactBlock (ContactBlock.Request) returns (ContactBlock.Reply);
// ContactUnblock unblocks a contact from sending requests
rpc ContactUnblock (ContactUnblock.Request) returns (ContactUnblock.Reply);
// ContactAliasKeySend send an alias key to a contact, the contact will be able to assert that your account is being present on a multi-member group
rpc ContactAliasKeySend (ContactAliasKeySend.Request) returns (ContactAliasKeySend.Reply);
// MultiMemberGroupCreate creates a new multi-member group
rpc MultiMemberGroupCreate (MultiMemberGroupCreate.Request) returns (MultiMemberGroupCreate.Reply);
// MultiMemberGroupJoin joins a multi-member group
rpc MultiMemberGroupJoin (MultiMemberGroupJoin.Request) returns (MultiMemberGroupJoin.Reply);
// MultiMemberGroupLeave leaves a multi-member group
rpc MultiMemberGroupLeave (MultiMemberGroupLeave.Request) returns (MultiMemberGroupLeave.Reply);
// MultiMemberGroupAliasResolverDisclose discloses your alias resolver key
rpc MultiMemberGroupAliasResolverDisclose (MultiMemberGroupAliasResolverDisclose.Request) returns (MultiMemberGroupAliasResolverDisclose.Reply);
// MultiMemberGroupAdminRoleGrant grants an admin role to a group member
rpc MultiMemberGroupAdminRoleGrant (MultiMemberGroupAdminRoleGrant.Request) returns (MultiMemberGroupAdminRoleGrant.Reply);
// MultiMemberGroupInvitationCreate creates an invitation to a multi-member group
rpc MultiMemberGroupInvitationCreate (MultiMemberGroupInvitationCreate.Request) returns (MultiMemberGroupInvitationCreate.Reply);
// AppMetadataSend adds an app event to the metadata store, the message is encrypted using a symmetric key and readable by future group members
rpc AppMetadataSend (AppMetadataSend.Request) returns (AppMetadataSend.Reply);
// AppMessageSend adds an app event to the message store, the message is encrypted using a derived key and readable by current group members
rpc AppMessageSend (AppMessageSend.Request) returns (AppMessageSend.Reply);
// GroupMetadataList replays previous and subscribes to new metadata events from the group
rpc GroupMetadataList (GroupMetadataList.Request) returns (stream GroupMetadataEvent);
// GroupMessageList replays previous and subscribes to new message events from the group
rpc GroupMessageList (GroupMessageList.Request) returns (stream GroupMessageEvent);
// GroupInfo retrieves information about a group
rpc GroupInfo (GroupInfo.Request) returns (GroupInfo.Reply);
// ActivateGroup explicitly opens a group
rpc ActivateGroup (ActivateGroup.Request) returns (ActivateGroup.Reply);
// DeactivateGroup closes a group
rpc DeactivateGroup (DeactivateGroup.Request) returns (DeactivateGroup.Reply);
// GroupDeviceStatus monitor device status
rpc GroupDeviceStatus(GroupDeviceStatus.Request) returns (stream GroupDeviceStatus.Reply);
rpc DebugListGroups (DebugListGroups.Request) returns (stream DebugListGroups.Reply);
rpc DebugInspectGroupStore (DebugInspectGroupStore.Request) returns (stream DebugInspectGroupStore.Reply);
rpc DebugGroup (DebugGroup.Request) returns (DebugGroup.Reply);
rpc SystemInfo (SystemInfo.Request) returns (SystemInfo.Reply);
// CredentialVerificationServiceInitFlow Initialize a credential verification flow
rpc CredentialVerificationServiceInitFlow (CredentialVerificationServiceInitFlow.Request) returns (CredentialVerificationServiceInitFlow.Reply);
// CredentialVerificationServiceCompleteFlow Completes a credential verification flow
rpc CredentialVerificationServiceCompleteFlow (CredentialVerificationServiceCompleteFlow.Request) returns (CredentialVerificationServiceCompleteFlow.Reply);
// VerifiedCredentialsList Retrieves the list of verified credentials
rpc VerifiedCredentialsList (VerifiedCredentialsList.Request) returns (stream VerifiedCredentialsList.Reply);
// ReplicationServiceRegisterGroup Asks a replication service to distribute a group contents
rpc ReplicationServiceRegisterGroup (ReplicationServiceRegisterGroup.Request) returns (ReplicationServiceRegisterGroup.Reply);
// PeerList returns a list of P2P peers
rpc PeerList(PeerList.Request) returns (PeerList.Reply);
// OutOfStoreReceive parses a payload received outside a synchronized store
rpc OutOfStoreReceive(OutOfStoreReceive.Request) returns (OutOfStoreReceive.Reply);
// OutOfStoreSeal creates a payload of a message present in store to be sent outside a synchronized store
rpc OutOfStoreSeal(OutOfStoreSeal.Request) returns (OutOfStoreSeal.Reply);
// RefreshContactRequest try to refresh the contact request for the given contact
rpc RefreshContactRequest(RefreshContactRequest.Request) returns (RefreshContactRequest.Reply);
}
enum GroupType {
// GroupTypeUndefined indicates that the value has not been set. For example, happens if group is replicated.
GroupTypeUndefined = 0;
// GroupTypeAccount is the group managing an account, available to all its devices.
GroupTypeAccount = 1;
// GroupTypeContact is the group created between two accounts, available to all their devices.
GroupTypeContact = 2;
// GroupTypeMultiMember is a group containing an undefined number of members.
GroupTypeMultiMember = 3;
// Following group types have not been defined, first is a group with
// only approved writers, second is public group with anyone allowed to
// write, in both cases full history is available to new members.
//
// GroupTypeChannel = 4;
// GroupTypePublic = 5;
}
enum EventType {
// EventTypeUndefined indicates that the value has not been set. Should not happen.
EventTypeUndefined = 0;
// EventTypeGroupMemberDeviceAdded indicates the payload includes that a member has added their device to the group
EventTypeGroupMemberDeviceAdded = 1;
// EventTypeGroupDeviceChainKeyAdded indicates the payload includes that a member has sent their device chain key to another member
EventTypeGroupDeviceChainKeyAdded = 2;
// EventTypeGroupAdditionalRendezvousSeedAdded adds a new rendezvous seed to a group
// Might be implemented later, could be useful for replication services
// EventTypeGroupAdditionalRendezvousSeedAdded = 3;
// EventTypeGroupAdditionalRendezvousSeedRemoved removes a rendezvous seed from a group
// Might be implemented later, could be useful for replication services
// EventTypeGroupAdditionalRendezvousSeedRemoved = 4;
// EventTypeAccountGroupJoined indicates the payload includes that the account has joined a group
EventTypeAccountGroupJoined = 101;
// EventTypeAccountGroupLeft indicates the payload includes that the account has left a group
EventTypeAccountGroupLeft = 102;
// EventTypeAccountContactRequestDisabled indicates the payload includes that the account has disabled incoming contact requests
EventTypeAccountContactRequestDisabled = 103;
// EventTypeAccountContactRequestEnabled indicates the payload includes that the account has enabled incoming contact requests
EventTypeAccountContactRequestEnabled = 104;
// EventTypeAccountContactRequestReferenceReset indicates the payload includes that the account has a new contact request rendezvous seed
EventTypeAccountContactRequestReferenceReset = 105;
// EventTypeAccountContactRequestOutgoingEnqueued indicates the payload includes that the account will attempt to send a new contact request
EventTypeAccountContactRequestOutgoingEnqueued = 106;
// EventTypeAccountContactRequestOutgoingSent indicates the payload includes that the account has sent a contact request
EventTypeAccountContactRequestOutgoingSent = 107;
// EventTypeAccountContactRequestIncomingReceived indicates the payload includes that the account has received a contact request
EventTypeAccountContactRequestIncomingReceived = 108;
// EventTypeAccountContactRequestIncomingDiscarded indicates the payload includes that the account has ignored a contact request
EventTypeAccountContactRequestIncomingDiscarded = 109;
// EventTypeAccountContactRequestIncomingAccepted indicates the payload includes that the account has accepted a contact request
EventTypeAccountContactRequestIncomingAccepted = 110;
// EventTypeAccountContactBlocked indicates the payload includes that the account has blocked a contact
EventTypeAccountContactBlocked = 111;
// EventTypeAccountContactUnblocked indicates the payload includes that the account has unblocked a contact
EventTypeAccountContactUnblocked = 112;
// EventTypeContactAliasKeyAdded indicates the payload includes that the contact group has received an alias key
EventTypeContactAliasKeyAdded = 201;
// EventTypeMultiMemberGroupAliasResolverAdded indicates the payload includes that a member of the group sent their alias proof
EventTypeMultiMemberGroupAliasResolverAdded = 301;
// EventTypeMultiMemberGroupInitialMemberAnnounced indicates the payload includes that a member has authenticated themselves as the group owner
EventTypeMultiMemberGroupInitialMemberAnnounced = 302;
// EventTypeMultiMemberGroupAdminRoleGranted indicates the payload includes that an admin of the group granted another member as an admin
EventTypeMultiMemberGroupAdminRoleGranted = 303;
// EventTypeGroupReplicating indicates that the group has been registered for replication on a server
EventTypeGroupReplicating = 403;
// EventTypeAccountVerifiedCredentialRegistered
EventTypeAccountVerifiedCredentialRegistered = 500;
// EventTypeGroupMetadataPayloadSent indicates the payload includes an app specific event, unlike messages stored on the message store it is encrypted using a static key
EventTypeGroupMetadataPayloadSent = 1001;
}
// Account describes all the secrets that identifies an Account
message Account {
// group specifies which group is used to manage the account
Group group = 1;
// account_private_key, private part is used to signs handshake, signs device, create contacts group keys via ECDH -- public part is used to have a shareable identity
bytes account_private_key = 2;
// alias_private_key, private part is use to derive group members private keys, signs alias proofs, public part can be shared to contacts to prove identity
bytes alias_private_key = 3;
// public_rendezvous_seed, rendezvous seed used for direct communication
bytes public_rendezvous_seed = 4;
}
// Group define a group and is enough to invite someone to it
message Group {
// public_key is the identifier of the group, it signs the group secret and the initial member of a multi-member group
bytes public_key = 1;
// secret is the symmetric secret of the group, which is used to encrypt the metadata
bytes secret = 2;
// secret_sig is the signature of the secret used to ensure the validity of the group
bytes secret_sig = 3;
// group_type specifies the type of the group, used to determine how device chain key is generated
GroupType group_type = 4;
// sign_pub is the signature public key used to verify entries, not required when secret and secret_sig are provided
bytes sign_pub = 5;
// link_key is the secret key used to exchange group updates and links to attachments, useful for replication services
bytes link_key = 6;
// link_key_sig is the signature of the link_key using the group private key
bytes link_key_sig = 7;
}
message GroupHeadsExport {
// public_key is the identifier of the group, it signs the group secret and the initial member of a multi-member group
bytes public_key = 1;
// sign_pub is the signature public key used to verify entries
bytes sign_pub = 2;
// metadata_heads_cids are the heads of the metadata store that should be restored from an export
repeated bytes metadata_heads_cids = 3;
// messages_heads_cids are the heads of the metadata store that should be restored from an export
repeated bytes messages_heads_cids = 4;
// link_key
bytes link_key = 5;
}
// GroupMetadata is used in GroupEnvelope and only readable by invited group members
message GroupMetadata {
// event_type defines which event type is used
EventType event_type = 1;
// the serialization depends on event_type, event is symmetrically encrypted
bytes payload = 2;
// sig is the signature of the payload, it depends on the event_type for the used key
bytes sig = 3;
// protocol_metadata is protocol layer data
ProtocolMetadata protocol_metadata = 4;
}
// GroupEnvelope is a publicly exposed structure containing a group metadata event
message GroupEnvelope {
// nonce is used to encrypt the message
bytes nonce = 1;
// event is encrypted using a symmetric key shared among group members
bytes event = 2;
reserved 3; // repeated bytes encrypted_attachment_cids = 3 ;
}
// MessageHeaders is used in MessageEnvelope and only readable by invited group members
message MessageHeaders {
// counter is the current counter value for the specified device
uint64 counter = 1;
// device_pk is the public key of the device sending the message
bytes device_pk = 2;
// sig is the signature of the encrypted message using the device's private key
bytes sig = 3;
// metadata allow to pass custom informations
map<string, string> metadata = 4;
}
message ProtocolMetadata {
// attachments_secrets is a list of secret keys used retrieve attachments
reserved 1; //repeated bytes attachments_secrets = 1;
}
// EncryptedMessage is used in MessageEnvelope and only readable by groups members that joined before the message was sent
message EncryptedMessage {
// plaintext is the app layer data
bytes plaintext = 1;
// protocol_metadata is protocol layer data
ProtocolMetadata protocol_metadata = 2;
}
// MessageEnvelope is a publicly exposed structure containing a group secure message
message MessageEnvelope {
// message_headers is an encrypted serialization using a symmetric key of a MessageHeaders message
bytes message_headers = 1;
// message is an encrypted message, only readable by group members who previously received the appropriate chain key
bytes message = 2;
// nonce is a nonce for message headers
bytes nonce = 3;
// encrypted_attachment_cids is a list of attachment CIDs encrypted specifically for replication services
reserved 4; // repeated bytes encrypted_attachment_cids = 4;
}
// ***************************************************************************
// Group event types
// ***************************************************************************
// EventContext adds context (its id, its parents and its attachments) to an event
message EventContext {
// id is the CID of the underlying OrbitDB event
bytes id = 1;
// id are the the CIDs of the underlying parents of the OrbitDB event
repeated bytes parent_ids = 2;
// group_pk receiving the event
bytes group_pk = 3;
// attachment_cids is a list of attachment that can be retrieved
reserved 4; // repeated bytes attachment_cids = 4;
}
// GroupMetadataPayloadSent is an app defined message, accessible to future group members
message GroupMetadataPayloadSent {
// device_pk is the device sending the event, signs the message
bytes device_pk = 1;
// message is the payload
bytes message = 2;
}
// ContactAliasKeyAdded is an event type where ones shares their alias public key
message ContactAliasKeyAdded {
// device_pk is the device sending the event, signs the message
bytes device_pk = 1;
// alias_pk is the alias key which will be used to verify a contact identity
bytes alias_pk = 2;
}
// GroupMemberDeviceAdded is an event which indicates to a group a new device (and eventually a new member) is joining it
// When added on AccountGroup, this event should be followed by appropriate GroupMemberDeviceAdded and GroupDeviceChainKeyAdded events
message GroupMemberDeviceAdded {
// member_pk is the member sending the event
bytes member_pk = 1;
// device_pk is the device sending the event, signs the message
bytes device_pk = 2;
// member_sig is used to prove the ownership of the member pk
bytes member_sig = 3; // TODO: signature of what ??? ensure it can't be replayed
}
// DeviceChainKey is a chain key, which will be encrypted for a specific member of the group
message DeviceChainKey {
// chain_key is the current value of the chain key of the group device
bytes chain_key = 1;
// counter is the current value of the counter of the group device
uint64 counter = 2;
}
// GroupDeviceChainKeyAdded is an event which indicates to a group member a device chain key
message GroupDeviceChainKeyAdded {
// device_pk is the device sending the event, signs the message
bytes device_pk = 1;
// dest_member_pk is the member who should receive the secret
bytes dest_member_pk = 2;
// payload is the serialization of Payload encrypted for the specified member
bytes payload = 3;
}
// MultiMemberGroupAliasResolverAdded indicates that a group member want to disclose their presence in the group to their contacts
message MultiMemberGroupAliasResolverAdded {
// device_pk is the device sending the event, signs the message
bytes device_pk = 1;
// alias_resolver allows contact of an account to resolve the real identity behind an alias (Multi-Member Group Member)
// Generated by both contacts and account independently using: hmac(aliasPK, GroupID)
bytes alias_resolver = 2;
// alias_proof ensures that the associated alias_resolver has been issued by the right account
// Generated using aliasSKSig(GroupID)
bytes alias_proof = 3;
}
// MultiMemberGroupAdminRoleGranted indicates that a group admin allows another group member to act as an admin
message MultiMemberGroupAdminRoleGranted {
// device_pk is the device sending the event, signs the message, must be the device of an admin of the group
bytes device_pk = 1;
// grantee_member_pk is the member public key of the member granted of the admin role
bytes grantee_member_pk = 2;
}
// MultiMemberGroupInitialMemberAnnounced indicates that a member is the group creator, this event is signed using the group ID private key
message MultiMemberGroupInitialMemberAnnounced {
// member_pk is the public key of the member who is the group creator
bytes member_pk = 1;
}
// GroupAddAdditionalRendezvousSeed indicates that an additional rendezvous point should be used for data synchronization
message GroupAddAdditionalRendezvousSeed {
// device_pk is the device sending the event, signs the message, must be the device of an admin of the group
bytes device_pk = 1;
// seed is the additional rendezvous point seed which should be used
bytes seed = 2;
}
// GroupRemoveAdditionalRendezvousSeed indicates that a previously added rendezvous point should be removed
message GroupRemoveAdditionalRendezvousSeed {
// device_pk is the device sending the event, signs the message, must be the device of an admin of the group
bytes device_pk = 1;
// seed is the additional rendezvous point seed which should be removed
bytes seed = 2;
}
// AccountGroupJoined indicates that the account is now part of a new group
message AccountGroupJoined {
// device_pk is the device sending the event, signs the message
bytes device_pk = 1;
// group describe the joined group
Group group = 2;
}
// AccountGroupLeft indicates that the account has left a group
message AccountGroupLeft {
// device_pk is the device sending the event, signs the message
bytes device_pk = 1;
// group_pk references the group left
bytes group_pk = 2;
}
// AccountContactRequestDisabled indicates that the account should not be advertised on a public rendezvous point
message AccountContactRequestDisabled {
// device_pk is the device sending the event, signs the message
bytes device_pk = 1;
}
// AccountContactRequestEnabled indicates that the account should be advertised on a public rendezvous point
message AccountContactRequestEnabled {
// device_pk is the device sending the event, signs the message
bytes device_pk = 1;
}
// AccountContactRequestReferenceReset indicates that the account should be advertised on different public rendezvous points
message AccountContactRequestReferenceReset {
// device_pk is the device sending the event, signs the message
bytes device_pk = 1;
// public_rendezvous_seed is the new rendezvous point seed
bytes public_rendezvous_seed = 2;
}
// This event should be followed by an AccountGroupJoined event
// This event should be followed by a GroupMemberDeviceAdded event within the AccountGroup
// This event should be followed by a GroupDeviceChainKeyAdded event within the AccountGroup
// AccountContactRequestOutgoingEnqueued indicates that the account will attempt to send a contact request when a matching peer is discovered
message AccountContactRequestOutgoingEnqueued {
// device_pk is the device sending the event, signs the message
bytes device_pk = 1;
// group_pk is the 1to1 group with the requested user
bytes group_pk = 2;
// contact is a message describing how to connect to the other account
ShareableContact contact = 3;
// own_metadata is the identifying metadata that will be shared to the other account
bytes own_metadata = 4;
}
// AccountContactRequestOutgoingSent indicates that the account has sent a contact request
message AccountContactRequestOutgoingSent {
// device_pk is the device sending the account event, signs the message
bytes device_pk = 1;
// contact_pk is the contacted account
bytes contact_pk = 2;
}
// AccountContactRequestIncomingReceived indicates that the account has received a new contact request
message AccountContactRequestIncomingReceived {
// device_pk is the device sending the account event (which received the contact request), signs the message
bytes device_pk = 1;
// contact_pk is the account sending the request
bytes contact_pk = 2;
// TODO: is this necessary?
// contact_rendezvous_seed is the rendezvous seed of the contact sending the request
bytes contact_rendezvous_seed = 3;
// TODO: is this necessary?
// contact_metadata is the metadata specific to the app to identify the contact for the request
bytes contact_metadata = 4;
}
// AccountContactRequestIncomingDiscarded indicates that a contact request has been refused
message AccountContactRequestIncomingDiscarded {
// device_pk is the device sending the event, signs the message
bytes device_pk = 1;
// contact_pk is the contact whom request is refused
bytes contact_pk = 2;
}
// This event should be followed by an AccountGroupJoined event
// This event should be followed by GroupMemberDeviceAdded and GroupDeviceChainKeyAdded events within the AccountGroup
// AccountContactRequestIncomingAccepted indicates that a contact request has been accepted
message AccountContactRequestIncomingAccepted {
// device_pk is the device sending the event, signs the message
bytes device_pk = 1;
// contact_pk is the contact whom request is accepted
bytes contact_pk = 2;
// group_pk is the 1to1 group with the requester user
bytes group_pk = 3;
}
// AccountContactBlocked indicates that a contact is blocked
message AccountContactBlocked {
// device_pk is the device sending the event, signs the message
bytes device_pk = 1;
// contact_pk is the contact blocked
bytes contact_pk = 2;
}
// AccountContactUnblocked indicates that a contact is unblocked
message AccountContactUnblocked {
// device_pk is the device sending the event, signs the message
bytes device_pk = 1;
// contact_pk is the contact unblocked
bytes contact_pk = 2;
}
message GroupReplicating {
// device_pk is the device sending the event, signs the message
bytes device_pk = 1;
// authentication_url indicates which server has been used for authentication
string authentication_url = 2;
// replication_server indicates which server will be used for replication
string replication_server = 3;
}
// ***************************************************************************
// RPC methods inputs and outputs
// ***************************************************************************
message ServiceExportData {
message Request {}
message Reply {
bytes exported_data = 1;
}
}
message ServiceGetConfiguration {
enum SettingState {
Unknown = 0;
Enabled = 1;
Disabled = 2;
Unavailable = 3;
}
message Request {}
message Reply {
// account_pk is the public key of the current account
bytes account_pk = 1;
// device_pk is the public key of the current device
bytes device_pk = 2;
// account_group_pk is the public key of the account group
bytes account_group_pk = 3;
// peer_id is the peer ID of the current IPFS node
string peer_id = 4;
// listeners is the list of swarm listening addresses of the current IPFS node
repeated string listeners = 5;
SettingState ble_enabled = 6;
SettingState wifi_p2p_enabled = 7; // MultiPeerConnectivity for Darwin and Nearby for Android
SettingState mdns_enabled = 8;
SettingState relay_enabled = 9;
}
}
message ContactRequestReference {
message Request {}
message Reply {
// public_rendezvous_seed is the rendezvous seed used by the current account
bytes public_rendezvous_seed = 1;
// enabled indicates if incoming contact requests are enabled
bool enabled = 2;
}
}
message ContactRequestDisable {
message Request {}
message Reply {}
}
message ContactRequestEnable {
message Request {}
message Reply {
// public_rendezvous_seed is the rendezvous seed used by the current account
bytes public_rendezvous_seed = 1;
}
}
message ContactRequestResetReference {
message Request {}
message Reply {
// public_rendezvous_seed is the rendezvous seed used by the current account
bytes public_rendezvous_seed = 1;
}
}
message ContactRequestSend {
message Request {
// contact is a message describing how to connect to the other account
ShareableContact contact = 1;
// own_metadata is the identifying metadata that will be shared to the other account
bytes own_metadata = 2;
}
message Reply {}
}
message ContactRequestAccept {
message Request {
// contact_pk is the identifier of the contact to accept the request from
bytes contact_pk = 1;
}
message Reply {}
}
message ContactRequestDiscard {
message Request {
// contact_pk is the identifier of the contact to ignore the request from
bytes contact_pk = 1;
}
message Reply {}
}
message ShareContact {
message Request {}
message Reply {
// encoded_contact is the Protobuf encoding of the ShareableContact. You can further encode the bytes for sharing, such as base58 or QR code.
bytes encoded_contact = 1;
}
}
message DecodeContact {
message Request {
// encoded_contact is the Protobuf encoding of the shareable contact (as returned by ShareContact).
bytes encoded_contact = 1;
}
message Reply {
// shareable_contact is the decoded shareable contact.
ShareableContact contact = 1;
}
}
message ContactBlock {
message Request {
// contact_pk is the identifier of the contact to block
bytes contact_pk = 1;
}
message Reply {}
}
message ContactUnblock {
message Request {
// contact_pk is the identifier of the contact to unblock
bytes contact_pk = 1;
}
message Reply {}
}
message ContactAliasKeySend {
message Request {
// contact_pk is the identifier of the contact to send the alias public key to
bytes group_pk = 1;
}
message Reply {}
}
message MultiMemberGroupCreate {
message Request {}
message Reply {
// group_pk is the identifier of the newly created group
bytes group_pk = 1;
}
}
message MultiMemberGroupJoin {
message Request {
// group is the information of the group to join
Group group = 1;
}
message Reply {}
}
message MultiMemberGroupLeave {
message Request {
bytes group_pk = 1;
}
message Reply {}
}
message MultiMemberGroupAliasResolverDisclose {
message Request {
// group_pk is the identifier of the group
bytes group_pk = 1;
}
message Reply {}
}
message MultiMemberGroupAdminRoleGrant {
message Request {
// group_pk is the identifier of the group
bytes group_pk = 1;
// member_pk is the identifier of the member which will be granted the admin role
bytes member_pk = 2;
}
message Reply {}
}
message MultiMemberGroupInvitationCreate {
message Request {
// group_pk is the identifier of the group
bytes group_pk = 1;
}
message Reply {
// group is the invitation to the group
Group group = 1;
}
}
message AppMetadataSend {
message Request {
// group_pk is the identifier of the group
bytes group_pk = 1;
// payload is the payload to send
bytes payload = 2;
// attachment_cids is a list of attachment cids
reserved 3; // repeated bytes attachment_cids = 3;
}
message Reply {
bytes cid = 1;
}
}
message AppMessageSend {
message Request {
// group_pk is the identifier of the group
bytes group_pk = 1;
// payload is the payload to send
bytes payload = 2;
// attachment_cids is a list of attachment cids
reserved 3; // repeated bytes attachment_cids = 3;
}
message Reply {
bytes cid = 1;
}
}
message GroupMetadataEvent {
// event_context contains context information about the event
EventContext event_context = 1;
// metadata contains the newly available metadata
GroupMetadata metadata = 2;
// event_clear clear bytes for the event
bytes event = 3;
}
message GroupMessageEvent {
// event_context contains context information about the event
EventContext event_context = 1;
// headers contains headers of the secure message
MessageHeaders headers = 2;
// message contains the secure message payload
bytes message = 3;
}
message GroupMetadataList {
message Request {
// group_pk is the identifier of the group
bytes group_pk = 1;
// since is the lower ID bound used to filter events
// if not set, will return events since the beginning
bytes since_id = 2;
// since_now will list only new event to come
// since_id must not be set
bool since_now = 3;
// until is the upper ID bound used to filter events
// if not set, will subscribe to new events to come
bytes until_id = 4;
// until_now will not list new event to come
// until_id must not be set
bool until_now = 5;
// reverse_order indicates whether the previous events should be returned in
// reverse chronological order
bool reverse_order = 6;
}
}
message GroupMessageList {
message Request {
// group_pk is the identifier of the group
bytes group_pk = 1;
// since is the lower ID bound used to filter events
// if not set, will return events since the beginning
bytes since_id = 2;
// since_now will list only new event to come
// since_id must not be set
bool since_now = 3;
// until is the upper ID bound used to filter events
// if not set, will subscribe to new events to come
bytes until_id = 4;
// until_now will not list new event to come
// until_id must not be set
bool until_now = 5;
// reverse_order indicates whether the previous events should be returned in
// reverse chronological order
bool reverse_order = 6;
}
}
message GroupInfo {
message Request {
// group_pk is the identifier of the group
bytes group_pk = 1;
// contact_pk is the identifier of the contact
bytes contact_pk = 2;
}
message Reply {
// group is the group invitation, containing the group pk and its type
Group group = 1;
// member_pk is the identifier of the current member in the group
bytes member_pk = 2;
// device_pk is the identifier of the current device in the group
bytes device_pk = 3;
}
}
message ActivateGroup {
message Request {
// group_pk is the identifier of the group
bytes group_pk = 1;
// local_only will open the group without enabling network interactions
// with other members
bool local_only = 2;
}
message Reply {
}
}
message DeactivateGroup {
message Request {
// group_pk is the identifier of the group
bytes group_pk = 1;
}
message Reply {
}
}
message GroupDeviceStatus {
enum Type {
TypeUnknown = 0;
TypePeerDisconnected = 1;
TypePeerConnected = 2;
TypePeerReconnecting = 3;
}
enum Transport {
TptUnknown = 0;
TptLAN = 1;
TptWAN = 2;
TptProximity = 3;
}
message Request {
bytes group_pk = 1;
}
message Reply {
message PeerConnected {
string peer_id = 1;
bytes device_pk = 2;
repeated Transport transports = 3;
repeated string maddrs = 4;
}
message PeerReconnecting {
string peer_id = 1;
}
message PeerDisconnected {
string peer_id = 1;
}
Type type = 1;
bytes event = 2;
}
}
message DebugListGroups {
message Request {
}
message Reply {
// group_pk is the public key of the group
bytes group_pk = 1;
// group_type is the type of the group
GroupType group_type = 2;
// contact_pk is the contact public key if appropriate
bytes contact_pk = 3;
}
}
message DebugInspectGroupStore {
message Request {
// group_pk is the identifier of the group
bytes group_pk = 1;
// log_type is the log to inspect
DebugInspectGroupLogType log_type = 2;
}
message Reply {
// cid is the CID of the IPFS log entry
bytes cid = 1;
// parent_cids is the list of the parent entries
repeated bytes parent_cids = 2 ;
// event_type metadata event type if subscribed to metadata events
EventType metadata_event_type = 3;
// device_pk is the public key of the device signing the entry
bytes device_pk = 4;
// payload is the un encrypted entry payload if available
bytes payload = 6;
}
}
message DebugGroup {
message Request {
// group_pk is the identifier of the group
bytes group_pk = 1;
}
message Reply {
// peer_ids is the list of peer ids connected to the same group
repeated string peer_ids = 1 ;
}
}
enum DebugInspectGroupLogType {
DebugInspectGroupLogTypeUndefined = 0;
DebugInspectGroupLogTypeMessage = 1;
DebugInspectGroupLogTypeMetadata = 2;
}
enum ContactState {
ContactStateUndefined = 0;
ContactStateToRequest = 1;
ContactStateReceived = 2;
ContactStateAdded = 3;
ContactStateRemoved = 4;
ContactStateDiscarded = 5;
ContactStateBlocked = 6;
}
message ShareableContact {
// pk is the account to send a contact request to
bytes pk = 1;
// public_rendezvous_seed is the rendezvous seed used by the account to send a contact request to
bytes public_rendezvous_seed = 2;
// metadata is the metadata specific to the app to identify the contact for the request
bytes metadata = 3;
}
message ServiceTokenSupportedService {
string service_type = 1;
string service_endpoint = 2;
}
message ServiceToken {
string token = 1;
string authentication_url = 2 ;
repeated ServiceTokenSupportedService supported_services = 3;
int64 expiration = 4;
}
message CredentialVerificationServiceInitFlow {
message Request {
string service_url = 1;
bytes public_key = 2;
string link = 3;
}
message Reply {
string url = 1;
bool secure_url = 2;
}
}
message CredentialVerificationServiceCompleteFlow {
message Request {
string callback_uri = 1;
}
message Reply {
string identifier = 1;
}
}
message VerifiedCredentialsList {
message Request {
string filter_identifier = 1;
string filter_issuer = 2;
bool exclude_expired = 3;
}
message Reply {
AccountVerifiedCredentialRegistered credential = 1;
}
}
message ReplicationServiceRegisterGroup {
message Request{
bytes group_pk = 1;
string token = 2;
string authentication_url = 3;
string replication_server = 4;
}
message Reply{}
}
message ReplicationServiceReplicateGroup {
message Request {
Group group = 1;
}
message Reply {
bool ok = 1;
}
}
message SystemInfo {
message Request {}
message Reply {
Process process = 1;
P2P p2p = 2;
OrbitDB orbitdb = 3;
repeated string warns = 4;
}
message OrbitDB {
ReplicationStatus account_metadata = 1;
message ReplicationStatus {
int64 progress = 1;
int64 maximum = 2;
int64 buffered = 3;
int64 queued = 4;
}
}
message P2P {
int64 connected_peers = 1;
}
message Process {
string version = 1;
string vcs_ref = 2;
int64 uptime_ms = 3;
int64 user_cpu_time_ms = 10;
int64 system_cpu_time_ms = 11;
int64 started_at = 12;
uint64 rlimit_cur = 13;
int64 num_goroutine = 14;
int64 nofile = 15;
bool too_many_open_files = 16;
int64 num_cpu = 17;
string go_version = 18;
string operating_system = 19;
string host_name = 20;
string arch = 21;
uint64 rlimit_max = 22;
int64 pid = 23;
int64 ppid = 24;
int64 priority = 25;
int64 uid = 26;
string working_dir = 27;
string system_username = 28;
}
}
message PeerList {
message Request {}
message Reply {
repeated Peer peers = 1;
}
message Peer {
// id is the libp2p.PeerID.
string id = 1;
// routes are the list of active and known maddr.
repeated Route routes = 2;
// errors is a list of errors related to the peer.
repeated string errors = 3;
// Features is a list of available features.
repeated Feature features = 4;
// MinLatency is the minimum latency across all the peer routes.
int64 min_latency = 5;
// IsActive is true if at least one of the route is active.
bool is_active = 6;
// Direction is the aggregate of all the routes's direction.
Direction direction = 7;
}
message Route {
// IsActive indicates whether the address is currently used or just known.
bool is_active = 1;
// Address is the multiaddress via which we are connected with the peer.
string address = 2;
// Direction is which way the connection was established.
Direction direction = 3;
// Latency is the last known round trip time to the peer in ms.
int64 latency = 4;
// Streams returns list of streams established with the peer.
repeated Stream streams = 5;
}
message Stream {
// id is an identifier used to write protocol headers in streams.
string id = 1;
}
enum Feature {
UnknownFeature = 0;
WeshFeature = 1;
BLEFeature = 2;
LocalFeature = 3;
TorFeature = 4;
QuicFeature = 5;
}
}
enum Direction {
UnknownDir = 0;
InboundDir = 1;
OutboundDir = 2;
BiDir = 3;
}
// Progress define a generic object that can be used to display a progress bar for long-running actions.
message Progress {
string state = 1;
string doing = 2;
float progress = 3;
uint64 completed = 4;
uint64 total = 5;
uint64 delay = 6;
}
message OutOfStoreMessage {
bytes cid = 1;
bytes device_pk = 2;
fixed64 counter = 3;
bytes sig = 4;
fixed32 flags = 5;
bytes encrypted_payload = 6;
bytes nonce = 7;
}
message OutOfStoreMessageEnvelope {
bytes nonce = 1;
bytes box = 2;
bytes group_reference = 3;
}
message OutOfStoreReceive {
message Request {
bytes payload = 1;
}
message Reply {
OutOfStoreMessage message = 1;
bytes cleartext = 2;
bytes group_public_key = 3;
bool already_received = 4;
}
}
message OutOfStoreSeal {
message Request {
bytes cid = 1;
bytes group_public_key = 2;
}
message Reply {
bytes encrypted = 1;
}
}
message AccountVerifiedCredentialRegistered {
// device_pk is the public key of the device sending the message
bytes device_pk = 1;
bytes signed_identity_public_key = 2;
string verified_credential = 3;
int64 registration_date = 4;
int64 expiration_date = 5;
string identifier = 6;
string issuer = 7;
}
message FirstLastCounters {
uint64 first = 1;
uint64 last = 2;
}
// OrbitDBMessageHeads is the payload sent on orbitdb to share peer's heads
message OrbitDBMessageHeads {
message Box {
string address = 1;
bytes heads = 2;
bytes device_pk = 3;
bytes peer_id = 4;
}
// sealed box should contain encrypted Box
bytes sealed_box = 2;
// current topic used
bytes raw_rotation = 3;
}
message RefreshContactRequest {
message Peer {
// id is the libp2p.PeerID.
string id = 1;
// list of peers multiaddrs.
repeated string addrs = 2;
}
message Request {
bytes contact_pk = 1;
// timeout in second
int64 timeout = 2;
}
message Reply {
// peers found and successfully connected.
repeated Peer peers_found = 1;
}
}
================================================
FILE: api/protocol/replicationtypes/bertyreplication.proto
================================================
syntax = "proto3";
package weshnet.replication.v1;
import "protocoltypes.proto";
import "tagger/tagger.proto";
option go_package = "berty.tech/weshnet/v2/pkg/replicationtypes";
// ReplicationService
service ReplicationService {
// ReplicateGroup
rpc ReplicateGroup(ReplicationServiceReplicateGroup.Request) returns (ReplicationServiceReplicateGroup.Reply);
rpc ReplicateGlobalStats(ReplicateGlobalStats.Request) returns (ReplicateGlobalStats.Reply);
rpc ReplicateGroupStats(ReplicateGroupStats.Request) returns (ReplicateGroupStats.Reply);
}
message ReplicatedGroup {
string public_key = 1 [(tagger.tags) = "gorm:\"primaryKey\""];
string sign_pub = 2;
string link_key = 3;
int64 created_at = 100;
int64 updated_at = 101;
int64 metadata_entries_count = 102;
string metadata_latest_head = 103;
int64 message_entries_count = 104;
string message_latest_head = 105;
}
message ReplicatedGroupToken {
string replicated_group_public_key = 1 [(tagger.tags) = "gorm:\"index;primaryKey;autoIncrement:false\""];
ReplicatedGroup replicated_group = 2;
string token_issuer = 3 [(tagger.tags) = "gorm:\"primaryKey;autoIncrement:false\""];
string token_id = 4 [(tagger.tags) = "gorm:\"primaryKey;autoIncrement:false\""];
int64 created_at = 5;
}
message ReplicationServiceReplicateGroup {
message Request {
weshnet.protocol.v1.Group group = 1;
}
message Reply {
bool ok = 1;
}
}
message ReplicateGlobalStats {
message Request {}
message Reply {
int64 started_at = 1;
int64 replicated_groups = 2;
int64 total_metadata_entries = 3;
int64 total_message_entries = 4;
}
}
message ReplicateGroupStats {
message Request {
string group_public_key = 1;
}
message Reply {
ReplicatedGroup group = 1;
}
}
================================================
FILE: api/protocol/verifiablecredstypes/bertyverifiablecreds.proto
================================================
syntax = "proto3";
package weshnet.account.v1;
option go_package = "berty.tech/weshnet/v2/pkg/verifiablecredstypes";
// StateChallenge serialized and signed state used when requesting a challenge
message StateChallenge {
bytes timestamp = 1;
bytes nonce = 2;
string berty_link = 3;
string redirect_uri = 4;
string state = 5;
}
// StateCode serialized and signed state used when requesting a code
message StateCode {
bytes timestamp = 1;
string berty_link = 2;
CodeStrategy code_strategy = 3;
string identifier = 4;
string code = 5;
string redirect_uri = 6;
string state = 7;
}
message AccountCryptoChallenge {
string challenge = 1;
}
enum FlowType {
FlowTypeUndefined = 0;
// FlowTypeCode asks users a code sent on a side channel
FlowTypeCode = 1;
// FlowTypeAuth currently unimplemented
FlowTypeAuth = 2;
// FlowTypeProof currently unimplemented
FlowTypeProof = 3;
}
enum CodeStrategy {
CodeStrategyUndefined = 0;
// CodeStrategy6Digits currently unimplemented
CodeStrategy6Digits = 1;
// CodeStrategy10Chars currently unimplemented
CodeStrategy10Chars = 2;
// CodeStrategyMocked6Zeroes must only be used in testing
CodeStrategyMocked6Zeroes = 999;
}
================================================
FILE: api_app.go
================================================
package weshnet
import (
"context"
"encoding/base64"
"fmt"
"github.com/ipfs/go-cid"
"go.uber.org/zap"
"google.golang.org/protobuf/proto"
"berty.tech/weshnet/v2/pkg/errcode"
"berty.tech/weshnet/v2/pkg/protocoltypes"
"berty.tech/weshnet/v2/pkg/tyber"
)
func (s *service) AppMetadataSend(ctx context.Context, req *protocoltypes.AppMetadataSend_Request) (_ *protocoltypes.AppMetadataSend_Reply, err error) {
ctx, _, endSection := tyber.Section(ctx, s.logger, fmt.Sprintf("Sending app metadata to group %s", base64.RawURLEncoding.EncodeToString(req.GroupPk)))
defer func() { endSection(err, "") }()
gc, err := s.GetContextGroupForID(req.GroupPk)
if err != nil {
return nil, errcode.ErrCode_ErrGroupMissing.Wrap(err)
}
tyberLogGroupContext(ctx, s.logger, gc)
op, err := gc.MetadataStore().SendAppMetadata(ctx, req.Payload)
if err != nil {
return nil, errcode.ErrCode_ErrOrbitDBAppend.Wrap(err)
}
return &protocoltypes.AppMetadataSend_Reply{Cid: op.GetEntry().GetHash().Bytes()}, nil
}
func (s *service) AppMessageSend(ctx context.Context, req *protocoltypes.AppMessageSend_Request) (_ *protocoltypes.AppMessageSend_Reply, err error) {
ctx, _, endSection := tyber.Section(ctx, s.logger, fmt.Sprintf("Sending message to group %s", base64.RawURLEncoding.EncodeToString(req.GroupPk)))
defer func() { endSection(err, "") }()
gc, err := s.GetContextGroupForID(req.GroupPk)
if err != nil {
return nil, errcode.ErrCode_ErrGroupMissing.Wrap(err)
}
tyberLogGroupContext(ctx, s.logger, gc)
op, err := gc.MessageStore().AddMessage(ctx, req.Payload)
if err != nil {
return nil, errcode.ErrCode_ErrOrbitDBAppend.Wrap(err)
}
return &protocoltypes.AppMessageSend_Reply{Cid: op.GetEntry().GetHash().Bytes()}, nil
}
// OutOfStoreReceive parses a payload received outside a synchronized store
func (s *service) OutOfStoreReceive(ctx context.Context, request *protocoltypes.OutOfStoreReceive_Request) (*protocoltypes.OutOfStoreReceive_Reply, error) {
outOfStoreMessage, group, clearPayload, alreadyDecrypted, err := s.secretStore.OpenOutOfStoreMessage(ctx, request.Payload)
if err != nil {
return nil, errcode.ErrCode_ErrCryptoDecrypt.Wrap(err)
}
return &protocoltypes.OutOfStoreReceive_Reply{
Message: outOfStoreMessage,
Cleartext: clearPayload,
GroupPublicKey: group.PublicKey,
AlreadyReceived: alreadyDecrypted,
}, nil
}
// OutOfStoreSeal creates a payload of a message present in store to be sent outside a synchronized store
func (s *service) OutOfStoreSeal(ctx context.Context, request *protocoltypes.OutOfStoreSeal_Request) (*protocoltypes.OutOfStoreSeal_Reply, error) {
gc, err := s.GetContextGroupForID(request.GroupPublicKey)
if err != nil {
return nil, err
}
_, c, err := cid.CidFromBytes(request.Cid)
if err != nil {
return nil, errcode.ErrCode_ErrInvalidInput.Wrap(err)
}
sealedMessageEnvelope, err := gc.messageStore.GetOutOfStoreMessageEnvelope(ctx, c)
if err != nil {
return nil, errcode.ErrCode_ErrInternal.Wrap(err)
}
sealedMessageEnvelopeBytes, err := proto.Marshal(sealedMessageEnvelope)
if err != nil {
return nil, errcode.ErrCode_ErrSerialization.Wrap(err)
}
return &protocoltypes.OutOfStoreSeal_Reply{
Encrypted: sealedMessageEnvelopeBytes,
}, nil
}
func tyberLogGroupContext(ctx context.Context, logger *zap.Logger, gc *GroupContext) {
memberPK, err := gc.MemberPubKey().Raw()
if err != nil {
memberPK = []byte{}
}
logger.Debug("Got group context", tyber.FormatStepLogFields(ctx, []tyber.Detail{
{Name: "GroupType", Description: gc.Group().GetGroupType().String()},
{Name: "GroupPK", Description: base64.RawURLEncoding.EncodeToString(gc.Group().PublicKey)},
{Name: "MemberPK", Description: base64.RawURLEncoding.EncodeToString(memberPK)},
})...)
}
================================================
FILE: api_client.go
================================================
package weshnet
import (
"context"
"io"
"sync"
"berty.tech/weshnet/v2/pkg/errcode"
"berty.tech/weshnet/v2/pkg/protocoltypes"
"berty.tech/weshnet/v2/pkg/tyber"
)
func (s *service) ServiceExportData(_ *protocoltypes.ServiceExportData_Request, server protocoltypes.ProtocolService_ServiceExportDataServer) (err error) {
ctx, _, endSection := tyber.Section(server.Context(), s.logger, "Exporting protocol instance data")
defer func() { endSection(err, "") }()
r, w := io.Pipe()
var exportErr error
wg := sync.WaitGroup{}
wg.Add(1)
go func() {
defer func() { _ = r.Close() }()
defer wg.Done()
for {
contents := make([]byte, 4096)
l, err := r.Read(contents)
if err == io.EOF {
break
} else if err != nil {
exportErr = errcode.ErrCode_ErrStreamRead.Wrap(err)
break
}
if err := server.Send(&protocoltypes.ServiceExportData_Reply{ExportedData: contents[:l]}); err != nil {
exportErr = errcode.ErrCode_ErrStreamWrite.Wrap(err)
break
}
}
}()
if err := s.export(ctx, w); err != nil {
return errcode.ErrCode_ErrInternal.Wrap(err)
}
_ = w.Close()
wg.Wait()
if exportErr != nil {
return exportErr
}
return nil
}
func (s *service) ServiceGetConfiguration(ctx context.Context, _ *protocoltypes.ServiceGetConfiguration_Request) (*protocoltypes.ServiceGetConfiguration_Reply, error) {
key, err := s.ipfsCoreAPI.Key().Self(ctx)
if err != nil {
return nil, errcode.ErrCode_TODO.Wrap(err)
}
maddrs, err := s.ipfsCoreAPI.Swarm().ListenAddrs(ctx)
if err != nil {
return nil, errcode.ErrCode_TODO.Wrap(err)
}
listeners := make([]string, len(maddrs))
for i, addr := range maddrs {
listeners[i] = addr.String()
}
accountGroup := s.getAccountGroup()
if accountGroup == nil {
return nil, errcode.ErrCode_ErrGroupMissing
}
member, err := accountGroup.MemberPubKey().Raw()
if err != nil {
return nil, errcode.ErrCode_ErrSerialization.Wrap(err)
}
device, err := accountGroup.DevicePubKey().Raw()
if err != nil {
return nil, errcode.ErrCode_ErrSerialization.Wrap(err)
}
return &protocoltypes.ServiceGetConfiguration_Reply{
AccountPk: member,
DevicePk: device,
AccountGroupPk: accountGroup.Group().PublicKey,
PeerId: key.ID().String(),
Listeners: listeners,
}, nil
}
================================================
FILE: api_contact.go
================================================
package weshnet
import (
"context"
"fmt"
"time"
"github.com/libp2p/go-libp2p/core/crypto"
"berty.tech/weshnet/v2/pkg/errcode"
"berty.tech/weshnet/v2/pkg/protocoltypes"
"berty.tech/weshnet/v2/pkg/tyber"
)
func (s *service) ContactAliasKeySend(ctx context.Context, req *protocoltypes.ContactAliasKeySend_Request) (_ *protocoltypes.ContactAliasKeySend_Reply, err error) {
ctx, _, endSection := tyber.Section(ctx, s.logger, "Sending contact alias key")
defer func() { endSection(err, "") }()
g, err := s.GetContextGroupForID(req.GroupPk)
if err != nil {
return nil, errcode.ErrCode_ErrGroupMissing.Wrap(err)
}
if _, err := g.MetadataStore().ContactSendAliasKey(ctx); err != nil {
return nil, errcode.ErrCode_ErrOrbitDBAppend.Wrap(err)
}
return &protocoltypes.ContactAliasKeySend_Reply{}, nil
}
func (s *service) ContactBlock(ctx context.Context, req *protocoltypes.ContactBlock_Request) (_ *protocoltypes.ContactBlock_Reply, err error) {
ctx, _, endSection := tyber.Section(ctx, s.logger, "Blocking contact")
defer func() { endSection(err, "") }()
pk, err := crypto.UnmarshalEd25519PublicKey(req.ContactPk)
if err != nil {
return nil, errcode.ErrCode_ErrDeserialization.Wrap(err)
}
if _, err := s.getAccountGroup().MetadataStore().ContactBlock(ctx, pk); err != nil {
return nil, errcode.ErrCode_ErrOrbitDBAppend.Wrap(err)
}
return &protocoltypes.ContactBlock_Reply{}, nil
}
func (s *service) ContactUnblock(ctx context.Context, req *protocoltypes.ContactUnblock_Request) (_ *protocoltypes.ContactUnblock_Reply, err error) {
ctx, _, endSection := tyber.Section(ctx, s.logger, "Unblocking contact")
defer func() { endSection(err, "") }()
pk, err := crypto.UnmarshalEd25519PublicKey(req.ContactPk)
if err != nil {
return nil, errcode.ErrCode_ErrDeserialization.Wrap(err)
}
if _, err := s.getAccountGroup().MetadataStore().ContactUnblock(ctx, pk); err != nil {
return nil, errcode.ErrCode_ErrOrbitDBAppend.Wrap(err)
}
return &protocoltypes.ContactUnblock_Reply{}, nil
}
func (s *service) RefreshContactRequest(ctx context.Context, req *protocoltypes.RefreshContactRequest_Request) (*protocoltypes.RefreshContactRequest_Reply, error) {
if len(req.ContactPk) == 0 {
return nil, errcode.ErrCode_ErrInternal
}
var cancel context.CancelFunc
if req.Timeout > 0 {
ctx, cancel = context.WithTimeout(ctx, time.Duration(req.Timeout)*time.Second)
} else {
ctx, cancel = context.WithCancel(ctx)
}
defer cancel()
key := string(req.ContactPk)
s.muRefreshprocess.Lock()
if clfn, ok := s.refreshprocess[key]; ok {
clfn() // close previous refresh method
}
s.refreshprocess[key] = cancel
s.muRefreshprocess.Unlock()
peers, err := s.swiper.RefreshContactRequest(ctx, req.ContactPk)
if err != nil {
return nil, fmt.Errorf("unable to refresh group: %w", err)
}
res := &protocoltypes.RefreshContactRequest_Reply{
PeersFound: []*protocoltypes.RefreshContactRequest_Peer{},
}
for _, p := range peers {
// check if we can connect to this peers
if err := s.host.Connect(ctx, p); err != nil {
continue
}
addrs := make([]string, len(p.Addrs))
for i, addr := range p.Addrs {
addrs[i] = addr.String()
}
res.PeersFound = append(res.PeersFound, &protocoltypes.RefreshContactRequest_Peer{
Id: p.ID.String(),
Addrs: addrs,
})
}
return res, nil
}
================================================
FILE: api_contact_request_test.go
================================================
package weshnet
import (
"context"
"testing"
"time"
mocknet "github.com/libp2p/go-libp2p/p2p/net/mock"
"github.com/stretchr/testify/require"
"berty.tech/weshnet/v2/pkg/protocoltypes"
"berty.tech/weshnet/v2/pkg/testutil"
)
func TestShareContact(t *testing.T) {
ctx, cancel := context.WithTimeout(context.Background(), time.Second*20)
defer cancel()
logger, cleanup := testutil.Logger(t)
defer cleanup()
opts := TestingOpts{
Mocknet: mocknet.New(),
Logger: logger,
}
pts, cleanup := NewTestingProtocolWithMockedPeers(ctx, t, &opts, nil, 2)
defer cleanup()
binaryContact, err := pts[0].Client.ShareContact(ctx, &protocoltypes.ShareContact_Request{})
require.NoError(t, err)
// Check that ShareContact reset the contact request reference and enabled contact requests.
contactRequestRef, err := pts[0].Client.ContactRequestReference(ctx,
&protocoltypes.ContactRequestReference_Request{})
require.NoError(t, err)
require.NotEqual(t, 0, len(contactRequestRef.PublicRendezvousSeed))
require.Equal(t, true, contactRequestRef.Enabled)
// Decode.
contact, err := pts[0].Client.DecodeContact(ctx, &protocoltypes.DecodeContact_Request{
EncodedContact: binaryContact.EncodedContact,
})
require.NoError(t, err)
// Check for the expected info.
config, err := pts[0].Client.ServiceGetConfiguration(ctx,
&protocoltypes.ServiceGetConfiguration_Request{})
require.NoError(t, err)
require.Equal(t, contact.Contact.Pk, config.AccountPk)
require.Equal(t, contact.Contact.PublicRendezvousSeed, contactRequestRef.PublicRendezvousSeed)
}
================================================
FILE: api_contactrequest.go
================================================
package weshnet
import (
"context"
"github.com/libp2p/go-libp2p/core/crypto"
"google.golang.org/protobuf/proto"
"berty.tech/weshnet/v2/pkg/errcode"
"berty.tech/weshnet/v2/pkg/protocoltypes"
"berty.tech/weshnet/v2/pkg/tyber"
)
// ContactRequestReference retrieves the necessary information to create a contact link
func (s *service) ContactRequestReference(context.Context, *protocoltypes.ContactRequestReference_Request) (*protocoltypes.ContactRequestReference_Reply, error) {
accountGroup := s.getAccountGroup()
if accountGroup == nil {
return nil, errcode.ErrCode_ErrGroupMissing
}
enabled, shareableContact := accountGroup.MetadataStore().GetIncomingContactRequestsStatus()
rdvSeed := []byte(nil)
if shareableContact != nil {
rdvSeed = shareableContact.PublicRendezvousSeed
}
return &protocoltypes.ContactRequestReference_Reply{
PublicRendezvousSeed: rdvSeed,
Enabled: enabled,
}, nil
}
// ContactRequestDisable disables incoming contact requests
func (s *service) ContactRequestDisable(ctx context.Context, _ *protocoltypes.ContactRequestDisable_Request) (_ *protocoltypes.ContactRequestDisable_Reply, err error) {
ctx, _, endSection := tyber.Section(ctx, s.logger, "Disabling contact requests")
defer func() { endSection(err, "") }()
accountGroup := s.getAccountGroup()
if accountGroup == nil {
return nil, errcode.ErrCode_ErrGroupMissing
}
if _, err := accountGroup.MetadataStore().ContactRequestDisable(ctx); err != nil {
return nil, errcode.ErrCode_ErrOrbitDBAppend.Wrap(err)
}
return &protocoltypes.ContactRequestDisable_Reply{}, nil
}
// ContactRequestEnable enables incoming contact requests
func (s *service) ContactRequestEnable(ctx context.Context, _ *protocoltypes.ContactRequestEnable_Request) (_ *protocoltypes.ContactRequestEnable_Reply, err error) {
ctx, _, endSection := tyber.Section(ctx, s.logger, "Enabling contact requests")
defer func() { endSection(err, "") }()
accountGroup := s.getAccountGroup()
if accountGroup == nil {
return nil, errcode.ErrCode_ErrGroupMissing
}
if _, err := accountGroup.MetadataStore().ContactRequestEnable(ctx); err != nil {
return nil, errcode.ErrCode_ErrOrbitDBAppend.Wrap(err)
}
_, shareableContact := accountGroup.MetadataStore().GetIncomingContactRequestsStatus()
rdvSeed := []byte(nil)
if shareableContact != nil {
rdvSeed = shareableContact.PublicRendezvousSeed
}
return &protocoltypes.ContactRequestEnable_Reply{
PublicRendezvousSeed: rdvSeed,
}, nil
}
// ContactRequestResetReference generates a new contact request reference
func (s *service) ContactRequestResetReference(ctx context.Context, _ *protocoltypes.ContactRequestResetReference_Request) (_ *protocoltypes.ContactRequestResetReference_Reply, err error) {
ctx, _, endSection := tyber.Section(ctx, s.logger, "Resetting contact requests reference")
defer func() { endSection(err, "") }()
accountGroup := s.getAccountGroup()
if accountGroup == nil {
return nil, errcode.ErrCode_ErrGroupMissing
}
if _, err := accountGroup.MetadataStore().ContactRequestReferenceReset(ctx); err != nil {
return nil, errcode.ErrCode_ErrOrbitDBAppend.Wrap(err)
}
_, shareableContact := accountGroup.MetadataStore().GetIncomingContactRequestsStatus()
rdvSeed := []byte(nil)
if shareableContact != nil {
rdvSeed = shareableContact.PublicRendezvousSeed
}
return &protocoltypes.ContactRequestResetReference_Reply{
PublicRendezvousSeed: rdvSeed,
}, nil
}
// ContactRequestSend enqueues a new contact request to be sent
func (s *service) ContactRequestSend(ctx context.Context, req *protocoltypes.ContactRequestSend_Request) (_ *protocoltypes.ContactRequestSend_Reply, err error) {
ctx, _, endSection := tyber.Section(ctx, s.logger, "Sending contact request")
defer func() { endSection(err, "") }()
s.logger.Debug("Contact request info", tyber.FormatStepLogFields(ctx, []tyber.Detail{}, tyber.WithJSONDetail("Request", req))...)
shareableContact := req.Contact
if shareableContact == nil {
return nil, errcode.ErrCode_ErrInvalidInput
}
accountGroup := s.getAccountGroup()
if accountGroup == nil {
return nil, errcode.ErrCode_ErrGroupMissing
}
if _, err := accountGroup.MetadataStore().ContactRequestOutgoingEnqueue(ctx, shareableContact, req.OwnMetadata); err != nil {
return nil, errcode.ErrCode_ErrOrbitDBAppend.Wrap(err)
}
return &protocoltypes.ContactRequestSend_Reply{}, nil
}
// ContactRequestAccept accepts a contact request
func (s *service) ContactRequestAccept(ctx context.Context, req *protocoltypes.ContactRequestAccept_Request) (_ *protocoltypes.ContactRequestAccept_Reply, err error) {
ctx, _, endSection := tyber.Section(ctx, s.logger, "Accepting contact request")
defer func() { endSection(err, "") }()
pk, err := crypto.UnmarshalEd25519PublicKey(req.ContactPk)
if err != nil {
return nil, errcode.ErrCode_ErrDeserialization.Wrap(err)
}
group, err := s.secretStore.GetGroupForContact(pk)
if err != nil {
return nil, errcode.ErrCode_ErrInternal.Wrap(err)
}
accountGroup := s.getAccountGroup()
if accountGroup == nil {
return nil, errcode.ErrCode_ErrGroupMissing
}
if _, err := accountGroup.MetadataStore().ContactRequestIncomingAccept(ctx, pk); err != nil {
return nil, errcode.ErrCode_ErrOrbitDBAppend.Wrap(err)
}
if err = s.secretStore.PutGroup(ctx, group); err != nil {
return nil, err
}
return &protocoltypes.ContactRequestAccept_Reply{}, nil
}
// ContactRequestDiscard ignores a contact request without informing the request sender
func (s *service) ContactRequestDiscard(ctx context.Context, req *protocoltypes.ContactRequestDiscard_Request) (_ *protocoltypes.ContactRequestDiscard_Reply, err error) {
ctx, _, endSection := tyber.Section(ctx, s.logger, "Discarding contact request")
defer func() { endSection(err, "") }()
pk, err := crypto.UnmarshalEd25519PublicKey(req.ContactPk)
if err != nil {
return nil, errcode.ErrCode_ErrDeserialization.Wrap(err)
}
accountGroup := s.getAccountGroup()
if accountGroup == nil {
return nil, errcode.ErrCode_ErrGroupMissing
}
if _, err := accountGroup.MetadataStore().ContactRequestIncomingDiscard(ctx, pk); err != nil {
return nil, errcode.ErrCode_ErrOrbitDBAppend.Wrap(err)
}
return &protocoltypes.ContactRequestDiscard_Reply{}, nil
}
// ShareContact uses ContactRequestReference to get the contact information for the current account and
// returns the Protobuf encoding which you can further encode and share. If needed, his will reset the
// contact request reference and enable contact requests.
func (s *service) ShareContact(ctx context.Context, _ *protocoltypes.ShareContact_Request) (_ *protocoltypes.ShareContact_Reply, err error) {
accountGroup := s.getAccountGroup()
if accountGroup == nil {
return nil, errcode.ErrCode_ErrGroupMissing
}
enabled, shareableContact := accountGroup.MetadataStore().GetIncomingContactRequestsStatus()
rdvSeed := []byte(nil)
if shareableContact != nil {
rdvSeed = shareableContact.PublicRendezvousSeed
}
if !enabled || len(rdvSeed) == 0 {
// We need to enable and reset the contact request reference.
if _, err := accountGroup.MetadataStore().ContactRequestEnable(ctx); err != nil {
return nil, errcode.ErrCode_ErrOrbitDBAppend.Wrap(err)
}
if _, err := accountGroup.MetadataStore().ContactRequestReferenceReset(ctx); err != nil {
return nil, errcode.ErrCode_ErrOrbitDBAppend.Wrap(err)
}
// Refresh the info.
_, shareableContact = accountGroup.MetadataStore().GetIncomingContactRequestsStatus()
rdvSeed = []byte(nil)
if shareableContact != nil {
rdvSeed = shareableContact.PublicRendezvousSeed
}
}
// Get the client's AccountPK.
member, err := accountGroup.MemberPubKey().Raw()
if err != nil {
return nil, errcode.ErrCode_ErrSerialization.Wrap(err)
}
encodedContact, err := proto.Marshal(&protocoltypes.ShareableContact{
Pk: member,
PublicRendezvousSeed: rdvSeed,
})
if err != nil {
return nil, err
}
return &protocoltypes.ShareContact_Reply{
EncodedContact: encodedContact,
}, nil
}
// DecodeContact decodes the Protobuf encoding of a shareable contact which was returned by ShareContact.
func (s *service) DecodeContact(_ context.Context, req *protocoltypes.DecodeContact_Request) (_ *protocoltypes.DecodeContact_Reply, err error) {
contact := &protocoltypes.ShareableContact{}
if err := proto.Unmarshal(req.EncodedContact, contact); err != nil {
panic(err)
}
return &protocoltypes.DecodeContact_Reply{
Contact: contact,
}, nil
}
================================================
FILE: api_debug.go
================================================
package weshnet
import (
"context"
"fmt"
"strings"
"time"
"github.com/libp2p/go-libp2p/core/crypto"
"github.com/libp2p/go-libp2p/core/network"
peer "github.com/libp2p/go-libp2p/core/peer"
"go.uber.org/multierr"
"go.uber.org/zap"
"google.golang.org/protobuf/proto"
"berty.tech/go-orbit-db/stores/operation"
"berty.tech/weshnet/v2/internal/sysutil"
"berty.tech/weshnet/v2/pkg/errcode"
"berty.tech/weshnet/v2/pkg/protocoltypes"
)
func (s *service) DebugListGroups(_ *protocoltypes.DebugListGroups_Request, srv protocoltypes.ProtocolService_DebugListGroupsServer) error {
accountGroup := s.getAccountGroup()
if accountGroup == nil {
return errcode.ErrCode_ErrGroupMissing
}
if err := srv.SendMsg(&protocoltypes.DebugListGroups_Reply{
GroupPk: accountGroup.group.PublicKey,
GroupType: accountGroup.group.GroupType,
}); err != nil {
return err
}
for _, c := range accountGroup.MetadataStore().ListContactsByStatus(protocoltypes.ContactState_ContactStateAdded) {
pk, err := crypto.UnmarshalEd25519PublicKey(c.Pk)
if err != nil {
return errcode.ErrCode_ErrDeserialization.Wrap(err)
}
group, err := s.secretStore.GetGroupForContact(pk)
if err != nil {
return errcode.ErrCode_ErrCryptoKeyGeneration.Wrap(err)
}
if err := srv.SendMsg(&protocoltypes.DebugListGroups_Reply{
GroupPk: group.PublicKey,
GroupType: group.GroupType,
ContactPk: c.Pk,
}); err != nil {
return err
}
}
for _, g := range accountGroup.MetadataStore().ListMultiMemberGroups() {
if err := srv.SendMsg(&protocoltypes.DebugListGroups_Reply{
GroupPk: g.PublicKey,
GroupType: g.GroupType,
}); err != nil {
return err
}
}
return nil
}
func (s *service) DebugInspectGroupStore(req *protocoltypes.DebugInspectGroupStore_Request, srv protocoltypes.ProtocolService_DebugInspectGroupStoreServer) error {
if req.LogType == protocoltypes.DebugInspectGroupLogType_DebugInspectGroupLogTypeUndefined {
return errcode.ErrCode_ErrInvalidInput.Wrap(fmt.Errorf("invalid log type specified"))
}
cg, err := s.GetContextGroupForID(req.GroupPk)
if err != nil {
return errcode.ErrCode_ErrInvalidInput.Wrap(err)
}
switch req.LogType {
case protocoltypes.DebugInspectGroupLogType_DebugInspectGroupLogTypeMessage:
for _, e := range cg.messageStore.OpLog().GetEntries().Slice() {
var (
payload = []byte(nil)
devicePK = []byte(nil)
nexts = make([][]byte, len(e.GetNext()))
)
if evt, err := cg.messageStore.openMessage(srv.Context(), e); err != nil {
s.logger.Error("unable to open message", zap.Error(err))
} else {
devicePK = evt.Headers.DevicePk
payload = evt.Message
}
for i, n := range e.GetNext() {
nexts[i] = n.Bytes()
}
if err := srv.SendMsg(&protocoltypes.DebugInspectGroupStore_Reply{
Cid: e.GetHash().Bytes(),
ParentCids: nexts,
DevicePk: devicePK,
Payload: payload,
}); err != nil {
return err
}
}
case protocoltypes.DebugInspectGroupLogType_DebugInspectGroupLogTypeMetadata:
log := cg.metadataStore.OpLog()
for _, e := range log.GetEntries().Slice() {
var (
eventType protocoltypes.EventType
payload = []byte(nil)
devicePK = []byte(nil)
nexts = make([][]byte, len(e.GetNext()))
)
if op, err := operation.ParseOperation(e); err != nil {
s.logger.Error("unable to parse operation", zap.Error(err))
} else if meta, event, err := openGroupEnvelope(cg.group, op.GetValue()); err != nil {
s.logger.Error("unable to open group envelope", zap.Error(err))
} else if metaEvent, err := newGroupMetadataEventFromEntry(log, e, meta, event, cg.group); err != nil {
s.logger.Error("unable to get group metadata event from entry", zap.Error(err))
} else {
payload = metaEvent.Event
eventType = metaEvent.Metadata.EventType
if typeData, ok := eventTypesMapper[metaEvent.Metadata.EventType]; ok {
p := proto.Clone(typeData.Message)
if err := proto.Unmarshal(metaEvent.Event, p); err == nil {
if msg, ok := p.(eventDeviceSigned); ok {
devicePK = msg.GetDevicePk()
}
}
} else {
s.logger.Error("unable to get message struct for event type", zap.String("event_type", metaEvent.Metadata.EventType.String()))
}
}
for i, n := range e.GetNext() {
nexts[i] = n.Bytes()
}
if err := srv.SendMsg(&protocoltypes.DebugInspectGroupStore_Reply{
Cid: e.GetHash().Bytes(),
ParentCids: nexts,
Payload: payload,
MetadataEventType: eventType,
DevicePk: devicePK,
}); err != nil {
return err
}
}
}
return nil
}
func (s *service) DebugGroup(ctx context.Context, request *protocoltypes.DebugGroup_Request) (*protocoltypes.DebugGroup_Reply, error) {
rep := &protocoltypes.DebugGroup_Reply{}
peers, err := s.ipfsCoreAPI.Swarm().Peers(ctx)
if err != nil {
return nil, err
}
topic := fmt.Sprintf("grp_%s", string(request.GroupPk))
for _, p := range peers {
tagInfo := s.ipfsCoreAPI.ConnMgr().GetTagInfo(p.ID())
if _, ok := tagInfo.Tags[topic]; ok {
rep.PeerIds = append(rep.PeerIds, p.ID().String())
}
}
return rep, nil
}
func (s *service) SystemInfo(ctx context.Context, _ *protocoltypes.SystemInfo_Request) (*protocoltypes.SystemInfo_Reply, error) {
reply := protocoltypes.SystemInfo_Reply{}
// process
process, errs := sysutil.SystemInfoProcess()
reply.Process = process
reply.Process.StartedAt = s.startedAt.Unix()
reply.Process.UptimeMs = time.Since(s.startedAt).Milliseconds()
// gRPC
// TODO
// p2p
{
reply.P2P = &protocoltypes.SystemInfo_P2P{}
// swarm metrics
if api := s.IpfsCoreAPI(); api != nil {
peers, err := api.Swarm().Peers(ctx)
reply.P2P.ConnectedPeers = int64(len(peers))
errs = multierr.Append(errs, err)
} else {
errs = multierr.Append(errs, fmt.Errorf("no such IPFS core API"))
}
// pubsub metrics
// TODO
// BLE metrics
}
// OrbitDB
accountGroup := s.getAccountGroup()
if accountGroup == nil {
return nil, errcode.ErrCode_ErrGroupMissing
}
status := accountGroup.metadataStore.ReplicationStatus()
reply.Orbitdb = &protocoltypes.SystemInfo_OrbitDB{
AccountMetadata: &protocoltypes.SystemInfo_OrbitDB_ReplicationStatus{
Progress: int64(status.GetProgress()),
Maximum: int64(status.GetMax()),
},
}
// FIXME: compute more stores
// warns
if errs != nil {
reply.Warns = []string{}
for _, err := range multierr.Errors(errs) {
reply.Warns = append(reply.Warns, err.Error())
}
}
return &reply, nil
}
func (s *service) PeerList(ctx context.Context, _ *protocoltypes.PeerList_Request) (*protocoltypes.PeerList_Reply, error) {
reply := protocoltypes.PeerList_Reply{}
api := s.IpfsCoreAPI()
if api == nil {
return nil, errcode.ErrCode_TODO.Wrap(fmt.Errorf("IPFS Core API is not available"))
}
swarmPeers, err := api.Swarm().Peers(ctx) // https://pkg.go.dev/github.com/ipfs/interface-go-ipfs-core#ConnectionInfo
if err != nil {
return nil, errcode.ErrCode_TODO.Wrap(err)
}
peers := map[peer.ID]*protocoltypes.PeerList_Peer{}
// each peer in the swarm should be visible
for _, swarmPeer := range swarmPeers {
peers[swarmPeer.ID()] = &protocoltypes.PeerList_Peer{
Id: swarmPeer.ID().String(),
Errors: []string{},
Routes: []*protocoltypes.PeerList_Route{},
}
}
// FIXME: do not restrict on swarm peers, also print some other important ones (old, etc)
// append peer addrs from peerstore
for peerID, peer := range peers {
info := s.host.Peerstore().PeerInfo(peerID)
for _, addr := range info.Addrs {
peer.Routes = append(peer.Routes, &protocoltypes.PeerList_Route{
Address: addr.String(),
})
}
}
// append more info for active connections
for _, swarmPeer := range swarmPeers {
peer, ok := peers[swarmPeer.ID()]
if !ok {
peer = &protocoltypes.PeerList_Peer{
Id: swarmPeer.ID().String(),
Errors: []string{},
Routes: []*protocoltypes.PeerList_Route{},
}
peer.Errors = append(peer.Errors, "peer in swarm peers, but not in peerstore")
peers[swarmPeer.ID()] = peer
}
address := swarmPeer.Address().String()
found := false
var selectedRoute *protocoltypes.PeerList_Route
for _, route := range peer.Routes {
if route.Address == address {
found = true
selectedRoute = route
}
}
if !found {
newRoute := protocoltypes.PeerList_Route{Address: address}
peer.Routes = append(peer.Routes, &newRoute)
selectedRoute = &newRoute
}
selectedRoute.IsActive = true
// latency
{
latency, err := swarmPeer.Latency()
if err != nil {
peer.Errors = append(peer.Errors, err.Error())
} else {
selectedRoute.Latency = latency.Milliseconds()
}
}
// direction
{
switch swarmPeer.Direction() {
case network.DirInbound:
selectedRoute.Direction = protocoltypes.Direction_InboundDir
case network.DirOutbound:
selectedRoute.Direction = protocoltypes.Direction_OutboundDir
}
}
// streams
{
peerStreams, err := swarmPeer.Streams()
if err != nil {
peer.Errors = append(peer.Errors, err.Error())
} else {
selectedRoute.Streams = []*protocoltypes.PeerList_Stream{}
for _, peerStream := range peerStreams {
if peerStream == "" {
continue
}
selectedRoute.Streams = append(selectedRoute.Streams, &protocoltypes.PeerList_Stream{
Id: string(peerStream),
})
}
}
}
}
// compute features
for _, peer := range peers {
features := map[protocoltypes.PeerList_Feature]bool{}
for _, route := range peer.Routes {
// FIXME: use the multiaddr library instead of string comparisons
if strings.Contains(route.Address, "/quic") {
features[protocoltypes.PeerList_QuicFeature] = true
}
if strings.Contains(route.Address, "/mc/") {
features[protocoltypes.PeerList_BLEFeature] = true
features[protocoltypes.PeerList_WeshFeature] = true
}
if strings.Contains(route.Address, "/tor/") {
features[protocoltypes.PeerList_TorFeature] = true
}
for _, stream := range route.Streams {
if stream.Id == "/wesh/contact_req/1.0.0" {
features[protocoltypes.PeerList_WeshFeature] = true
}
if stream.Id == "/rendezvous/1.0.0" {
features[protocoltypes.PeerList_WeshFeature] = true
}
}
}
for feature := range features {
peer.Features = append(peer.Features, feature)
}
}
// compute peer-level aggregates
for _, peer := range peers {
// aggregate direction
for _, route := range peer.Routes {
if route.Direction == protocoltypes.Direction_UnknownDir {
continue
}
switch {
case peer.Direction == protocoltypes.Direction_UnknownDir: // first route with a direction
peer.Direction = route.Direction
case peer.Direction == protocoltypes.Direction_BiDir: // peer aggregate is already maximal
// noop
case route.Direction == peer.Direction: // another route with the same direction
// noop
case route.Direction == protocoltypes.Direction_InboundDir && peer.Direction == protocoltypes.Direction_OutboundDir:
peer.Direction = protocoltypes.Direction_BiDir
case route.Direction == protocoltypes.Direction_OutboundDir && peer.Direction == protocoltypes.Direction_InboundDir:
peer.Direction = protocoltypes.Direction_BiDir
default:
peer.Errors = append(peer.Errors, "failed to compute direction aggregate")
}
}
// aggregate latency
for _, route := range peer.Routes {
if route.Latency == 0 {
continue
}
switch {
case peer.MinLatency == 0: // first route with a latency
peer.MinLatency = route.Latency
case peer.MinLatency > route.Latency: // smaller value
peer.MinLatency = route.Latency
}
}
// aggregate isActive
for _, route := range peer.Routes {
if route.IsActive {
peer.IsActive = true
break
}
}
}
// FIXME: compute pubsub peers too?
// FIXME: add metrics about "amount of times seen", "first time seen", "bandwidth"
// use protobuf format
for _, peer := range peers {
reply.Peers = append(reply.Peers, peer)
}
return &reply, nil
}
================================================
FILE: api_event.go
================================================
package weshnet
import (
"context"
"errors"
"fmt"
"github.com/libp2p/go-libp2p/p2p/host/eventbus"
"berty.tech/weshnet/v2/pkg/errcode"
"berty.tech/weshnet/v2/pkg/protocoltypes"
)
func checkParametersConsistency(sinceID, untilID []byte, sinceNow, untilNow, reverseOrder bool) error {
// Since can't be both set to an ID and to now
if sinceID != nil && sinceNow {
return errcode.ErrCode_ErrInvalidInput.Wrap(errors.New("params SinceNow and SinceID are both set"))
}
// Until can't be both set to an ID and to now
if untilID != nil && untilNow {
return errcode.ErrCode_ErrInvalidInput.Wrap(errors.New("params UntilNow and UntilID are both set"))
}
// Since and Until can't be both set to now at the same time
if sinceNow && untilNow {
return errcode.ErrCode_ErrInvalidInput.Wrap(errors.New("params SinceNow and UntilNow are both set"))
}
// Can't reverse events orders if subscribed to new events
if untilID == nil && !untilNow && reverseOrder {
return errcode.ErrCode_ErrInvalidInput.Wrap(errors.New("reverse chronological order requested while subscribing to new events"))
}
return nil
}
// GroupMetadataList replays previous and subscribes to new metadata events from the group
func (s *service) GroupMetadataList(req *protocoltypes.GroupMetadataList_Request, sub protocoltypes.ProtocolService_GroupMetadataListServer) error {
ctx, cancel := context.WithCancel(sub.Context())
defer cancel()
// Get group context / check if the group is opened
cg, err := s.GetContextGroupForID(req.GroupPk)
if err != nil {
return errcode.ErrCode_ErrGroupMemberUnknownGroupID.Wrap(err)
}
// Check parameters consistency
if err := checkParametersConsistency(req.SinceId, req.UntilId, req.SinceNow, req.UntilNow, req.ReverseOrder); err != nil {
return err
}
// Subscribe to new metadata events if requested
var newEvents <-chan any
if req.UntilId == nil && !req.UntilNow {
sub, err := cg.MetadataStore().EventBus().Subscribe([]any{
// new(stores.EventReplicated),
new(*protocoltypes.GroupMetadataEvent),
}, eventbus.Name("weshnet/api/group-metadata-list"), eventbus.BufSize(32))
if err != nil {
return fmt.Errorf("unable to subscribe to new events")
}
defer sub.Close()
newEvents = sub.Out()
}
// Subscribe to previous metadata events and stream them if requested
previousEvents := make(chan *protocoltypes.GroupMetadataEvent)
if !req.SinceNow {
pevt, err := cg.MetadataStore().ListEvents(ctx, req.SinceId, req.UntilId, req.ReverseOrder)
if err != nil {
return err
}
go func() {
for {
var evt *protocoltypes.GroupMetadataEvent
select {
case <-ctx.Done():
return
case evt = <-pevt:
}
if evt == nil {
// if we don't want to stream new event, cancel the process
if req.UntilNow {
cancel()
} else {
previousEvents <- &protocoltypes.GroupMetadataEvent{EventContext: nil}
}
cg.logger.Debug("GroupMetadataList: previous events stream ended")
return
}
previousEvents <- evt
}
}()
}
// Subscribe to new metadata events and stream them if requested
for {
var event any
select {
case <-ctx.Done():
return nil
case event = <-previousEvents:
case event = <-newEvents:
}
msg := event.(*protocoltypes.GroupMetadataEvent)
if msg.EventContext == nil {
continue
}
if err := sub.Send(msg); err != nil {
return err
}
cg.logger.Info("service - metadata store - sent 1 event from log subscription")
}
}
// GroupMessageList replays previous and subscribes to new message events from the group
func (s *service) GroupMessageList(req *protocoltypes.GroupMessageList_Request, sub protocoltypes.ProtocolService_GroupMessageListServer) error {
ctx, cancel := context.WithCancel(sub.Context())
defer cancel()
// Get group context / check if the group is opened
cg, err := s.GetContextGroupForID(req.GroupPk)
if err != nil {
return errcode.ErrCode_ErrGroupMemberUnknownGroupID.Wrap(err)
}
// Check parameters consistency
if err := checkParametersConsistency(req.SinceId, req.UntilId, req.SinceNow, req.UntilNow, req.ReverseOrder); err != nil {
return err
}
// Subscribe to new message events if requested
var newEvents <-chan any
if req.UntilId == nil && !req.UntilNow {
messageStoreSub, err := cg.MessageStore().EventBus().Subscribe([]any{
new(*protocoltypes.GroupMessageEvent),
}, eventbus.Name("weshnet/api/group-message-list"))
if err != nil {
return fmt.Errorf("unable to subscribe to new events")
}
defer messageStoreSub.Close()
newEvents = messageStoreSub.Out()
}
// Subscribe to previous message events and stream them if requested
previousEvents := make(chan *protocoltypes.GroupMessageEvent)
if !req.SinceNow {
pevt, err := cg.MessageStore().ListEvents(ctx, req.SinceId, req.UntilId, req.ReverseOrder)
if err != nil {
return err
}
go func() {
for {
var evt *protocoltypes.GroupMessageEvent
select {
case <-ctx.Done():
return
case evt = <-pevt:
}
if evt == nil {
// if we don't want to stream new event, cancel the process
if req.UntilNow {
cancel()
} else {
previousEvents <- &protocoltypes.GroupMessageEvent{EventContext: nil}
}
cg.logger.Debug("GroupMessageList: previous events stream ended")
return
}
previousEvents <- evt
}
}()
}
// Subscribe to new message events and stream them if requested
for {
var event any
select {
case <-ctx.Done():
return nil
case event = <-previousEvents:
case event = <-newEvents:
}
msg := event.(*protocoltypes.GroupMessageEvent)
if msg.EventContext == nil {
continue
}
if err := sub.Send(msg); err != nil {
return err
}
cg.logger.Info("service - message store - sent 1 event from log subscription")
}
}
================================================
FILE: api_group.go
================================================
package weshnet
import (
"context"
"encoding/base64"
"encoding/hex"
"fmt"
"github.com/libp2p/go-libp2p/core/crypto"
peer "github.com/libp2p/go-libp2p/core/peer"
manet "github.com/multiformats/go-multiaddr/net"
"go.uber.org/zap"
"google.golang.org/protobuf/proto"
"berty.tech/weshnet/v2/pkg/errcode"
"berty.tech/weshnet/v2/pkg/logutil"
"berty.tech/weshnet/v2/pkg/protocoltypes"
)
func (s *service) GroupInfo(ctx context.Context, req *protocoltypes.GroupInfo_Request) (*protocoltypes.GroupInfo_Reply, error) {
var (
g *protocoltypes.Group
err error
)
switch {
case req.GroupPk != nil:
pk, err := crypto.UnmarshalEd25519PublicKey(req.GroupPk)
if err != nil {
return nil, errcode.ErrCode_ErrInvalidInput.Wrap(err)
}
g, err = s.getGroupForPK(ctx, pk)
if err != nil {
return nil, errcode.ErrCode_TODO.Wrap(err)
}
case req.ContactPk != nil:
pk, err := crypto.UnmarshalEd25519PublicKey(req.ContactPk)
if err != nil {
return nil, errcode.ErrCode_ErrInvalidInput.Wrap(err)
}
g, err = s.getContactGroup(pk)
if err != nil {
return nil, errcode.ErrCode_ErrOrbitDBOpen.Wrap(err)
}
default:
return nil, errcode.ErrCode_ErrInvalidInput
}
memberDevice, err := s.secretStore.GetOwnMemberDeviceForGroup(g)
if err != nil {
return nil, errcode.ErrCode_TODO.Wrap(err)
}
member, err := memberDevice.Member().Raw()
if err != nil {
return nil, errcode.ErrCode_ErrSerialization.Wrap(err)
}
device, err := memberDevice.Device().Raw()
if err != nil {
return nil, errcode.ErrCode_ErrSerialization.Wrap(err)
}
return &protocoltypes.GroupInfo_Reply{
Group: g,
MemberPk: member,
DevicePk: device,
}, nil
}
func (s *service) ActivateGroup(ctx context.Context, req *protocoltypes.ActivateGroup_Request) (*protocoltypes.ActivateGroup_Reply, error) {
pk, err := crypto.UnmarshalEd25519PublicKey(req.GroupPk)
if err != nil {
return nil, errcode.ErrCode_ErrInvalidInput.Wrap(err)
}
err = s.activateGroup(ctx, pk, req.LocalOnly)
if err != nil {
return nil, errcode.ErrCode_ErrInternal.Wrap(err)
}
return &protocoltypes.ActivateGroup_Reply{}, nil
}
func (s *service) DeactivateGroup(_ context.Context, req *protocoltypes.DeactivateGroup_Request) (*protocoltypes.DeactivateGroup_Reply, error) {
pk, err := crypto.UnmarshalEd25519PublicKey(req.GroupPk)
if err != nil {
return nil, errcode.ErrCode_ErrInvalidInput.Wrap(err)
}
if err := s.deactivateGroup(pk); err != nil {
return nil, errcode.ErrCode_ErrInternal.Wrap(err)
}
return &protocoltypes.DeactivateGroup_Reply{}, nil
}
func (s *service) GroupDeviceStatus(req *protocoltypes.GroupDeviceStatus_Request, srv protocoltypes.ProtocolService_GroupDeviceStatusServer) error {
ctx := srv.Context()
gkey := hex.EncodeToString(req.GroupPk)
peers := PeersConnectedness{}
logger := s.logger.Named("pstatus")
logger.Debug("start monitor device status group", logutil.PrivateString("group_key", gkey))
for {
updated, ok := s.peerStatusManager.WaitForConnectednessChange(ctx, gkey, peers)
if !ok {
return nil // server context has expired
}
// send updated peers
var err error
for _, peer := range updated {
var evt protocoltypes.GroupDeviceStatus_Reply
switch peers[peer] {
case ConnectednessTypeConnected:
evt.Type = protocoltypes.GroupDeviceStatus_TypePeerConnected
var connected *protocoltypes.GroupDeviceStatus_Reply_PeerConnected
if connected, err = s.craftPeerConnectedMessage(peer); err == nil {
evt.Event, err = proto.Marshal(connected)
logger.Debug("peer connected",
logutil.PrivateString("group_key", gkey),
logutil.PrivateString("peer", connected.PeerId),
logutil.PrivateString("devicePK", base64.URLEncoding.EncodeToString(connected.GetDevicePk())))
}
case ConnectednessTypeDisconnected:
evt.Type = protocoltypes.GroupDeviceStatus_TypePeerDisconnected
disconnected := s.craftDeviceDisconnectedMessage(peer)
logger.Debug("peer disconnected",
logutil.PrivateString("group_key", gkey),
logutil.PrivateString("peer", disconnected.PeerId))
evt.Event, err = proto.Marshal(disconnected)
case ConnectednessTypeReconnecting:
evt.Type = protocoltypes.GroupDeviceStatus_TypePeerConnected
reconnecting := s.craftDeviceReconnectedMessage(peer)
logger.Debug("peer reconnecting",
logutil.PrivateString("group_key", gkey),
logutil.PrivateString("peer", reconnecting.PeerId))
evt.Event, err = proto.Marshal(reconnecting)
default:
evt.Type = protocoltypes.GroupDeviceStatus_TypeUnknown
}
if err != nil {
logger.Error("GroupDeviceStatus: unable to handle event", zap.Error(err))
continue
}
if err := srv.Send(&evt); err != nil {
logger.Debug("GroupDeviceStatus: failed to send event", zap.Error(err))
return err
}
}
}
}
func (s *service) craftPeerConnectedMessage(peer peer.ID) (*protocoltypes.GroupDeviceStatus_Reply_PeerConnected, error) {
pdg, ok := s.odb.GetDevicePKForPeerID(peer)
if !ok {
return nil, fmt.Errorf("PeerDeviceGroup unknown")
}
devicePKRaw, err := pdg.DevicePK.Raw()
if err != nil {
return nil, fmt.Errorf("unable to get raw devicePK: %w", err)
}
connected := protocoltypes.GroupDeviceStatus_Reply_PeerConnected{
PeerId: peer.String(),
DevicePk: devicePKRaw,
}
activeConns := s.host.Network().ConnsToPeer(peer)
connected.Transports = make([]protocoltypes.GroupDeviceStatus_Transport, len(activeConns))
connected.Maddrs = make([]string, len(activeConns))
CONN_LOOP:
for i, conn := range activeConns {
connected.Maddrs[i] = conn.RemoteMultiaddr().String()
// check for proximity transport
protocols := conn.RemoteMultiaddr().Protocols()
for _, protocol := range protocols {
switch protocol.Name {
case "nearby", "mc", "ble":
connected.Transports[i] = protocoltypes.GroupDeviceStatus_TptProximity
continue CONN_LOOP
}
}
// otherwise, check for WAN/LAN addr
if manet.IsPrivateAddr(conn.RemoteMultiaddr()) {
connected.Transports[i] = protocoltypes.GroupDeviceStatus_TptLAN
} else {
connected.Transports[i] = protocoltypes.GroupDeviceStatus_TptWAN
}
}
return &connected, nil
}
func (s *service) craftDeviceDisconnectedMessage(peer peer.ID) *protocoltypes.GroupDeviceStatus_Reply_PeerDisconnected {
return &protocoltypes.GroupDeviceStatus_Reply_PeerDisconnected{
PeerId: peer.String(),
}
}
func (s *service) craftDeviceReconnectedMessage(peer peer.ID) *protocoltypes.GroupDeviceStatus_Reply_PeerReconnecting {
return &protocoltypes.GroupDeviceStatus_Reply_PeerReconnecting{
PeerId: peer.String(),
}
}
================================================
FILE: api_multimember.go
================================================
package weshnet
import (
"context"
"fmt"
"github.com/libp2p/go-libp2p/core/crypto"
"berty.tech/weshnet/v2/pkg/errcode"
"berty.tech/weshnet/v2/pkg/protocoltypes"
"berty.tech/weshnet/v2/pkg/tyber"
)
// MultiMemberGroupCreate creates a new MultiMember group
func (s *service) MultiMemberGroupCreate(ctx context.Context, _ *protocoltypes.MultiMemberGroupCreate_Request) (_ *protocoltypes.MultiMemberGroupCreate_Reply, err error) {
ctx, _, endSection := tyber.Section(ctx, s.logger, "Creating MultiMember group")
defer func() { endSection(err, "") }()
group, groupPrivateKey, err := NewGroupMultiMember()
if err != nil {
return nil, errcode.ErrCode_ErrCryptoKeyGeneration.Wrap(err)
}
accountGroup := s.getAccountGroup()
if accountGroup == nil {
return nil, errcode.ErrCode_ErrGroupMissing
}
_, err = accountGroup.MetadataStore().GroupJoin(ctx, group)
if err != nil {
return nil, errcode.ErrCode_ErrOrbitDBAppend.Wrap(err)
}
if err := s.secretStore.PutGroup(ctx, group); err != nil {
return nil, errcode.ErrCode_ErrInternal.Wrap(err)
}
err = s.activateGroup(ctx, groupPrivateKey.GetPublic(), false)
if err != nil {
return nil, errcode.ErrCode_ErrInternal.Wrap(fmt.Errorf("unable to activate group: %w", err))
}
cg, err := s.GetContextGroupForID(group.PublicKey)
if err != nil {
return nil, errcode.ErrCode_ErrOrbitDBAppend.Wrap(err)
}
_, err = cg.MetadataStore().ClaimGroupOwnership(ctx, groupPrivateKey)
if err != nil {
return nil, errcode.ErrCode_ErrOrbitDBAppend.Wrap(err)
}
return &protocoltypes.MultiMemberGroupCreate_Reply{
GroupPk: group.PublicKey,
}, nil
}
// MultiMemberGroupJoin joins an existing MultiMember group using an invitation
func (s *service) MultiMemberGroupJoin(ctx context.Context, req *protocoltypes.MultiMemberGroupJoin_Request) (_ *protocoltypes.MultiMemberGroupJoin_Reply, err error) {
ctx, _, endSection := tyber.Section(ctx, s.logger, "Joining MultiMember group")
defer func() { endSection(err, "") }()
accountGroup := s.getAccountGroup()
if accountGroup == nil {
return nil, errcode.ErrCode_ErrGroupMissing
}
if _, err := accountGroup.MetadataStore().GroupJoin(ctx, req.Group); err != nil {
return nil, errcode.ErrCode_ErrOrbitDBAppend.Wrap(err)
}
return &protocoltypes.MultiMemberGroupJoin_Reply{}, nil
}
// MultiMemberGroupLeave leaves a previously joined MultiMember group
func (s *service) MultiMemberGroupLeave(ctx context.Context, req *protocoltypes.MultiMemberGroupLeave_Request) (_ *protocoltypes.MultiMemberGroupLeave_Reply, err error) {
ctx, _, endSection := tyber.Section(ctx, s.logger, "Leaving MultiMember group")
defer func() { endSection(err, "") }()
pk, err := crypto.UnmarshalEd25519PublicKey(req.GroupPk)
if err != nil {
return nil, errcode.ErrCode_ErrDeserialization.Wrap(err)
}
accountGroup := s.getAccountGroup()
if accountGroup == nil {
return nil, errcode.ErrCode_ErrGroupMissing
}
_, err = accountGroup.MetadataStore().GroupLeave(ctx, pk)
if err != nil {
return nil, errcode.ErrCode_ErrOrbitDBAppend.Wrap(err)
}
if err := s.deactivateGroup(pk); err != nil {
return nil, errcode.ErrCode_ErrOrbitDBAppend.Wrap(err)
}
return &protocoltypes.MultiMemberGroupLeave_Reply{}, nil
}
// MultiMemberGroupAliasResolverDisclose sends an deviceKeystore identity proof to the group members
func (s *service) MultiMemberGroupAliasResolverDisclose(ctx context.Context, req *protocoltypes.MultiMemberGroupAliasResolverDisclose_Request) (*protocoltypes.MultiMemberGroupAliasResolverDisclose_Reply, error) {
cg, err := s.GetContextGroupForID(req.GroupPk)
if err != nil {
return nil, errcode.ErrCode_ErrGroupMemberUnknownGroupID.Wrap(err)
}
_, err = cg.MetadataStore().SendAliasProof(ctx)
if err != nil {
return nil, errcode.ErrCode_ErrOrbitDBAppend.Wrap(err)
}
return &protocoltypes.MultiMemberGroupAliasResolverDisclose_Reply{}, nil
}
// MultiMemberGroupAdminRoleGrant grants admin role to another member of the group
func (s *service) MultiMemberGroupAdminRoleGrant(context.Context, *protocoltypes.MultiMemberGroupAdminRoleGrant_Request) (*protocoltypes.MultiMemberGroupAdminRoleGrant_Reply, error) {
return nil, errcode.ErrCode_ErrNotImplemented
}
// MultiMemberGroupInvitationCreate creates a group invitation
func (s *service) MultiMemberGroupInvitationCreate(_ context.Context, req *protocoltypes.MultiMemberGroupInvitationCreate_Request) (*protocoltypes.MultiMemberGroupInvitationCreate_Reply, error) {
cg, err := s.GetContextGroupForID(req.GroupPk)
if err != nil {
return nil, errcode.ErrCode_ErrGroupMemberUnknownGroupID.Wrap(err)
}
return &protocoltypes.MultiMemberGroupInvitationCreate_Reply{
Group: cg.Group(),
}, nil
}
================================================
FILE: api_replication.go
================================================
package weshnet
import (
"context"
"crypto/tls"
"encoding/base64"
"fmt"
"go.uber.org/zap"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials"
"google.golang.org/grpc/credentials/insecure"
"berty.tech/weshnet/v2/pkg/errcode"
"berty.tech/weshnet/v2/pkg/grpcutil"
"berty.tech/weshnet/v2/pkg/logutil"
"berty.tech/weshnet/v2/pkg/protocoltypes"
"berty.tech/weshnet/v2/pkg/replicationtypes"
"berty.tech/weshnet/v2/pkg/tyber"
)
func FilterGroupForReplication(m *protocoltypes.Group) (*protocoltypes.Group, error) {
groupSigPK, err := m.GetSigningPubKey()
if err != nil {
return nil, errcode.ErrCode_TODO.Wrap(err)
}
groupSigPKBytes, err := groupSigPK.Raw()
if err != nil {
return nil, errcode.ErrCode_ErrSerialization.Wrap(err)
}
linkKey, err := m.GetLinkKeyArray()
if err != nil {
return nil, errcode.ErrCode_TODO.Wrap(err)
}
return &protocoltypes.Group{
PublicKey: m.PublicKey,
SignPub: groupSigPKBytes,
LinkKey: linkKey[:],
LinkKeySig: m.LinkKeySig,
}, nil
}
func (s *service) ReplicationServiceRegisterGroup(ctx context.Context, request *protocoltypes.ReplicationServiceRegisterGroup_Request) (_ *protocoltypes.ReplicationServiceRegisterGroup_Reply, err error) {
ctx, _, endSection := tyber.Section(ctx, s.logger, "Registering replication service for group")
defer func() { endSection(err, "") }()
if request.GroupPk == nil {
return nil, errcode.ErrCode_ErrInvalidInput.Wrap(fmt.Errorf("invalid GroupPK"))
}
if request.Token == "" {
return nil, errcode.ErrCode_ErrInvalidInput.Wrap(fmt.Errorf("invalid token"))
}
if request.ReplicationServer == "" {
return nil, errcode.ErrCode_ErrInvalidInput.Wrap(fmt.Errorf("invalid replication server"))
}
gc, err := s.GetContextGroupForID(request.GroupPk)
if err != nil {
return nil, errcode.ErrCode_ErrInvalidInput.Wrap(err)
}
replGroup, err := FilterGroupForReplication(gc.group)
if err != nil {
return nil, errcode.ErrCode_TODO.Wrap(err)
}
accountGroup := s.getAccountGroup()
if accountGroup == nil {
return nil, errcode.ErrCode_ErrGroupMissing
}
gopts := []grpc.DialOption{
grpc.WithPerRPCCredentials(grpcutil.NewUnsecureSimpleAuthAccess("bearer", request.Token)),
}
if s.grpcInsecure {
gopts = append(gopts, grpc.WithTransportCredentials(insecure.NewCredentials()))
} else {
tlsconfig := credentials.NewTLS(&tls.Config{
MinVersion: tls.VersionTLS12,
})
gopts = append(gopts, grpc.WithTransportCredentials(tlsconfig))
}
cc, err := grpc.NewClient("passthrough://"+request.ReplicationServer, gopts...)
if err != nil {
return nil, errcode.ErrCode_ErrStreamWrite.Wrap(err)
}
client := replicationtypes.NewReplicationServiceClient(cc)
if _, err = client.ReplicateGroup(ctx, &replicationtypes.ReplicationServiceReplicateGroup_Request{
Group: replGroup,
}); err != nil {
return nil, errcode.ErrCode_ErrServiceReplicationServer.Wrap(err)
}
s.logger.Info("group will be replicated", logutil.PrivateString("public-key", base64.RawURLEncoding.EncodeToString(request.GroupPk)))
if _, err := gc.metadataStore.SendGroupReplicating(ctx, request.AuthenticationUrl, request.ReplicationServer); err != nil {
s.logger.Error("error while notifying group about replication", zap.Error(err))
}
return &protocoltypes.ReplicationServiceRegisterGroup_Reply{}, nil
}
================================================
FILE: api_verified_credentials.go
================================================
package weshnet
import (
"bytes"
"context"
"fmt"
"strings"
"time"
"berty.tech/weshnet/v2/pkg/bertyvcissuer"
"berty.tech/weshnet/v2/pkg/cryptoutil"
"berty.tech/weshnet/v2/pkg/errcode"
"berty.tech/weshnet/v2/pkg/protocoltypes"
)
func (s *service) CredentialVerificationServiceInitFlow(ctx context.Context, request *protocoltypes.CredentialVerificationServiceInitFlow_Request) (*protocoltypes.CredentialVerificationServiceInitFlow_Reply, error) {
s.lock.Lock()
s.vcClient = bertyvcissuer.NewClient(request.ServiceUrl)
client := s.vcClient
s.lock.Unlock()
ctx, cancel := context.WithTimeout(ctx, time.Second*10)
defer cancel()
// TODO: allow selection of alt-scoped keys
// TODO: avoid exporting account keys
pkRaw, err := s.accountGroupCtx.ownMemberDevice.Member().Raw()
if err != nil {
return nil, errcode.ErrCode_ErrInvalidInput
}
if !bytes.Equal(pkRaw, request.PublicKey) {
return nil, errcode.ErrCode_ErrInvalidInput
}
url, err := client.Init(ctx, request.Link, cryptoutil.NewFuncSigner(s.accountGroupCtx.ownMemberDevice.Member(), s.accountGroupCtx.ownMemberDevice.MemberSign))
if err != nil {
return nil, errcode.ErrCode_ErrInternal.Wrap(err)
}
return &protocoltypes.CredentialVerificationServiceInitFlow_Reply{
Url: url,
SecureUrl: strings.HasPrefix(url, "https://"),
}, nil
}
func (s *service) CredentialVerificationServiceCompleteFlow(ctx context.Context, request *protocoltypes.CredentialVerificationServiceCompleteFlow_Request) (*protocoltypes.CredentialVerificationServiceCompleteFlow_Reply, error) {
s.lock.Lock()
client := s.vcClient
s.lock.Unlock()
if client == nil {
return nil, errcode.ErrCode_ErrInvalidInput.Wrap(fmt.Errorf("a verification flow needs to be started first"))
}
credentials, identifier, parsedCredential, err := client.Complete(request.CallbackUri)
if err != nil {
return nil, errcode.ErrCode_ErrInternal.Wrap(err)
}
_, err = s.accountGroupCtx.metadataStore.SendAccountVerifiedCredentialAdded(ctx, &protocoltypes.AccountVerifiedCredentialRegistered{
VerifiedCredential: credentials,
RegistrationDate: parsedCredential.Issued.UnixNano(),
ExpirationDate: parsedCredential.Expired.UnixNano(),
Identifier: identifier,
Issuer: parsedCredential.Issuer.ID,
})
if err != nil {
return nil, errcode.ErrCode_ErrInternal.Wrap(err)
}
return &protocoltypes.CredentialVerificationServiceCompleteFlow_Reply{
Identifier: identifier,
}, nil
}
func (s *service) VerifiedCredentialsList(request *protocoltypes.VerifiedCredentialsList_Request, server protocoltypes.ProtocolService_VerifiedCredentialsListServer) error {
now := time.Now().UnixNano()
credentials := s.accountGroupCtx.metadataStore.ListVerifiedCredentials()
for _, credential := range credentials {
if request.FilterIdentifier != "" && credential.Identifier != request.FilterIdentifier {
continue
}
if request.ExcludeExpired && credential.ExpirationDate < now {
continue
}
if request.FilterIssuer != "" && credential.Issuer != request.FilterIssuer {
continue
}
if err := server.Send(&protocoltypes.VerifiedCredentialsList_Reply{
Credential: credential,
}); err != nil {
return errcode.ErrCode_ErrStreamWrite.Wrap(err)
}
}
return nil
}
================================================
FILE: blackbox_test.go
================================================
package weshnet_test
import (
"context"
"fmt"
"os"
"testing"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"berty.tech/weshnet/v2"
"berty.tech/weshnet/v2/pkg/protocoltypes"
"berty.tech/weshnet/v2/pkg/secretstore"
"berty.tech/weshnet/v2/pkg/testutil"
)
func TestTestingClient_impl(t *testing.T) {
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
logger, cleanup := testutil.Logger(t)
defer cleanup()
secretStore, err := secretstore.NewInMemSecretStore(nil)
require.NoError(t, err)
client, cleanup := weshnet.TestingService(ctx, t, weshnet.Opts{
Logger: logger,
SecretStore: secretStore,
})
defer cleanup()
// test service
_, _ = client.ServiceGetConfiguration(ctx, &protocoltypes.ServiceGetConfiguration_Request{})
status := client.Status()
expected := weshnet.Status{}
assert.Equal(t, expected, status)
}
func ExampleNewInMemoryServiceClient_basic() {
// disable resources manager for test
os.Setenv("LIBP2P_RCMGR", "false")
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
client, err := weshnet.NewInMemoryServiceClient()
if err != nil {
panic(err)
}
defer client.Close()
ret, err := client.ServiceGetConfiguration(ctx, &protocoltypes.ServiceGetConfiguration_Request{})
if err != nil {
panic(err)
}
for _, listener := range ret.Listeners {
if listener == "/p2p-circuit" {
fmt.Println(listener)
}
}
// Output:
// /p2p-circuit
}
func ExampleNewPersistentServiceClient_basic() {
// disable resources manager for test
os.Setenv("LIBP2P_RCMGR", "false")
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
// create a temporary path to host data of our persistent service
path, err := os.MkdirTemp("", "weshnet-test-persistent")
if err != nil {
panic(err)
}
defer os.RemoveAll(path)
var peerid string
// open once
{
client, err := weshnet.NewPersistentServiceClient(path)
if err != nil {
panic(err)
}
ret, err := client.ServiceGetConfiguration(ctx, &protocoltypes.ServiceGetConfiguration_Request{})
if err != nil {
panic(err)
}
peerid = ret.PeerId
if err := client.Close(); err != nil {
panic(err)
}
}
// open twice
{
client, err := weshnet.NewPersistentServiceClient(path)
if err != nil {
panic(err)
}
defer client.Close()
ret, err := client.ServiceGetConfiguration(ctx, &protocoltypes.ServiceGetConfiguration_Request{})
if err != nil {
panic(err)
}
if peerid != ret.PeerId {
panic("peerid should be identical")
}
}
// Output:
}
func ExampleNewServiceClient_basic() {
// disable resources manager for test
os.Setenv("LIBP2P_RCMGR", "false")
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
client, err := weshnet.NewServiceClient(weshnet.Opts{})
if err != nil {
panic(err)
}
defer client.Close()
ret, err := client.ServiceGetConfiguration(ctx, &protocoltypes.ServiceGetConfiguration_Request{})
if err != nil {
panic(err)
}
for _, listener := range ret.Listeners {
if listener == "/p2p-circuit" {
fmt.Println(listener)
}
}
// Output:
// /p2p-circuit
}
func ExampleNewService_basic() {
// disable resources manager for test
os.Setenv("LIBP2P_RCMGR", "false")
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
client, err := weshnet.NewService(weshnet.Opts{})
if err != nil {
panic(err)
}
defer client.Close()
ret, err := client.ServiceGetConfiguration(ctx, &protocoltypes.ServiceGetConfiguration_Request{})
if err != nil {
panic(err)
}
for _, listener := range ret.Listeners {
if listener == "/p2p-circuit" {
fmt.Println(listener)
}
}
// Output:
// /p2p-circuit
}
// FIXME: create examples that actually use groups and contacts
================================================
FILE: buf.gen.tag.yaml
================================================
version: v1
plugins:
- name: gotag
out: ./
opt: module=berty.tech/weshnet/v2
================================================
FILE: buf.gen.yaml
================================================
version: v2
plugins:
- local: protoc-gen-go
out: ./
opt: module=berty.tech/weshnet/v2
- local: protoc-gen-go-grpc
out: ./
opt: module=berty.tech/weshnet/v2
- local: protoc-gen-grpc-gateway
out: ./
opt:
- module=berty.tech/weshnet/v2
- generate_unbound_methods=true
================================================
FILE: connectedness_manager.go
================================================
package weshnet
import (
"context"
"sync"
peer "github.com/libp2p/go-libp2p/core/peer"
"berty.tech/weshnet/v2/internal/notify"
)
type ConnectednessType int
const (
Connectedne
gitextract_xdu0swom/ ├── .codecov.yml ├── .dockerignore ├── .editorconfig ├── .gitattributes ├── .github/ │ ├── ISSUE_TEMPLATE/ │ │ ├── bug_template.yml │ │ ├── feature_template.yml │ │ └── question_template.yml │ ├── dependabot.yml │ ├── pull_request_template.md │ ├── weekly-digest.yml │ └── workflows/ │ ├── benchmark.yml │ ├── buf-push.yml │ ├── cancel.yml │ ├── codeql-analysis.yml │ ├── dependent-issues.yml │ ├── go.yml │ ├── protobuf.yml │ ├── release.yml │ ├── ssh-runner.yml │ └── utils/ │ └── variables.json ├── .gitignore ├── .golangci.yml ├── .tool-versions ├── COPYRIGHT ├── INSTALL.md ├── LICENSE-APACHE ├── LICENSE-MIT ├── Makefile ├── README.md ├── account_export.go ├── account_export_test.go ├── api/ │ ├── go-internal/ │ │ ├── buf.yaml │ │ ├── handshake/ │ │ │ └── handshake.proto │ │ └── tinder/ │ │ └── records.proto │ └── protocol/ │ ├── buf.yaml │ ├── errcode/ │ │ └── errcode.proto │ ├── outofstoremessagetypes/ │ │ └── outofstoremessage.proto │ ├── protocoltypes.proto │ ├── replicationtypes/ │ │ └── bertyreplication.proto │ └── verifiablecredstypes/ │ └── bertyverifiablecreds.proto ├── api_app.go ├── api_client.go ├── api_contact.go ├── api_contact_request_test.go ├── api_contactrequest.go ├── api_debug.go ├── api_event.go ├── api_group.go ├── api_multimember.go ├── api_replication.go ├── api_verified_credentials.go ├── blackbox_test.go ├── buf.gen.tag.yaml ├── buf.gen.yaml ├── connectedness_manager.go ├── consts.go ├── contact_request_manager.go ├── contact_request_manager_test.go ├── deactivate_test.go ├── doc.go ├── docs/ │ ├── CONTRIBUTING.md │ ├── Makefile │ ├── apis/ │ │ ├── protocoltypes.md │ │ └── protocoltypes.swagger.json │ ├── architecture/ │ │ ├── 2020-11-27-adr-berty-grpc-bridge.txt │ │ ├── 2020-11-27-adr-gomobile-ipfs.md │ │ ├── README.md │ │ └── messenger-mvp/ │ │ ├── README.md │ │ └── contact-request.mermaid │ ├── buf-doc.gen.yaml │ ├── gen.sum │ ├── ideas/ │ │ ├── distributed-entropy.md │ │ └── entropy-pool.md │ └── protocol/ │ └── README.md ├── events.go ├── events_sig_checkers.go ├── gen.sum ├── go.mod ├── go.sum ├── group.go ├── group_context.go ├── iface_account.go ├── infra/ │ ├── .gitignore │ ├── README.md │ ├── rdvp/ │ │ ├── .env │ │ ├── Makefile │ │ └── docker-compose.yml │ └── relay/ │ ├── Dockerfile │ ├── Makefile │ ├── config.json │ └── docker-compose.yml ├── internal/ │ ├── benchmark/ │ │ └── benchmark_test.go │ ├── bertyversion/ │ │ ├── example_test.go │ │ └── version.go │ ├── datastoreutil/ │ │ ├── consts.go │ │ └── datastore_namespaced.go │ ├── handshake/ │ │ ├── doc.go │ │ ├── handshake.go │ │ ├── handshake.pb.go │ │ ├── handshake_test.go │ │ ├── handshake_util_test.go │ │ ├── request.go │ │ └── response.go │ ├── notify/ │ │ ├── notify.go │ │ └── notify_test.go │ ├── queue/ │ │ ├── metrics.go │ │ ├── priority.go │ │ ├── simple.go │ │ └── simple_test.go │ ├── sysutil/ │ │ ├── sysutil.go │ │ ├── sysutil_unix.go │ │ └── sysutil_unsupported.go │ └── tools/ │ ├── example_test.go │ ├── tools.go │ └── tools_untool.go ├── message_marshaler.go ├── message_marshaler_test.go ├── orbitdb.go ├── orbitdb_datastore_cache.go ├── orbitdb_many_adds_berty_test.go ├── orbitdb_many_adds_test.go ├── orbitdb_signed_entry_accesscontroller.go ├── orbitdb_signed_entry_identity_provider.go ├── orbitdb_signed_entry_keystore.go ├── orbitdb_test.go ├── orbitdb_utils_test.go ├── pkg/ │ ├── androidnearby/ │ │ ├── bridge_android.go │ │ ├── bridge_unsupported.go │ │ ├── const.go │ │ ├── example_test.go │ │ ├── init.go │ │ └── multiaddr.go │ ├── bertyvcissuer/ │ │ ├── client.go │ │ ├── urls.go │ │ └── verifiable_public_key_fetcher.go │ ├── ble-driver/ │ │ ├── BertyDevice_darwin.h │ │ ├── BertyDevice_darwin.m │ │ ├── BleInterface_darwin.h │ │ ├── BleInterface_darwin.m │ │ ├── BleManager_darwin.h │ │ ├── BleManager_darwin.m │ │ ├── BleQueue.h │ │ ├── BleQueue.m │ │ ├── CircularQueue.h │ │ ├── CircularQueue.m │ │ ├── ConnectedPeer.h │ │ ├── ConnectedPeer.m │ │ ├── CountDownLatch_darwin.h │ │ ├── CountDownLatch_darwin.m │ │ ├── Logger.h │ │ ├── Logger.m │ │ ├── PeerManager.h │ │ ├── PeerManager.m │ │ ├── TaskDelay.h │ │ ├── TaskDelay.m │ │ ├── WriteDataCache.h │ │ ├── WriteDataCache.m │ │ ├── bridge_android.go │ │ ├── bridge_darwin.go │ │ ├── bridge_unsupported.go │ │ ├── const.go │ │ ├── example_test.go │ │ ├── init.go │ │ └── multiaddr.go │ ├── cryptoutil/ │ │ ├── cryptoutil.go │ │ ├── cryptoutil_test.go │ │ ├── doc.go │ │ └── signer_wrapper.go │ ├── errcode/ │ │ ├── doc.go │ │ ├── errcode.pb.go │ │ ├── error.go │ │ ├── error_test.go │ │ └── stdproto.go │ ├── grpcutil/ │ │ ├── buf_listener.go │ │ ├── doc.go │ │ ├── simple_auth.go │ │ └── simple_auth_test.go │ ├── ipfsutil/ │ │ ├── collector_bandwidth.go │ │ ├── collector_host.go │ │ ├── conn_logger.go │ │ ├── conn_manager.go │ │ ├── consts.go │ │ ├── doc.go │ │ ├── extended_core_api.go │ │ ├── helpers.go │ │ ├── helpers_test.go │ │ ├── keystore_datastore.go │ │ ├── lifecycle.go │ │ ├── localrecord.go │ │ ├── metrics.go │ │ ├── mobile/ │ │ │ ├── host.go │ │ │ ├── node.go │ │ │ ├── repo.go │ │ │ └── routing.go │ │ ├── mobile.go │ │ ├── peering.go │ │ ├── pubsub_adaptater.go │ │ ├── pubsub_api.go │ │ ├── pubsub_monitor.go │ │ ├── repo.go │ │ ├── testing.go │ │ └── util.go │ ├── lifecycle/ │ │ ├── example_test.go │ │ ├── manager.go │ │ └── task.go │ ├── logutil/ │ │ ├── crypto_utils.go │ │ ├── encoders.go │ │ ├── example_test.go │ │ ├── file.go │ │ ├── file_test.go │ │ ├── grpc_logger.go │ │ ├── logger_native.go │ │ ├── logger_native_android.go │ │ ├── logger_native_darwin.go │ │ ├── logger_native_other.go │ │ ├── logutil.go │ │ ├── logutil_test.go │ │ ├── private_field.go │ │ └── stream.go │ ├── multipeer-connectivity-driver/ │ │ ├── bridge_darwin.go │ │ ├── bridge_unsupported.go │ │ ├── const.go │ │ ├── driver/ │ │ │ ├── Logger.h │ │ │ ├── Logger.m │ │ │ ├── MCManager.h │ │ │ ├── MCManager.m │ │ │ ├── cgo_bridge.go │ │ │ ├── mc-driver.h │ │ │ └── mc-driver.m │ │ ├── example_test.go │ │ ├── init.go │ │ └── multiaddr.go │ ├── netmanager/ │ │ ├── connectivity.go │ │ ├── netmanager.go │ │ ├── netmanager_noop.go │ │ └── netmanager_test.go │ ├── outofstoremessage/ │ │ ├── outofstoremessage_test.go │ │ └── service_outofstoremessage.go │ ├── outofstoremessagetypes/ │ │ ├── outofstoremessage.pb.go │ │ ├── outofstoremessage.pb.gw.go │ │ └── outofstoremessage_grpc.pb.go │ ├── protocoltypes/ │ │ ├── contact.go │ │ ├── doc.go │ │ ├── events_account.go │ │ ├── example_test.go │ │ ├── group.go │ │ ├── protocoltypes.pb.go │ │ ├── protocoltypes.pb.gw.go │ │ └── protocoltypes_grpc.pb.go │ ├── protoio/ │ │ ├── full.go │ │ ├── io.go │ │ ├── uint32.go │ │ └── varint.go │ ├── proximitytransport/ │ │ ├── addr.go │ │ ├── conn.go │ │ ├── example_test.go │ │ ├── listener.go │ │ ├── mplex.go │ │ ├── proximitydriver.go │ │ ├── ringBuffer_map.go │ │ └── transport.go │ ├── rendezvous/ │ │ ├── emitterio_sync_client.go │ │ ├── emitterio_sync_provider.go │ │ ├── emitterio_sync_test.go │ │ ├── rendezvous.go │ │ ├── rendezvous_test.go │ │ └── rotation.go │ ├── replicationtypes/ │ │ ├── bertyreplication.pb.go │ │ ├── bertyreplication.pb.gw.go │ │ ├── bertyreplication_grpc.pb.go │ │ ├── consts.go │ │ └── models.go │ ├── secretstore/ │ │ ├── chain_key.go │ │ ├── datastore_keys.go │ │ ├── device_keystore_wrapper.go │ │ ├── device_keystore_wrapper_test.go │ │ ├── doc.go │ │ ├── keys_utils.go │ │ ├── member_device.go │ │ ├── secret_store.go │ │ ├── secret_store_interfaces.go │ │ ├── secret_store_messages.go │ │ ├── secret_store_messages_test.go │ │ └── secret_store_test.go │ ├── testutil/ │ │ ├── doc.go │ │ ├── example_test.go │ │ ├── filters.go │ │ ├── logging.go │ │ ├── require.go │ │ ├── skip.go │ │ ├── skip_norace.go │ │ ├── skip_race.go │ │ └── skip_test.go │ ├── tinder/ │ │ ├── driver.go │ │ ├── driver_discovery.go │ │ ├── driver_localdiscovery.go │ │ ├── driver_localdiscovery_test.go │ │ ├── driver_mock.go │ │ ├── driver_mock_test.go │ │ ├── driver_rdvp.go │ │ ├── driver_service_test.go │ │ ├── filter.go │ │ ├── notify_network.go │ │ ├── options.go │ │ ├── peer_cache.go │ │ ├── peer_cache_test.go │ │ ├── records.pb.go │ │ ├── service.go │ │ ├── service_adaptater.go │ │ ├── service_advertises.go │ │ ├── service_mocked_test.go │ │ ├── service_subscription.go │ │ └── testing_test.go │ ├── tyber/ │ │ ├── context.go │ │ ├── format.go │ │ ├── ipfs.go │ │ ├── log.go │ │ ├── section.go │ │ ├── step.go │ │ └── subscribe.go │ ├── username/ │ │ ├── android.go │ │ ├── example_test.go │ │ ├── ios.go │ │ ├── others.go │ │ └── username.go │ └── verifiablecredstypes/ │ └── bertyverifiablecreds.pb.go ├── scenario_test.go ├── service.go ├── service_client.go ├── service_group.go ├── store_message.go ├── store_message_metrics.go ├── store_message_queue.go ├── store_message_test.go ├── store_metadata.go ├── store_metadata_index.go ├── store_metadata_test.go ├── store_options.go ├── store_utils.go ├── testing.go ├── testing_test.go ├── tinder_swiper.go ├── tinder_swiper_test.go ├── tool/ │ ├── bench-cellular/ │ │ ├── .gitignore │ │ ├── Makefile │ │ ├── bench.go │ │ ├── client.go │ │ ├── go.mod │ │ ├── go.sum │ │ └── server.go │ └── docker-protoc/ │ ├── Dockerfile │ └── Makefile └── tyber.go
Showing preview only (373K chars total). Download the full file or copy to clipboard to get everything.
SYMBOL INDEX (3771 symbols across 234 files)
FILE: account_export.go
constant exportAccountKeyFilename (line 26) | exportAccountKeyFilename = "account.key"
constant exportAccountProofKeyFilename (line 27) | exportAccountProofKeyFilename = "account_proof.key"
constant exportOrbitDBEntriesPrefix (line 28) | exportOrbitDBEntriesPrefix = "entries/"
constant exportOrbitDBHeadsPrefix (line 29) | exportOrbitDBHeadsPrefix = "heads/"
method export (line 32) | func (s *service) export(ctx context.Context, output io.Writer) error {
method exportGroupContext (line 58) | func (s *service) exportGroupContext(ctx context.Context, gc *GroupConte...
method exportOrbitDBStore (line 86) | func (s *service) exportOrbitDBStore(ctx context.Context, store orbitdb....
method exportAccountKeys (line 106) | func (s *service) exportAccountKeys(tw *tar.Writer) error {
method exportOrbitDBGroupHeads (line 125) | func (s *service) exportOrbitDBGroupHeads(gc *GroupContext, headsMetadat...
function exportPrivateKey (line 187) | func exportPrivateKey(tw *tar.Writer, marshalledPrivateKey []byte, filen...
method exportOrbitDBEntry (line 209) | func (s *service) exportOrbitDBEntry(ctx context.Context, tw *tar.Writer...
function readExportSecretKeyFile (line 243) | func readExportSecretKeyFile(expectedSize int64, reader *tar.Reader) ([]...
function readExportOrbitDBGroupHeads (line 261) | func readExportOrbitDBGroupHeads(expectedSize int64, reader *tar.Reader)...
function readExportCBORNode (line 300) | func readExportCBORNode(expectedSize int64, cidStr string, reader *tar.R...
type RestoreAccountHandler (line 332) | type RestoreAccountHandler struct
type restoreAccountState (line 337) | type restoreAccountState struct
method readKey (line 341) | func (state *restoreAccountState) readKey(keyName string) RestoreAccou...
method restoreKeys (line 364) | func (state *restoreAccountState) restoreKeys(odb *WeshOrbitDB) Restor...
function restoreOrbitDBEntry (line 376) | func restoreOrbitDBEntry(ctx context.Context, coreAPI coreiface.CoreAPI)...
function restoreOrbitDBHeads (line 399) | func restoreOrbitDBHeads(ctx context.Context, odb *WeshOrbitDB) RestoreA...
function RestoreAccountExport (line 424) | func RestoreAccountExport(ctx context.Context, reader io.Reader, coreAPI...
FILE: account_export_test.go
function Test_service_exportAccountKeys (line 25) | func Test_service_exportAccountKeys(t *testing.T) {
function getKeyFromTar (line 76) | func getKeyFromTar(t *testing.T, tr *tar.Reader, expectedFilename string...
function TestFlappyRestoreAccount (line 89) | func TestFlappyRestoreAccount(t *testing.T) {
FILE: api_app.go
method AppMetadataSend (line 17) | func (s *service) AppMetadataSend(ctx context.Context, req *protocoltype...
method AppMessageSend (line 35) | func (s *service) AppMessageSend(ctx context.Context, req *protocoltypes...
method OutOfStoreReceive (line 54) | func (s *service) OutOfStoreReceive(ctx context.Context, request *protoc...
method OutOfStoreSeal (line 69) | func (s *service) OutOfStoreSeal(ctx context.Context, request *protocolt...
function tyberLogGroupContext (line 95) | func tyberLogGroupContext(ctx context.Context, logger *zap.Logger, gc *G...
FILE: api_client.go
method ServiceExportData (line 13) | func (s *service) ServiceExportData(_ *protocoltypes.ServiceExportData_R...
method ServiceGetConfiguration (line 59) | func (s *service) ServiceGetConfiguration(ctx context.Context, _ *protoc...
FILE: api_contact.go
method ContactAliasKeySend (line 15) | func (s *service) ContactAliasKeySend(ctx context.Context, req *protocol...
method ContactBlock (line 31) | func (s *service) ContactBlock(ctx context.Context, req *protocoltypes.C...
method ContactUnblock (line 47) | func (s *service) ContactUnblock(ctx context.Context, req *protocoltypes...
method RefreshContactRequest (line 63) | func (s *service) RefreshContactRequest(ctx context.Context, req *protoc...
FILE: api_contact_request_test.go
function TestShareContact (line 15) | func TestShareContact(t *testing.T) {
FILE: api_contactrequest.go
method ContactRequestReference (line 15) | func (s *service) ContactRequestReference(context.Context, *protocoltype...
method ContactRequestDisable (line 35) | func (s *service) ContactRequestDisable(ctx context.Context, _ *protocol...
method ContactRequestEnable (line 52) | func (s *service) ContactRequestEnable(ctx context.Context, _ *protocolt...
method ContactRequestResetReference (line 78) | func (s *service) ContactRequestResetReference(ctx context.Context, _ *p...
method ContactRequestSend (line 104) | func (s *service) ContactRequestSend(ctx context.Context, req *protocolt...
method ContactRequestAccept (line 128) | func (s *service) ContactRequestAccept(ctx context.Context, req *protoco...
method ContactRequestDiscard (line 159) | func (s *service) ContactRequestDiscard(ctx context.Context, req *protoc...
method ShareContact (line 183) | func (s *service) ShareContact(ctx context.Context, _ *protocoltypes.Sha...
method DecodeContact (line 235) | func (s *service) DecodeContact(_ context.Context, req *protocoltypes.De...
FILE: api_debug.go
method DebugListGroups (line 22) | func (s *service) DebugListGroups(_ *protocoltypes.DebugListGroups_Reque...
method DebugInspectGroupStore (line 67) | func (s *service) DebugInspectGroupStore(req *protocoltypes.DebugInspect...
method DebugGroup (line 159) | func (s *service) DebugGroup(ctx context.Context, request *protocoltypes...
method SystemInfo (line 179) | func (s *service) SystemInfo(ctx context.Context, _ *protocoltypes.Syste...
method PeerList (line 235) | func (s *service) PeerList(ctx context.Context, _ *protocoltypes.PeerLis...
FILE: api_event.go
function checkParametersConsistency (line 14) | func checkParametersConsistency(sinceID, untilID []byte, sinceNow, until...
method GroupMetadataList (line 36) | func (s *service) GroupMetadataList(req *protocoltypes.GroupMetadataList...
method GroupMessageList (line 124) | func (s *service) GroupMessageList(req *protocoltypes.GroupMessageList_R...
FILE: api_group.go
method GroupInfo (line 20) | func (s *service) GroupInfo(ctx context.Context, req *protocoltypes.Grou...
method ActivateGroup (line 73) | func (s *service) ActivateGroup(ctx context.Context, req *protocoltypes....
method DeactivateGroup (line 87) | func (s *service) DeactivateGroup(_ context.Context, req *protocoltypes....
method GroupDeviceStatus (line 100) | func (s *service) GroupDeviceStatus(req *protocoltypes.GroupDeviceStatus...
method craftPeerConnectedMessage (line 164) | func (s *service) craftPeerConnectedMessage(peer peer.ID) (*protocoltype...
method craftDeviceDisconnectedMessage (line 209) | func (s *service) craftDeviceDisconnectedMessage(peer peer.ID) *protocol...
method craftDeviceReconnectedMessage (line 215) | func (s *service) craftDeviceReconnectedMessage(peer peer.ID) *protocolt...
FILE: api_multimember.go
method MultiMemberGroupCreate (line 15) | func (s *service) MultiMemberGroupCreate(ctx context.Context, _ *protoco...
method MultiMemberGroupJoin (line 59) | func (s *service) MultiMemberGroupJoin(ctx context.Context, req *protoco...
method MultiMemberGroupLeave (line 76) | func (s *service) MultiMemberGroupLeave(ctx context.Context, req *protoc...
method MultiMemberGroupAliasResolverDisclose (line 103) | func (s *service) MultiMemberGroupAliasResolverDisclose(ctx context.Cont...
method MultiMemberGroupAdminRoleGrant (line 118) | func (s *service) MultiMemberGroupAdminRoleGrant(context.Context, *proto...
method MultiMemberGroupInvitationCreate (line 123) | func (s *service) MultiMemberGroupInvitationCreate(_ context.Context, re...
FILE: api_replication.go
function FilterGroupForReplication (line 22) | func FilterGroupForReplication(m *protocoltypes.Group) (*protocoltypes.G...
method ReplicationServiceRegisterGroup (line 46) | func (s *service) ReplicationServiceRegisterGroup(ctx context.Context, r...
FILE: api_verified_credentials.go
method CredentialVerificationServiceInitFlow (line 16) | func (s *service) CredentialVerificationServiceInitFlow(ctx context.Cont...
method CredentialVerificationServiceCompleteFlow (line 47) | func (s *service) CredentialVerificationServiceCompleteFlow(ctx context....
method VerifiedCredentialsList (line 77) | func (s *service) VerifiedCredentialsList(request *protocoltypes.Verifie...
FILE: blackbox_test.go
function TestTestingClient_impl (line 18) | func TestTestingClient_impl(t *testing.T) {
function ExampleNewInMemoryServiceClient_basic (line 41) | func ExampleNewInMemoryServiceClient_basic() {
function ExampleNewPersistentServiceClient_basic (line 69) | func ExampleNewPersistentServiceClient_basic() {
function ExampleNewServiceClient_basic (line 124) | func ExampleNewServiceClient_basic() {
function ExampleNewService_basic (line 152) | func ExampleNewService_basic() {
FILE: connectedness_manager.go
type ConnectednessType (line 12) | type ConnectednessType
constant ConnectednessTypeDisconnected (line 15) | ConnectednessTypeDisconnected ConnectednessType = iota
constant ConnectednessTypeReconnecting (line 16) | ConnectednessTypeReconnecting
constant ConnectednessTypeConnected (line 17) | ConnectednessTypeConnected
type ConnectednessUpdate (line 20) | type ConnectednessUpdate struct
type PeersConnectedness (line 25) | type PeersConnectedness
type GroupStatus (line 27) | type GroupStatus struct
type PeerStatus (line 32) | type PeerStatus struct
type ConnectednessManager (line 37) | type ConnectednessManager struct
method AssociatePeer (line 51) | func (m *ConnectednessManager) AssociatePeer(group string, peer peer.I...
method UpdateState (line 69) | func (m *ConnectednessManager) UpdateState(peer peer.ID, update Connec...
method WaitForConnectednessChange (line 85) | func (m *ConnectednessManager) WaitForConnectednessChange(ctx context....
method getGroupStatus (line 109) | func (m *ConnectednessManager) getGroupStatus(gkey string) *GroupStatus {
method getPeerStatus (line 121) | func (m *ConnectednessManager) getPeerStatus(peer peer.ID) *PeerStatus {
method updateStatus (line 132) | func (m *ConnectednessManager) updateStatus(group *GroupStatus, curren...
function NewConnectednessManager (line 43) | func NewConnectednessManager() *ConnectednessManager {
FILE: consts.go
constant NamespaceOrbitDBDatastore (line 8) | NamespaceOrbitDBDatastore = "orbitdb_datastore"
constant NamespaceOrbitDBDirectory (line 9) | NamespaceOrbitDBDirectory = "orbitdb"
constant NamespaceIPFSDatastore (line 10) | NamespaceIPFSDatastore = "ipfs_datastore"
FILE: contact_request_manager.go
constant contactRequestV1 (line 30) | contactRequestV1 = "/wesh/contact_req/1.0.0"
type contactRequestsManager (line 32) | type contactRequestsManager struct
method close (line 78) | func (c *contactRequestsManager) close() {
method isClosed (line 96) | func (c *contactRequestsManager) isClosed() bool {
method metadataWatcher (line 105) | func (c *contactRequestsManager) metadataWatcher(ctx context.Context) {
method metadataRequestDisabled (line 175) | func (c *contactRequestsManager) metadataRequestDisabled(_ context.Con...
method metadataRequestEnabled (line 190) | func (c *contactRequestsManager) metadataRequestEnabled(ctx context.Co...
method enableContactRequest (line 199) | func (c *contactRequestsManager) enableContactRequest(ctx context.Cont...
method metadataRequestReset (line 236) | func (c *contactRequestsManager) metadataRequestReset(ctx context.Cont...
method metadataRequestEnqueued (line 266) | func (c *contactRequestsManager) metadataRequestEnqueued(ctx context.C...
method metadataRequestSent (line 286) | func (c *contactRequestsManager) metadataRequestSent(_ context.Context...
method metadataRequestReceived (line 298) | func (c *contactRequestsManager) metadataRequestReceived(_ context.Con...
method registerContactLookup (line 310) | func (c *contactRequestsManager) registerContactLookup(ctx context.Con...
method cancelContactLookup (line 326) | func (c *contactRequestsManager) cancelContactLookup(contactPK []byte) {
method enableAnnounce (line 340) | func (c *contactRequestsManager) enableAnnounce(ctx context.Context, s...
method disableAnnounce (line 361) | func (c *contactRequestsManager) disableAnnounce() {
method enqueueRequest (line 368) | func (c *contactRequestsManager) enqueueRequest(ctx context.Context, t...
method SendContactRequest (line 415) | func (c *contactRequestsManager) SendContactRequest(ctx context.Contex...
method handleIncomingRequest (line 477) | func (c *contactRequestsManager) handleIncomingRequest(ctx context.Con...
function newContactRequestsManager (line 54) | func newContactRequestsManager(s *Swiper, store *MetadataStore, ipfs ipf...
function cidBytesString (line 527) | func cidBytesString(bytes []byte) string {
FILE: contact_request_manager_test.go
function TestContactRequestFlow (line 18) | func TestContactRequestFlow(t *testing.T) {
function TestContactRequestFlowWithoutIncoming (line 142) | func TestContactRequestFlowWithoutIncoming(t *testing.T) {
FILE: deactivate_test.go
function TestReactivateAccountGroup (line 19) | func TestReactivateAccountGroup(t *testing.T) {
function TestRaceReactivateAccountGroup (line 92) | func TestRaceReactivateAccountGroup(t *testing.T) {
function TestReactivateContactGroup (line 164) | func TestReactivateContactGroup(t *testing.T) {
function TestRaceReactivateContactGroup (line 204) | func TestRaceReactivateContactGroup(t *testing.T) {
function TestReactivateMultimemberGroup (line 260) | func TestReactivateMultimemberGroup(t *testing.T) {
FILE: events.go
function newEventContext (line 43) | func newEventContext(eventID cid.Cid, parentIDs []cid.Cid, g *protocolty...
function getParentsForCID (line 58) | func getParentsForCID(log ipfslog.Log, c cid.Cid) []cid.Cid {
function newGroupMetadataEventFromEntry (line 87) | func newGroupMetadataEventFromEntry(_ ipfslog.Log, e ipfslog.Entry, meta...
function openGroupEnvelope (line 108) | func openGroupEnvelope(g *protocoltypes.Group, envelopeBytes []byte) (*p...
function sealGroupEnvelope (line 148) | func sealGroupEnvelope(g *protocoltypes.Group, eventType protocoltypes.E...
FILE: events_sig_checkers.go
type sigChecker (line 11) | type sigChecker
function sigCheckerGroupSigned (line 13) | func sigCheckerGroupSigned(g *protocoltypes.Group, metadata *protocoltyp...
type eventDeviceSigned (line 31) | type eventDeviceSigned interface
function sigCheckerDeviceSigned (line 36) | func sigCheckerDeviceSigned(_ *protocoltypes.Group, metadata *protocolty...
function sigCheckerGroupMemberDeviceAdded (line 59) | func sigCheckerGroupMemberDeviceAdded(g *protocoltypes.Group, metadata *...
FILE: group.go
constant CurrentGroupVersion (line 11) | CurrentGroupVersion = 1
function NewGroupMultiMember (line 15) | func NewGroupMultiMember() (*protocoltypes.Group, crypto.PrivKey, error) {
function getAndFilterGroupDeviceChainKeyAddedPayload (line 19) | func getAndFilterGroupDeviceChainKeyAddedPayload(m *protocoltypes.GroupM...
FILE: group_context.go
type GroupContext (line 23) | type GroupContext struct
method SecretStore (line 41) | func (gc *GroupContext) SecretStore() secretstore.SecretStore {
method MessageStore (line 45) | func (gc *GroupContext) MessageStore() *MessageStore {
method MetadataStore (line 49) | func (gc *GroupContext) MetadataStore() *MetadataStore {
method Group (line 53) | func (gc *GroupContext) Group() *protocoltypes.Group {
method MemberPubKey (line 57) | func (gc *GroupContext) MemberPubKey() crypto.PubKey {
method DevicePubKey (line 61) | func (gc *GroupContext) DevicePubKey() crypto.PubKey {
method Close (line 65) | func (gc *GroupContext) Close() error {
method IsClosed (line 83) | func (gc *GroupContext) IsClosed() bool {
method ActivateGroupContext (line 109) | func (gc *GroupContext) ActivateGroupContext(contactPK crypto.PubKey) ...
method handleGroupMetadataEvent (line 191) | func (gc *GroupContext) handleGroupMetadataEvent(e *protocoltypes.Grou...
method fillMessageKeysHolderUsingPreviousData (line 240) | func (gc *GroupContext) fillMessageKeysHolderUsingPreviousData() {
method metadataStoreListSecrets (line 255) | func (gc *GroupContext) metadataStoreListSecrets() map[crypto.PubKey][...
method sendSecretsToExistingMembers (line 285) | func (gc *GroupContext) sendSecretsToExistingMembers(contact crypto.Pu...
method TagGroupContextPeers (line 322) | func (gc *GroupContext) TagGroupContextPeers(ipfsCoreAPI ipfsutil.Exte...
method WaitForDeviceAdded (line 360) | func (gc *GroupContext) WaitForDeviceAdded(ctx context.Context, device...
method notifyDeviceAdded (line 392) | func (gc *GroupContext) notifyDeviceAdded(dPK []byte) {
function NewContextGroup (line 87) | func NewContextGroup(group *protocoltypes.Group, metadataStore *Metadata...
FILE: iface_account.go
type AccountKeys (line 10) | type AccountKeys interface
FILE: internal/benchmark/benchmark_test.go
function BenchmarkScenario (line 9) | func BenchmarkScenario(b *testing.B) {
FILE: internal/datastoreutil/consts.go
constant NamespaceMessageKeystore (line 4) | NamespaceMessageKeystore = "messages_keystore"
FILE: internal/datastoreutil/datastore_namespaced.go
type namespacedDatastore (line 8) | type namespacedDatastore struct
method Close (line 12) | func (n *namespacedDatastore) Close() error {
function NewNamespacedDatastore (line 17) | func NewNamespacedDatastore(child ds.Datastore, prefix ds.Key) ds.Batchi...
FILE: internal/handshake/handshake.go
type handshakeContext (line 23) | type handshakeContext struct
method toTyberStepMutator (line 33) | func (hc *handshakeContext) toTyberStepMutator() tyber.StepMutator {
method generateOwnEphemeralAndSendPubKey (line 60) | func (hc *handshakeContext) generateOwnEphemeralAndSendPubKey() error {
method receivePeerEphemeralPubKey (line 81) | func (hc *handshakeContext) receivePeerEphemeralPubKey() error {
method computeRequesterAuthenticateBoxKey (line 100) | func (hc *handshakeContext) computeRequesterAuthenticateBoxKey(asReque...
method computeResponderAcceptBoxKey (line 142) | func (hc *handshakeContext) computeResponderAcceptBoxKey() (*[cryptout...
FILE: internal/handshake/handshake.pb.go
constant _ (line 18) | _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
constant _ (line 20) | _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
type BoxEnvelope (line 23) | type BoxEnvelope struct
method Reset (line 31) | func (x *BoxEnvelope) Reset() {
method String (line 40) | func (x *BoxEnvelope) String() string {
method ProtoMessage (line 44) | func (*BoxEnvelope) ProtoMessage() {}
method ProtoReflect (line 46) | func (x *BoxEnvelope) ProtoReflect() protoreflect.Message {
method Descriptor (line 59) | func (*BoxEnvelope) Descriptor() ([]byte, []int) {
method GetBox (line 63) | func (x *BoxEnvelope) GetBox() []byte {
type HelloPayload (line 70) | type HelloPayload struct
method Reset (line 78) | func (x *HelloPayload) Reset() {
method String (line 87) | func (x *HelloPayload) String() string {
method ProtoMessage (line 91) | func (*HelloPayload) ProtoMessage() {}
method ProtoReflect (line 93) | func (x *HelloPayload) ProtoReflect() protoreflect.Message {
method Descriptor (line 106) | func (*HelloPayload) Descriptor() ([]byte, []int) {
method GetEphemeralPubKey (line 110) | func (x *HelloPayload) GetEphemeralPubKey() []byte {
type RequesterAuthenticatePayload (line 117) | type RequesterAuthenticatePayload struct
method Reset (line 126) | func (x *RequesterAuthenticatePayload) Reset() {
method String (line 135) | func (x *RequesterAuthenticatePayload) String() string {
method ProtoMessage (line 139) | func (*RequesterAuthenticatePayload) ProtoMessage() {}
method ProtoReflect (line 141) | func (x *RequesterAuthenticatePayload) ProtoReflect() protoreflect.Mes...
method Descriptor (line 154) | func (*RequesterAuthenticatePayload) Descriptor() ([]byte, []int) {
method GetRequesterAccountId (line 158) | func (x *RequesterAuthenticatePayload) GetRequesterAccountId() []byte {
method GetRequesterAccountSig (line 165) | func (x *RequesterAuthenticatePayload) GetRequesterAccountSig() []byte {
type ResponderAcceptPayload (line 172) | type ResponderAcceptPayload struct
method Reset (line 180) | func (x *ResponderAcceptPayload) Reset() {
method String (line 189) | func (x *ResponderAcceptPayload) String() string {
method ProtoMessage (line 193) | func (*ResponderAcceptPayload) ProtoMessage() {}
method ProtoReflect (line 195) | func (x *ResponderAcceptPayload) ProtoReflect() protoreflect.Message {
method Descriptor (line 208) | func (*ResponderAcceptPayload) Descriptor() ([]byte, []int) {
method GetResponderAccountSig (line 212) | func (x *ResponderAcceptPayload) GetResponderAccountSig() []byte {
type RequesterAcknowledgePayload (line 219) | type RequesterAcknowledgePayload struct
method Reset (line 227) | func (x *RequesterAcknowledgePayload) Reset() {
method String (line 236) | func (x *RequesterAcknowledgePayload) String() string {
method ProtoMessage (line 240) | func (*RequesterAcknowledgePayload) ProtoMessage() {}
method ProtoReflect (line 242) | func (x *RequesterAcknowledgePayload) ProtoReflect() protoreflect.Mess...
method Descriptor (line 255) | func (*RequesterAcknowledgePayload) Descriptor() ([]byte, []int) {
method GetSuccess (line 259) | func (x *RequesterAcknowledgePayload) GetSuccess() bool {
function file_handshake_handshake_proto_rawDescGZIP (line 305) | func file_handshake_handshake_proto_rawDescGZIP() []byte {
function init (line 328) | func init() { file_handshake_handshake_proto_init() }
function file_handshake_handshake_proto_init (line 329) | func file_handshake_handshake_proto_init() {
FILE: internal/handshake/handshake_test.go
function Request (line 25) | func Request(stream p2pnetwork.Stream, ownAccountID p2pcrypto.PrivKey, p...
function Response (line 33) | func Response(stream p2pnetwork.Stream, ownAccountID p2pcrypto.PrivKey) ...
function TestValidHandshake (line 40) | func TestValidHandshake(t *testing.T) {
function TestInvalidRequesterHello (line 80) | func TestInvalidRequesterHello(t *testing.T) {
function TestInvalidResponderHello (line 114) | func TestInvalidResponderHello(t *testing.T) {
function TestInvalidRequesterAuthenticate (line 157) | func TestInvalidRequesterAuthenticate(t *testing.T) {
function TestInvalidResponderAccept (line 700) | func TestInvalidResponderAccept(t *testing.T) {
function TestInvalidResponderAcceptAck (line 1127) | func TestInvalidResponderAcceptAck(t *testing.T) {
FILE: internal/handshake/handshake_util_test.go
constant testProtocolID (line 21) | testProtocolID = "/berty/handshake_test/1.0.0"
type mockedPeer (line 23) | type mockedPeer struct
type mockedHandshake (line 29) | type mockedHandshake struct
method close (line 88) | func (mh *mockedHandshake) close(t *testing.T) {
type requesterTestFunc (line 34) | type requesterTestFunc
type responderTestFunc (line 40) | type responderTestFunc
function newMockedPeer (line 47) | func newMockedPeer(t *testing.T, ctx context.Context, ipfsOpts *ipfsutil...
function newMockedHandshake (line 61) | func newMockedHandshake(t *testing.T, ctx context.Context) *mockedHandsh...
function newTestHandshakeContext (line 95) | func newTestHandshakeContext(stream p2pnetwork.Stream, ownAccountID p2pc...
function runHandshakeTest (line 105) | func runHandshakeTest(t *testing.T, requesterTest requesterTestFunc, res...
FILE: internal/handshake/request.go
function RequestUsingReaderWriter (line 19) | func RequestUsingReaderWriter(ctx context.Context, logger *zap.Logger, r...
method sendRequesterHello (line 54) | func (hc *handshakeContext) sendRequesterHello() error {
method receiveResponderHello (line 63) | func (hc *handshakeContext) receiveResponderHello() error {
method sendRequesterAuthenticate (line 75) | func (hc *handshakeContext) sendRequesterAuthenticate() error {
method receiveResponderAccept (line 118) | func (hc *handshakeContext) receiveResponderAccept() error {
method sendRequesterAcknowledge (line 169) | func (hc *handshakeContext) sendRequesterAcknowledge() error {
FILE: internal/handshake/response.go
function ResponseUsingReaderWriter (line 19) | func ResponseUsingReaderWriter(ctx context.Context, logger *zap.Logger, ...
method receiveRequesterHello (line 53) | func (hc *handshakeContext) receiveRequesterHello() error {
method sendResponderHello (line 62) | func (hc *handshakeContext) sendResponderHello() error {
method receiveRequesterAuthenticate (line 74) | func (hc *handshakeContext) receiveRequesterAuthenticate() error {
method sendResponderAccept (line 127) | func (hc *handshakeContext) sendResponderAccept() error {
method receiveRequesterAcknowledge (line 166) | func (hc *handshakeContext) receiveRequesterAcknowledge() error {
FILE: internal/notify/notify.go
type Notify (line 8) | type Notify struct
method getChan (line 19) | func (n *Notify) getChan() <-chan struct{} {
method Wait (line 29) | func (n *Notify) Wait(ctx context.Context) (ok bool) {
method Broadcast (line 44) | func (n *Notify) Broadcast() {
function New (line 15) | func New(l sync.Locker) *Notify {
FILE: internal/notify/notify_test.go
function TestNotify (line 12) | func TestNotify(t *testing.T) {
function TestNotifyConcurrentWait (line 37) | func TestNotifyConcurrentWait(t *testing.T) {
FILE: internal/queue/metrics.go
type MetricsTracer (line 3) | type MetricsTracer interface
type noopTracer (line 10) | type noopTracer struct
method ItemQueued (line 13) | func (*noopTracer[T]) ItemQueued(name string, item T) {}
method ItemPop (line 16) | func (*noopTracer[T]) ItemPop(name string, item T) {}
FILE: internal/queue/priority.go
type ICounter (line 8) | type ICounter interface
type PriorityQueue (line 13) | type PriorityQueue struct
function NewPriorityQueue (line 21) | func NewPriorityQueue[T ICounter](name string, tracer MetricsTracer[T]) ...
method Add (line 33) | func (pq *PriorityQueue[T]) Add(m T) {
method NextAll (line 40) | func (pq *PriorityQueue[T]) NextAll(cb func(next T) error) error {
method Next (line 54) | func (pq *PriorityQueue[T]) Next() (item T) {
method Size (line 63) | func (pq *PriorityQueue[T]) Size() (l int) {
method Len (line 70) | func (pq *PriorityQueue[T]) Len() (l int) {
method Less (line 75) | func (pq *PriorityQueue[T]) Less(i, j int) bool {
method Swap (line 80) | func (pq *PriorityQueue[T]) Swap(i, j int) {
method Push (line 84) | func (pq *PriorityQueue[T]) Push(x any) {
method Pop (line 89) | func (pq *PriorityQueue[T]) Pop() (item any) {
FILE: internal/queue/simple.go
type SimpleQueue (line 9) | type SimpleQueue struct
function NewSimpleQueue (line 17) | func NewSimpleQueue[T any](name string, tracer MetricsTracer[T]) *Simple...
method Add (line 27) | func (q *SimpleQueue[T]) Add(m T) {
method Pop (line 43) | func (q *SimpleQueue[T]) Pop() (m T, ok bool) {
method WaitForItem (line 59) | func (q *SimpleQueue[T]) WaitForItem(ctx context.Context) (item T, ok bo...
FILE: internal/queue/simple_test.go
function newTestSimpleQueue (line 15) | func newTestSimpleQueue() testSimpleQueue {
function TestQueue (line 19) | func TestQueue(t *testing.T) {
function TestSyncQueue (line 36) | func TestSyncQueue(t *testing.T) {
function TestAsyncQueue (line 59) | func TestAsyncQueue(t *testing.T) {
function TestWaitnForItemQueue (line 97) | func TestWaitnForItemQueue(t *testing.T) {
FILE: internal/sysutil/sysutil.go
function SystemInfoProcess (line 16) | func SystemInfoProcess() (*protocoltypes.SystemInfo_Process, error) {
FILE: internal/sysutil/sysutil_unix.go
function appendCustomSystemInfo (line 13) | func appendCustomSystemInfo(reply *protocoltypes.SystemInfo_Process) err...
FILE: internal/sysutil/sysutil_unsupported.go
function appendCustomSystemInfo (line 7) | func appendCustomSystemInfo(reply *protocoltypes.SystemInfo_Process) err...
FILE: message_marshaler.go
type PeerDeviceGroup (line 20) | type PeerDeviceGroup struct
type OrbitDBMessageMarshaler (line 25) | type OrbitDBMessageMarshaler struct
method RegisterSharedKeyForTopic (line 50) | func (m *OrbitDBMessageMarshaler) RegisterSharedKeyForTopic(topic stri...
method RegisterGroup (line 56) | func (m *OrbitDBMessageMarshaler) RegisterGroup(sid string, group *pro...
method GetDevicePKForPeerID (line 62) | func (m *OrbitDBMessageMarshaler) GetDevicePKForPeerID(id peer.ID) (pd...
method getSharedKeyFor (line 69) | func (m *OrbitDBMessageMarshaler) getSharedKeyFor(topic string) (sk en...
method Marshal (line 74) | func (m *OrbitDBMessageMarshaler) Marshal(msg *iface.MessageExchangeHe...
method Unmarshal (line 139) | func (m *OrbitDBMessageMarshaler) Unmarshal(payload []byte, msg *iface...
method sealBox (line 201) | func (m *OrbitDBMessageMarshaler) sealBox(topic string, box *protocolt...
method openBox (line 220) | func (m *OrbitDBMessageMarshaler) openBox(topic string, payload []byte...
function NewOrbitDBMessageMarshaler (line 38) | func NewOrbitDBMessageMarshaler(selfid peer.ID, secretStore secretstore....
FILE: message_marshaler_test.go
function TestRotationMessageMarshaler (line 23) | func TestRotationMessageMarshaler(t *testing.T) {
function TestRotationMessageMarshalUnknownTopic (line 65) | func TestRotationMessageMarshalUnknownTopic(t *testing.T) {
function TestRotationMessageUnmarshalUnknownTopic (line 90) | func TestRotationMessageUnmarshalUnknownTopic(t *testing.T) {
function TestRotationMessageMarshalWrongKey (line 149) | func TestRotationMessageMarshalWrongKey(t *testing.T) {
FILE: orbitdb.go
type GroupOpenMode (line 39) | type GroupOpenMode
constant GroupOpenModeUndefined (line 42) | GroupOpenModeUndefined GroupOpenMode = iota
constant GroupOpenModeReplicate (line 43) | GroupOpenModeReplicate
constant GroupOpenModeWrite (line 44) | GroupOpenModeWrite
type loggable (line 49) | type loggable interface
type NewOrbitDBOptions (line 53) | type NewOrbitDBOptions struct
method applyDefaults (line 65) | func (n *NewOrbitDBOptions) applyDefaults() {
type WeshOrbitDB (line 106) | type WeshOrbitDB struct
method registerGroupPrivateKey (line 126) | func (s *WeshOrbitDB) registerGroupPrivateKey(g *protocoltypes.Group) ...
method registerGroupSigningPubKey (line 145) | func (s *WeshOrbitDB) registerGroupSigningPubKey(g *protocoltypes.Grou...
method openAccountGroup (line 223) | func (s *WeshOrbitDB) openAccountGroup(ctx context.Context, options *o...
method setHeadsForGroup (line 256) | func (s *WeshOrbitDB) setHeadsForGroup(ctx context.Context, g *protoco...
method loadHeads (line 336) | func (s *WeshOrbitDB) loadHeads(ctx context.Context, store iface.Store...
method OpenGroup (line 382) | func (s *WeshOrbitDB) OpenGroup(ctx context.Context, g *protocoltypes....
method OpenGroupReplication (line 458) | func (s *WeshOrbitDB) OpenGroupReplication(ctx context.Context, g *pro...
method getGroupContext (line 493) | func (s *WeshOrbitDB) getGroupContext(id string) (*GroupContext, error) {
method SetGroupSigPubKey (line 515) | func (s *WeshOrbitDB) SetGroupSigPubKey(groupID string, pubKey crypto....
method storeForGroup (line 525) | func (s *WeshOrbitDB) storeForGroup(ctx context.Context, o iface.BaseO...
method groupMetadataStore (line 589) | func (s *WeshOrbitDB) groupMetadataStore(ctx context.Context, g *proto...
method groupMessageStore (line 616) | func (s *WeshOrbitDB) groupMessageStore(ctx context.Context, g *protoc...
method getGroupFromOptions (line 639) | func (s *WeshOrbitDB) getGroupFromOptions(options *iface.NewStoreOptio...
method IsGroupLoaded (line 662) | func (s *WeshOrbitDB) IsGroupLoaded(groupID string) bool {
method GetDevicePKForPeerID (line 668) | func (s *WeshOrbitDB) GetDevicePKForPeerID(id peer.ID) (pdg *PeerDevic...
function NewWeshOrbitDB (line 167) | func NewWeshOrbitDB(ctx context.Context, ipfs coreiface.CoreAPI, options...
FILE: orbitdb_datastore_cache.go
type datastoreCache (line 14) | type datastoreCache struct
method Load (line 19) | func (d *datastoreCache) Load(directory string, dbAddress address.Addr...
method Close (line 23) | func (d *datastoreCache) Close() error {
method Destroy (line 28) | func (d *datastoreCache) Destroy(directory string, dbAddress address.A...
function NewOrbitDatastoreCache (line 46) | func NewOrbitDatastoreCache(ds datastore.Batching) cache.Interface {
FILE: orbitdb_many_adds_berty_test.go
function testAddBerty (line 24) | func testAddBerty(ctx context.Context, t *testing.T, node ipfsutil.CoreA...
function TestAddBerty (line 113) | func TestAddBerty(t *testing.T) {
FILE: orbitdb_many_adds_test.go
function TestAdd (line 18) | func TestAdd(t *testing.T) {
FILE: orbitdb_signed_entry_accesscontroller.go
type simpleAccessController (line 20) | type simpleAccessController struct
method SetLogger (line 26) | func (o *simpleAccessController) SetLogger(logger *zap.Logger) {
method Logger (line 33) | func (o *simpleAccessController) Logger() *zap.Logger {
method Grant (line 41) | func (o *simpleAccessController) Grant(ctx context.Context, capability...
method Revoke (line 46) | func (o *simpleAccessController) Revoke(ctx context.Context, capabilit...
method Load (line 51) | func (o *simpleAccessController) Load(ctx context.Context, address str...
method Save (line 74) | func (o *simpleAccessController) Save(context.Context) (accesscontroll...
method Close (line 83) | func (o *simpleAccessController) Close() error {
method Type (line 87) | func (o *simpleAccessController) Type() string {
method GetAuthorizedByRole (line 91) | func (o *simpleAccessController) GetAuthorizedByRole(role string) ([]s...
method CanAppend (line 95) | func (o *simpleAccessController) CanAppend(e logac.LogEntry, _ identit...
function simpleAccessControllerCID (line 55) | func simpleAccessControllerCID(allowedKeys map[string][]string) (cid.Cid...
function NewSimpleAccessController (line 106) | func NewSimpleAccessController(_ context.Context, _ iface.BaseOrbitDB, p...
FILE: orbitdb_signed_entry_identity_provider.go
constant identityGroupIDKey (line 13) | identityGroupIDKey = "group_id"
constant storeTypeKey (line 14) | storeTypeKey = "store_type"
constant identityType (line 15) | identityType = "betry_group_entry"
type bertySignedIdentityProvider (line 18) | type bertySignedIdentityProvider struct
method UnmarshalPublicKey (line 22) | func (b *bertySignedIdentityProvider) UnmarshalPublicKey(data []byte) ...
method GetID (line 26) | func (b *bertySignedIdentityProvider) GetID(_ context.Context, opts *i...
method SignIdentity (line 31) | func (b *bertySignedIdentityProvider) SignIdentity(ctx context.Context...
method GetType (line 35) | func (b *bertySignedIdentityProvider) GetType() string {
method VerifyIdentity (line 39) | func (b *bertySignedIdentityProvider) VerifyIdentity(*identityprovider...
method Sign (line 43) | func (b *bertySignedIdentityProvider) Sign(ctx context.Context, identi...
method signID (line 57) | func (b *bertySignedIdentityProvider) signID(ctx context.Context, id s...
method createIdentity (line 71) | func (b *bertySignedIdentityProvider) createIdentity(ctx context.Conte...
FILE: orbitdb_signed_entry_keystore.go
type BertySignedKeyStore (line 14) | type BertySignedKeyStore struct
method SetKey (line 18) | func (s *BertySignedKeyStore) SetKey(pk crypto.PrivKey) error {
method HasKey (line 31) | func (s *BertySignedKeyStore) HasKey(_ context.Context, id string) (bo...
method CreateKey (line 37) | func (s *BertySignedKeyStore) CreateKey(ctx context.Context, id string...
method GetKey (line 41) | func (s *BertySignedKeyStore) GetKey(_ context.Context, id string) (cr...
method Sign (line 51) | func (s *BertySignedKeyStore) Sign(privKey crypto.PrivKey, bytes []byt...
method Verify (line 55) | func (s *BertySignedKeyStore) Verify(signature []byte, publicKey crypt...
method getIdentityProvider (line 68) | func (s *BertySignedKeyStore) getIdentityProvider() *bertySignedIdenti...
FILE: orbitdb_test.go
function TestDifferentStores (line 25) | func TestDifferentStores(t *testing.T) {
FILE: orbitdb_utils_test.go
function inviteAllPeersToGroup (line 15) | func inviteAllPeersToGroup(ctx context.Context, t *testing.T, peers []*m...
function waitForBertyEventType (line 71) | func waitForBertyEventType(ctx context.Context, t *testing.T, ms *Metada...
FILE: pkg/androidnearby/bridge_android.go
constant Supported (line 14) | Supported = true
function NewDriver (line 18) | func NewDriver(logger *zap.Logger) proximity.ProximityDriver {
FILE: pkg/androidnearby/bridge_unsupported.go
constant Supported (line 11) | Supported = false
function NewDriver (line 15) | func NewDriver(logger *zap.Logger) proximity.ProximityDriver {
FILE: pkg/androidnearby/const.go
constant DefaultAddr (line 4) | DefaultAddr = "/nearby/Qmeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"
constant ProtocolCode (line 5) | ProtocolCode = 0x0044
constant ProtocolName (line 6) | ProtocolName = "nearby"
FILE: pkg/androidnearby/init.go
function init (line 9) | func init() { // nolint:gochecknoinits
FILE: pkg/androidnearby/multiaddr.go
function newProtocol (line 8) | func newProtocol() ma.Protocol {
function mcStB (line 20) | func mcStB(s string) ([]byte, error) {
function mcBtS (line 28) | func mcBtS(b []byte) (string, error) {
function mcVal (line 36) | func mcVal(b []byte) error {
FILE: pkg/bertyvcissuer/client.go
constant DefaultRedirectURI (line 22) | DefaultRedirectURI = "berty://vc"
type Client (line 24) | type Client struct
method Init (line 40) | func (c *Client) Init(ctx context.Context, bertyURL string, accountPri...
method Complete (line 84) | func (c *Client) Complete(uri string) (string, string, *verifiable.Cre...
function NewClient (line 32) | func NewClient(serverRoot string) *Client {
function ExtractSubjectFromVC (line 125) | func ExtractSubjectFromVC(credential *verifiable.Credential) (string, er...
FILE: pkg/bertyvcissuer/urls.go
constant PathChallenge (line 9) | PathChallenge = "/challenge"
constant PathAuthenticate (line 10) | PathAuthenticate = "/authenticate"
constant PathProof (line 11) | PathProof = "/proof"
constant ParamBertyID (line 13) | ParamBertyID = "berty_id"
constant ParamState (line 14) | ParamState = "state"
constant ParamRedirectURI (line 15) | ParamRedirectURI = "redirect_uri"
constant ParamChallenge (line 16) | ParamChallenge = "challenge"
constant ParamChallengeSig (line 17) | ParamChallengeSig = "challenge_sig"
constant ParamCode (line 18) | ParamCode = "code"
constant ParamContext (line 19) | ParamContext = "context"
constant ParamCredentials (line 20) | ParamCredentials = "credentials"
constant ParamIdentifier (line 21) | ParamIdentifier = "identifier"
function MakeAuthenticateURL (line 24) | func MakeAuthenticateURL(serverBaseRoot, flowCtxStr string) string {
function MakeProofURL (line 28) | func MakeProofURL(serverBaseRoot, flowCtxStr string) string {
function MakeRedirectSuccessURI (line 32) | func MakeRedirectSuccessURI(redirectURI, state string, credentials []byt...
FILE: pkg/bertyvcissuer/verifiable_public_key_fetcher.go
function embeddedPublicKeyFetcher (line 16) | func embeddedPublicKeyFetcher(issuerID string, allowList []string) (*ver...
function EmbeddedPublicKeyFetcher (line 46) | func EmbeddedPublicKeyFetcher(issuerID, keyID string) (*verifier.PublicK...
function EmbeddedPublicKeyFetcherAllowList (line 51) | func EmbeddedPublicKeyFetcherAllowList(allowList []string) func(issuerID...
FILE: pkg/ble-driver/BleInterface_darwin.h
type level (line 28) | enum level
FILE: pkg/ble-driver/Logger.h
type Debug (line 16) | typedef NS_ENUM(uint8_t, level) {
type level (line 31) | enum level
FILE: pkg/ble-driver/bridge_android.go
constant Supported (line 14) | Supported = true
function NewDriver (line 18) | func NewDriver(logger *zap.Logger) proximity.ProximityDriver {
FILE: pkg/ble-driver/bridge_darwin.go
constant Supported (line 25) | Supported = true
type Driver (line 29) | type Driver struct
method Start (line 118) | func (d *Driver) Start(localPID string) {
method Stop (line 125) | func (d *Driver) Stop() {
method DialPeer (line 129) | func (d *Driver) DialPeer(remotePID string) bool {
method SendToPeer (line 136) | func (d *Driver) SendToPeer(remotePID string, payload []byte) bool {
method CloseConnWithPeer (line 145) | func (d *Driver) CloseConnWithPeer(remotePID string) {
method ProtocolCode (line 152) | func (d *Driver) ProtocolCode() int {
method ProtocolName (line 156) | func (d *Driver) ProtocolName() string {
method DefaultAddr (line 160) | func (d *Driver) DefaultAddr() string {
function NewDriver (line 38) | func NewDriver(logger *zap.Logger) proximity.ProximityDriver {
function BLEHandleFoundPeer (line 56) | func BLEHandleFoundPeer(remotePID *C.char) int { // nolint:revive // Nee...
function BLEHandleLostPeer (line 72) | func BLEHandleLostPeer(remotePID *C.char) { // nolint:revive // Need to ...
function BLEReceiveFromPeer (line 85) | func BLEReceiveFromPeer(remotePID *C.char, payload unsafe.Pointer, lengt...
function BLELog (line 99) | func BLELog(level C.enum_level, message *C.char) { //nolint:revive
FILE: pkg/ble-driver/bridge_unsupported.go
constant Supported (line 11) | Supported = false
function NewDriver (line 15) | func NewDriver(logger *zap.Logger) proximity.ProximityDriver {
FILE: pkg/ble-driver/const.go
constant DefaultAddr (line 4) | DefaultAddr = "/ble/Qmeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"
constant ProtocolCode (line 5) | ProtocolCode = 0x0042
constant ProtocolName (line 6) | ProtocolName = "ble"
FILE: pkg/ble-driver/init.go
function init (line 7) | func init() { // nolint:gochecknoinits
FILE: pkg/ble-driver/multiaddr.go
function newProtocol (line 8) | func newProtocol() ma.Protocol {
function mcStB (line 20) | func mcStB(s string) ([]byte, error) {
function mcBtS (line 28) | func mcBtS(b []byte) (string, error) {
function mcVal (line 36) | func mcVal(b []byte) error {
FILE: pkg/cryptoutil/cryptoutil.go
constant KeySize (line 21) | KeySize = 32
constant NonceSize (line 22) | NonceSize = 24
constant ScryptIterations (line 23) | ScryptIterations = 1 << 15
constant ScryptR (line 24) | ScryptR = 8
constant ScryptP (line 25) | ScryptP = 1
constant ScryptKeyLen (line 26) | ScryptKeyLen = 32
function ConcatAndHashSha256 (line 29) | func ConcatAndHashSha256(slices ...[]byte) *[sha256.Size]byte {
function GenerateNonce (line 40) | func GenerateNonce() (*[NonceSize]byte, error) {
function GenerateNonceSize (line 54) | func GenerateNonceSize(size int) ([]byte, error) {
function NonceSliceToArray (line 68) | func NonceSliceToArray(nonceSlice []byte) (*[NonceSize]byte, error) {
function KeySliceToArray (line 79) | func KeySliceToArray(keySlice []byte) (*[KeySize]byte, error) {
function SeedFromEd25519PrivateKey (line 90) | func SeedFromEd25519PrivateKey(key crypto.PrivKey) ([]byte, error) {
function EdwardsToMontgomery (line 109) | func EdwardsToMontgomery(privKey crypto.PrivKey, pubKey crypto.PubKey) (...
function EdwardsToMontgomeryPub (line 124) | func EdwardsToMontgomeryPub(pubKey crypto.PubKey) (*[KeySize]byte, error) {
function EdwardsToMontgomeryPriv (line 147) | func EdwardsToMontgomeryPriv(privKey crypto.PrivKey) (*[KeySize]byte, er...
function AESGCMEncrypt (line 169) | func AESGCMEncrypt(key, data []byte) ([]byte, error) {
function AESGCMDecrypt (line 191) | func AESGCMDecrypt(key, data []byte) ([]byte, error) {
function AESCTRStream (line 213) | func AESCTRStream(key, iv []byte) (cipher.Stream, error) {
function DeriveKey (line 231) | func DeriveKey(passphrase, salt []byte) ([]byte, []byte, error) {
function PublicKeyToCurve25519 (line 250) | func PublicKeyToCurve25519(ret *[32]byte, publicKey ed25519.PublicKey) e...
function PrivateKeyToCurve25519 (line 264) | func PrivateKeyToCurve25519(ret *[32]byte, privateKey ed25519.PrivateKey) {
FILE: pkg/cryptoutil/cryptoutil_test.go
function TestCurve25519Conversion (line 18) | func TestCurve25519Conversion(t *testing.T) {
function TestSeedFromEd25519PrivateKey (line 33) | func TestSeedFromEd25519PrivateKey(t *testing.T) {
function TestEdwardsToMontgomeryPub (line 46) | func TestEdwardsToMontgomeryPub(t *testing.T) {
function TestEdwardsToMontgomeryPriv (line 59) | func TestEdwardsToMontgomeryPriv(t *testing.T) {
function TestDeriveKey (line 72) | func TestDeriveKey(t *testing.T) {
function TestAESGCMEncryptDecrypt (line 99) | func TestAESGCMEncryptDecrypt(t *testing.T) {
function TestAESCTRStream (line 120) | func TestAESCTRStream(t *testing.T) {
FILE: pkg/cryptoutil/signer_wrapper.go
function NewFuncSigner (line 10) | func NewFuncSigner(key libp2p_ci.PubKey, signer func([]byte) ([]byte, er...
type funcSigner (line 17) | type funcSigner struct
method Public (line 22) | func (f *funcSigner) Public() stdcrypto.PublicKey {
method Sign (line 26) | func (f *funcSigner) Sign(_ io.Reader, digest []byte, _ stdcrypto.Sign...
FILE: pkg/errcode/errcode.pb.go
constant _ (line 18) | _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
constant _ (line 20) | _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
type ErrCode (line 23) | type ErrCode
method Enum (line 294) | func (x ErrCode) Enum() *ErrCode {
method String (line 300) | func (x ErrCode) String() string {
method Descriptor (line 304) | func (ErrCode) Descriptor() protoreflect.EnumDescriptor {
method Type (line 308) | func (ErrCode) Type() protoreflect.EnumType {
method Number (line 312) | func (x ErrCode) Number() protoreflect.EnumNumber {
method EnumDescriptor (line 317) | func (ErrCode) EnumDescriptor() ([]byte, []int) {
constant ErrCode_Undefined (line 26) | ErrCode_Undefined ErrCode = 0
constant ErrCode_TODO (line 27) | ErrCode_TODO ErrCode = 666
constant ErrCode_ErrNotImplemented (line 28) | ErrCode_ErrNotImplemented ErrCode = 777
constant ErrCode_ErrInternal (line 29) | ErrCode_ErrInternal ErrCode = 888
constant ErrCode_ErrInvalidInput (line 30) | ErrCode_ErrInvalidInput ErrCode = 100
constant ErrCode_ErrInvalidRange (line 31) | ErrCode_ErrInvalidRange ErrCode = 101
constant ErrCode_ErrMissingInput (line 32) | ErrCode_ErrMissingInput ErrCode = 102
constant ErrCode_ErrSerialization (line 33) | ErrCode_ErrSerialization ErrCode = 103
constant ErrCode_ErrDeserialization (line 34) | ErrCode_ErrDeserialization ErrCode = 104
constant ErrCode_ErrStreamRead (line 35) | ErrCode_ErrStreamRead ErrCode = 105
constant ErrCode_ErrStreamWrite (line 36) | ErrCode_ErrStreamWrite ErrCode = 106
constant ErrCode_ErrStreamTransform (line 37) | ErrCode_ErrStreamTransform ErrCode = 110
constant ErrCode_ErrStreamSendAndClose (line 38) | ErrCode_ErrStreamSendAndClose ErrCode = 111
constant ErrCode_ErrStreamHeaderWrite (line 39) | ErrCode_ErrStreamHeaderWrite ErrCode = 112
constant ErrCode_ErrStreamHeaderRead (line 40) | ErrCode_ErrStreamHeaderRead ErrCode = 115
constant ErrCode_ErrStreamSink (line 41) | ErrCode_ErrStreamSink ErrCode = 113
constant ErrCode_ErrStreamCloseAndRecv (line 42) | ErrCode_ErrStreamCloseAndRecv ErrCode = 114
constant ErrCode_ErrMissingMapKey (line 43) | ErrCode_ErrMissingMapKey ErrCode = 107
constant ErrCode_ErrDBWrite (line 44) | ErrCode_ErrDBWrite ErrCode = 108
constant ErrCode_ErrDBRead (line 45) | ErrCode_ErrDBRead ErrCode = 109
constant ErrCode_ErrDBDestroy (line 46) | ErrCode_ErrDBDestroy ErrCode = 120
constant ErrCode_ErrDBMigrate (line 47) | ErrCode_ErrDBMigrate ErrCode = 121
constant ErrCode_ErrDBReplay (line 48) | ErrCode_ErrDBReplay ErrCode = 122
constant ErrCode_ErrDBRestore (line 49) | ErrCode_ErrDBRestore ErrCode = 123
constant ErrCode_ErrDBOpen (line 50) | ErrCode_ErrDBOpen ErrCode = 124
constant ErrCode_ErrDBClose (line 51) | ErrCode_ErrDBClose ErrCode = 125
constant ErrCode_ErrCryptoRandomGeneration (line 52) | ErrCode_ErrCryptoRandomGeneration ErrCode = 200
constant ErrCode_ErrCryptoKeyGeneration (line 53) | ErrCode_ErrCryptoKeyGeneration ErrCode = 201
constant ErrCode_ErrCryptoNonceGeneration (line 54) | ErrCode_ErrCryptoNonceGeneration ErrCode = 202
constant ErrCode_ErrCryptoSignature (line 55) | ErrCode_ErrCryptoSignature ErrCode = 203
constant ErrCode_ErrCryptoSignatureVerification (line 56) | ErrCode_ErrCryptoSignatureVerification ErrCode = 204
constant ErrCode_ErrCryptoDecrypt (line 57) | ErrCode_ErrCryptoDecrypt ErrCode = 205
constant ErrCode_ErrCryptoDecryptPayload (line 58) | ErrCode_ErrCryptoDecryptPayload ErrCode = 206
constant ErrCode_ErrCryptoEncrypt (line 59) | ErrCode_ErrCryptoEncrypt ErrCode = 207
constant ErrCode_ErrCryptoKeyConversion (line 60) | ErrCode_ErrCryptoKeyConversion ErrCode = 208
constant ErrCode_ErrCryptoCipherInit (line 61) | ErrCode_ErrCryptoCipherInit ErrCode = 209
constant ErrCode_ErrCryptoKeyDerivation (line 62) | ErrCode_ErrCryptoKeyDerivation ErrCode = 210
constant ErrCode_ErrMap (line 63) | ErrCode_ErrMap ErrCode = 300
constant ErrCode_ErrForEach (line 64) | ErrCode_ErrForEach ErrCode = 301
constant ErrCode_ErrKeystoreGet (line 65) | ErrCode_ErrKeystoreGet ErrCode = 400
constant ErrCode_ErrKeystorePut (line 66) | ErrCode_ErrKeystorePut ErrCode = 401
constant ErrCode_ErrNotFound (line 67) | ErrCode_ErrNotFound ErrCode = 404
constant ErrCode_ErrOrbitDBInit (line 68) | ErrCode_ErrOrbitDBInit ErrCode = 1000
constant ErrCode_ErrOrbitDBOpen (line 69) | ErrCode_ErrOrbitDBOpen ErrCode = 1001
constant ErrCode_ErrOrbitDBAppend (line 70) | ErrCode_ErrOrbitDBAppend ErrCode = 1002
constant ErrCode_ErrOrbitDBDeserialization (line 71) | ErrCode_ErrOrbitDBDeserialization ErrCode = 1003
constant ErrCode_ErrOrbitDBStoreCast (line 72) | ErrCode_ErrOrbitDBStoreCast ErrCode = 1004
constant ErrCode_ErrHandshakeOwnEphemeralKeyGenSend (line 73) | ErrCode_ErrHandshakeOwnEphemeralKeyGenSend ErrCode = 1100
constant ErrCode_ErrHandshakePeerEphemeralKeyRecv (line 74) | ErrCode_ErrHandshakePeerEphemeralKeyRecv ErrCode = 1101
constant ErrCode_ErrHandshakeRequesterAuthenticateBoxKeyGen (line 75) | ErrCode_ErrHandshakeRequesterAuthenticateBoxKeyGen ErrCode = 1102
constant ErrCode_ErrHandshakeResponderAcceptBoxKeyGen (line 76) | ErrCode_ErrHandshakeResponderAcceptBoxKeyGen ErrCode = 1103
constant ErrCode_ErrHandshakeRequesterHello (line 77) | ErrCode_ErrHandshakeRequesterHello ErrCode = 1104
constant ErrCode_ErrHandshakeResponderHello (line 78) | ErrCode_ErrHandshakeResponderHello ErrCode = 1105
constant ErrCode_ErrHandshakeRequesterAuthenticate (line 79) | ErrCode_ErrHandshakeRequesterAuthenticate ErrCode = 1106
constant ErrCode_ErrHandshakeResponderAccept (line 80) | ErrCode_ErrHandshakeResponderAccept ErrCode = 1107
constant ErrCode_ErrHandshakeRequesterAcknowledge (line 81) | ErrCode_ErrHandshakeRequesterAcknowledge ErrCode = 1108
constant ErrCode_ErrContactRequestSameAccount (line 82) | ErrCode_ErrContactRequestSameAccount ErrCode = 1200
constant ErrCode_ErrContactRequestContactAlreadyAdded (line 83) | ErrCode_ErrContactRequestContactAlreadyAdded ErrCode = 1201
constant ErrCode_ErrContactRequestContactBlocked (line 84) | ErrCode_ErrContactRequestContactBlocked ErrCode = 1202
constant ErrCode_ErrContactRequestContactUndefined (line 85) | ErrCode_ErrContactRequestContactUndefined ErrCode = 1203
constant ErrCode_ErrContactRequestIncomingAlreadyReceived (line 86) | ErrCode_ErrContactRequestIncomingAlreadyReceived ErrCode = 1204
constant ErrCode_ErrGroupMemberLogEventOpen (line 87) | ErrCode_ErrGroupMemberLogEventOpen ErrCode = 1300
constant ErrCode_ErrGroupMemberLogEventSignature (line 88) | ErrCode_ErrGroupMemberLogEventSignature ErrCode = 1301
constant ErrCode_ErrGroupMemberUnknownGroupID (line 89) | ErrCode_ErrGroupMemberUnknownGroupID ErrCode = 1302
constant ErrCode_ErrGroupSecretOtherDestMember (line 90) | ErrCode_ErrGroupSecretOtherDestMember ErrCode = 1303
constant ErrCode_ErrGroupSecretAlreadySentToMember (line 91) | ErrCode_ErrGroupSecretAlreadySentToMember ErrCode = 1304
constant ErrCode_ErrGroupInvalidType (line 92) | ErrCode_ErrGroupInvalidType ErrCode = 1305
constant ErrCode_ErrGroupMissing (line 93) | ErrCode_ErrGroupMissing ErrCode = 1306
constant ErrCode_ErrGroupActivate (line 94) | ErrCode_ErrGroupActivate ErrCode = 1307
constant ErrCode_ErrGroupDeactivate (line 95) | ErrCode_ErrGroupDeactivate ErrCode = 1308
constant ErrCode_ErrGroupInfo (line 96) | ErrCode_ErrGroupInfo ErrCode = 1309
constant ErrCode_ErrGroupUnknown (line 97) | ErrCode_ErrGroupUnknown ErrCode = 1310
constant ErrCode_ErrGroupOpen (line 98) | ErrCode_ErrGroupOpen ErrCode = 1311
constant ErrCode_ErrMessageKeyPersistencePut (line 99) | ErrCode_ErrMessageKeyPersistencePut ErrCode = 1500
constant ErrCode_ErrMessageKeyPersistenceGet (line 100) | ErrCode_ErrMessageKeyPersistenceGet ErrCode = 1501
constant ErrCode_ErrServiceReplication (line 101) | ErrCode_ErrServiceReplication ErrCode = 4100
constant ErrCode_ErrServiceReplicationServer (line 102) | ErrCode_ErrServiceReplicationServer ErrCode = 4101
constant ErrCode_ErrServiceReplicationMissingEndpoint (line 103) | ErrCode_ErrServiceReplicationMissingEndpoint ErrCode = 4102
constant ErrCode_ErrServicesDirectory (line 104) | ErrCode_ErrServicesDirectory ErrCode = 4200
constant ErrCode_ErrServicesDirectoryInvalidVerifiedCredentialSubject (line 105) | ErrCode_ErrServicesDirectoryInvalidVerifiedCredentialSubject ErrCode = 4201
constant ErrCode_ErrServicesDirectoryExistingRecordNotFound (line 106) | ErrCode_ErrServicesDirectoryExistingRecordNotFound ErrCode = 4202
constant ErrCode_ErrServicesDirectoryRecordLockedAndCantBeReplaced (line 107) | ErrCode_ErrServicesDirectoryRecordLockedAndCantBeReplaced ErrCode = 4203
constant ErrCode_ErrServicesDirectoryExplicitReplaceFlagRequired (line 108) | ErrCode_ErrServicesDirectoryExplicitReplaceFlagRequired ErrCode = 4204
constant ErrCode_ErrServicesDirectoryInvalidVerifiedCredential (line 109) | ErrCode_ErrServicesDirectoryInvalidVerifiedCredential ErrCode = 4205
constant ErrCode_ErrServicesDirectoryExpiredVerifiedCredential (line 110) | ErrCode_ErrServicesDirectoryExpiredVerifiedCredential ErrCode = 4206
constant ErrCode_ErrServicesDirectoryInvalidVerifiedCredentialID (line 111) | ErrCode_ErrServicesDirectoryInvalidVerifiedCredentialID ErrCode = 4207
type ErrDetails (line 321) | type ErrDetails struct
method Reset (line 329) | func (x *ErrDetails) Reset() {
method String (line 338) | func (x *ErrDetails) String() string {
method ProtoMessage (line 342) | func (*ErrDetails) ProtoMessage() {}
method ProtoReflect (line 344) | func (x *ErrDetails) ProtoReflect() protoreflect.Message {
method Descriptor (line 357) | func (*ErrDetails) Descriptor() ([]byte, []int) {
method GetCodes (line 361) | func (x *ErrDetails) GetCodes() []ErrCode {
function file_errcode_errcode_proto_rawDescGZIP (line 546) | func file_errcode_errcode_proto_rawDescGZIP() []byte {
function init (line 568) | func init() { file_errcode_errcode_proto_init() }
function file_errcode_errcode_proto_init (line 569) | func file_errcode_errcode_proto_init() {
FILE: pkg/errcode/error.go
type WithCode (line 14) | type WithCode interface
function Codes (line 20) | func Codes(err error) []ErrCode {
function Has (line 45) | func Has(err error, code WithCode) bool {
function Is (line 51) | func Is(err error, code WithCode) bool {
function currentCode (line 56) | func currentCode(err error) ErrCode {
function Code (line 77) | func Code(err error) ErrCode {
function LastCode (line 94) | func LastCode(err error) ErrCode {
function genericCause (line 116) | func genericCause(err error) error {
method Error (line 135) | func (e ErrCode) Error() string {
method Code (line 143) | func (e ErrCode) Code() ErrCode {
method Wrap (line 147) | func (e ErrCode) Wrap(inner error) WithCode {
method GRPCStatus (line 155) | func (e ErrCode) GRPCStatus() *status.Status {
type wrappedError (line 167) | type wrappedError struct
method Error (line 173) | func (e wrappedError) Error() string {
method Code (line 177) | func (e wrappedError) Code() ErrCode {
method Cause (line 182) | func (e wrappedError) Cause() error {
method Unwrap (line 187) | func (e wrappedError) Unwrap() error {
method GRPCStatus (line 191) | func (e wrappedError) GRPCStatus() *status.Status {
method Format (line 199) | func (e wrappedError) Format(f fmt.State, c rune) {
method FormatError (line 215) | func (e wrappedError) FormatError(p xerrors.Printer) error {
type lightWrappedError (line 227) | type lightWrappedError struct
method Error (line 232) | func (e lightWrappedError) Error() string { return "" }
method Format (line 234) | func (e lightWrappedError) Format(f fmt.State, c rune) {
method FormatError (line 250) | func (e lightWrappedError) FormatError(p xerrors.Printer) error {
function codesFromGRPCStatus (line 260) | func codesFromGRPCStatus(st *status.Status) []ErrCode {
function grpcCodeFromWithCode (line 270) | func grpcCodeFromWithCode(WithCode) codes.Code {
type gRPCStatus (line 276) | type gRPCStatus interface
function getGRPCStatus (line 278) | func getGRPCStatus(err error) *status.Status {
FILE: pkg/errcode/error_test.go
function TestError (line 18) | func TestError(t *testing.T) {
function TestStatus (line 68) | func TestStatus(t *testing.T) {
FILE: pkg/errcode/stdproto.go
function init (line 7) | func init() {
FILE: pkg/grpcutil/buf_listener.go
type BufListener (line 12) | type BufListener struct
method dialer (line 22) | func (bl *BufListener) dialer(context.Context, string) (net.Conn, erro...
method NewClientConn (line 26) | func (bl *BufListener) NewClientConn(_ context.Context, opts ...grpc.D...
function NewBufListener (line 16) | func NewBufListener(sz int) *BufListener {
FILE: pkg/grpcutil/simple_auth.go
constant headerAuthorize (line 9) | headerAuthorize = "authorization"
type unsecureSimpleAuthAccess (line 14) | type unsecureSimpleAuthAccess struct
method GetRequestMetadata (line 25) | func (sa *unsecureSimpleAuthAccess) GetRequestMetadata(_ context.Conte...
method RequireTransportSecurity (line 31) | func (unsecureSimpleAuthAccess) RequireTransportSecurity() bool {
function NewUnsecureSimpleAuthAccess (line 20) | func NewUnsecureSimpleAuthAccess(scheme, token string) credentials.PerRP...
FILE: pkg/grpcutil/simple_auth_test.go
constant testGoodToken (line 19) | testGoodToken = "hellobuddy"
function validateToken (line 21) | func validateToken(token string) bool {
function testAuthFunc (line 26) | func testAuthFunc(ctx context.Context) (context.Context, error) {
function SayHelloAuthenticated (line 41) | func SayHelloAuthenticated(ctx context.Context, request *pb.HelloRequest...
function TestSimpleAuth (line 45) | func TestSimpleAuth(t *testing.T) {
FILE: pkg/ipfsutil/collector_bandwidth.go
type BandwidthCollector (line 24) | type BandwidthCollector struct
method Collect (line 32) | func (bc *BandwidthCollector) Collect(cmetric chan<- prometheus.Metric) {
method Describe (line 50) | func (bc *BandwidthCollector) Describe(ch chan<- *prometheus.Desc) {
function NewBandwidthCollector (line 28) | func NewBandwidthCollector(reporter *metrics.BandwidthCounter) *Bandwidt...
FILE: pkg/ipfsutil/collector_host.go
constant UnknownProtocol (line 28) | UnknownProtocol = "UnknownProtocol"
type HostCollector (line 30) | type HostCollector struct
method Collect (line 49) | func (cc *HostCollector) Collect(cmetric chan<- prometheus.Metric) {
method Describe (line 72) | func (cc *HostCollector) Describe(ch chan<- *prometheus.Desc) {
method Listen (line 79) | func (cc *HostCollector) Listen(network.Network, ma.Multiaddr) {}
method ListenClose (line 80) | func (cc *HostCollector) ListenClose(network.Network, ma.Multiaddr) {}
method Connected (line 82) | func (cc *HostCollector) Connected(network.Network, network.Conn) {
method Disconnected (line 86) | func (cc *HostCollector) Disconnected(network.Network, network.Conn) {
method OpenedStream (line 90) | func (cc *HostCollector) OpenedStream(network.Network, network.Stream) {}
method ClosedStream (line 91) | func (cc *HostCollector) ClosedStream(network.Network, network.Stream) {
function NewHostCollector (line 36) | func NewHostCollector(h host.Host) *HostCollector {
FILE: pkg/ipfsutil/conn_logger.go
type connLogger (line 22) | type connLogger struct
method getPeerTags (line 41) | func (cl *connLogger) getPeerTags(p peer.ID) []string {
method Listen (line 58) | func (cl *connLogger) Listen(_ network.Network, m ma.Multiaddr) {
method ListenClose (line 62) | func (cl *connLogger) ListenClose(_ network.Network, m ma.Multiaddr) {
method Connected (line 66) | func (cl *connLogger) Connected(_ network.Network, c network.Conn) {
method Disconnected (line 81) | func (cl *connLogger) Disconnected(_ network.Network, c network.Conn) {
method OpenedStream (line 92) | func (cl *connLogger) OpenedStream(_ network.Network, s network.Stream) {
method ClosedStream (line 104) | func (cl *connLogger) ClosedStream(_ network.Network, s network.Stream) {
function EnableConnLogger (line 27) | func EnableConnLogger(ctx context.Context, logger *zap.Logger, h host.Ho...
FILE: pkg/ipfsutil/conn_manager.go
type TypeTagAction (line 13) | type TypeTagAction
constant TypeTagActionTag (line 16) | TypeTagActionTag TypeTagAction = iota
constant TypeTagActionUntag (line 17) | TypeTagActionUntag
constant TypeTagActionUpsert (line 18) | TypeTagActionUpsert
type EvtPeerTag (line 21) | type EvtPeerTag struct
type BertyConnManager (line 33) | type BertyConnManager struct
method RegisterEventBus (line 50) | func (c *BertyConnManager) RegisterEventBus(bus event.Bus) (err error) {
method GetPeerScore (line 59) | func (c *BertyConnManager) GetPeerScore(p peer.ID) (score int, exist b...
method TagPeer (line 67) | func (c *BertyConnManager) TagPeer(p peer.ID, tag string, score int) {
method UntagPeer (line 88) | func (c *BertyConnManager) UntagPeer(p peer.ID, tag string) {
method UpsertTag (line 113) | func (c *BertyConnManager) UpsertTag(p peer.ID, tag string, upsert fun...
method computePeerScore (line 133) | func (c *BertyConnManager) computePeerScore(p peer.ID) (old, newScore ...
function NewBertyConnManager (line 42) | func NewBertyConnManager(logger *zap.Logger, cm connmgr.ConnManager) *Be...
FILE: pkg/ipfsutil/consts.go
constant DefaultP2PRdvpMaddr (line 5) | DefaultP2PRdvpMaddr = "/ip4/51.15.25.224/udp/4040/quic-v1/p2p/12D3KooWHh...
constant DefaultP2PStaticRelay (line 7) | DefaultP2PStaticRelay = "/ip4/51.15.25.224/udp/6363/quic-v1/p2p/12D3KooW...
FILE: pkg/ipfsutil/extended_core_api.go
type ConnMgr (line 11) | type ConnMgr interface
type ExtendedCoreAPI (line 15) | type ExtendedCoreAPI interface
type extendedCoreAPI (line 22) | type extendedCoreAPI struct
method ConnMgr (line 27) | func (e *extendedCoreAPI) ConnMgr() ConnMgr {
function NewExtendedCoreAPI (line 31) | func NewExtendedCoreAPI(host ipfs_host.Host, api coreiface.CoreAPI) Exte...
function NewExtendedCoreAPIFromNode (line 38) | func NewExtendedCoreAPIFromNode(node *ipfs_core.IpfsNode) (ExtendedCoreA...
FILE: pkg/ipfsutil/helpers.go
function ParseAndResolveIpfsAddr (line 21) | func ParseAndResolveIpfsAddr(ctx context.Context, addr string) (*peer.Ad...
function ParseAndResolveMaddrs (line 63) | func ParseAndResolveMaddrs(ctx context.Context, logger *zap.Logger, addr...
constant DefaultCloseTimeout (line 120) | DefaultCloseTimeout = time.Second * 5
function FullClose (line 122) | func FullClose(s network.Stream) error {
FILE: pkg/ipfsutil/helpers_test.go
constant closeTestPid (line 24) | closeTestPid = "/testing/close/0.1.0"
function TestFullClose (line 28) | func TestFullClose(t *testing.T) {
FILE: pkg/ipfsutil/keystore_datastore.go
type datastoreKeystore (line 13) | type datastoreKeystore struct
method Has (line 17) | func (k *datastoreKeystore) Has(name string) (bool, error) {
method Put (line 21) | func (k *datastoreKeystore) Put(name string, key crypto.PrivKey) error {
method Get (line 30) | func (k *datastoreKeystore) Get(name string) (crypto.PrivKey, error) {
method Delete (line 41) | func (k *datastoreKeystore) Delete(name string) error {
method List (line 45) | func (k *datastoreKeystore) List() ([]string, error) {
function NewDatastoreKeystore (line 49) | func NewDatastoreKeystore(ds datastore.Datastore) keystore.Keystore {
FILE: pkg/ipfsutil/lifecycle.go
type ConnLifecycle (line 28) | type ConnLifecycle struct
method monitorAppState (line 82) | func (cl *ConnLifecycle) monitorAppState(ctx context.Context) {
method dropUnavailableConn (line 105) | func (cl *ConnLifecycle) dropUnavailableConn() {
method monitorPeerOfInterest (line 153) | func (cl *ConnLifecycle) monitorPeerOfInterest(ctx context.Context) er...
function NewConnLifecycle (line 41) | func NewConnLifecycle(ctx context.Context, logger *zap.Logger, h host.Ho...
FILE: pkg/ipfsutil/localrecord.go
constant recProtocolID (line 19) | recProtocolID = protocol.ID("wesh/p2p/localrecord")
type LocalRecord (line 21) | type LocalRecord struct
method Listen (line 37) | func (lr *LocalRecord) Listen(network.Network, ma.Multiaddr) {}
method ListenClose (line 40) | func (lr *LocalRecord) ListenClose(network.Network, ma.Multiaddr) {}
method Connected (line 43) | func (lr *LocalRecord) Connected(_ network.Network, c network.Conn) {
method Disconnected (line 55) | func (lr *LocalRecord) Disconnected(network.Network, network.Conn) {}
method OpenedStream (line 58) | func (lr *LocalRecord) OpenedStream(network.Network, network.Stream) {}
method ClosedStream (line 61) | func (lr *LocalRecord) ClosedStream(network.Network, network.Stream) {}
method sendLocalRecord (line 63) | func (lr *LocalRecord) sendLocalRecord(ctx context.Context, c network....
method handleLocalRecords (line 71) | func (lr *LocalRecord) handleLocalRecords(network.Stream) {
function OptionLocalRecord (line 26) | func OptionLocalRecord(node *ipfs_core.IpfsNode, _ coreiface.CoreAPI) er...
FILE: pkg/ipfsutil/mobile.go
type DHTNetworkMode (line 23) | type DHTNetworkMode
constant DHTNetworkLan (line 26) | DHTNetworkLan DHTNetworkMode = iota
constant DHTNetworkWan (line 27) | DHTNetworkWan
constant DHTNetworkDual (line 28) | DHTNetworkDual
type Config (line 31) | type Config
type MobileOptions (line 33) | type MobileOptions struct
method fillDefault (line 49) | func (o *MobileOptions) fillDefault() {
method defaultIpfsConfigPatch (line 148) | func (o *MobileOptions) defaultIpfsConfigPatch(cfg *ipfs_config.Config...
function NewIPFSMobile (line 85) | func NewIPFSMobile(ctx context.Context, repo *ipfs_mobile.RepoMobile, op...
function CustomRoutingOption (line 135) | func CustomRoutingOption(mode dht.ModeOpt, net DHTNetworkMode, opts ...d...
constant maxPrefixCountPerCpl (line 197) | maxPrefixCountPerCpl = 2
constant maxPrefixCount (line 198) | maxPrefixCount = 3
function newDualDHT (line 201) | func newDualDHT(ctx context.Context, h host.Host, net DHTNetworkMode, op...
FILE: pkg/ipfsutil/mobile/host.go
type HostConfigFunc (line 16) | type HostConfigFunc
type HostConfig (line 19) | type HostConfig struct
function ChainHostConfig (line 27) | func ChainHostConfig(cfgs ...HostConfigFunc) HostConfigFunc {
type HostMobile (line 42) | type HostMobile struct
function NewHostConfigOption (line 46) | func NewHostConfigOption(hopt ipfs_p2p.HostOption, cfg *HostConfig) ipfs...
FILE: pkg/ipfsutil/mobile/node.go
type IpfsConfig (line 16) | type IpfsConfig struct
method fillDefault (line 27) | func (c *IpfsConfig) fillDefault() error {
type IpfsMobile (line 55) | type IpfsMobile struct
method PeerHost (line 62) | func (im *IpfsMobile) PeerHost() p2p_host.Host {
method Close (line 66) | func (im *IpfsMobile) Close() error {
method ServeCoreHTTP (line 70) | func (im *IpfsMobile) ServeCoreHTTP(l net.Listener, opts ...ipfs_coreh...
method ServeGateway (line 81) | func (im *IpfsMobile) ServeGateway(l net.Listener, opts ...ipfs_coreht...
function NewNode (line 93) | func NewNode(ctx context.Context, cfg *IpfsConfig) (*IpfsMobile, error) {
FILE: pkg/ipfsutil/mobile/repo.go
type RepoConfigPatch (line 10) | type RepoConfigPatch
type RepoMobile (line 12) | type RepoMobile struct
method ApplyPatchs (line 25) | func (mr *RepoMobile) ApplyPatchs(patchs ...RepoConfigPatch) error {
function NewRepoMobile (line 18) | func NewRepoMobile(path string, repo ipfs_repo.Repo) *RepoMobile {
function ChainIpfsConfigPatch (line 38) | func ChainIpfsConfigPatch(patchs ...RepoConfigPatch) RepoConfigPatch {
FILE: pkg/ipfsutil/mobile/routing.go
type RoutingConfigFunc (line 11) | type RoutingConfigFunc
type RoutingConfig (line 13) | type RoutingConfig struct
function NewRoutingConfigOption (line 17) | func NewRoutingConfigOption(ro ipfs_p2p.RoutingOption, rc *RoutingConfig...
FILE: pkg/ipfsutil/peering.go
constant connmgrTag (line 25) | connmgrTag = "berty-peering"
constant MaximumReconnectingDelay (line 29) | MaximumReconnectingDelay = time.Second * 30
type state (line 32) | type state
constant stateInit (line 35) | stateInit state = iota
constant stateRunning (line 36) | stateRunning
constant stateStopped (line 37) | stateStopped
type PeeringService (line 42) | type PeeringService struct
method Start (line 66) | func (ps *PeeringService) Start() error {
method Stop (line 87) | func (ps *PeeringService) Stop() error {
method AddPeer (line 110) | func (ps *PeeringService) AddPeer(info peer.AddrInfo) {
method ListPeers (line 144) | func (ps *PeeringService) ListPeers() []peer.AddrInfo {
method RemovePeer (line 160) | func (ps *PeeringService) RemovePeer(id peer.ID) {
function NewPeeringService (line 54) | func NewPeeringService(logger *zap.Logger, host host.Host, fact backoff....
type netNotifee (line 173) | type netNotifee
method Connected (line 175) | func (nn *netNotifee) Connected(_ network.Network, c network.Conn) {
method Disconnected (line 188) | func (nn *netNotifee) Disconnected(_ network.Network, c network.Conn) {
method OpenedStream (line 200) | func (nn *netNotifee) OpenedStream(network.Network, network.Stream) ...
method ClosedStream (line 201) | func (nn *netNotifee) ClosedStream(network.Network, network.Stream) ...
method Listen (line 202) | func (nn *netNotifee) Listen(network.Network, multiaddr.Multiaddr) ...
method ListenClose (line 203) | func (nn *netNotifee) ListenClose(network.Network, multiaddr.Multiaddr...
type peerHandler (line 206) | type peerHandler struct
method setAddrs (line 221) | func (ph *peerHandler) setAddrs(addrs []multiaddr.Multiaddr) {
method getAddrs (line 232) | func (ph *peerHandler) getAddrs() []multiaddr.Multiaddr {
method stop (line 239) | func (ph *peerHandler) stop() {
method nextBackoff (line 252) | func (ph *peerHandler) nextBackoff() time.Duration {
method reconnect (line 256) | func (ph *peerHandler) reconnect() {
method stopIfConnected (line 288) | func (ph *peerHandler) stopIfConnected() {
method startIfDisconnected (line 302) | func (ph *peerHandler) startIfDisconnected() {
FILE: pkg/ipfsutil/pubsub_adaptater.go
type pubsubCoreAPIAdapter (line 7) | type pubsubCoreAPIAdapter struct
method PubSub (line 13) | func (ps *pubsubCoreAPIAdapter) PubSub() coreiface.PubSubAPI {
function InjectPubSubAPI (line 17) | func InjectPubSubAPI(api coreiface.CoreAPI, ps coreiface.PubSubAPI) core...
type pubsubExtendedCoreAPIAdapter (line 24) | type pubsubExtendedCoreAPIAdapter struct
method PubSub (line 30) | func (ps *pubsubExtendedCoreAPIAdapter) PubSub() coreiface.PubSubAPI {
function InjectPubSubCoreAPIExtendedAdapter (line 34) | func InjectPubSubCoreAPIExtendedAdapter(exapi ExtendedCoreAPI, ps coreif...
FILE: pkg/ipfsutil/pubsub_api.go
type PubSubAPI (line 16) | type PubSubAPI struct
method topicJoin (line 33) | func (ps *PubSubAPI) topicJoin(topic string, opts ...p2p_pubsub.TopicO...
method Ls (line 68) | func (ps *PubSubAPI) Ls(context.Context) ([]string, error) {
method Peers (line 73) | func (ps *PubSubAPI) Peers(_ context.Context, opts ...coreiface_option...
method Publish (line 85) | func (ps *PubSubAPI) Publish(ctx context.Context, topic string, msg []...
method Subscribe (line 95) | func (ps *PubSubAPI) Subscribe(_ context.Context, topic string, _ ...c...
function NewPubSubAPI (line 24) | func NewPubSubAPI(_ context.Context, logger *zap.Logger, ps *p2p_pubsub....
type pubsubSubscriptionAPI (line 111) | type pubsubSubscriptionAPI struct
method Close (line 117) | func (pss *pubsubSubscriptionAPI) Close() (_ error) {
method Next (line 123) | func (pss *pubsubSubscriptionAPI) Next(ctx context.Context) (coreiface...
type pubsubMessageAPI (line 133) | type pubsubMessageAPI struct
method From (line 138) | func (psm *pubsubMessageAPI) From() p2p_peer.ID {
method Data (line 143) | func (psm *pubsubMessageAPI) Data() []byte {
method Seq (line 148) | func (psm *pubsubMessageAPI) Seq() []byte {
method Topics (line 153) | func (psm *pubsubMessageAPI) Topics() []string {
FILE: pkg/ipfsutil/pubsub_monitor.go
type EventMonitor (line 19) | type EventMonitor
constant TypeEventMonitorPeerUnknown (line 22) | TypeEventMonitorPeerUnknown EventMonitor = iota
constant TypeEventMonitorPeerJoined (line 23) | TypeEventMonitorPeerJoined
constant TypeEventMonitorPeerLeft (line 24) | TypeEventMonitorPeerLeft
type EventTracer (line 27) | type EventTracer interface
type EvtPubSubTopic (line 31) | type EvtPubSubTopic struct
type PubsubMonitor (line 37) | type PubsubMonitor struct
method EventTracerOption (line 60) | func (pt *PubsubMonitor) EventTracerOption() ps.Option {
method Trace (line 67) | func (pt *PubsubMonitor) Trace(e *ps_pb.TraceEvent) {
method Emit (line 127) | func (pt *PubsubMonitor) Emit(e *EvtPubSubTopic) {
method popTopicFromPeer (line 133) | func (pt *PubsubMonitor) popTopicFromPeer(p peer.ID) []string {
method addTopicToPeer (line 145) | func (pt *PubsubMonitor) addTopicToPeer(p peer.ID, ns string) {
function NewPubsubMonitor (line 47) | func NewPubsubMonitor(l *zap.Logger, h host.Host) (EventTracer, error) {
FILE: pkg/ipfsutil/repo.go
constant defaultConnMgrHighWater (line 24) | defaultConnMgrHighWater = 200
constant defaultConnMgrLowWater (line 28) | defaultConnMgrLowWater = 150
constant defaultConnMgrGracePeriod (line 32) | defaultConnMgrGracePeriod = time.Second * 20
function CreateMockedRepo (line 37) | func CreateMockedRepo(dstore ipfs_ds.Batching) (ipfs_repo.Repo, error) {
function CreateOrLoadMockedRepo (line 49) | func CreateOrLoadMockedRepo(dstore ipfs_ds.Batching) (ipfs_repo.Repo, er...
function LoadRepoFromPath (line 61) | func LoadRepoFromPath(path string) (ipfs_repo.Repo, error) {
function CreateBaseConfig (line 93) | func CreateBaseConfig() (*ipfs_cfg.Config, error) {
function ResetRepoIdentity (line 127) | func ResetRepoIdentity(c *ipfs_cfg.Config) error {
function upgradeToPersistentConfig (line 150) | func upgradeToPersistentConfig(cfg *ipfs_cfg.Config) (*ipfs_cfg.Config, ...
function ResetExistingRepoIdentity (line 207) | func ResetExistingRepoIdentity(repo ipfs_repo.Repo) (ipfs_repo.Repo, err...
function LoadPlugins (line 231) | func LoadPlugins(repoPath string) (*ipfs_loader.PluginLoader, error) { /...
FILE: pkg/ipfsutil/testing.go
type CoreAPIMock (line 37) | type CoreAPIMock interface
function getOrCreatePrivateKeyFromDatastore (line 47) | func getOrCreatePrivateKeyFromDatastore(t testing.TB, ctx context.Contex...
function TestingRepo (line 79) | func TestingRepo(t testing.TB, ctx context.Context, datastore ds.Datasto...
type TestingAPIOpts (line 112) | type TestingAPIOpts struct
function TestingCoreAPIUsingMockNet (line 120) | func TestingCoreAPIUsingMockNet(ctx context.Context, t testing.TB, opts ...
function TestingCoreAPI (line 190) | func TestingCoreAPI(ctx context.Context, t testing.TB) CoreAPIMock {
function TestingRDVP (line 204) | func TestingRDVP(ctx context.Context, t testing.TB, h host.Host) (*rende...
type coreAPIMock (line 218) | type coreAPIMock struct
method ConnMgr (line 227) | func (m *coreAPIMock) ConnMgr() ConnMgr {
method NewStream (line 231) | func (m *coreAPIMock) NewStream(ctx context.Context, p p2p_peer.ID, pi...
method SetStreamHandler (line 235) | func (m *coreAPIMock) SetStreamHandler(pid protocol.ID, handler p2pnet...
method RemoveStreamHandler (line 239) | func (m *coreAPIMock) RemoveStreamHandler(pid protocol.ID) {
method API (line 243) | func (m *coreAPIMock) API() ExtendedCoreAPI {
method MockNetwork (line 247) | func (m *coreAPIMock) MockNetwork() mocknet.Mocknet {
method MockNode (line 251) | func (m *coreAPIMock) MockNode() *ipfs_core.IpfsNode {
method PubSub (line 255) | func (m *coreAPIMock) PubSub() *pubsub.PubSub {
method Tinder (line 259) | func (m *coreAPIMock) Tinder() *tinder.Service {
method Close (line 263) | func (m *coreAPIMock) Close() {
function MockHostOption (line 267) | func MockHostOption(mn mocknet.Mocknet) ipfs_p2p.HostOption {
FILE: pkg/ipfsutil/util.go
type Multiaddrs (line 13) | type Multiaddrs
method Len (line 22) | func (ms Multiaddrs) Len() int { return len(ms) }
method Less (line 26) | func (ms Multiaddrs) Less(i, j int) bool { return bytes.Compare(ms[i]....
method Swap (line 29) | func (ms Multiaddrs) Swap(i, j int) { ms[i], ms[j] = ms[j], ms[i] }
function NewMultiaddrs (line 15) | func NewMultiaddrs(m []ma.Multiaddr) Multiaddrs {
function MultiaddrIsEqual (line 32) | func MultiaddrIsEqual(a Multiaddrs, b Multiaddrs) bool {
function ParseAddr (line 46) | func ParseAddr(addr string) (ma.Multiaddr, error) {
function ParseAddrs (line 65) | func ParseAddrs(addrs ...string) ([]ma.Multiaddr, error) {
FILE: pkg/lifecycle/manager.go
type State (line 10) | type State
constant StateActive (line 13) | StateActive State = iota
constant StateInactive (line 14) | StateInactive
type Manager (line 17) | type Manager struct
method UpdateState (line 36) | func (m *Manager) UpdateState(state State) {
method WaitForStateChange (line 46) | func (m *Manager) WaitForStateChange(ctx context.Context, sourceState ...
method GetCurrentState (line 60) | func (m *Manager) GetCurrentState() (state State) {
method TaskWaitForStateChange (line 71) | func (m *Manager) TaskWaitForStateChange(ctx context.Context, sourceSt...
method WaitForTasks (line 87) | func (m *Manager) WaitForTasks() {
function NewManager (line 26) | func NewManager(initialState State) *Manager {
FILE: pkg/lifecycle/task.go
type Task (line 5) | type Task interface
type task (line 9) | type task struct
method Done (line 14) | func (t *task) Done() {
FILE: pkg/logutil/crypto_utils.go
function CryptoKeyToBytes (line 9) | func CryptoKeyToBytes(key crypto.Key) []byte {
function CryptoKeyToBase64 (line 18) | func CryptoKeyToBase64(key crypto.Key) string {
FILE: pkg/logutil/encoders.go
constant Black (line 10) | Black uint8 = iota + 30
constant Red (line 11) | Red
constant Green (line 12) | Green
constant Yellow (line 13) | Yellow
constant Blue (line 14) | Blue
constant Magenta (line 15) | Magenta
constant Cyan (line 16) | Cyan
constant White (line 17) | White
function stableWidthNameEncoder (line 20) | func stableWidthNameEncoder(loggerName string, enc zapcore.PrimitiveArra...
function stableWidthCapitalLevelEncoder (line 24) | func stableWidthCapitalLevelEncoder(l zapcore.Level, enc zapcore.Primiti...
function stableWidthCapitalColorLevelEncoder (line 28) | func stableWidthCapitalColorLevelEncoder(l zapcore.Level, enc zapcore.Pr...
FILE: pkg/logutil/example_test.go
function Example_logall (line 7) | func Example_logall() {
function Example_logerrors (line 35) | func Example_logerrors() {
FILE: pkg/logutil/file.go
function newFileWriteCloser (line 20) | func newFileWriteCloser(target, kind string) (io.WriteCloser, error) {
type Logfile (line 65) | type Logfile struct
method Path (line 75) | func (l Logfile) Path() string {
constant filePatternDateLayout (line 79) | filePatternDateLayout = "2006-01-02T15-04-05.000"
function LogfileList (line 83) | func LogfileList(logDir string) ([]*Logfile, error) {
function CurrentLogfilePath (line 145) | func CurrentLogfilePath(target string) (string, error) {
function LogfileGC (line 168) | func LogfileGC(logDir string, max int) error {
FILE: pkg/logutil/file_test.go
function TestLogfile (line 14) | func TestLogfile(t *testing.T) {
FILE: pkg/logutil/grpc_logger.go
function ReplaceGRPCLogger (line 17) | func ReplaceGRPCLogger(l *zap.Logger) {
FILE: pkg/logutil/logger_native.go
type nativeCore (line 10) | type nativeCore struct
method Enabled (line 19) | func (nc *nativeCore) Enabled(zapcore.Level) bool {
method With (line 23) | func (nc *nativeCore) With([]zapcore.Field) zapcore.Core {
method Check (line 27) | func (nc *nativeCore) Check(entry zapcore.Entry, checked *zapcore.Chec...
method Write (line 31) | func (nc *nativeCore) Write(entry zapcore.Entry, fields []zapcore.Fiel...
method Sync (line 45) | func (nc *nativeCore) Sync() error {
function NewNativeDriverCore (line 15) | func NewNativeDriverCore(subsystem string, enc zapcore.Encoder) zapcore....
function NewNativeLogger (line 49) | func NewNativeLogger(subsystem string) *zap.Logger {
FILE: pkg/logutil/logger_native_android.go
function NativeLog (line 17) | func NativeLog(logLevel zapcore.Level, namespace string, message string) {
FILE: pkg/logutil/logger_native_darwin.go
function NativeLog (line 38) | func NativeLog(logLevel zapcore.Level, namespace string, message string) {
FILE: pkg/logutil/logger_native_other.go
function NativeLog (line 12) | func NativeLog(logLevel zapcore.Level, namespace string, message string) {
FILE: pkg/logutil/logutil.go
constant consoleEncoding (line 17) | consoleEncoding = "console"
constant jsonEncoding (line 18) | jsonEncoding = "json"
function NewLogger (line 21) | func NewLogger(streams ...Stream) (*zap.Logger, func(), error) {
FILE: pkg/logutil/logutil_test.go
function TestTypeStd (line 19) | func TestTypeStd(t *testing.T) {
function TestTypeRing (line 42) | func TestTypeRing(t *testing.T) {
function TestTypeFile (line 78) | func TestTypeFile(t *testing.T) {
function TestMultiple (line 150) | func TestMultiple(t *testing.T) {
FILE: pkg/logutil/private_field.go
type PrivateField (line 18) | type PrivateField struct
method hash (line 23) | func (p *PrivateField) hash(value string) string {
method PrivateString (line 38) | func (p *PrivateField) PrivateString(key string, value string) zap.Fie...
method PrivateStringer (line 46) | func (p *PrivateField) PrivateStringer(key string, value fmt.Stringer)...
method PrivateStrings (line 54) | func (p *PrivateField) PrivateStrings(key string, values []string) zap...
method PrivateAny (line 67) | func (p *PrivateField) PrivateAny(key string, value any) zap.Field {
method PrivateBinary (line 75) | func (p *PrivateField) PrivateBinary(key string, value []byte) zap.Fie...
function PrivateStrings (line 83) | func PrivateStrings(key string, value []string) zap.Field {
function PrivateString (line 91) | func PrivateString(key string, value string) zap.Field {
function PrivateStringer (line 99) | func PrivateStringer(key string, value fmt.Stringer) zap.Field {
function PrivateAny (line 107) | func PrivateAny(key string, value any) zap.Field {
function PrivateBinary (line 115) | func PrivateBinary(key string, value []byte) zap.Field {
function SetGlobal (line 123) | func SetGlobal(namespace []byte, enabled bool) {
function DisablePrivateFields (line 132) | func DisablePrivateFields() {
function init (line 136) | func init() { // nolint:gochecknoinits
FILE: pkg/logutil/stream.go
constant typeStd (line 9) | typeStd = "std"
constant typeRing (line 10) | typeRing = "ring"
constant typeFile (line 11) | typeFile = "file"
constant typeCustom (line 12) | typeCustom = "custom"
type Stream (line 15) | type Stream struct
function NewStdStream (line 25) | func NewStdStream(filters, format, path string) Stream {
function NewRingStream (line 34) | func NewRingStream(filters, format string, ring *zapring.Core) Stream {
function NewFileStream (line 54) | func NewFileStream(filters, format, path, sessionKind string) Stream {
function NewCustomStream (line 64) | func NewCustomStream(filters string, logger *zap.Logger) Stream {
FILE: pkg/multipeer-connectivity-driver/bridge_darwin.go
constant Supported (line 12) | Supported = true
type Driver (line 14) | type Driver struct
method Start (line 41) | func (d *Driver) Start(localPID string) {
method Stop (line 45) | func (d *Driver) Stop() {
method DialPeer (line 49) | func (d *Driver) DialPeer(remotePID string) bool {
method SendToPeer (line 53) | func (d *Driver) SendToPeer(remotePID string, payload []byte) bool {
method CloseConnWithPeer (line 57) | func (d *Driver) CloseConnWithPeer(remotePID string) {
method ProtocolCode (line 61) | func (d *Driver) ProtocolCode() int {
method ProtocolName (line 65) | func (d *Driver) ProtocolName() string {
method DefaultAddr (line 69) | func (d *Driver) DefaultAddr() string {
function NewDriver (line 23) | func NewDriver(logger *zap.Logger) proximity.ProximityDriver {
FILE: pkg/multipeer-connectivity-driver/bridge_unsupported.go
constant Supported (line 11) | Supported = false
function NewDriver (line 15) | func NewDriver(logger *zap.Logger) proximity.ProximityDriver {
FILE: pkg/multipeer-connectivity-driver/const.go
constant DefaultAddr (line 4) | DefaultAddr = "/mc/Qmeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"
constant ProtocolCode (line 5) | ProtocolCode = 0x0043
constant ProtocolName (line 6) | ProtocolName = "mc"
FILE: pkg/multipeer-connectivity-driver/driver/Logger.h
type Debug (line 16) | typedef NS_ENUM(uint8_t, level) {
type level (line 31) | enum level
FILE: pkg/multipeer-connectivity-driver/driver/cgo_bridge.go
function MCHandleFoundPeer (line 30) | func MCHandleFoundPeer(remotePID *C.char) int {
function MCHandleLostPeer (line 46) | func MCHandleLostPeer(remotePID *C.char) {
function MCReceiveFromPeer (line 59) | func MCReceiveFromPeer(remotePID *C.char, payload unsafe.Pointer, length...
function MCLog (line 73) | func MCLog(level C.enum_level, message *C.char) { //nolint:golint
function Start (line 92) | func Start(localPID string) {
function Stop (line 99) | func Stop() {
function DialPeer (line 103) | func DialPeer(remotePID string) bool {
function SendToPeer (line 110) | func SendToPeer(remotePID string, payload []byte) bool {
function CloseConnWithPeer (line 119) | func CloseConnWithPeer(remotePID string) {
function MCUseExternalLogger (line 126) | func MCUseExternalLogger() {
FILE: pkg/multipeer-connectivity-driver/driver/mc-driver.h
type level (line 22) | enum level
FILE: pkg/multipeer-connectivity-driver/init.go
function init (line 9) | func init() { // nolint:gochecknoinits
FILE: pkg/multipeer-connectivity-driver/multiaddr.go
function newProtocol (line 8) | func newProtocol() ma.Protocol {
function mcStB (line 20) | func mcStB(s string) ([]byte, error) {
function mcBtS (line 28) | func mcBtS(b []byte) (string, error) {
function mcVal (line 36) | func mcVal(b []byte) error {
FILE: pkg/netmanager/connectivity.go
type ConnectivityState (line 8) | type ConnectivityState
method String (line 16) | func (cs ConnectivityState) String() string {
constant ConnectivityStateUnknown (line 11) | ConnectivityStateUnknown ConnectivityState = iota
constant ConnectivityStateOff (line 12) | ConnectivityStateOff
constant ConnectivityStateOn (line 13) | ConnectivityStateOn
function ParseConnectivityState (line 29) | func ParseConnectivityState(s string) (ConnectivityState, error) {
type ConnectivityNetType (line 42) | type ConnectivityNetType
method String (line 52) | func (cnt ConnectivityNetType) String() string {
constant ConnectivityNetUnknown (line 45) | ConnectivityNetUnknown ConnectivityNetType = iota
constant ConnectivityNetNone (line 46) | ConnectivityNetNone
constant ConnectivityNetWifi (line 47) | ConnectivityNetWifi
constant ConnectivityNetEthernet (line 48) | ConnectivityNetEthernet
constant ConnectivityNetCellular (line 49) | ConnectivityNetCellular
function ParseConnectivityNetType (line 69) | func ParseConnectivityNetType(s string) (ConnectivityNetType, error) {
type ConnectivityCellularType (line 86) | type ConnectivityCellularType
method String (line 97) | func (cct ConnectivityCellularType) String() string {
constant ConnectivityCellularUnknown (line 89) | ConnectivityCellularUnknown ConnectivityCellularType = iota
constant ConnectivityCellularNone (line 90) | ConnectivityCellularNone
constant ConnectivityCellular2G (line 91) | ConnectivityCellular2G
constant ConnectivityCellular3G (line 92) | ConnectivityCellular3G
constant ConnectivityCellular4G (line 93) | ConnectivityCellular4G
constant ConnectivityCellular5G (line 94) | ConnectivityCellular5G
function ParseConnectivityCellularType (line 116) | func ParseConnectivityCellularType(s string) (ConnectivityCellularType, ...
type ConnectivityInfo (line 135) | type ConnectivityInfo struct
method String (line 153) | func (ci ConnectivityInfo) String() string {
FILE: pkg/netmanager/netmanager.go
type NetManager (line 10) | type NetManager struct
method UpdateState (line 48) | func (m *NetManager) UpdateState(state ConnectivityInfo) {
method WaitForStateChange (line 61) | func (m *NetManager) WaitForStateChange(ctx context.Context, sourceSta...
method GetCurrentState (line 102) | func (m *NetManager) GetCurrentState() (state ConnectivityInfo) {
type EventType (line 17) | type EventType
method Has (line 34) | func (t EventType) Has(other EventType) bool {
constant ConnectivityStateChanged (line 20) | ConnectivityStateChanged EventType = 1 << iota
constant ConnectivityMeteringChanged (line 21) | ConnectivityMeteringChanged
constant ConnectivityBluetoothChanged (line 22) | ConnectivityBluetoothChanged
constant ConnectivityNetTypeChanged (line 23) | ConnectivityNetTypeChanged
constant ConnectivityCellularTypeChanged (line 24) | ConnectivityCellularTypeChanged
constant ConnectivityChanged (line 26) | ConnectivityChanged = 0 |
function NewNetManager (line 38) | func NewNetManager(initialState ConnectivityInfo) *NetManager {
FILE: pkg/netmanager/netmanager_noop.go
function NewNoopNetManager (line 3) | func NewNoopNetManager() *NetManager {
FILE: pkg/netmanager/netmanager_test.go
function TestNewNetManager (line 10) | func TestNewNetManager(t *testing.T) {
function TestNetManagerSingleUpdate (line 24) | func TestNetManagerSingleUpdate(t *testing.T) {
function TestNetManagerDoubleUpdate (line 45) | func TestNetManagerDoubleUpdate(t *testing.T) {
function TestNetManagerFilterUpdate (line 71) | func TestNetManagerFilterUpdate(t *testing.T) {
FILE: pkg/outofstoremessage/outofstoremessage_test.go
function Test_sealPushMessage_OutOfStoreReceive (line 18) | func Test_sealPushMessage_OutOfStoreReceive(t *testing.T) {
function Test_OutOfStoreMessageFlow (line 80) | func Test_OutOfStoreMessageFlow(t *testing.T) {
function createVirtualOtherPeerSecrets (line 138) | func createVirtualOtherPeerSecrets(t testing.TB, ctx context.Context, gc...
FILE: pkg/outofstoremessage/service_outofstoremessage.go
type OOSMService (line 23) | type OOSMService interface
type oosmService (line 29) | type oosmService struct
method Close (line 127) | func (s *oosmService) Close() error {
method Status (line 131) | func (s *oosmService) Status() (weshnet.Status, error) {
method IpfsCoreAPI (line 135) | func (s *oosmService) IpfsCoreAPI() coreiface.CoreAPI {
method OutOfStoreReceive (line 139) | func (s *oosmService) OutOfStoreReceive(ctx context.Context, request *...
type OOSMServiceClient (line 37) | type OOSMServiceClient interface
type oosmServiceClient (line 43) | type oosmServiceClient struct
type OOSMOption (line 50) | type OOSMOption
function NewOutOfStoreMessageServiceClient (line 56) | func NewOutOfStoreMessageServiceClient(opts ...OOSMOption) (OOSMServiceC...
type oosmClient (line 79) | type oosmClient struct
method Close (line 86) | func (c *oosmClient) Close() error {
function newClientFromService (line 92) | func newClientFromService(ctx context.Context, s *grpc.Server, svc OOSMS...
function NewOutOfStoreMessageService (line 112) | func NewOutOfStoreMessageService(opts ...OOSMOption) (OOSMService, error) {
type FallBackOption (line 154) | type FallBackOption struct
FILE: pkg/outofstoremessagetypes/outofstoremessage.pb.go
constant _ (line 18) | _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
constant _ (line 20) | _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
function init (line 61) | func init() { file_outofstoremessagetypes_outofstoremessage_proto_init() }
function file_outofstoremessagetypes_outofstoremessage_proto_init (line 62) | func file_outofstoremessagetypes_outofstoremessage_proto_init() {
FILE: pkg/outofstoremessagetypes/outofstoremessage.pb.gw.go
function request_OutOfStoreMessageService_OutOfStoreReceive_0 (line 37) | func request_OutOfStoreMessageService_OutOfStoreReceive_0(ctx context.Co...
function local_request_OutOfStoreMessageService_OutOfStoreReceive_0 (line 54) | func local_request_OutOfStoreMessageService_OutOfStoreReceive_0(ctx cont...
function RegisterOutOfStoreMessageServiceHandlerServer (line 75) | func RegisterOutOfStoreMessageServiceHandlerServer(ctx context.Context, ...
function RegisterOutOfStoreMessageServiceHandlerFromEndpoint (line 105) | func RegisterOutOfStoreMessageServiceHandlerFromEndpoint(ctx context.Con...
function RegisterOutOfStoreMessageServiceHandler (line 130) | func RegisterOutOfStoreMessageServiceHandler(ctx context.Context, mux *r...
function RegisterOutOfStoreMessageServiceHandlerClient (line 139) | func RegisterOutOfStoreMessageServiceHandlerClient(ctx context.Context, ...
FILE: pkg/outofstoremessagetypes/outofstoremessage_grpc.pb.go
constant _ (line 20) | _ = grpc.SupportPackageIsVersion9
constant OutOfStoreMessageService_OutOfStoreReceive_FullMethodName (line 23) | OutOfStoreMessageService_OutOfStoreReceive_FullMethodName = "/weshnet.ou...
type OutOfStoreMessageServiceClient (line 32) | type OutOfStoreMessageServiceClient interface
type outOfStoreMessageServiceClient (line 37) | type outOfStoreMessageServiceClient struct
method OutOfStoreReceive (line 45) | func (c *outOfStoreMessageServiceClient) OutOfStoreReceive(ctx context...
function NewOutOfStoreMessageServiceClient (line 41) | func NewOutOfStoreMessageServiceClient(cc grpc.ClientConnInterface) OutO...
type OutOfStoreMessageServiceServer (line 61) | type OutOfStoreMessageServiceServer interface
type UnimplementedOutOfStoreMessageServiceServer (line 72) | type UnimplementedOutOfStoreMessageServiceServer struct
method OutOfStoreReceive (line 74) | func (UnimplementedOutOfStoreMessageServiceServer) OutOfStoreReceive(c...
method mustEmbedUnimplementedOutOfStoreMessageServiceServer (line 77) | func (UnimplementedOutOfStoreMessageServiceServer) mustEmbedUnimplemen...
method testEmbeddedByValue (line 79) | func (UnimplementedOutOfStoreMessageServiceServer) testEmbeddedByValue...
type UnsafeOutOfStoreMessageServiceServer (line 84) | type UnsafeOutOfStoreMessageServiceServer interface
function RegisterOutOfStoreMessageServiceServer (line 88) | func RegisterOutOfStoreMessageServiceServer(s grpc.ServiceRegistrar, srv...
function _OutOfStoreMessageService_OutOfStoreReceive_Handler (line 99) | func _OutOfStoreMessageService_OutOfStoreReceive_Handler(srv interface{}...
FILE: pkg/protocoltypes/contact.go
constant RendezvousSeedLength (line 11) | RendezvousSeedLength = 32
type ShareableContactOptions (line 13) | type ShareableContactOptions
constant shareableContactOptionsUndefined (line 16) | shareableContactOptionsUndefined = iota
constant ShareableContactOptionsAllowMissingRDVSeed (line 17) | ShareableContactOptionsAllowMissingRDVSeed
constant ShareableContactOptionsAllowMissingPK (line 18) | ShareableContactOptionsAllowMissingPK
method CheckFormat (line 23) | func (m *ShareableContact) CheckFormat(options ...ShareableContactOption...
method IsSamePK (line 59) | func (m *ShareableContact) IsSamePK(otherPK crypto.PubKey) bool {
method GetPubKey (line 68) | func (m *ShareableContact) GetPubKey() (crypto.PubKey, error) {
FILE: pkg/protocoltypes/events_account.go
method SetDevicePK (line 3) | func (m *AccountGroupJoined) SetDevicePK(pk []byte) {
method SetDevicePK (line 7) | func (m *AccountGroupLeft) SetDevicePK(pk []byte) {
method SetDevicePK (line 11) | func (m *AccountContactRequestDisabled) SetDevicePK(pk []byte) {
method SetDevicePK (line 15) | func (m *AccountContactRequestEnabled) SetDevicePK(pk []byte) {
method SetDevicePK (line 19) | func (m *AccountContactRequestReferenceReset) SetDevicePK(pk []byte) {
method SetDevicePK (line 23) | func (m *AccountContactRequestOutgoingEnqueued) SetDevicePK(pk []byte) {
method SetDevicePK (line 27) | func (m *AccountContactRequestOutgoingSent) SetDevicePK(pk []byte) {
method SetDevicePK (line 31) | func (m *AccountContactRequestIncomingReceived) SetDevicePK(pk []byte) {
method SetDevicePK (line 35) | func (m *AccountContactRequestIncomingDiscarded) SetDevicePK(pk []byte) {
method SetDevicePK (line 39) | func (m *AccountContactRequestIncomingAccepted) SetDevicePK(pk []byte) {
method SetDevicePK (line 43) | func (m *AccountContactBlocked) SetDevicePK(pk []byte) {
method SetDevicePK (line 47) | func (m *AccountContactUnblocked) SetDevicePK(pk []byte) {
method SetContactPK (line 51) | func (m *AccountContactRequestOutgoingSent) SetContactPK(pk []byte) {
method SetContactPK (line 55) | func (m *AccountContactRequestIncomingDiscarded) SetContactPK(pk []byte) {
method SetContactPK (line 59) | func (m *AccountContactRequestIncomingAccepted) SetContactPK(pk []byte) {
method SetContactPK (line 63) | func (m *AccountContactBlocked) SetContactPK(pk []byte) {
method SetContactPK (line 67) | func (m *AccountContactUnblocked) SetContactPK(pk []byte) {
method SetGroupPK (line 71) | func (m *AccountGroupLeft) SetGroupPK(pk []byte) {
method SetDevicePK (line 75) | func (m *ContactAliasKeyAdded) SetDevicePK(pk []byte) {
method SetDevicePK (line 79) | func (m *MultiMemberGroupAliasResolverAdded) SetDevicePK(pk []byte) {
method SetDevicePK (line 83) | func (m *MultiMemberGroupAdminRoleGranted) SetDevicePK(pk []byte) {
method SetDevicePK (line 87) | func (m *GroupMetadataPayloadSent) SetDevicePK(pk []byte) {
method SetDevicePK (line 91) | func (m *GroupReplicating) SetDevicePK(pk []byte) {
method SetDevicePK (line 95) | func (m *AccountVerifiedCredentialRegistered) SetDevicePK(pk []byte) {
FILE: pkg/protocoltypes/group.go
method GetSigningPrivKey (line 17) | func (m *Group) GetSigningPrivKey() (crypto.PrivKey, error) {
method GetPubKey (line 32) | func (m *Group) GetPubKey() (crypto.PubKey, error) {
method GetSigningPubKey (line 36) | func (m *Group) GetSigningPubKey() (crypto.PubKey, error) {
method IsValid (line 49) | func (m *Group) IsValid() error {
method GroupIDAsString (line 68) | func (m *Group) GroupIDAsString() string {
method Copy (line 72) | func (m *Group) Copy() *Group {
constant CurrentGroupVersion (line 82) | CurrentGroupVersion = 1
function NewGroupMultiMember (line 86) | func NewGroupMultiMember() (*Group, crypto.PrivKey, error) {
function ComputeLinkKey (line 134) | func ComputeLinkKey(publicKey, secret []byte) (*[cryptoutil.KeySize]byte...
method GetLinkKeyArray (line 145) | func (m *Group) GetLinkKeyArray() (*[cryptoutil.KeySize]byte, error) {
method GetSharedSecret (line 159) | func (m *Group) GetSharedSecret() *[cryptoutil.KeySize]byte {
FILE: pkg/protocoltypes/protocoltypes.pb.go
constant _ (line 18) | _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
constant _ (line 20) | _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
type GroupType (line 23) | type GroupType
method Enum (line 52) | func (x GroupType) Enum() *GroupType {
method String (line 58) | func (x GroupType) String() string {
method Descriptor (line 62) | func (GroupType) Descriptor() protoreflect.EnumDescriptor {
method Type (line 66) | func (GroupType) Type() protoreflect.EnumType {
method Number (line 70) | func (x GroupType) Number() protoreflect.EnumNumber {
method EnumDescriptor (line 75) | func (GroupType) EnumDescriptor() ([]byte, []int) {
constant GroupType_GroupTypeUndefined (line 27) | GroupType_GroupTypeUndefined GroupType = 0
constant GroupType_GroupTypeAccount (line 29) | GroupType_GroupTypeAccount GroupType = 1
constant GroupType_GroupTypeContact (line 31) | GroupType_GroupTypeContact GroupType = 2
constant GroupType_GroupTypeMultiMember (line 33) | GroupType_GroupTypeMultiMember GroupType = 3
type EventType (line 79) | type EventType
method Enum (line 180) | func (x EventType) Enum() *EventType {
method String (line 186) | func (x EventType) String() string {
method Descriptor (line 190) | func (EventType) Descriptor() protoreflect.EnumDescriptor {
method Type (line 194) | func (EventType) Type() protoreflect.EnumType {
method Number (line 198) | func (x EventType) Number() protoreflect.EnumNumber {
method EnumDescriptor (line 203) | func (EventType) EnumDescriptor() ([]byte, []int) {
constant EventType_EventTypeUndefined (line 83) | EventType_EventTypeUndefined EventType = 0
constant EventType_EventTypeGroupMemberDeviceAdded (line 85) | EventType_EventTypeGroupMemberDeviceAdded EventType = 1
constant EventType_EventTypeGroupDeviceChainKeyAdded (line 87) | EventType_EventTypeGroupDeviceChainKeyAdded EventType = 2
constant EventType_EventTypeAccountGroupJoined (line 89) | EventType_EventTypeAccountGroupJoined EventType = 101
constant EventType_EventTypeAccountGroupLeft (line 91) | EventType_EventTypeAccountGroupLeft EventType = 102
constant EventType_EventTypeAccountContactRequestDisabled (line 93) | EventType_EventTypeAccountContactRequestDisabled EventType = 103
constant EventType_EventTypeAccountContactRequestEnabled (line 95) | EventType_EventTypeAccountContactRequestEnabled EventType = 104
constant EventType_EventTypeAccountContactRequestReferenceReset (line 97) | EventType_EventTypeAccountContactRequestReferenceReset EventType = 105
constant EventType_EventTypeAccountContactRequestOutgoingEnqueued (line 99) | EventType_EventTypeAccountContactRequestOutgoingEnqueued EventType = 106
constant EventType_EventTypeAccountContactRequestOutgoingSent (line 101) | EventType_EventTypeAccountContactRequestOutgoingSent EventType = 107
constant EventType_EventTypeAccountContactRequestIncomingReceived (line 103) | EventType_EventTypeAccountContactRequestIncomingReceived EventType = 108
constant EventType_EventTypeAccountContactRequestIncomingDiscarded (line 105) | EventType_EventTypeAccountContactRequestIncomingDiscarded EventType = 109
constant EventType_EventTypeAccountContactRequestIncomingAccepted (line 107) | EventType_EventTypeAccountContactRequestIncomingAccepted EventType = 110
constant EventType_EventTypeAccountContactBlocked (line 109) | EventType_EventTypeAccountContactBlocked EventType = 111
constant EventType_EventTypeAccountContactUnblocked (line 111) | EventType_EventTypeAccountContactUnblocked EventType = 112
constant EventType_EventTypeContactAliasKeyAdded (line 113) | EventType_EventTypeContactAliasKeyAdded EventType = 201
constant EventType_EventTypeMultiMemberGroupAliasResolverAdded (line 115) | EventType_EventTypeMultiMemberGroupAliasResolverAdded EventType = 301
constant EventType_EventTypeMultiMemberGroupInitialMemberAnnounced (line 117) | EventType_EventTypeMultiMemberGroupInitialMemberAnnounced EventType = 302
constant EventType_EventTypeMultiMemberGroupAdminRoleGranted (line 119) | EventType_EventTypeMultiMemberGroupAdminRoleGranted EventType = 303
constant EventType_EventTypeGroupReplicating (line 121) | EventType_EventTypeGroupReplicating EventType = 403
constant EventType_EventTypeAccountVerifiedCredentialRegistered (line 123) | EventType_EventTypeAccountVerifiedCredentialRegistered EventType = 500
constant EventType_EventTypeGroupMetadataPayloadSent (line 125) | EventType_EventTypeGroupMetadataPayloadSent EventType = 1001
type DebugInspectGroupLogType (line 207) | type DebugInspectGroupLogType
method Enum (line 229) | func (x DebugInspectGroupLogType) Enum() *DebugInspectGroupLogType {
method String (line 235) | func (x DebugInspectGroupLogType) String() string {
method Descriptor (line 239) | func (DebugInspectGroupLogType) Descriptor() protoreflect.EnumDescript...
method Type (line 243) | func (DebugInspectGroupLogType) Type() protoreflect.EnumType {
method Number (line 247) | func (x DebugInspectGroupLogType) Number() protoreflect.EnumNumber {
method EnumDescriptor (line 252) | func (DebugInspectGroupLogType) EnumDescriptor() ([]byte, []int) {
constant DebugInspectGroupLogType_DebugInspectGroupLogTypeUndefined (line 210) | DebugInspectGroupLogType_DebugInspectGroupLogTypeUndefined DebugInspectG...
constant DebugInspectGroupLogType_DebugInspectGroupLogTypeMessage (line 211) | DebugInspectGroupLogType_DebugInspectGroupLogTypeMessage DebugInspectG...
constant DebugInspectGroupLogType_DebugInspectGroupLogTypeMetadata (line 212) | DebugInspectGroupLogType_DebugInspectGroupLogTypeMetadata DebugInspectG...
type ContactState (line 256) | type ContactState
method Enum (line 290) | func (x ContactState) Enum() *ContactState {
method String (line 296) | func (x ContactState) String() string {
method Descriptor (line 300) | func (ContactState) Descriptor() protoreflect.EnumDescriptor {
method Type (line 304) | func (ContactState) Type() protoreflect.EnumType {
method Number (line 308) | func (x ContactState) Number() protoreflect.EnumNumber {
method EnumDescriptor (line 313) | func (ContactState) EnumDescriptor() ([]byte, []int) {
constant ContactState_ContactStateUndefined (line 259) | ContactState_ContactStateUndefined ContactState = 0
constant ContactState_ContactStateToRequest (line 260) | ContactState_ContactStateToRequest ContactState = 1
constant ContactState_ContactStateReceived (line 261) | ContactState_ContactStateReceived ContactState = 2
constant ContactState_ContactStateAdded (line 262) | ContactState_ContactStateAdded ContactState = 3
constant ContactState_ContactStateRemoved (line 263) | ContactState_ContactStateRemoved ContactState = 4
constant ContactState_ContactStateDiscarded (line 264) | ContactState_ContactStateDiscarded ContactState = 5
constant ContactState_ContactStateBlocked (line 265) | ContactState_ContactStateBlocked ContactState = 6
type Direction (line 317) | type Direction
method Enum (line 342) | func (x Direction) Enum() *Direction {
method String (line 348) | func (x Direction) String() string {
method Descriptor (line 352) | func (Direction) Descriptor() protoreflect.EnumDescriptor {
method Type (line 356) | func (Direction) Type() protoreflect.EnumType {
method Number (line 360) | func (x Direction) Number() protoreflect.EnumNumber {
method EnumDescriptor (line 365) | func (Direction) EnumDescriptor() ([]byte, []int) {
constant Direction_UnknownDir (line 320) | Direction_UnknownDir Direction = 0
constant Direction_InboundDir (line 321) | Direction_InboundDir Direction = 1
constant Direction_OutboundDir (line 322) | Direction_OutboundDir Direction = 2
constant Direction_BiDir (line 323) | Direction_BiDir Direction = 3
type ServiceGetConfiguration_SettingState (line 369) | type ServiceGetConfiguration_SettingState
method Enum (line 394) | func (x ServiceGetConfiguration_SettingState) Enum() *ServiceGetConfig...
method String (line 400) | func (x ServiceGetConfiguration_SettingState) String() string {
method Descriptor (line 404) | func (ServiceGetConfiguration_SettingState) Descriptor() protoreflect....
method Type (line 408) | func (ServiceGetConfiguration_SettingState) Type() protoreflect.EnumTy...
method Number (line 412) | func (x ServiceGetConfiguration_SettingState) Number() protoreflect.En...
method EnumDescriptor (line 417) | func (ServiceGetConfiguration_SettingState) EnumDescriptor() ([]byte, ...
constant ServiceGetConfiguration_Unknown (line 372) | ServiceGetConfiguration_Unknown ServiceGetConfiguration_SettingState...
constant ServiceGetConfiguration_Enabled (line 373) | ServiceGetConfiguration_Enabled ServiceGetConfiguration_SettingState...
constant ServiceGetConfiguration_Disabled (line 374) | ServiceGetConfiguration_Disabled ServiceGetConfiguration_SettingState...
constant ServiceGetConfiguration_Unavailable (line 375) | ServiceGetConfiguration_Unavailable ServiceGetConfiguration_SettingState...
type GroupDeviceStatus_Type (line 421) | type GroupDeviceStatus_Type
method Enum (line 446) | func (x GroupDeviceStatus_Type) Enum() *GroupDeviceStatus_Type {
method String (line 452) | func (x GroupDeviceStatus_Type) String() string {
method Descriptor (line 456) | func (GroupDeviceStatus_Type) Descriptor() protoreflect.EnumDescriptor {
method Type (line 460) | func (GroupDeviceStatus_Type) Type() protoreflect.EnumType {
method Number (line 464) | func (x GroupDeviceStatus_Type) Number() protoreflect.EnumNumber {
method EnumDescriptor (line 469) | func (GroupDeviceStatus_Type) EnumDescriptor() ([]byte, []int) {
constant GroupDeviceStatus_TypeUnknown (line 424) | GroupDeviceStatus_TypeUnknown GroupDeviceStatus_Type = 0
constant GroupDeviceStatus_TypePeerDisconnected (line 425) | GroupDeviceStatus_TypePeerDisconnected GroupDeviceStatus_Type = 1
constant GroupDeviceStatus_TypePeerConnected (line 426) | GroupDeviceStatus_TypePeerConnected GroupDeviceStatus_Type = 2
constant GroupDeviceStatus_TypePeerReconnecting (line 427) | GroupDeviceStatus_TypePeerReconnecting GroupDeviceStatus_Type = 3
type GroupDeviceStatus_Transport (line 473) | type GroupDeviceStatus_Transport
method Enum (line 498) | func (x GroupDeviceStatus_Transport) Enum() *GroupDeviceStatus_Transpo...
method String (line 504) | func (x GroupDeviceStatus_Transport) String() string {
method Descriptor (line 508) | func (GroupDeviceStatus_Transport) Descriptor() protoreflect.EnumDescr...
method Type (line 512) | func (GroupDeviceStatus_Transport) Type() protoreflect.EnumType {
method Number (line 516) | func (x GroupDeviceStatus_Transport) Number() protoreflect.EnumNumber {
method EnumDescriptor (line 521) | func (GroupDeviceStatus_Transport) EnumDescriptor() ([]byte, []int) {
constant GroupDeviceStatus_TptUnknown (line 476) | GroupDeviceStatus_TptUnknown GroupDeviceStatus_Transport = 0
constant GroupDeviceStatus_TptLAN (line 477) | GroupDeviceStatus_TptLAN GroupDeviceStatus_Transport = 1
constant GroupDeviceStatus_TptWAN (line 478) | GroupDeviceStatus_TptWAN GroupDeviceStatus_Transport = 2
constant GroupDeviceStatus_TptProximity (line 479) | GroupDeviceStatus_TptProximity GroupDeviceStatus_Transport = 3
type PeerList_Feature (line 525) | type PeerList_Feature
method Enum (line 556) | func (x PeerList_Feature) Enum() *PeerList_Feature {
method String (line 562) | func (x PeerList_Feature) String() string {
method Descriptor (line 566) | func (PeerList_Feature) Descriptor() protoreflect.EnumDescriptor {
method Type (line 570) | func (PeerList_Feature) Type() protoreflect.EnumType {
method Number (line 574) | func (x PeerList_Feature) Number() protoreflect.EnumNumber {
method EnumDescriptor (line 579) | func (PeerList_Feature) EnumDescriptor() ([]byte, []int) {
constant PeerList_UnknownFeature (line 528) | PeerList_UnknownFeature PeerList_Feature = 0
constant PeerList_WeshFeature (line 529) | PeerList_WeshFeature PeerList_Feature = 1
constant PeerList_BLEFeature (line 530) | PeerList_BLEFeature PeerList_Feature = 2
constant PeerList_LocalFeature (line 531) | PeerList_LocalFeature PeerList_Feature = 3
constant PeerList_TorFeature (line 532) | PeerList_TorFeature PeerList_Feature = 4
constant PeerList_QuicFeature (line 533) | PeerList_QuicFeature PeerList_Feature = 5
type Account (line 584) | type Account struct
method Reset (line 599) | func (x *Account) Reset() {
method String (line 608) | func (x *Account) String() string {
method ProtoMessage (line 612) | func (*Account) ProtoMessage() {}
method ProtoReflect (line 614) | func (x *Account) ProtoReflect() protoreflect.Message {
method Descriptor (line 627) | func (*Account) Descriptor() ([]byte, []int) {
method GetGroup (line 631) | func (x *Account) GetGroup() *Group {
method GetAccountPrivateKey (line 638) | func (x *Account) GetAccountPrivateKey() []byte {
method GetAliasPrivateKey (line 645) | func (x *Account) GetAliasPrivateKey() []byte {
method GetPublicRendezvousSeed (line 652) | func (x *Account) GetPublicRendezvousSeed() []byte {
type Group (line 660) | type Group struct
method Reset (line 681) | func (x *Group) Reset() {
method String (line 690) | func (x *Group) String() string {
method ProtoMessage (line 694) | func (*Group) ProtoMessage() {}
method ProtoReflect (line 696) | func (x *Group) ProtoReflect() protoreflect.Message {
method Descriptor (line 709) | func (*Group) Descriptor() ([]byte, []int) {
method GetPublicKey (line 713) | func (x *Group) GetPublicKey() []byte {
method GetSecret (line 720) | func (x *Group) GetSecret() []byte {
method GetSecretSig (line 727) | func (x *Group) GetSecretSig() []byte {
method GetGroupType (line 734) | func (x *Group) GetGroupType() GroupType {
method GetSignPub (line 741) | func (x *Group) GetSignPub() []byte {
method GetLinkKey (line 748) | func (x *Group) GetLinkKey() []byte {
method GetLinkKeySig (line 755) | func (x *Group) GetLinkKeySig() []byte {
type GroupHeadsExport (line 762) | type GroupHeadsExport struct
method Reset (line 779) | func (x *GroupHeadsExport) Reset() {
method String (line 788) | func (x *GroupHeadsExport) String() string {
method ProtoMessage (line 792) | func (*GroupHeadsExport) ProtoMessage() {}
method ProtoReflect (line 794) | func (x *GroupHeadsExport) ProtoReflect() protoreflect.Message {
method Descriptor (line 807) | func (*GroupHeadsExport) Descriptor() ([]byte, []int) {
method GetPublicKey (line 811) | func (x *GroupHeadsExport) GetPublicKey() []byte {
method GetSignPub (line 818) | func (x *GroupHeadsExport) GetSignPub() []byte {
method GetMetadataHeadsCids (line 825) | func (x *GroupHeadsExport) GetMetadataHeadsCids() [][]byte {
method GetMessagesHeadsCids (line 832) | func (x *GroupHeadsExport) GetMessagesHeadsCids() [][]byte {
method GetLinkKey (line 839) | func (x *GroupHeadsExport) GetLinkKey() []byte {
type GroupMetadata (line 847) | type GroupMetadata struct
method Reset (line 862) | func (x *GroupMetadata) Reset() {
method String (line 871) | func (x *GroupMetadata) String() string {
method ProtoMessage (line 875) | func (*GroupMetadata) ProtoMessage() {}
method ProtoReflect (line 877) | func (x *GroupMetadata) ProtoReflect() protoreflect.Message {
method Descriptor (line 890) | func (*GroupMetadata) Descriptor() ([]byte, []int) {
method GetEventType (line 894) | func (x *GroupMetadata) GetEventType() EventType {
method GetPayload (line 901) | func (x *GroupMetadata) GetPayload() []byte {
method GetSig (line 908) | func (x *GroupMetadata) GetSig() []byte {
method GetProtocolMetadata (line 915) | func (x *GroupMetadata) GetProtocolMetadata() *ProtocolMetadata {
type GroupEnvelope (line 923) | type GroupEnvelope struct
method Reset (line 934) | func (x *GroupEnvelope) Reset() {
method String (line 943) | func (x *GroupEnvelope) String() string {
method ProtoMessage (line 947) | func (*GroupEnvelope) ProtoMessage() {}
method ProtoReflect (line 949) | func (x *GroupEnvelope) ProtoReflect() protoreflect.Message {
method Descriptor (line 962) | func (*GroupEnvelope) Descriptor() ([]byte, []int) {
method GetNonce (line 966) | func (x *GroupEnvelope) GetNonce() []byte {
method GetEvent (line 973) | func (x *GroupEnvelope) GetEvent() []byte {
type MessageHeaders (line 981) | type MessageHeaders struct
method Reset (line 996) | func (x *MessageHeaders) Reset() {
method String (line 1005) | func (x *MessageHeaders) String() string {
method ProtoMessage (line 1009) | func (*MessageHeaders) ProtoMessage() {}
method ProtoReflect (line 1011) | func (x *MessageHeaders) ProtoReflect() protoreflect.Message {
method Descriptor (line 1024) | func (*MessageHeaders) Descriptor() ([]byte, []int) {
method GetCounter (line 1028) | func (x *MessageHeaders) GetCounter() uint64 {
method GetDevicePk (line 1035) | func (x *MessageHeaders) GetDevicePk() []byte {
method GetSig (line 1042) | func (x *MessageHeaders) GetSig() []byte {
method GetMetadata (line 1049) | func (x *MessageHeaders) GetMetadata() map[string]string {
type ProtocolMetadata (line 1056) | type ProtocolMetadata struct
method Reset (line 1062) | func (x *ProtocolMetadata) Reset() {
method String (line 1071) | func (x *ProtocolMetadata) String() string {
method ProtoMessage (line 1075) | func (*ProtocolMetadata) ProtoMessage() {}
method ProtoReflect (line 1077) | func (x *ProtocolMetadata) ProtoReflect() protoreflect.Message {
method Descriptor (line 1090) | func (*ProtocolMetadata) Descriptor() ([]byte, []int) {
type EncryptedMessage (line 1095) | type EncryptedMessage struct
method Reset (line 1106) | func (x *EncryptedMessage) Reset() {
method String (line 1115) | func (x *EncryptedMessage) String() string {
method ProtoMessage (line 1119) | func (*EncryptedMessage) ProtoMessage() {}
method ProtoReflect (line 1121) | func (x *EncryptedMessage) ProtoReflect() protoreflect.Message {
method Descriptor (line 1134) | func (*EncryptedMessage) Descriptor() ([]byte, []int) {
method GetPlaintext (line 1138) | func (x *EncryptedMessage) GetPlaintext() []byte {
method GetProtocolMetadata (line 1145) | func (x *EncryptedMessage) GetProtocolMetadata() *ProtocolMetadata {
type MessageEnvelope (line 1153) | type MessageEnvelope struct
method Reset (line 1166) | func (x *MessageEnvelope) Reset() {
method String (line 1175) | func (x *MessageEnvelope) String() string {
method ProtoMessage (line 1179) | func (*MessageEnvelope) ProtoMessage() {}
method ProtoReflect (line 1181) | func (x *MessageEnvelope) ProtoReflect() protoreflect.Message {
method Descriptor (line 1194) | func (*MessageEnvelope) Descriptor() ([]byte, []int) {
method GetMessageHeaders (line 1198) | func (x *MessageEnvelope) GetMessageHeaders() []byte {
method GetMessage (line 1205) | func (x *MessageEnvelope) GetMessage() []byte {
method GetNonce (line 1212) | func (x *MessageEnvelope) GetNonce() []byte {
type EventContext (line 1220) | type EventContext struct
method Reset (line 1233) | func (x *EventContext) Reset() {
method String (line 1242) | func (x *EventContext) String() string {
method ProtoMessage (line 1246) | func (*EventContext) ProtoMessage() {}
method ProtoReflect (line 1248) | func (x *EventContext) ProtoReflect() protoreflect.Message {
method Descriptor (line 1261) | func (*EventContext) Descriptor() ([]byte, []int) {
method GetId (line 1265) | func (x *EventContext) GetId() []byte {
method GetParentIds (line 1272) | func (x *EventContext) GetParentIds() [][]byte {
method GetGroupPk (line 1279) | func (x *EventContext) GetGroupPk() []byte {
type GroupMetadataPayloadSent (line 1287) | type GroupMetadataPayloadSent struct
method Reset (line 1298) | func (x *GroupMetadataPayloadSent) Reset() {
method String (line 1307) | func (x *GroupMetadataPayloadSent) String() string {
method ProtoMessage (line 1311) | func (*GroupMetadataPayloadSent) ProtoMessage() {}
method ProtoReflect (line 1313) | func (x *GroupMetadataPayloadSent) ProtoReflect() protoreflect.Message {
method Descriptor (line 1326) | func (*GroupMetadataPayloadSent) Descriptor() ([]byte, []int) {
method GetDevicePk (line 1330) | func (x *GroupMetadataPayloadSent) GetDevicePk() []byte {
method GetMessage (line 1337) | func (x *GroupMetadataPayloadSent) GetMessage() []byte {
type ContactAliasKeyAdded (line 1345) | type ContactAliasKeyAdded struct
method Reset (line 1356) | func (x *ContactAliasKeyAdded) Reset() {
method String (line 1365) | func (x *ContactAliasKeyAdded) String() string {
method ProtoMessage (line 1369) | func (*ContactAliasKeyAdded) ProtoMessage() {}
method ProtoReflect (line 1371) | func (x *ContactAliasKeyAdded) ProtoReflect() protoreflect.Message {
method Descriptor (line 1384) | func (*ContactAliasKeyAdded) Descriptor() ([]byte, []int) {
method GetDevicePk (line 1388) | func (x *ContactAliasKeyAdded) GetDevicePk() []byte {
method GetAliasPk (line 1395) | func (x *ContactAliasKeyAdded) GetAliasPk() []byte {
type GroupMemberDeviceAdded (line 1404) | type GroupMemberDeviceAdded struct
method Reset (line 1417) | func (x *GroupMemberDeviceAdded) Reset() {
method String (line 1426) | func (x *GroupMemberDeviceAdded) String() string {
method ProtoMessage (line 1430) | func (*GroupMemberDeviceAdded) ProtoMessage() {}
method ProtoReflect (line 1432) | func (x *GroupMemberDeviceAdded) ProtoReflect() protoreflect.Message {
method Descriptor (line 1445) | func (*GroupMemberDeviceAdded) Descriptor() ([]byte, []int) {
method GetMemberPk (line 1449) | func (x *GroupMemberDeviceAdded) GetMemberPk() []byte {
method GetDevicePk (line 1456) | func (x *GroupMemberDeviceAdded) GetDevicePk() []byte {
method GetMemberSig (line 1463) | func (x *GroupMemberDeviceAdded) GetMemberSig() []byte {
type DeviceChainKey (line 1471) | type DeviceChainKey struct
method Reset (line 1482) | func (x *DeviceChainKey) Reset() {
method String (line 1491) | func (x *DeviceChainKey) String() string {
method ProtoMessage (line 1495) | func (*DeviceChainKey) ProtoMessage() {}
method ProtoReflect (line 1497) | func (x *DeviceChainKey) ProtoReflect() protoreflect.Message {
method Descriptor (line 1510) | func (*DeviceChainKey) Descriptor() ([]byte, []int) {
method GetChainKey (line 1514) | func (x *DeviceChainKey) GetChainKey() []byte {
method GetCounter (line 1521) | func (x *DeviceChainKey) GetCounter() uint64 {
type GroupDeviceChainKeyAdded (line 1529) | type GroupDeviceChainKeyAdded struct
method Reset (line 1542) | func (x *GroupDeviceChainKeyAdded) Reset() {
method String (line 1551) | func (x *GroupDeviceChainKeyAdded) String() string {
method ProtoMessage (line 1555) | func (*GroupDeviceChainKeyAdded) ProtoMessage() {}
method ProtoReflect (line 1557) | func (x *GroupDeviceChainKeyAdded) ProtoReflect() protoreflect.Message {
method Descriptor (line 1570) | func (*GroupDeviceChainKeyAdded) Descriptor() ([]byte, []int) {
method GetDevicePk (line 1574) | func (x *GroupDeviceChainKeyAdded) GetDevicePk() []byte {
method GetDestMemberPk (line 1581) | func (x *GroupDeviceChainKeyAdded) GetDestMemberPk() []byte {
method GetPayload (line 1588) | func (x *GroupDeviceChainKeyAdded) GetPayload() []byte {
type MultiMemberGroupAliasResolverAdded (line 1596) | type MultiMemberGroupAliasResolverAdded struct
method Reset (line 1611) | func (x *MultiMemberGroupAliasResolverAdded) Reset() {
method String (line 1620) | func (x *MultiMemberGroupAliasResolverAdded) String() string {
method ProtoMessage (line 1624) | func (*MultiMemberGroupAliasResolverAdded) ProtoMessage() {}
method ProtoReflect (line 1626) | func (x *MultiMemberGroupAliasResolverAdded) ProtoReflect() protorefle...
method Descriptor (line 1639) | func (*MultiMemberGroupAliasResolverAdded) Descriptor() ([]byte, []int) {
method GetDevicePk (line 1643) | func (x *MultiMemberGroupAliasResolverAdded) GetDevicePk() []byte {
method GetAliasResolver (line 1650) | func (x *MultiMemberGroupAliasResolverAdded) GetAliasResolver() []byte {
method GetAliasProof (line 1657) | func (x *MultiMemberGroupAliasResolverAdded) GetAliasProof() []byte {
type MultiMemberGroupAdminRoleGranted (line 1665) | type MultiMemberGroupAdminRoleGranted struct
method Reset (line 1676) | func (x *MultiMemberGroupAdminRoleGranted) Reset() {
method String (line 1685) | func (x *MultiMemberGroupAdminRoleGranted) String() string {
method ProtoMessage (line 1689) | func (*MultiMemberGroupAdminRoleGranted) ProtoMessage() {}
method ProtoReflect (line 1691) | func (x *MultiMemberGroupAdminRoleGranted) ProtoReflect() protoreflect...
method Descriptor (line 1704) | func (*MultiMemberGroupAdminRoleGranted) Descriptor() ([]byte, []int) {
method GetDevicePk (line 1708) | func (x *MultiMemberGroupAdminRoleGranted) GetDevicePk() []byte {
method GetGranteeMemberPk (line 1715) | func (x *MultiMemberGroupAdminRoleGranted) GetGranteeMemberPk() []byte {
type MultiMemberGroupInitialMemberAnnounced (line 1723) | type MultiMemberGroupInitialMemberAnnounced struct
method Reset (line 1732) | func (x *MultiMemberGroupInitialMemberAnnounced) Reset() {
method String (line 1741) | func (x *MultiMemberGroupInitialMemberAnnounced) String() string {
method ProtoMessage (line 1745) | func (*MultiMemberGroupInitialMemberAnnounced) ProtoMessage() {}
method ProtoReflect (line 1747) | func (x *MultiMemberGroupInitialMemberAnnounced) ProtoReflect() protor...
method Descriptor (line 1760) | func (*MultiMemberGroupInitialMemberAnnounced) Descriptor() ([]byte, [...
method GetMemberPk (line 1764) | func (x *MultiMemberGroupInitialMemberAnnounced) GetMemberPk() []byte {
type GroupAddAdditionalRendezvousSeed (line 1772) | type GroupAddAdditionalRendezvousSeed struct
method Reset (line 1783) | func (x *GroupAddAdditionalRendezvousSeed) Reset() {
method String (line 1792) | func (x *GroupAddAdditionalRendezvousSeed) String() string {
method ProtoMessage (line 1796) | func (*GroupAddAdditionalRendezvousSeed) ProtoMessage() {}
method ProtoReflect (line 1798) | func (x *GroupAddAdditionalRendezvousSeed) ProtoReflect() protoreflect...
method Descriptor (line 1811) | func (*GroupAddAdditionalRendezvousSeed) Descriptor() ([]byte, []int) {
method GetDevicePk (line 1815) | func (x *GroupAddAdditionalRendezvousSeed) GetDevicePk() []byte {
method GetSeed (line 1822) | func (x *GroupAddAdditionalRendezvousSeed) GetSeed() []byte {
type GroupRemoveAdditionalRendezvousSeed (line 1830) | type GroupRemoveAdditionalRendezvousSeed struct
method Reset (line 1841) | func (x *GroupRemoveAdditionalRendezvousSeed) Reset() {
method String (line 1850) | func (x *GroupRemoveAdditionalRendezvousSeed) String() string {
method ProtoMessage (line 1854) | func (*GroupRemoveAdditionalRendezvousSeed) ProtoMessage() {}
method ProtoReflect (line 1856) | func (x *GroupRemoveAdditionalRendezvousSeed) ProtoReflect() protorefl...
method Descriptor (line 1869) | func (*GroupRemoveAdditionalRendezvousSeed) Descriptor() ([]byte, []in...
method GetDevicePk (line 1873) | func (x *GroupRemoveAdditionalRendezvousSeed) GetDevicePk() []byte {
method GetSeed (line 1880) | func (x *GroupRemoveAdditionalRendezvousSeed) GetSeed() []byte {
type AccountGroupJoined (line 1888) | type AccountGroupJoined struct
method Reset (line 1899) | func (x *AccountGroupJoined) Reset() {
method String (line 1908) | func (x *AccountGroupJoined) String() string {
method ProtoMessage (line 1912) | func (*AccountGroupJoined) ProtoMessage() {}
method ProtoReflect (line 1914) | func (x *AccountGroupJoined) ProtoReflect() protoreflect.Message {
method Descriptor (line 1927) | func (*AccountGroupJoined) Descriptor() ([]byte, []int) {
method GetDevicePk (line 1931) | func (x *AccountGroupJoined) GetDevicePk() []byte {
method GetGroup (line 1938) | func (x *AccountGroupJoined) GetGroup() *Group {
type AccountGroupLeft (line 1946) | type AccountGroupLeft struct
method Reset (line 1957) | func (x *AccountGroupLeft) Reset() {
method String (line 1966) | func (x *AccountGroupLeft) String() string {
method ProtoMessage (line 1970) | func (*AccountGroupLeft) ProtoMessage() {}
method ProtoReflect (line 1972) | func (x *AccountGroupLeft) ProtoReflect() protoreflect.Message {
method Descriptor (line 1985) | func (*AccountGroupLeft) Descriptor() ([]byte, []int) {
method GetDevicePk (line 1989) | func (x *AccountGroupLeft) GetDevicePk() []byte {
method GetGroupPk (line 1996) | func (x *AccountGroupLeft) GetGroupPk() []byte {
type AccountContactRequestDisabled (line 2004) | type AccountContactRequestDisabled struct
method Reset (line 2013) | func (x *AccountContactRequestDisabled) Reset() {
method String (line 2022) | func (x *AccountContactRequestDisabled) String() string {
method ProtoMessage (line 2026) | func (*AccountContactRequestDisabled) ProtoMessage() {}
method ProtoReflect (line 2028) | func (x *AccountContactRequestDisabled) ProtoReflect() protoreflect.Me...
method Descriptor (line 2041) | func (*AccountContactRequestDisabled) Descriptor() ([]byte, []int) {
method GetDevicePk (line 2045) | func (x *AccountContactRequestDisabled) GetDevicePk() []byte {
type AccountContactRequestEnabled (line 2053) | type AccountContactRequestEnabled struct
method Reset (line 2062) | func (x *AccountContactRequestEnabled) Reset() {
method String (line 2071) | func (x *AccountContactRequestEnabled) String() string {
method ProtoMessage (line 2075) | func (*AccountContactRequestEnabled) ProtoMessage() {}
method ProtoReflect (line 2077) | func (x *AccountContactRequestEnabled) ProtoReflect() protoreflect.Mes...
method Descriptor (line 2090) | func (*AccountContactRequestEnabled) Descriptor() ([]byte, []int) {
method GetDevicePk (line 2094) | func (x *AccountContactRequestEnabled) GetDevicePk() []byte {
type AccountContactRequestReferenceReset (line 2102) | type AccountContactRequestReferenceReset struct
method Reset (line 2113) | func (x *AccountContactRequestReferenceReset) Reset() {
method String (line 2122) | func (x *AccountContactRequestReferenceReset) String() string {
method ProtoMessage (line 2126) | func (*AccountContactRequestReferenceReset) ProtoMessage() {}
method ProtoReflect (line 2128) | func (x *AccountContactRequestReferenceReset) ProtoReflect() protorefl...
method Descriptor (line 2141) | func (*AccountContactRequestReferenceReset) Descriptor() ([]byte, []in...
method GetDevicePk (line 2145) | func (x *AccountContactRequestReferenceReset) GetDevicePk() []byte {
method GetPublicRendezvousSeed (line 2152) | func (x *AccountContactRequestReferenceReset) GetPublicRendezvousSeed(...
type AccountContactRequestOutgoingEnqueued (line 2163) | type AccountContactRequestOutgoingEnqueued struct
method Reset (line 2178) | func (x *AccountContactRequestOutgoingEnqueued) Reset() {
method String (line 2187) | func (x *AccountContactRequestOutgoingEnqueued) String() string {
method ProtoMessage (line 2191) | func (*AccountContactRequestOutgoingEnqueued) ProtoMessage() {}
method ProtoReflect (line 2193) | func (x *AccountContactRequestOutgoingEnqueued) ProtoReflect() protore...
method Descriptor (line 2206) | func (*AccountContactRequestOutgoingEnqueued) Descriptor() ([]byte, []...
method GetDevicePk (line 2210) | func (x *AccountContactRequestOutgoingEnqueued) GetDevicePk() []byte {
method GetGroupPk (line 2217) | func (x *AccountContactRequestOutgoingEnqueued) GetGroupPk() []byte {
method GetContact (line 2224) | func (x *AccountContactRequestOutgoingEnqueued) GetContact() *Shareabl...
method GetOwnMetadata (line 2231) | func (x *AccountContactRequestOutgoingEnqueued) GetOwnMetadata() []byte {
type AccountContactRequestOutgoingSent (line 2239) | type AccountContactRequestOutgoingSent struct
method Reset (line 2250) | func (x *AccountContactRequestOutgoingSent) Reset() {
method String (line 2259) | func (x *AccountContactRequestOutgoingSent) String() string {
method ProtoMessage (line 2263) | func (*AccountContactRequestOutgoingSent) ProtoMessage() {}
method ProtoReflect (line 2265) | func (x *AccountContactRequestOutgoingSent) ProtoReflect() protoreflec...
method Descriptor (line 2278) | func (*AccountContactRequestOutgoingSent) Descriptor() ([]byte, []int) {
method GetDevicePk (line 2282) | func (x *AccountContactRequestOutgoingSent) GetDevicePk() []byte {
method GetContactPk (line 2289) | func (x *AccountContactRequestOutgoingSent) GetContactPk() []byte {
type AccountContactRequestIncomingReceived (line 2297) | type AccountContactRequestIncomingReceived struct
method Reset (line 2314) | func (x *AccountContactRequestIncomingReceived) Reset() {
method String (line 2323) | func (x *AccountContactRequestIncomingReceived) String() string {
method ProtoMessage (line 2327) | func (*AccountContactRequestIncomingReceived) ProtoMessage() {}
method ProtoReflect (line 2329) | func (x *AccountContactRequestIncomingReceived) ProtoReflect() protore...
method Descriptor (line 2342) | func (*AccountContactRequestIncomingReceived) Descriptor() ([]byte, []...
method GetDevicePk (line 2346) | func (x *AccountContactRequestIncomingReceived) GetDevicePk() []byte {
method GetContactPk (line 2353) | func (x *AccountContactRequestIncomingReceived) GetContactPk() []byte {
method GetContactRendezvousSeed (line 2360) | func (x *AccountContactRequestIncomingReceived) GetContactRendezvousSe...
method GetContactMetadata (line 2367) | func (x *AccountContactRequestIncomingReceived) GetContactMetadata() [...
type AccountContactRequestIncomingDiscarded (line 2375) | type AccountContactRequestIncomingDiscarded struct
method Reset (line 2386) | func (x *AccountContactRequestIncomingDiscarded) Reset() {
method String (line 2395) | func (x *AccountContactRequestIncomingDiscarded) String() string {
method ProtoMessage (line 2399) | func (*AccountContactRequestIncomingDiscarded) ProtoMessage() {}
method ProtoReflect (line 2401) | func (x *AccountContactRequestIncomingDiscarded) ProtoReflect() protor...
method Descriptor (line 2414) | func (*AccountContactRequestIncomingDiscarded) Descriptor() ([]byte, [...
method GetDevicePk (line 2418) | func (x *AccountContactRequestIncomingDiscarded) GetDevicePk() []byte {
method GetContactPk (line 2425) | func (x *AccountContactRequestIncomingDiscarded) GetContactPk() []byte {
type AccountContactRequestIncomingAccepted (line 2435) | type AccountContactRequestIncomingAccepted struct
method Reset (line 2448) | func (x *AccountContactRequestIncomingAccepted) Reset() {
method String (line 2457) | func (x *AccountContactRequestIncomingAccepted) String() string {
method ProtoMessage (line 2461) | func (*AccountContactRequestIncomingAccepted) ProtoMessage() {}
method ProtoReflect (line 2463) | func (x *AccountContactRequestIncomingAccepted) ProtoReflect() protore...
method Descriptor (line 2476) | func (*AccountContactRequestIncomingAccepted) Descriptor() ([]byte, []...
method GetDevicePk (line 2480) | func (x *AccountContactRequestIncomingAccepted) GetDevicePk() []byte {
method GetContactPk (line 2487) | func (x *AccountContactRequestIncomingAccepted) GetContactPk() []byte {
method GetGroupPk (line 2494) | func (x *AccountContactRequestIncomingAccepted) GetGroupPk() []byte {
type AccountContactBlocked (line 2502) | type AccountContactBlocked struct
method Reset (line 2513) | func (x *AccountContactBlocked) Reset() {
method String (line 2522) | func (x *AccountContactBlocked) String() string {
method ProtoMessage (line 2526) | func (*AccountContactBlocked) ProtoMessage() {}
method ProtoReflect (line 2528) | func (x *AccountContactBlocked) ProtoReflect() protoreflect.Message {
method Descriptor (line 2541) | func (*AccountContactBlocked) Descriptor() ([]byte, []int) {
method GetDevicePk (line 2545) | func (x *AccountContactBlocked) GetDevicePk() []byte {
method GetContactPk (line 2552) | func (x *AccountContactBlocked) GetContactPk() []byte {
type AccountContactUnblocked (line 2560) | type AccountContactUnblocked struct
method Reset (line 2571) | func (x *AccountContactUnblocked) Reset() {
method String (line 2580) | func (x *AccountContactUnblocked) String() string {
method ProtoMessage (line 2584) | func (*AccountContactUnblocked) ProtoMessage() {}
method ProtoReflect (line 2586) | func (x *AccountContactUnblocked) ProtoReflect() protoreflect.Message {
method Descriptor (line 2599) | func (*AccountContactUnblocked) Descriptor() ([]byte, []int) {
method GetDevicePk (line 2603) | func (x *AccountContactUnblocked) GetDevicePk() []byte {
method GetContactPk (line 2610) | func (x *AccountContactUnblocked) GetContactPk() []byte {
type GroupReplicating (line 2617) | type GroupReplicating struct
method Reset (line 2630) | func (x *GroupReplicating) Reset() {
method String (line 2639) | func (x *GroupReplicating) String() string {
method ProtoMessage (line 2643) | func (*GroupReplicating) ProtoMessage() {}
method ProtoReflect (line 2645) | func (x *GroupReplicating) ProtoReflect() protoreflect.Message {
method Descriptor (line 2658) | func (*GroupReplicating) Descriptor() ([]byte, []int) {
method GetDevicePk (line 2662) | func (x *GroupReplicating) GetDevicePk() []byte {
method GetAuthenticationUrl (line 2669) | func (x *GroupReplicating) GetAuthenticationUrl() string {
method GetReplicationServer (line 2676) | func (x *GroupReplicating) GetReplicationServer() string {
type ServiceExportData (line 2683) | type ServiceExportData struct
method Reset (line 2689) | func (x *ServiceExportData) Reset() {
method String (line 2698) | func (x *ServiceExportData) String() string {
method ProtoMessage (line 2702) | func (*ServiceExportData) ProtoMessage() {}
method ProtoReflect (line 2704) | func (x *ServiceExportData) ProtoReflect() protoreflect.Message {
method Descriptor (line 2717) | func (*ServiceExportData) Descriptor() ([]byte, []int) {
type ServiceGetConfiguration (line 2721) | type ServiceGetConfiguration struct
method Reset (line 2727) | func (x *ServiceGetConfiguration) Reset() {
method String (line 2736) | func (x *ServiceGetConfiguration) String() string {
method ProtoMessage (line 2740) | func (*ServiceGetConfiguration) ProtoMessage() {}
method ProtoReflect (line 2742) | func (x *ServiceGetConfiguration) ProtoReflect() protoreflect.Message {
method Descriptor (line 2755) | func (*ServiceGetConfiguration) Descriptor() ([]byte, []int) {
type ContactRequestReference (line 2759) | type ContactRequestReference struct
method Reset (line 2765) | func (x *ContactRequestReference) Reset() {
method String (line 2774) | func (x *ContactRequestReference) String() string {
method ProtoMessage (line 2778) | func (*ContactRequestReference) ProtoMessage() {}
method ProtoReflect (line 2780) | func (x *ContactRequestReference) ProtoReflect() protoreflect.Message {
method Descriptor (line 2793) | func (*ContactRequestReference) Descriptor() ([]byte, []int) {
type ContactRequestDisable (line 2797) | type ContactRequestDisable struct
method Reset (line 2803) | func (x *ContactRequestDisable) Reset() {
method String (line 2812) | func (x *ContactRequestDisable) String() string {
method ProtoMessage (line 2816) | func (*ContactRequestDisable) ProtoMessage() {}
method ProtoReflect (line 2818) | func (x *ContactRequestDisable) ProtoReflect() protoreflect.Message {
method Descriptor (line 2831) | func (*ContactRequestDisable) Descriptor() ([]byte, []int) {
type ContactRequestEnable (line 2835) | type ContactRequestEnable struct
method Reset (line 2841) | func (x *ContactRequestEnable) Reset() {
method String (line 2850) | func (x *ContactRequestEnable) String() string {
method ProtoMessage (line 2854) | func (*ContactRequestEnable) ProtoMessage() {}
method ProtoReflect (line 2856) | func (x *ContactRequestEnable) ProtoReflect() protoreflect.Message {
method Descriptor (line 2869) | func (*ContactRequestEnable) Descriptor() ([]byte, []int) {
type ContactRequestResetReference (line 2873) | type ContactRequestResetReference struct
method Reset (line 2879) | func (x *ContactRequestResetReference) Reset() {
method String (line 2888) | func (x *ContactRequestResetReference) String() string {
method ProtoMessage (line 2892) | func (*ContactRequestResetReference) ProtoMessage() {}
method ProtoReflect (line 2894) | func (x *ContactRequestResetReference) ProtoReflect() protoreflect.Mes...
method Descriptor (line 2907) | func (*ContactRequestResetReference) Descriptor() ([]byte, []int) {
type ContactRequestSend (line 2911) | type ContactRequestSend struct
method Reset (line 2917) | func (x *ContactRequestSend) Reset() {
method String (line 2926) | func (x *ContactRequestSend) String() string {
method ProtoMessage (line 2930) | func (*ContactRequestSend) ProtoMessage() {}
method ProtoReflect (line 2932) | func (x *ContactRequestSend) ProtoReflect() protoreflect.Message {
method Descriptor (line 2945) | func (*ContactRequestSend) Descriptor() ([]byte, []int) {
type ContactRequestAccept (line 2949) | type ContactRequestAccept struct
method Reset (line 2955) | func (x *ContactRequestAccept) Reset() {
method String (line 2964) | func (x *ContactRequestAccept) String() string {
method ProtoMessage (line 2968) | func (*ContactRequestAccept) ProtoMessage() {}
method ProtoReflect (line 2970) | func (x *ContactRequestAccept) ProtoReflect() protoreflect.Message {
method Descriptor (line 2983) | func (*ContactRequestAccept) Descriptor() ([]byte, []int) {
type ContactRequestDiscard (line 2987) | type ContactRequestDiscard struct
method Reset (line 2993) | func (x *ContactRequestDiscard) Reset() {
method String (line 3002) | func (x *ContactRequestDiscard) String() string {
method ProtoMessage (line 3006) | func (*ContactRequestDiscard) ProtoMessage() {}
method ProtoReflect (line 3008) | func (x *ContactRequestDiscard) ProtoReflect() protoreflect.Message {
method Descriptor (line 3021) | func (*ContactRequestDiscard) Descriptor() ([]byte, []int) {
type ShareContact (line 3025) | type ShareContact struct
method Reset (line 3031) | func (x *ShareContact) Reset() {
method String (line 3040) | func (x *ShareContact) String() string {
method ProtoMessage (line 3044) | func (*ShareContact) ProtoMessage() {}
method ProtoReflect (line 3046) | func (x *ShareContact) ProtoReflect() protoreflect.Message {
method Descriptor (line 3059) | func (*ShareContact) Descriptor() ([]byte, []int) {
type DecodeContact (line 3063) | type DecodeContact struct
method Reset (line 3069) | func (x *DecodeContact) Reset() {
method String (line 3078) | func (x *DecodeContact) String() string {
method ProtoMessage (line 3082) | func (*DecodeContact) ProtoMessage() {}
method ProtoReflect (line 3084) | func (x *DecodeContact) ProtoReflect() protoreflect.Message {
method Descriptor (line 3097) | func (*DecodeContact) Descriptor() ([]byte, []int) {
type ContactBlock (line 3101) | type ContactBlock struct
method Reset (line 3107) | func (x *ContactBlock) Reset() {
method String (line 3116) | func (x *ContactBlock) String() string {
method ProtoMessage (line 3120) | func (*ContactBlock) ProtoMessage() {}
method ProtoReflect (line 3122) | func (x *ContactBlock) ProtoReflect() protoreflect.Message {
method Descriptor (line 3135) | func (*ContactBlock) Descriptor() ([]byte, []int) {
type ContactUnblock (line 3139) | type ContactUnblock struct
method Reset (line 3145) | func (x *ContactUnblock) Reset() {
method String (line 3154) | func (x *ContactUnblock) String() string {
method ProtoMessage (line 3158) | func (*ContactUnblock) ProtoMessage() {}
method ProtoReflect (line 3160) | func (x *ContactUnblock) ProtoReflect() protoreflect.Message {
method Descriptor (line 3173) | func (*ContactUnblock) Descriptor() ([]byte, []int) {
type ContactAliasKeySend (line 3177) | type ContactAliasKeySend struct
method Reset (line 3183) | func (x *ContactAliasKeySend) Reset() {
method String (line 3192) | func (x *ContactAliasKeySend) String() string {
method ProtoMessage (line 3196) | func (*ContactAliasKeySend) ProtoMessage() {}
method ProtoReflect (line 3198) | func (x *ContactAliasKeySend) ProtoReflect() protoreflect.Message {
method Descriptor (line 3211) | func (*ContactAliasKeySend) Descriptor() ([]byte, []int) {
type MultiMemberGroupCreate (line 3215) | type MultiMemberGroupCreate struct
method Reset (line 3221) | func (x *MultiMemberGroupCreate) Reset() {
method String (line 3230) | func (x *MultiMemberGroupCreate) String() string {
method ProtoMessage (line 3234) | func (*MultiMemberGroupCreate) ProtoMessage() {}
method ProtoReflect (line 3236) | func (x *MultiMemberGroupCreate) ProtoReflect() protoreflect.Message {
method Descriptor (line 3249) | func (*MultiMemberGroupCreate) Descriptor() ([]byte, []int) {
type MultiMemberGroupJoin (line 3253) | type MultiMemberGroupJoin struct
method Reset (line 3259) | func (x *MultiMemberGroupJoin) Reset() {
method String (line 3268) | func (x *MultiMemberGroupJoin) String() string {
method ProtoMessage (line 3272) | func (*MultiMemberGroupJoin) ProtoMessage() {}
method ProtoReflect (line 3274) | func (x *MultiMemberGroupJoin) ProtoReflect() protoreflect.Message {
method Descriptor (line 3287) | func (*MultiMemberGroupJoin) Descriptor() ([]byte, []int) {
type MultiMemberGroupLeave (line 3291) | type MultiMemberGroupLeave struct
method Reset (line 3297) | func (x *MultiMemberGroupLeave) Reset() {
method String (line 3306) | func (x *MultiMemberGroupLeave) String() string {
method ProtoMessage (line 3310) | func (*MultiMemberGroupLeave) ProtoMessage() {}
method ProtoReflect (line 3312) | func (x *MultiMemberGroupLeave) ProtoReflect() protoreflect.Message {
method Descriptor (line 3325) | func (*MultiMemberGroupLeave) Descriptor() ([]byte, []int) {
type MultiMemberGroupAliasResolverDisclose (line 3329) | type MultiMemberGroupAliasResolverDisclose struct
method Reset (line 3335) | func (x *MultiMemberGroupAliasResolverDisclose) Reset() {
method String (line 3344) | func (x *MultiMemberGroupAliasResolverDisclose) String() string {
method ProtoMessage (line 3348) | func (*MultiMemberGroupAliasResolverDisclose) ProtoMessage() {}
method ProtoReflect (line 3350) | func (x *MultiMemberGroupAliasResolverDisclose) ProtoReflect() protore...
method Descriptor (line 3363) | func (*MultiMemberGroupAliasResolverDisclose) Descriptor() ([]byte, []...
type MultiMemberGroupAdminRoleGrant (line 3367) | type MultiMemberGroupAdminRoleGrant struct
method Reset (line 3373) | func (x *MultiMemberGroupAdminRoleGrant) Reset() {
method String (line 3382) | func (x *MultiMemberGroupAdminRoleGrant) String() string {
method ProtoMessage (line 3386) | func (*MultiMemberGroupAdminRoleGrant) ProtoMessage() {}
method ProtoReflect (line 3388) | func (x *MultiMemberGroupAdminRoleGrant) ProtoReflect() protoreflect.M...
method Descriptor (line 3401) | func (*MultiMemberGroupAdminRoleGrant) Descriptor() ([]byte, []int) {
type MultiMemberGroupInvitationCreate (line 3405) | type MultiMemberGroupInvitationCreate struct
method Reset (line 3411) | func (x *MultiMemberGroupInvitationCreate) Reset() {
method String (line 3420) | func (x *MultiMemberGroupInvitationCreate) String() string {
method ProtoMessage (line 3424) | func (*MultiMemberGroupInvitationCreate) ProtoMessage() {}
method ProtoReflect (line 3426) | func (x *MultiMemberGroupInvitationCreate) ProtoReflect() protoreflect...
method Descriptor (line 3439) | func (*MultiMemberGroupInvitationCreate) Descriptor() ([]byte, []int) {
type AppMetadataSend (line 3443) | type AppMetadataSend struct
method Reset (line 3449) | func (x *AppMetadataSend) Reset() {
method String (line 3458) | func (x *AppMetadataSend) String() string {
method ProtoMessage (line 3462) | func (*AppMetadataSend) ProtoMessage() {}
method ProtoReflect (line 3464) | func (x *AppMetadataSend) ProtoReflect() protoreflect.Message {
method Descriptor (line 3477) | func (*AppMetadataSend) Descriptor() ([]byte, []int) {
type AppMessageSend (line 3481) | type AppMessageSend struct
method Reset (line 3487) | func (x *AppMessageSend) Reset() {
method String (line 3496) | func (x *AppMessageSend) String() string {
method ProtoMessage (line 3500) | func (*AppMessageSend) ProtoMessage() {}
method ProtoReflect (line 3502) | func (x *AppMessageSend) ProtoReflect() protoreflect.Message {
method Descriptor (line 3515) | func (*AppMessageSend) Descriptor() ([]byte, []int) {
type GroupMetadataEvent (line 3519) | type GroupMetadataEvent struct
method Reset (line 3532) | func (x *GroupMetadataEvent) Reset() {
method String (line 3541) | func (x *GroupMetadataEvent) String() string {
method ProtoMessage (line 3545) | func (*GroupMetadataEvent) ProtoMessage() {}
method ProtoReflect (line 3547) | func (x *GroupMetadataEvent) ProtoReflect() protoreflect.Message {
method Descriptor (line 3560) | func (*GroupMetadataEvent) Descriptor() ([]byte, []int) {
method GetEventContext (line 3564) | func (x *GroupMetadataEvent) GetEventContext() *EventContext {
method GetMetadata (line 3571) | func (x *GroupMetadataEvent) GetMetadata() *GroupMetadata {
method GetEvent (line 3578) | func (x *GroupMetadataEvent) GetEvent() []byte {
type GroupMessageEvent (line 3585) | type GroupMessageEvent struct
method Reset (line 3598) | func (x *GroupMessageEvent) Reset() {
method String (line 3607) | func (x *GroupMessageEvent) String() string {
method ProtoMessage (line 3611) | func (*GroupMessageEvent) ProtoMessage() {}
method ProtoReflect (line 3613) | func (x *GroupMessageEvent) ProtoReflect() protoreflect.Message {
method Descriptor (line 3626) | func (*GroupMessageEvent) Descriptor() ([]byte, []int) {
method GetEventContext (line 3630) | func (x *GroupMessageEvent) GetEventContext() *EventContext {
method GetHeaders (line 3637) | func (x *GroupMessageEvent) GetHeaders() *MessageHeaders {
method GetMessage (line 3644) | func (x *GroupMessageEvent) GetMessage() []byte {
type GroupMetadataList (line 3651) | type GroupMetadataList struct
method Reset (line 3657) | func (x *GroupMetadataList) Reset() {
method String (line 3666) | func (x *GroupMetadataList) String() string {
method ProtoMessage (line 3670) | func (*GroupMetadataList) ProtoMessage() {}
method ProtoReflect (line 3672) | func (x *GroupMetadataList) ProtoReflect() protoreflect.Message {
method Descriptor (line 3685) | func (*GroupMetadataList) Descriptor() ([]byte, []int) {
type GroupMessageList (line 3689) | type GroupMessageList struct
method Reset (line 3695) | func (x *GroupMessageList) Reset() {
method String (line 3704) | func (x *GroupMessageList) String() string {
method ProtoMessage (line 3708) | func (*GroupMessageList) ProtoMessage() {}
method ProtoReflect (line 3710) | func (x *GroupMessageList) ProtoReflect() protoreflect.Message {
method Descriptor (line 3723) | func (*GroupMessageList) Descriptor() ([]byte, []int) {
type GroupInfo (line 3727) | type GroupInfo struct
method Reset (line 3733) | func (x *GroupInfo) Reset() {
method String (line 3742) | func (x *GroupInfo) String() string {
method ProtoMessage (line 3746) | func (*GroupInfo) ProtoMessage() {}
method ProtoReflect (line 3748) | func (x *GroupInfo) ProtoReflect() protoreflect.Message {
method Descriptor (line 3761) | func (*GroupInfo) Descriptor() ([]byte, []int) {
type ActivateGroup (line 3765) | type ActivateGroup struct
method Reset (line 3771) | func (x *ActivateGroup) Reset() {
method String (line 3780) | func (x *ActivateGroup) String() string {
method ProtoMessage (line 3784) | func (*ActivateGroup) ProtoMessage() {}
method ProtoReflect (line 3786) | func (x *ActivateGroup) ProtoReflect() protoreflect.Message {
method Descriptor (line 3799) | func (*ActivateGroup) Descriptor() ([]byte, []int) {
type DeactivateGroup (line 3803) | type DeactivateGroup struct
method Reset (line 3809) | func (x *DeactivateGroup) Reset() {
method String (line 3818) | func (x *DeactivateGroup) String() string {
method ProtoMessage (line 3822) | func (*DeactivateGroup) ProtoMessage() {}
method ProtoReflect (line 3824) | func (x *DeactivateGroup) ProtoReflect() protoreflect.Message {
method Descriptor (line 3837) | func (*DeactivateGroup) Descriptor() ([]byte, []int) {
type GroupDeviceStatus (line 3841) | type GroupDeviceStatus struct
method Reset (line 3847) | func (x *GroupDeviceStatus) Reset() {
method String (line 3856) | func (x *GroupDeviceStatus) String() string {
method ProtoMessage (line 3860) | func (*GroupDeviceStatus) ProtoMessage() {}
method ProtoReflect (line 3862) | func (x *GroupDeviceStatus) ProtoReflect() protoreflect.Message {
method Descriptor (line 3875) | func (*GroupDeviceStatus) Descriptor() ([]byte, []int) {
type DebugListGroups (line 3879) | type DebugListGroups struct
method Reset (line 3885) | func (x *DebugListGroups) Reset() {
method String (line 3894) | func (x *DebugListGroups) String() string {
method ProtoMessage (line 3898) | func (*DebugListGroups) ProtoMessage() {}
method ProtoReflect (line 3900) | func (x *DebugListGroups) ProtoReflect() protoreflect.Message {
method Descriptor (line 3913) | func (*DebugListGroups) Descriptor() ([]byte, []int) {
type DebugInspectGroupStore (line 3917) | type DebugInspectGroupStore struct
method Reset (line 3923) | func (x *DebugInspectGroupStore) Reset() {
method String (line 3932) | func (x *DebugInspectGroupStore) String() string {
method ProtoMessage (line 3936) | func (*DebugInspectGroupStore) ProtoMessage() {}
method ProtoReflect (line 3938) | func (x *DebugInspectGroupStore) ProtoReflect() protoreflect.Message {
method Descriptor (line 3951) | func (*DebugInspectGroupStore) Descriptor() ([]byte, []int) {
type DebugGroup (line 3955) | type DebugGroup struct
method Reset (line 3961) | func (x *DebugGroup) Reset() {
method String (line 3970) | func (x *DebugGroup) String() string {
method ProtoMessage (line 3974) | func (*DebugGroup) ProtoMessage() {}
method ProtoReflect (line 3976) | func (x *DebugGroup) ProtoReflect() protoreflect.Message {
method Descriptor (line 3989) | func (*DebugGroup) Descriptor() ([]byte, []int) {
type ShareableContact (line 3993) | type ShareableContact struct
method Reset (line 4006) | func (x *ShareableContact) Reset() {
method String (line 4015) | func (x *ShareableContact) String() string {
method ProtoMessage (line 4019) | func (*ShareableContact) ProtoMessage() {}
method ProtoReflect (line 4021) | func (x *ShareableContact) ProtoReflect() protoreflect.Message {
method Descriptor (line 4034) | func (*ShareableContact) Descriptor() ([]byte, []int) {
method GetPk (line 4038) | func (x *ShareableContact) GetPk() []byte {
method GetPublicRendezvousSeed (line 4045) | func (x *ShareableContact) GetPublicRendezvousSeed() []byte {
method GetMetadata (line 4052) | func (x *ShareableContact) GetMetadata() []byte {
type ServiceTokenSupportedService (line 4059) | type ServiceTokenSupportedService struct
method Reset (line 4068) | func (x *ServiceTokenSupportedService) Reset() {
method String (line 4077) | func (x *ServiceTokenSupportedService) String() string {
method ProtoMessage (line 4081) | func (*ServiceTokenSupportedService) ProtoMessage() {}
method ProtoReflect (line 4083) | func (x *ServiceTokenSupportedService) ProtoReflect() protoreflect.Mes...
method Descriptor (line 4096) | func (*ServiceTokenSupportedService) Descriptor() ([]byte, []int) {
method GetServiceType (line 4100) | func (x *ServiceTokenSupportedService) GetServiceType() string {
method GetServiceEndpoint (line 4107) | func (x *ServiceTokenSupportedService) GetServiceEndpoint() string {
type ServiceToken (line 4114) | type ServiceToken struct
method Reset (line 4125) | func (x *ServiceToken) Reset() {
method String (line 4134) | func (x *ServiceToken) String() string {
method ProtoMessage (line 4138) | func (*ServiceToken) ProtoMessage() {}
method ProtoReflect (line 4140) | func (x *ServiceToken) ProtoReflect() protoreflect.Message {
method Descriptor (line 4153) | func (*ServiceToken) Descriptor() ([]byte, []int) {
method GetToken (line 4157) | func (x *ServiceToken) GetToken() string {
method GetAuthenticationUrl (line 4164) | func (x *ServiceToken) GetAuthenticationUrl() string {
method GetSupportedServices (line 4171) | func (x *ServiceToken) GetSupportedServices() []*ServiceTokenSupported...
method GetExpiration (line 4178) | func (x *ServiceToken) GetExpiration() int64 {
type CredentialVerificationServiceInitFlow (line 4185) | type CredentialVerificationServiceInitFlow struct
method Reset (line 4191) | func (x *CredentialVerificationServiceInitFlow) Reset() {
method String (line 4200) | func (x *CredentialVerificationServiceInitFlow) String() string {
method ProtoMessage (line 4204) | func (*CredentialVerificationServiceInitFlow) ProtoMessage() {}
method ProtoReflect (line 4206) | func (x *CredentialVerificationServiceInitFlow) ProtoReflect() protore...
method Descriptor (line 4219) | func (*CredentialVerificationServiceInitFlow) Descriptor() ([]byte, []...
type CredentialVerificationServiceCompleteFlow (line 4223) | type CredentialVerificationServiceCompleteFlow struct
method Reset (line 4229) | func (x *CredentialVerificationServiceCompleteFlow) Reset() {
method String (line 4238) | func (x *CredentialVerificationServiceCompleteFlow) String() string {
method ProtoMessage (line 4242) | func (*CredentialVerificationServiceCompleteFlow) ProtoMessage() {}
method ProtoReflect (line 4244) | func (x *CredentialVerificationServiceCompleteFlow) ProtoReflect() pro...
method Descriptor (line 4257) | func (*CredentialVerificationServiceCompleteFlow) Descriptor() ([]byte...
type VerifiedCredentialsList (line 4261) | type VerifiedCredentialsList struct
method Reset (line 4267) | func (x *VerifiedCredentialsList) Reset() {
method String (line 4276) | func (x *VerifiedCredentialsList) String() string {
method ProtoMessage (line 4280) | func (*VerifiedCredentialsList) ProtoMessage() {}
method ProtoReflect (line 4282) | func (x *VerifiedCredentialsList) ProtoReflect() protoreflect.Message {
method Descriptor (line 4295) | func (*VerifiedCredentialsList) Descriptor() ([]byte, []int) {
type ReplicationServiceRegisterGroup (line 4299) | type ReplicationServiceRegisterGroup struct
method Reset (line 4305) | func (x *ReplicationServiceRegisterGroup) Reset() {
method String (line 4314) | func (x *ReplicationServiceRegisterGroup) String() string {
method ProtoMessage (line 4318) | func (*ReplicationServiceRegisterGroup) ProtoMessage() {}
method ProtoReflect (line 4320) | func (x *ReplicationServiceRegisterGroup) ProtoReflect() protoreflect....
method Descriptor (line 4333) | func (*ReplicationServiceRegisterGroup) Descriptor() ([]byte, []int) {
type ReplicationServiceReplicateGroup (line 4337) | type ReplicationServiceReplicateGroup struct
method Reset (line 4343) | func (x *ReplicationServiceReplicateGroup) Reset() {
method String (line 4352) | func (x *ReplicationServiceReplicateGroup) String() string {
method ProtoMessage (line 4356) | func (*ReplicationServiceReplicateGroup) ProtoMessage() {}
method ProtoReflect (line 4358) | func (x *ReplicationServiceReplicateGroup) ProtoReflect() protoreflect...
method Descriptor (line 4371) | func (*ReplicationServiceReplicateGroup) Descriptor() ([]byte, []int) {
type SystemInfo (line 4375) | type SystemInfo struct
method Reset (line 4381) | func (x *SystemInfo) Reset() {
method String (line 4390) | func (x *SystemInfo) String() string {
method ProtoMessage (line 4394) | func (*SystemInfo) ProtoMessage() {}
method ProtoReflect (line 4396) | func (x *SystemInfo) ProtoReflect() protoreflect.Message {
method Descriptor (line 4409) | func (*SystemInfo) Descriptor() ([]byte, []int) {
type PeerList (line 4413) | type PeerList struct
method Reset (line 4419) | func (x *PeerList) Reset() {
method String (line 4428) | func (x *PeerList) String() string {
method ProtoMessage (line 4432) | func (*PeerList) ProtoMessage() {}
method ProtoReflect (line 4434) | func (x *PeerList) ProtoReflect() protoreflect.Message {
method Descriptor (line 4447) | func (*PeerList) Descriptor() ([]byte, []int) {
type Progress (line 4452) | type Progress struct
method Reset (line 4465) | func (x *Progress) Reset() {
method String (line 4474) | func (x *Progress) String() string {
method ProtoMessage (line 4478) | func (*Progress) ProtoMessage() {}
method ProtoReflect (line 4480) | func (x *Progress) ProtoReflect() protoreflect.Message {
method Descriptor (line 4493) | func (*Progress) Descriptor() ([]byte, []int) {
method GetState (line 4497) | func (x *Progress) GetState() string {
method GetDoing (line 4504) | func (x *Progress) GetDoing() string {
method GetProgress (line 4511) | func (x *Progress) GetProgress() float32 {
method GetCompleted (line 4518) | func (x *Progress) GetCompleted() uint64 {
method GetTotal (line 4525) | func (x *Progress) GetTotal() uint64 {
method GetDelay (line 4532) | func (x *Progress) GetDelay() uint64 {
type OutOfStoreMessage (line 4539) | type OutOfStoreMessage struct
method Reset (line 4553) | func (x *OutOfStoreMessage) Reset() {
method String (line 4562) | func (x *OutOfStoreMessage) String() string {
method ProtoMessage (line 4566) | func (*OutOfStoreMessage) ProtoMessage() {}
method ProtoReflect (line 4568) | func (x *OutOfStoreMessage) ProtoReflect() protoreflect.Message {
method Descriptor (line 4581) | func (*OutOfStoreMessage) Descriptor() ([]byte, []int) {
method GetCid (line 4585) | func (x *OutOfStoreMessage) GetCid() []byte {
method GetDevicePk (line 4592) | func (x *OutOfStoreMessage) GetDevicePk() []byte {
method GetCounter (line 4599) | func (x *OutOfStoreMessage) GetCounter() uint64 {
method GetSig (line 4606) | func (x *OutOfStoreMessage) GetSig() []byte {
method GetFlags (line 4613) | func (x *OutOfStoreMessage) GetFlags() uint32 {
method GetEncryptedPayload (line 4620) | func (x *OutOfStoreMessage) GetEncryptedPayload() []byte {
method GetNonce (line 4627) | func (x *OutOfStoreMessage) GetNonce() []byte {
type OutOfStoreMessageEnvelope (line 4634) | type OutOfStoreMessageEnvelope struct
method Reset (line 4644) | func (x *OutOfStoreMessageEnvelope) Reset() {
method String (line 4653) | func (x *OutOfStoreMessageEnvelope) String() string {
method ProtoMessage (line 4657) | func (*OutOfStoreMessageEnvelope) ProtoMessage() {}
method ProtoReflect (line 4659) | func (x *OutOfStoreMessageEnvelope) ProtoReflect() protoreflect.Message {
method Descriptor (line 4672) | func (*OutOfStoreMessageEnvelope) Descriptor() ([]byte, []int) {
method GetNonce (line 4676) | func (x *OutOfStoreMessageEnvelope) GetNonce() []byte {
method GetBox (line 4683) | func (x *OutOfStoreMessageEnvelope) GetBox() []byte {
method GetGroupReference (line 4690) | func (x *OutOfStoreMessageEnvelope) GetGroupReference() []byte {
type OutOfStoreReceive (line 4697) | type OutOfStoreReceive struct
method Reset (line 4703) | func (x *OutOfStoreReceive) Reset() {
method String (line 4712) | func (x *OutOfStoreReceive) String() string {
method ProtoMessage (line 4716) | func (*OutOfStoreReceive) ProtoMessage() {}
method ProtoReflect (line 4718) | func (x *OutOfStoreReceive) ProtoReflect() protoreflect.Message {
method Descriptor (line 4731) | func (*OutOfStoreReceive) Descriptor() ([]byte, []int) {
type OutOfStoreSeal (line 4735) | type OutOfStoreSeal struct
method Reset (line 4741) | func (x *OutOfStoreSeal) Reset() {
method String (line 4750) | func (x *OutOfStoreSeal) String() string {
method ProtoMessage (line 4754) | func (*OutOfStoreSeal) ProtoMessage() {}
method ProtoReflect (line 4756) | func (x *OutOfStoreSeal) ProtoReflect() protoreflect.Message {
method Descriptor (line 4769) | func (*OutOfStoreSeal) Descriptor() ([]byte, []int) {
type AccountVerifiedCredentialRegistered (line 4773) | type AccountVerifiedCredentialRegistered struct
method Reset (line 4788) | func (x *AccountVerifiedCredentialRegistered) Reset() {
method String (line 4797) | func (x *AccountVerifiedCredentialRegistered) String() string {
method ProtoMessage (line 4801) | func (*AccountVerifiedCredentialRegistered) ProtoMessage() {}
method ProtoReflect (line 4803) | func (x *AccountVerifiedCredentialRegistered) ProtoReflect() protorefl...
method Descriptor (line 4816) | func (*AccountVerifiedCredentialRegistered) Descriptor() ([]byte, []in...
method GetDevicePk (line 4820) | func (x *AccountVerifiedCredentialRegistered) GetDevicePk() []byte {
method GetSignedIdentityPublicKey (line 4827) | func (x *AccountVerifiedCredentialRegistered) GetSignedIdentityPublicK...
method GetVerifiedCredential (line 4834) | func (x *AccountVerifiedCredentialRegistered) GetVerifiedCredential() ...
method GetRegistrationDate (line 4841) | func (x *AccountVerifiedCredentialRegistered) GetRegistrationDate() in...
method GetExpirationDate (line 4848) | func (x *AccountVerifiedCredentialRegistered) GetExpirationDate() int64 {
method GetIdentifier (line 4855) | func (x *AccountVerifiedCredentialRegistered) GetIdentifier() string {
method GetIssuer (line 4862) | func (x *AccountVerifiedCredentialRegistered) GetIssuer() string {
type FirstLastCounters (line 4869) | type FirstLastCounters struct
method Reset (line 4878) | func (x *FirstLastCounters) Reset() {
method String (line 4887) | func (x *FirstLastCounters) String() string {
method ProtoMessage (line 4891) | func (*FirstLastCounters) ProtoMessage() {}
method ProtoReflect (line 4893) | func (x *FirstLastCounters) ProtoReflect() protoreflect.Message {
method Descriptor (line 4906) | func (*FirstLastCounters) Descriptor() ([]byte, []int) {
method GetFirst (line 4910) | func (x *FirstLastCounters) GetFirst() uint64 {
method GetLast (line 4917) | func (x *FirstLastCounters) GetLast() uint64 {
type OrbitDBMessageHeads (line 4925) | type OrbitDBMessageHeads struct
method Reset (line 4936) | func (x *OrbitDBMessageHeads) Reset() {
method String (line 4945) | func (x *OrbitDBMessageHeads) String() string {
method ProtoMessage (line 4949) | func (*OrbitDBMessageHeads) ProtoMessage() {}
method ProtoReflect (line 4951) | func (x *OrbitDBMessageHeads) ProtoReflect() protoreflect.Message {
method Descriptor (line 4964) | func (*OrbitDBMessageHeads) Descriptor() ([]byte, []int) {
method GetSealedBox (line 4968) | func (x *OrbitDBMessageHeads) GetSealedBox() []byte {
method GetRawRotation (line 4975) | func (x *OrbitDBMessageHeads) GetRawRotation() []byte {
type RefreshContactRequest (line 4982) | type RefreshContactRequest struct
method Reset (line 4988) | func (x *RefreshContactRequest) Reset() {
method String (line 4997) | func (x *RefreshContactRequest) String() string {
method ProtoMessage (line 5001) | func (*RefreshContactRequest) ProtoMessage() {}
method ProtoReflect (line 5003) | func (x *RefreshContactRequest) ProtoReflect() protoreflect.Message {
method Descriptor (line 5016) | func (*RefreshContactRequest) Descriptor() ([]byte, []int) {
type ServiceExportData_Request (line 5020) | type ServiceExportData_Request struct
method Reset (line 5026) | func (x *ServiceExportData_Request) Reset() {
method String (line 5035) | func (x *ServiceExportData_Request) String() string {
method ProtoMessage (line 5039) | func (*ServiceExportData_Request) ProtoMessage() {}
method ProtoReflect (line 5041) | func (x *ServiceExportData_Request) ProtoReflect() protoreflect.Message {
method Descriptor (line 5054) | func (*ServiceExportData_Request) Descriptor() ([]byte, []int) {
type ServiceExportData_Reply (line 5058) | type ServiceExportData_Reply struct
method Reset (line 5066) | func (x *ServiceExportData_Reply) Reset() {
method String (line 5075) | func (x *ServiceExportData_Reply) String() string {
method ProtoMessage (line 5079) | func (*ServiceExportData_Reply) ProtoMessage() {}
method ProtoReflect (line 5081) | func (x *ServiceExportData_Reply) ProtoReflect() protoreflect.Message {
method Descriptor (line 5094) | func (*ServiceExportData_Reply) Descriptor() ([]byte, []int) {
method GetExportedData (line 5098) | func (x *ServiceExportData_Reply) GetExportedData() []byte {
type ServiceGetConfiguration_Request (line 5105) | type ServiceGetConfiguration_Request struct
method Reset (line 5111) | func (x *ServiceGetConfiguration_Request) Reset() {
method String (line 5120) | func (x *ServiceGetConfiguration_Request) String() string {
method ProtoMessage (line 5124) | func (*ServiceGetConfiguration_Request) ProtoMessage() {}
method ProtoReflect (line 5126) | func (x *ServiceGetConfiguration_Request) ProtoReflect() protoreflect....
method Descriptor (line 5139) | func (*ServiceGetConfiguration_Request) Descriptor() ([]byte, []int) {
type ServiceGetConfiguration_Reply (line 5143) | type ServiceGetConfiguration_Reply struct
method Reset (line 5164) | func (x *ServiceGetConfiguration_Reply) Reset() {
method String (line 5173) | func (x *ServiceGetConfiguration_Reply) String() string {
method ProtoMessage (line 5177) | func (*ServiceGetConfiguration_Reply) ProtoMessage() {}
method ProtoReflect (line 5179) | func (x *ServiceGetConfiguration_Reply) ProtoReflect() protoreflect.Me...
method Descriptor (line 5192) | func (*ServiceGetConfiguration_Reply) Descriptor() ([]byte, []int) {
method GetAccountPk (line 5196) | func (x *ServiceGetConfiguration_Reply) GetAccountPk() []byte {
method GetDevicePk (line 5203) | func (x *ServiceGetConfiguration_Reply) GetDevicePk() []byte {
method GetAccountGroupPk (line 5210) | func (x *ServiceGetConfiguration_Reply) GetAccountGroupPk() []byte {
method GetPeerId (line 5217) | func (x *ServiceGetConfiguration_Reply) GetPeerId() string {
method GetListeners (line 5224) | func (x *ServiceGetConfiguration_Reply) GetListeners() []string {
method GetBleEnabled (line 5231) | func (x *ServiceGetConfiguration_Reply) GetBleEnabled() ServiceGetConf...
method GetWifiP2PEnabled (line 5238) | func (x *ServiceGetConfiguration_Reply) GetWifiP2PEnabled() ServiceGet...
method GetMdnsEnabled (line 5245) | func (x *ServiceGetConfiguration_Reply) GetMdnsEnabled() ServiceGetCon...
method GetRelayEnabled (line 5252) | func (x *ServiceGetConfiguration_Reply) GetRelayEnabled() ServiceGetCo...
type ContactRequestReference_Request (line 5259) | type ContactRequestReference_Request struct
method Reset (line 5265) | func (x *ContactRequestReference_Request) Reset() {
method String (line 5274) | func (x *ContactRequestReference_Request) String() string {
method ProtoMessage (line 5278) | func (*ContactRequestReference_Request) ProtoMessage() {}
method ProtoReflect (line 5280) | func (x *ContactRequestReference_Request) ProtoReflect() protoreflect....
method Descriptor (line 5293) | func (*ContactRequestReference_Request) Descriptor() ([]byte, []int) {
type ContactRequestReference_Reply (line 5297) | type ContactRequestReference_Reply struct
method Reset (line 5308) | func (x *ContactRequestReference_Reply) Reset() {
method String (line 5317) | func (x *ContactRequestReference_Reply) String() string {
method ProtoMessage (line 5321) | func (*ContactRequestReference_Reply) ProtoMessage() {}
method ProtoReflect (line 5323) | func (x *ContactRequestReference_Reply) ProtoReflect() protoreflect.Me...
method Descriptor (line 5336) | func (*ContactRequestReference_Reply) Descriptor() ([]byte, []int) {
method GetPublicRendezvousSeed (line 5340) | func (x *ContactRequestReference_Reply) GetPublicRendezvousSeed() []by...
method GetEnabled (line 5347) | func (x *ContactRequestReference_Reply) GetEnabled() bool {
type ContactRequestDisable_Request (line 5354) | type ContactRequestDisable_Request struct
method Reset (line 5360) | func (x *ContactRequestDisable_Request) Reset() {
method String (line 5369) | func (x *ContactRequestDisable_Request) String() string {
method ProtoMessage (line 5373) | func (*ContactRequestDisable_Request) ProtoMessage() {}
method ProtoReflect (line 5375) | func (x *ContactRequestDisable_Request) ProtoReflect() protoreflect.Me...
method Descriptor (line 5388) | func (*ContactRequestDisable_Request) Descriptor() ([]byte, []int) {
type ContactRequestDisable_Reply (line 5392) | type ContactRequestDisable_Reply struct
method Reset (line 5398) | func (x *ContactRequestDisable_Reply) Reset() {
method String (line 5407) | func (x *ContactRequestDisable_Reply) String() string {
method ProtoMessage (line 5411) | func (*ContactRequestDisable_Reply) ProtoMessage() {}
method ProtoReflect (line 5413) | func (x *ContactRequestDisable_Reply) ProtoReflect() protoreflect.Mess...
method Descriptor (line 5426) | func (*ContactRequestDisable_Reply) Descriptor() ([]byte, []int) {
type ContactRequestEnable_Request (line 5430) | type ContactRequestEnable_Request struct
method Reset (line 5436) | func (x *ContactRequestEnable_Request) Reset() {
method String (line 5445) | func (x *ContactRequestEnable_Request) String() string {
method ProtoMessage (line 5449) | func (*ContactRequestEnable_Request) ProtoMessage() {}
method ProtoReflect (line 5451) | func (x *ContactRequestEnable_Request) ProtoReflect() protoreflect.Mes...
method Descriptor (line 5464) | func (*ContactRequestEnable_Request) Descriptor() ([]byte, []int) {
type ContactRequestEnable_Reply (line 5468) | type ContactRequestEnable_Reply struct
method Reset (line 5477) | func (x *ContactRequestEnable_Reply) Reset() {
method String (line 5486) | func (x *ContactRequestEnable_Reply) String() string {
method ProtoMessage (line 5490) | func (*ContactRequestEnable_Reply) ProtoMessage() {}
method ProtoReflect (line 5492) | func (x *ContactRequestEnable_Reply) ProtoReflect() protoreflect.Messa...
method Descriptor (line 5505) | func (*ContactRequestEnable_Reply) Descriptor() ([]byte, []int) {
method GetPublicRendezvousSeed (line 5509) | func (x *ContactRequestEnable_Reply) GetPublicRendezvousSeed() []byte {
type ContactRequestResetReference_Request (line 5516) | type ContactRequestResetReference_Request struct
method Reset (line 5522) | func (x *ContactRequestResetReference_Request) Reset() {
method String (line 5531) | func (x *ContactRequestResetReference_Request) String() string {
method ProtoMessage (line 5535) | func (*ContactRequestResetReference_Request) ProtoMessage() {}
method ProtoReflect (line 5537) | func (x *ContactRequestResetReference_Request) ProtoReflect() protoref...
method Descriptor (line 5550) | func (*ContactRequestResetReference_Request) Descriptor() ([]byte, []i...
type ContactRequestResetReference_Reply (line 5554) | type ContactRequestResetReference_Reply struct
method Reset (line 5563) | func (x *ContactRequestResetReference_Reply) Reset() {
method String (line 5572) | func (x *ContactRequestResetReference_Reply) String() string {
method ProtoMessage (line 5576) | func (*ContactRequestResetReference_Reply) ProtoMessage() {}
method ProtoReflect (line 5578) | func (x *ContactRequestResetReference_Reply) ProtoReflect() protorefle...
method Descriptor (line 5591) | func (*ContactRequestResetReference_Reply) Descriptor() ([]byte, []int) {
method GetPublicRendezvousSeed (line 5595) | func (x *ContactRequestResetReference_Reply) GetPublicRendezvousSeed()...
type ContactRequestSend_Request (line 5602) | type ContactRequestSend_Request struct
method Reset (line 5613) | func (x *ContactRequestSend_Request) Reset() {
method String (line 5622) | func (x *ContactRequestSend_Request) String() string {
method ProtoMessage (line 5626) | func (*ContactRequestSend_Request) ProtoMessage() {}
method ProtoReflect (line 5628) | func (x *ContactRequestSend_Request) ProtoReflect() protoreflect.Messa...
method Descriptor (line 5641) | func (*ContactRequestSend_Request) Descriptor() ([]byte, []int) {
method GetContact (line 5645) | func (x *ContactRequestSend_Request) GetContact() *ShareableContact {
method GetOwnMetadata (line 5652) | func (x *ContactRequestSend_Request) GetOwnMetadata() []byte {
type ContactRequestSend_Reply (line 5659) | type ContactRequestSend_Reply struct
method Reset (line 5665) | func (x *ContactRequestSend_Reply) Reset() {
method String (line 5674) | func (x *ContactRequestSend_Reply) String() string {
method ProtoMessage (line 5678) | func (*ContactRequestSend_Reply) ProtoMessage() {}
method ProtoReflect (line 5680) | func (x *ContactRequestSend_Reply) ProtoReflect() protoreflect.Message {
method Descriptor (line 5693) | func (*ContactRequestSend_Reply) Descriptor() ([]byte, []int) {
type ContactRequestAccept_Request (line 5697) | type ContactRequestAccept_Request struct
method Reset (line 5706) | func (x *ContactRequestAccept_Request) Reset() {
method String (line 5715) | func (x *ContactRequestAccept_Request) String() string {
method ProtoMessage (line 5719) | func (*ContactRequestAccept_Request) ProtoMessage() {}
method ProtoReflect (line 5721) | func (x *ContactRequestAccept_Request) ProtoReflect() protoreflect.Mes...
method Descriptor (line 5734) | func (*ContactRequestAccept_Request) Descriptor() ([]byte, []int) {
method GetContactPk (line 5738) | func (x *ContactRequestAccept_Request) GetContactPk() []byte {
type ContactRequestAccept_Reply (line 5745) | type ContactRequestAccept_Reply struct
method Reset (line 5751) | func (x *ContactRequestAccept_Reply) Reset() {
method String (line 5760) | func (x *ContactRequestAccept_Reply) String() string {
method ProtoMessage (line 5764) | func (*ContactRequestAccept_Reply) ProtoMessage() {}
method ProtoReflect (line 5766) | func (x *ContactRequestAccept_Reply) ProtoReflect() protoreflect.Messa...
method Descriptor (line 5779) | func (*ContactRequestAccept_Reply) Descriptor() ([]byte, []int) {
type ContactRequestDiscard_Request (line 5783) | type ContactRequestDiscard_Request struct
method Reset (line 5792) | func (x *ContactRequestDiscard_Request) Reset() {
method String (line 5801) | func (x *ContactRequestDiscard_Request) String() string {
method ProtoMessage (line 5805) | func (*ContactRequestDiscard_Request) ProtoMessage() {}
method ProtoReflect (line 5807) | func (x *ContactRequestDiscard_Request) ProtoReflect() protoreflect.Me...
method Descriptor (line 5820) | func (*ContactRequestDiscard_Request) Descriptor() ([]byte, []int) {
method GetContactPk (line 5824) | func (x *ContactRequestDiscard_Request) GetContactPk() []byte {
type ContactRequestDiscard_Reply (line 5831) | type ContactRequestDiscard_Reply struct
method Reset (line 5837) | func (x *ContactRequestDiscard_Reply) Reset() {
method String (line 5846) | func (x *ContactRequestDiscard_Reply) String() string {
method ProtoMessage (line 5850) | func (*ContactRequestDiscard_Reply) ProtoMessage() {}
method ProtoReflect (line 5852) | func (x *ContactRequestDiscard_Reply) ProtoReflect() protoreflect.Mess...
method Descriptor (line 5865) | func (*ContactRequestDiscard_Reply) Descriptor() ([]byte, []int) {
type ShareContact_Request (line 5869) | type ShareContact_Request struct
method Reset (line 5875) | func (x *ShareContact_Request) Reset() {
method String (line 5884) | func (x *ShareContact_Request) String() string {
method ProtoMessage (line 5888) | func (*ShareContact_Request) ProtoMessage() {}
method ProtoReflect (line 5890) | func (x *ShareContact_Request) ProtoReflect() protoreflect.Message {
method Descriptor (line 5903) | func (*ShareContact_Request) Descriptor() ([]byte, []int) {
type ShareContact_Reply (line 5907) | type ShareContact_Reply struct
method Reset (line 5916) | func (x *ShareContact_Reply) Reset() {
method String (line 5925) | func (x *ShareContact_Reply) String() string {
method ProtoMessage (line 5929) | func (*ShareContact_Reply) ProtoMessage() {}
method ProtoReflect (line 5931) | func (x *ShareContact_Reply) ProtoReflect() protoreflect.Message {
method Descriptor (line 5944) | func (*ShareContact_Reply) Descriptor() ([]byte, []int) {
method GetEncodedContact (line 5948) | func (x *ShareContact_Reply) GetEncodedContact() []byte {
type DecodeContact_Request (line 5955) | type DecodeContact_Request struct
method Reset (line 5964) | func (x *DecodeContact_Request) Reset() {
method String (line 5973) | func (x *DecodeContact_Request) String() string {
method ProtoMessage (line 5977) | func (*DecodeContact_Request) ProtoMessage() {}
method ProtoReflect (line 5979) | func (x *DecodeContact_Request) ProtoReflect() protoreflect.Message {
method Descriptor (line 5992) | func (*DecodeContact_Request) Descriptor() ([]byte, []int) {
method GetEncodedContact (line 5996) | func (x *DecodeContact_Request) GetEncodedContact() []byte {
type DecodeContact_Reply (line 6003) | type DecodeContact_Reply struct
method Reset (line 6012) | func (x *DecodeContact_Reply) Reset() {
method String (line 6021) | func (x *DecodeContact_Reply) String() string {
method ProtoMessage (line 6025) | func (*DecodeContact_Reply) ProtoMessage() {}
method ProtoReflect (line 6027) | func (x *DecodeContact_Reply) ProtoReflect() protoreflect.Message {
method Descriptor (line 6040) | func (*DecodeContact_Reply) Descriptor() ([]byte, []int) {
method GetContact (line 6044) | func (x *DecodeContact_Reply) GetContact() *ShareableContact {
type ContactBlock_Request (line 6051) | type ContactBlock_Request struct
method Reset (line 6060) | func (x *ContactBlock_Request) Reset() {
method String (line 6069) | func (x *ContactBlock_Request) String() string {
method ProtoMessage (line 6073) | func (*ContactBlock_Request) ProtoMessage() {}
method ProtoReflect (line 6075) | func (x *ContactBlock_Request) ProtoReflect() protoreflect.Message {
method Descriptor (line 6088) | func (*ContactBlock_Request) Descriptor() ([]byte, []int) {
method GetContactPk (line 6092) | func (x *ContactBlock_Request) GetContactPk() []byte {
type ContactBlock_Reply (line 6099) | type ContactBlock_Reply struct
method Reset (line 6105) | func (x *ContactBlock_Reply) Reset() {
method String (line 6114) | func (x *ContactBlock_Reply) String() string {
method ProtoMessage (line 6118) | func (*ContactBlock_Reply) ProtoMessage() {}
method ProtoReflect (line 6120) | func (x *ContactBlock_Reply) ProtoReflect() protoreflect.Message {
method Descriptor (line 6133) | func (*ContactBlock_Reply) Descriptor() ([]byte, []int) {
type ContactUnblock_Request (line 6137) | type ContactUnblock_Request struct
method Reset (line 6146) | func (x *ContactUnblock_Request) Reset() {
method String (line 6155) | func (x *ContactUnblock_Request) String() string {
method ProtoMessage (line 6159) | func (*ContactUnblock_Request) ProtoMessage() {}
method ProtoReflect (line 6161) | func (x *ContactUnblock_Request) ProtoReflect() protoreflect.Message {
method Descriptor (line 6174) | func (*ContactUnblock_Request) Descriptor() ([]byte, []int) {
method GetContactPk (line 6178) | func (x *ContactUnblock_Request) GetContactPk() []byte {
type ContactUnblock_Reply (line 6185) | type ContactUnblock_Reply struct
method Reset (line 6191) | func (x *ContactUnblock_Reply) Reset() {
method String (line 6200) | func (x *ContactUnblock_Reply) String() string {
method ProtoMessage (line 6204) | func (*ContactUnblock_Reply) ProtoMessage() {}
method ProtoReflect (line 6206) | func (x *ContactUnblock_Reply) ProtoReflect() protoreflect.Message {
method Descriptor (line 6219) | func (*ContactUnblock_Reply) Descriptor() ([]byte, []int) {
type ContactAliasKeySend_Request (line 6223) | type ContactAliasKeySend_Request struct
method Reset (line 6232) | func (x *ContactAliasKeySend_Request) Reset() {
method String (line 6241) | func (x *ContactAliasKeySend_Request) String() string {
method ProtoMessage (line 6245) | func (*ContactAliasKeySend_Request) ProtoMessage() {}
method ProtoReflect (line 6247) | func (x *ContactAliasKeySend_Request) ProtoReflect() protoreflect.Mess...
method Descriptor (line 6260) | func (*ContactAliasKeySend_Request) Descriptor() ([]byte, []int) {
method GetGroupPk (line 6264) | func (x *ContactAliasKeySend_Request) GetGroupPk() []byte {
type ContactAliasKeySend_Reply (line 6271) | type ContactAliasKeySend_Reply struct
method Reset (line 6277) | func (x *ContactAliasKeySend_Reply) Reset() {
method String (line 6286) | func (x *ContactAliasKeySend_Reply) String() string {
method ProtoMessage (line 6290) | func (*ContactAliasKeySend_Reply) ProtoMessage() {}
method ProtoReflect (line 6292) | func (x *ContactAliasKeySend_Reply) ProtoReflect() protoreflect.Message {
method Descriptor (line 6305) | func (*ContactAliasKeySend_Reply) Descriptor() ([]byte, []int) {
type MultiMemberGroupCreate_Request (line 6309) | type MultiMemberGroupCreate_Request struct
method Reset (line 6315) | func (x *MultiMemberGroupCreate_Request) Reset() {
method String (line 6324) | func (x *MultiMemberGroupCreate_Request) String() string {
method ProtoMessage (line 6328) | func (*MultiMemberGroupCreate_Request) ProtoMessage() {}
method ProtoReflect (line 6330) | func (x *MultiMemberGroupCreate_Request) ProtoReflect() protoreflect.M...
method Descriptor (line 6343) | func (*MultiMemberGroupCreate_Request) Descriptor() ([]byte, []int) {
type MultiMemberGroupCreate_Reply (line 6347) | type MultiMemberGroupCreate_Reply struct
method Reset (line 6356) | func (x *MultiMemberGroupCreate_Reply) Reset() {
method String (line 6365) | func (x *MultiMemberGroupCreate_Reply) String() string {
method ProtoMessage (line 6369) | func (*MultiMemberGroupCreate_Reply) ProtoMessage() {}
method ProtoReflect (line 6371) | func (x *MultiMemberGroupCreate_Reply) ProtoReflect() protoreflect.Mes...
method Descriptor (line 6384) | func (*MultiMemberGroupCreate_Reply) Descriptor() ([]byte, []int) {
method GetGroupPk (line 6388) | func (x *MultiMemberGroupCreate_Reply) GetGroupPk() []byte {
type MultiMemberGroupJoin_Request (line 6395) | type MultiMemberGroupJoin_Request struct
method Reset (line 6404) | func (x *MultiMemberGroupJoin_Request) Reset() {
method String (line 6413) | func (x *MultiMemberGroupJoin_Request) String() string {
method ProtoMessage (line 6417) | func (*MultiMemberGroupJoin_Request) ProtoMessage() {}
method ProtoReflect (line 6419) | func (x *MultiMemberGroupJoin_Request) ProtoReflect() protoreflect.Mes...
method Descriptor (line 6432) | func (*MultiMemberGroupJoin_Request) Descriptor() ([]byte, []int) {
method GetGroup (line 6436) | func (x *MultiMemberGroupJoin_Request) GetGroup() *Group {
type MultiMemberGroupJoin_Reply (line 6443) | type MultiMemberGroupJoin_Reply struct
method Reset (line 6449) | func (x *MultiMemberGroupJoin_Reply) Reset() {
method String (line 6458) | func (x *MultiMemberGroupJoin_Reply) String() string {
method ProtoMessage (line 6462) | func (*MultiMemberGroupJoin_Reply) ProtoMessage() {}
method ProtoReflect (line 6464) | func (x *MultiMemberGroupJoin_Reply) ProtoReflect() protoreflect.Messa...
method Descriptor (line 6477) | func (*MultiMemberGroupJoin_Reply) Descriptor() ([]byte, []int) {
type MultiMemberGroupLeave_Request (line 6481) | type MultiMemberGroupLeave_Request struct
method Reset (line 6489) | func (x *MultiMemberGroupLeave_Request) Reset() {
method String (line 6498) | func (x *MultiMemberGroupLeave_Request) String() string {
method ProtoMessage (line 6502) | func (*MultiMemberGroupLeave_Request) ProtoMessage() {}
method ProtoReflect (line 6504) | func (x *MultiMemberGroupLeave_Request) ProtoReflect() protoreflect.Me...
method Descriptor (line 6517) | func (*MultiMemberGroupLeave_Request) Descriptor() ([]byte, []int) {
method GetGroupPk (line 6521) | func (x *MultiMemberGroupLeave_Request) GetGroupPk() []byte {
type MultiMemberGroupLeave_Reply (line 6528) | type MultiMemberGroupLeave_Reply struct
method Reset (line 6534) | func (x *MultiMemberGroupLeave_Reply) Reset() {
method String (line 6543) | func (x *MultiMemberGroupLeave_Reply) String() string {
method ProtoMessage (line 6547) | func (*MultiMemberGroupLeave_Reply) ProtoMessage() {}
method ProtoReflect (line 6549) | func (x *MultiMemberGroupLeave_Reply) ProtoReflect() protoreflect.Mess...
method Descriptor (line 6562) | func (*MultiMemberGroupLeave_Reply) Descriptor() ([]byte, []int) {
type MultiMemberGroupAliasResolverDisclose_Request (line 6566) | type MultiMemberGroupAliasResolverDisclose_Request struct
method Reset (line 6575) | func (x *MultiMemberGroupAliasResolverDisclose_Request) Reset() {
method String (line 6584) | func (x *MultiMemberGroupAliasResolverDisclose_Request) String() string {
method ProtoMessage (line 6588) | func (*MultiMemberGroupAliasResolverDisclose_Request) ProtoMessage() {}
method ProtoReflect (line 6590) | func (x *MultiMemberGroupAliasResolverDisclose_Request) ProtoReflect()...
method Descriptor (line 6603) | func (*MultiMemberGroupAliasResolverDisclose_Request) Descriptor() ([]...
method GetGroupPk (line 6607) | func (x *MultiMemberGroupAliasResolverDisclose_Request) GetGroupPk() [...
type MultiMemberGroupAliasResolverDisclose_Reply (line 6614) | type MultiMemberGroupAliasResolverDisclose_Reply struct
method Reset (line 6620) | func (x *MultiMemberGroupAliasResolverDisclose_Reply) Reset() {
method String (line 6629) | func (x *MultiMemberGroupAliasResolverDisclose_Reply) String() string {
method ProtoMessage (line 6633) | func (*MultiMemberGroupAliasResolverDisclose_Reply) ProtoMessage() {}
method ProtoReflect (line 6635) | func (x *MultiMemberGroupAliasResolverDisclose_Reply) ProtoReflect() p...
method Descriptor (line 6648) | func (*MultiMemberGroupAliasResolverDisclose_Reply) Descriptor() ([]by...
type MultiMemberGroupAdminRoleGrant_Request (line 6652) | type MultiMemberGroupAdminRoleGrant_Request struct
method Reset (line 6663) | func (x *MultiMemberGroupAdminRoleGrant_Request) Reset() {
method String (line 6672) | func (x *MultiMemberGroupAdminRoleGrant_Request) String() string {
method ProtoMessage (line 6676) | func (*MultiMemberGroupAdminRoleGrant_Request) ProtoMessage() {}
method ProtoReflect (line 6678) | func (x *MultiMemberGroupAdminRoleGrant_Request) ProtoReflect() protor...
method Descriptor (line 6691) | func (*MultiMemberGroupAdminRoleGrant_Request) Descriptor() ([]byte, [...
method GetGroupPk (line 6695) | func (x *MultiMemberGroupAdminRoleGrant_Request) GetGroupPk() []byte {
method GetMemberPk (line 6702) | func (x *MultiMemberGroupAdminRoleGrant_Request) GetMemberPk() []byte {
type MultiMemberGroupAdminRoleGrant_Reply (line 6709) | type MultiMemberGroupAdminRoleGrant_Reply struct
method Reset (line 6715) | func (x *MultiMemberGroupAdminRoleGrant_Reply) Reset() {
method String (line 6724) | func (x *MultiMemberGroupAdminRoleGrant_Reply) String() string {
method ProtoMessage (line 6728) | func (*MultiMemberGroupAdminRoleGrant_Reply) ProtoMessage() {}
method ProtoReflect (line 6730) | func (x *MultiMemberGroupAdminRoleGrant_Reply) ProtoReflect() protoref...
method Descriptor (line 6743) | func (*MultiMemberGroupAdminRoleGrant_Reply) Descriptor() ([]byte, []i...
type MultiMemberGroupInvitationCreate_Request (line 6747) | type MultiMemberGroupInvitationCreate_Request struct
method Reset (line 6756) | func (x *MultiMemberGroupInvitationCreate_Request) Reset() {
method String (line 6765) | func (x *MultiMemberGroupInvitationCreate_Request) String() string {
method ProtoMessage (line 6769) | func (*MultiMemberGroupInvitationCreate_Request) ProtoMessage() {}
method ProtoReflect (line 6771) | func (x *MultiMemberGroupInvitationCreate_Request) ProtoReflect() prot...
method Descriptor (line 6784) | func (*MultiMemberGroupInvitationCreate_Request) Descriptor() ([]byte,...
method GetGroupPk (line 6788) | func (x *MultiMemberGroupInvitationCreate_Request) GetGroupPk() []byte {
type MultiMemberGroupInvitationCreate_Reply (line 6795) | type MultiMemberGroupInvitationCreate_Reply struct
method Reset (line 6804) | func (x *MultiMemberGroupInvitationCreate_Reply) Reset() {
method String (line 6813) | func (x *MultiMemberGroupInvitationCreate_Reply) String() string {
method ProtoMessage (line 6817) | func (*MultiMemberGroupInvitationCreate_Reply) ProtoMessage() {}
method ProtoReflect (line 6819) | func (x *MultiMemberGroupInvitationCreate_Reply) ProtoReflect() protor...
method Descriptor (line 6832) | func (*MultiMemberGroupInvitationCreate_Reply) Descriptor() ([]byte, [...
method GetGroup (line 6836) | func (x *MultiMemberGroupInvitationCreate_Reply) GetGroup() *Group {
type AppMetadataSend_Request (line 6843) | type AppMetadataSend_Request struct
method Reset (line 6854) | func (x *AppMetadataSend_Request) Reset() {
method String (line 6863) | func (x *AppMetadataSend_Request) String() string {
method ProtoMessage (line 6867) | func (*AppMetadataSend_Request) ProtoMessage() {}
method ProtoReflect (line 6869) | func (x *AppMetadataSend_Request) ProtoReflect() protoreflect.Message {
method Descriptor (line 6882) | func (*AppMetadataSend_Request) Descriptor() ([]byte, []int) {
method GetGroupPk (line 6886) | func (x *AppMetadataSend_Request) GetGroupPk() []byte {
method GetPayload (line 6893) | func (x *AppMetadataSend_Request) GetPayload() []byte {
type AppMetadataSend_Reply (line 6900) | type AppMetadataSend_Reply struct
method Reset (line 6908) | func (x *AppMetadataSend_Reply) Reset() {
Condensed preview — 353 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (2,628K chars).
[
{
"path": ".codecov.yml",
"chars": 350,
"preview": "codecov:\n notify:\n require_ci_to_pass: yes\n\ncoverage:\n precision: 2\n round: down\n range: \"1...100\"\n status:\n "
},
{
"path": ".dockerignore",
"chars": 170,
"preview": "*#\n*~\n.#*\n.DS_Store\n.agignore\n.env\n.projectile\nDockerfile\ncore-sources.jar\ncoverage.txt\ndist/\ngen.sum.tmp\ngin-bin\ngoogle"
},
{
"path": ".editorconfig",
"chars": 1006,
"preview": "root = true\n\n[*]\ncharset = utf-8\n\nend_of_line = lf\ninsert_final_newline = true\ntrim_trailing_whitespace = true\n\nindent_s"
},
{
"path": ".gitattributes",
"chars": 1409,
"preview": "# Auto detect text files and perform LF normalization\n* text=auto\n\n# Collapse vendored files on GitHub\nvendor/* linguist"
},
{
"path": ".github/ISSUE_TEMPLATE/bug_template.yml",
"chars": 2316,
"preview": "# yamllint disable-line rule:document-start\nname: \"Bug report\"\ndescription: Report a bug found while using weshnet.\nlabe"
},
{
"path": ".github/ISSUE_TEMPLATE/feature_template.yml",
"chars": 1283,
"preview": "# yamllint disable-line rule:document-start\nname: \"Feature request\"\ndescription: Suggest an idea for this project.\nlabel"
},
{
"path": ".github/ISSUE_TEMPLATE/question_template.yml",
"chars": 1403,
"preview": "# yamllint disable-line rule:document-start\nname: \"Question\"\ndescription: Ask a question about this project.\nlabels: [\"q"
},
{
"path": ".github/dependabot.yml",
"chars": 1142,
"preview": "version: 2\n# @NOTE(gfanton): we use 0 as pull-request-limit to only enable security update.\n# see: https://docs.github.c"
},
{
"path": ".github/pull_request_template.md",
"chars": 45,
"preview": "<!-- Thank you for your contribution! ❤️ -->\n"
},
{
"path": ".github/weekly-digest.yml",
"chars": 222,
"preview": "# Configuration for weekly-digest - https://github.com/apps/weekly-digest\npublishDay: thu\ncanPublishIssues: true\ncanPubl"
},
{
"path": ".github/workflows/benchmark.yml",
"chars": 7572,
"preview": "name: Go benchmark\non:\n push:\n tags:\n - v*\n branches:\n - main\n paths:\n - \"**\"\n - \"!**.md\"\n"
},
{
"path": ".github/workflows/buf-push.yml",
"chars": 703,
"preview": "name: buf-push\non:\n push:\n branches:\n - main\n\n# from https://docs.buf.build/ci-cd/github-actions#buf-push\njobs:"
},
{
"path": ".github/workflows/cancel.yml",
"chars": 478,
"preview": "name: Cancel\non:\n workflow_run:\n workflows: [\n \"CodeQL\",\n \"Dependent Issues\",\n \"Go\",\n \"Integrati"
},
{
"path": ".github/workflows/codeql-analysis.yml",
"chars": 2583,
"preview": "# For most projects, this workflow file will not need changing; you simply need\n# to commit it to your repository.\n#\n# Y"
},
{
"path": ".github/workflows/dependent-issues.yml",
"chars": 901,
"preview": "name: Dependent Issues\n\non:\n issues:\n types:\n - opened\n - edited\n - reopened\n pull_request_target:\n "
},
{
"path": ".github/workflows/go.yml",
"chars": 8589,
"preview": "name: Go\non:\n push:\n tags:\n - v*\n branches:\n - main\n paths:\n - \"**\"\n - \"!**.md\"\n - \"g"
},
{
"path": ".github/workflows/protobuf.yml",
"chars": 3005,
"preview": "name: Protobuf\non:\n push:\n tags:\n - v*\n branches:\n - main\n paths:\n - \"api/**\"\n - \"Makefile"
},
{
"path": ".github/workflows/release.yml",
"chars": 2270,
"preview": "name: Release\non:\n push:\n branches:\n - main\n pull_request:\n paths:\n # Go\n - \"**\"\n - \"!**.md\""
},
{
"path": ".github/workflows/ssh-runner.yml",
"chars": 2185,
"preview": "name: SSH on runner\non:\n workflow_dispatch:\n inputs:\n os:\n description: \"Operating System\"\n requi"
},
{
"path": ".github/workflows/utils/variables.json",
"chars": 44,
"preview": "{\n \"cache-versions\": {\n \"go\": \"1\"\n }\n}\n"
},
{
"path": ".gitignore",
"chars": 246,
"preview": "*#\n*~\n.#*\n.DS_Store\n.agignore\n.env\n.projectile\n.tmp/\n.idea/\n*.bin\n*.swp\n.vscode\ncore-sources.jar\ncoverage.txt\ndist/\ngen."
},
{
"path": ".golangci.yml",
"chars": 1137,
"preview": "run:\n deadline: 1m\n tests: false\nissues:\n exclude-files:\n - \".*\\\\.pb\\\\.go$\"\n - \".*\\\\.pb\\\\.gw\\\\.go$\"\n - \".*\\\\"
},
{
"path": ".tool-versions",
"chars": 701,
"preview": "# To see the date when a version was updated, use git blame:\n# https://github.com/berty/weshnet/blame/main/.tool-version"
},
{
"path": "COPYRIGHT",
"chars": 768,
"preview": "Copyright 2018-2023 Berty Technologies and other Berty Developers.\n\nIntellectual Property Notice\n-----------------------"
},
{
"path": "INSTALL.md",
"chars": 1514,
"preview": "# Build weshnet\n\nThese are instructions to build weshnet.\n\n<!-- markdownlint-disable MD034 -->\n\n## Prerequisites\n\n* Requ"
},
{
"path": "LICENSE-APACHE",
"chars": 11353,
"preview": " Apache License\n Version 2.0, January 2004\n "
},
{
"path": "LICENSE-MIT",
"chars": 1067,
"preview": "Copyright (c) 2018-2021 Berty Technologies\n\nPermission is hereby granted, free of charge, to any person obtaining a copy"
},
{
"path": "Makefile",
"chars": 5516,
"preview": "##\n## Config\n##\n\nGO ?= go\nGOPATH ?= $(HOME)/go\nGO_TAGS ?= -tags \"\"\nGO_TEST_OPTS ?= -test.timeout=300s -race -cover -cove"
},
{
"path": "README.md",
"chars": 1455,
"preview": "# Wesh Network Toolkit\n\n[\n\nconst (\n\tNamespaceOrbitDBDatastore = \"orbitd"
},
{
"path": "contact_request_manager.go",
"chars": 16005,
"preview": "package weshnet\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"encoding/base64\"\n\t\"encoding/hex\"\n\t\"fmt\"\n\t\"strings\"\n\t\"sync\"\n\t\"time\"\n\n\tipf"
},
{
"path": "contact_request_manager_test.go",
"chars": 6388,
"preview": "package weshnet\n\nimport (\n\t\"context\"\n\t\"io\"\n\t\"testing\"\n\t\"time\"\n\n\tmocknet \"github.com/libp2p/go-libp2p/p2p/net/mock\"\n\t\"git"
},
{
"path": "deactivate_test.go",
"chars": 8137,
"preview": "package weshnet_test\n\nimport (\n\t\"context\"\n\t\"testing\"\n\t\"time\"\n\n\tds \"github.com/ipfs/go-datastore\"\n\tdsync \"github.com/ipfs"
},
{
"path": "doc.go",
"chars": 161,
"preview": "// Package weshnet contains code for integrating the Berty protocol in your project.\n//\n// See https://berty.tech/protoc"
},
{
"path": "docs/CONTRIBUTING.md",
"chars": 92,
"preview": "# Contributing\n\nPlease visit https://github.com/berty/community/blob/master/CONTRIBUTING.md\n"
},
{
"path": "docs/Makefile",
"chars": 2161,
"preview": "##\n## Code gen\n##\n\nVERSION ?= `go run github.com/mdomke/git-semver/v5`\n\nall: generate\n\ngen_src := $(wildcard ../api/*.pr"
},
{
"path": "docs/apis/protocoltypes.md",
"chars": 88085,
"preview": "# Protocol Documentation\n<a name=\"top\"></a>\n\n## Table of Contents\n\n- [protocoltypes.proto](#protocoltypes-proto)\n - ["
},
{
"path": "docs/apis/protocoltypes.swagger.json",
"chars": 30823,
"preview": "{\n \"swagger\": \"2.0\",\n \"info\": {\n \"title\": \"protocoltypes.proto\",\n \"version\": \"version not set\"\n },\n \"consumes\""
},
{
"path": "docs/architecture/2020-11-27-adr-berty-grpc-bridge.txt",
"chars": 12227,
"preview": "┌──────────────────────────────────────────────────────────────────────────────────────────┐\n│service BridgeService { "
},
{
"path": "docs/architecture/2020-11-27-adr-gomobile-ipfs.md",
"chars": 7384,
"preview": "# GomobileIPFS\n\n## concept\n\n### Driver\n```\n┌───────────────┐ ┌───────────────┐ ┌───────────────┐\n"
},
{
"path": "docs/architecture/README.md",
"chars": 184,
"preview": "# Architecture\n\nThis folder mostly contains snapshots of the architecture at Berty, some documentations may be outdated,"
},
{
"path": "docs/architecture/messenger-mvp/README.md",
"chars": 416,
"preview": "# Berty Messenger MVP\n\n## Reading linked graphs\n\n### Account group/log back and forth ignored\n\nSending an event from the"
},
{
"path": "docs/architecture/messenger-mvp/contact-request.mermaid",
"chars": 1717,
"preview": "sequenceDiagram\n\nparticipant aorbitdb as Alice orbitdb\nparticipant aprotocol as Alice fake protocol\nparticipant achat as"
},
{
"path": "docs/buf-doc.gen.yaml",
"chars": 144,
"preview": "version: v1\nplugins:\n - plugin: doc\n out: ./\n opt: markdown,api.md.tmp\n - plugin: swagger\n out: ./\n opt:\n "
},
{
"path": "docs/gen.sum",
"chars": 51,
"preview": "10db4498e1b002bb5bbfeb67ec3ce4d259b35c3d Makefile\n"
},
{
"path": "docs/ideas/distributed-entropy.md",
"chars": 1011,
"preview": "# Distributed entropy\n\nDate: 2019-05-24 \nAuthor: Antoine Eddi (aeddi)\n\n## Description\n\nThe idea would be to exchange ra"
},
{
"path": "docs/ideas/entropy-pool.md",
"chars": 734,
"preview": "# Entropy pool\n\nDate: 2019-05-24 \nAuthor: Manfred Touron (moul)\n\n## Description\n\nThe idea would be to add to a pool ran"
},
{
"path": "docs/protocol/README.md",
"chars": 87,
"preview": "# Wesh protocol\n\nThe Wesh protocol is documented at https://berty.tech/docs/protocol .\n"
},
{
"path": "events.go",
"chars": 7897,
"preview": "package weshnet\n\nimport (\n\t\"fmt\"\n\n\tcid \"github.com/ipfs/go-cid\"\n\t\"golang.org/x/crypto/nacl/secretbox\"\n\t\"google.golang.or"
},
{
"path": "events_sig_checkers.go",
"chars": 2021,
"preview": "package weshnet\n\nimport (\n\t\"github.com/libp2p/go-libp2p/core/crypto\"\n\t\"google.golang.org/protobuf/proto\"\n\n\t\"berty.tech/w"
},
{
"path": "gen.sum",
"chars": 51,
"preview": "78cfa180bfe8caf1572068cd6ea6bee4b89b3348 Makefile\n"
},
{
"path": "go.mod",
"chars": 15798,
"preview": "module berty.tech/weshnet/v2\n\ngo 1.22\n\ntoolchain go1.22.5\n\nrequire (\n\tberty.tech/go-ipfs-log v1.10.3-0.20240719141234-29"
},
{
"path": "go.sum",
"chars": 164227,
"preview": "bazil.org/fuse v0.0.0-20200117225306-7b5117fecadc h1:utDghgcjE8u+EBjHOgYT+dJPcnDF05KqWMBcjuJy510=\nbazil.org/fuse v0.0.0-"
},
{
"path": "group.go",
"chars": 1409,
"preview": "package weshnet\n\nimport (\n\t\"github.com/libp2p/go-libp2p/core/crypto\"\n\t\"google.golang.org/protobuf/proto\"\n\n\t\"berty.tech/w"
},
{
"path": "group_context.go",
"chars": 11235,
"preview": "package weshnet\n\nimport (\n\t\"context\"\n\t\"encoding/base64\"\n\t\"fmt\"\n\t\"sync\"\n\t\"sync/atomic\"\n\t\"time\"\n\n\t\"github.com/libp2p/go-li"
},
{
"path": "iface_account.go",
"chars": 464,
"preview": "package weshnet\n\nimport (\n\t\"github.com/libp2p/go-libp2p/core/crypto\"\n\n\t\"berty.tech/weshnet/v2/pkg/protocoltypes\"\n\t\"berty"
},
{
"path": "infra/.gitignore",
"chars": 6,
"preview": "!.env\n"
},
{
"path": "infra/README.md",
"chars": 5265,
"preview": "# How to Deploy Weshnet Infrastructure\n\nThis guide explains how to set up the essential services for a Weshnet network i"
},
{
"path": "infra/rdvp/.env",
"chars": 166,
"preview": "# Rendez-vous point public key\nRDVP_PK=\n# External IP address\nANNOUNCE_SERVER=\n\n# Emitter.io secret key\nEMITTER_SECRET_K"
},
{
"path": "infra/rdvp/Makefile",
"chars": 214,
"preview": ".PHONY: all\nall: up ps logs\n\nup:\n\tdocker compose up -d\n\nlogs:\n\tdocker compose logs --tail=100 -f\n\ndown ps:\n\tdocker compo"
},
{
"path": "infra/rdvp/docker-compose.yml",
"chars": 1063,
"preview": "version: \"3.7\"\n\nservices:\n rdvp:\n image: bertytech/berty:kubo-v0.29.0\n restart: on-failure\n environment:\n "
},
{
"path": "infra/relay/Dockerfile",
"chars": 504,
"preview": "# builder\nFROM golang:1.19-alpine3.16 as builder\nMAINTAINER gfanton <8671905+gfanton@users.noreply.github.com>\n\n\nARG GIT"
},
{
"path": "infra/relay/Makefile",
"chars": 194,
"preview": "build:\n\ttar -czh . | docker build -t relay - # need to tar because of the symlink\n.PHONY: build\n\nup:\n\tdocker compose up "
},
{
"path": "infra/relay/config.json",
"chars": 516,
"preview": "{\n \"RelayV2\": {\n \"Enabled\": true,\n \"Resources\": {\n \"Limit\": null\n }\n },\n \"RelayV1\": {\n \"Enabled\": tr"
},
{
"path": "infra/relay/docker-compose.yml",
"chars": 297,
"preview": "version: '3.7'\n\nservices:\n relay:\n image: relay\n restart: on-failure\n volumes:\n - ./config.json:/etc/daem"
},
{
"path": "internal/benchmark/benchmark_test.go",
"chars": 248,
"preview": "package benchmark\n\nimport (\n\t\"testing\"\n)\n\n// BenchmarkScenario is a benchmark for the scenario\n// FIXME: previous benchm"
},
{
"path": "internal/bertyversion/example_test.go",
"chars": 26,
"preview": "package bertyversion_test\n"
},
{
"path": "internal/bertyversion/version.go",
"chars": 64,
"preview": "package bertyversion\n\nvar (\n\tVersion = \"n/a\"\n\tVcsRef = \"n/a\"\n)\n"
},
{
"path": "internal/datastoreutil/consts.go",
"chars": 81,
"preview": "package datastoreutil\n\nconst (\n\tNamespaceMessageKeystore = \"messages_keystore\"\n)\n"
},
{
"path": "internal/datastoreutil/datastore_namespaced.go",
"chars": 425,
"preview": "package datastoreutil\n\nimport (\n\tds \"github.com/ipfs/go-datastore\"\n\t\"github.com/ipfs/go-datastore/keytransform\"\n)\n\ntype "
},
{
"path": "internal/handshake/doc.go",
"chars": 2526,
"preview": "// Package handshake implements a capability-based handshake.\n//\n// Handshake Sequence Diagram:\n// ---------------------"
},
{
"path": "internal/handshake/handshake.go",
"chars": 4740,
"preview": "package handshake\n\nimport (\n\tcrand \"crypto/rand\"\n\t\"encoding/base64\"\n\n\tp2pcrypto \"github.com/libp2p/go-libp2p/core/crypto"
},
{
"path": "internal/handshake/handshake.pb.go",
"chars": 13648,
"preview": "// Code generated by protoc-gen-go. DO NOT EDIT.\n// versions:\n// \tprotoc-gen-go v1.34.2\n// \tprotoc (unknown)\n// s"
},
{
"path": "internal/handshake/handshake_test.go",
"chars": 33115,
"preview": "package handshake\n\nimport (\n\t\"context\"\n\tcrand \"crypto/rand\"\n\t\"sync\"\n\t\"testing\"\n\t\"time\"\n\n\tp2pcrypto \"github.com/libp2p/go"
},
{
"path": "internal/handshake/handshake_util_test.go",
"chars": 3217,
"preview": "package handshake\n\nimport (\n\t\"context\"\n\tcrand \"crypto/rand\"\n\t\"sync\"\n\t\"testing\"\n\t\"time\"\n\n\tp2pcrypto \"github.com/libp2p/go"
},
{
"path": "internal/handshake/request.go",
"chars": 5432,
"preview": "package handshake\n\nimport (\n\t\"context\"\n\t\"errors\"\n\n\tp2pcrypto \"github.com/libp2p/go-libp2p/core/crypto\"\n\t\"go.uber.org/zap"
},
{
"path": "internal/handshake/response.go",
"chars": 5597,
"preview": "package handshake\n\nimport (\n\t\"context\"\n\t\"errors\"\n\n\tp2pcrypto \"github.com/libp2p/go-libp2p/core/crypto\"\n\t\"go.uber.org/zap"
},
{
"path": "internal/notify/notify.go",
"chars": 625,
"preview": "package notify\n\nimport (\n\t\"context\"\n\t\"sync\"\n)\n\ntype Notify struct {\n\tL sync.Locker\n\n\tcc chan struct{}\n\tmu sync.Mutex\n}\n\n"
},
{
"path": "internal/notify/notify_test.go",
"chars": 1582,
"preview": "package notify\n\nimport (\n\t\"context\"\n\t\"sync\"\n\t\"testing\"\n\n\t\"github.com/stretchr/testify/assert\"\n\t\"github.com/stretchr/test"
},
{
"path": "internal/queue/metrics.go",
"chars": 350,
"preview": "package queue\n\ntype MetricsTracer[T any] interface {\n\tItemQueued(name string, item T)\n\tItemPop(name string, item T)\n}\n\nv"
},
{
"path": "internal/queue/priority.go",
"chars": 1879,
"preview": "package queue\n\nimport (\n\t\"container/heap\"\n\t\"sync\"\n)\n\ntype ICounter interface {\n\tCounter() uint64\n}\n\n// A priorityMessage"
},
{
"path": "internal/queue/simple.go",
"chars": 1746,
"preview": "package queue\n\nimport (\n\t\"container/list\"\n\t\"context\"\n\t\"sync\"\n)\n\ntype SimpleQueue[T any] struct {\n\tname string\n\tlist "
},
{
"path": "internal/queue/simple_test.go",
"chars": 2463,
"preview": "package queue\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"sync\"\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/stretchr/testify/require\"\n)\n\ntype tes"
},
{
"path": "internal/sysutil/sysutil.go",
"chars": 1346,
"preview": "package sysutil\n\nimport (\n\t\"os\"\n\t\"runtime\"\n\t\"syscall\"\n\n\t\"go.uber.org/multierr\"\n\t\"moul.io/openfiles\"\n\n\t\"berty.tech/weshne"
},
{
"path": "internal/sysutil/sysutil_unix.go",
"chars": 1069,
"preview": "//go:build linux || darwin\n\npackage sysutil\n\nimport (\n\t\"syscall\"\n\n\t\"go.uber.org/multierr\"\n\n\t\"berty.tech/weshnet/v2/pkg/p"
},
{
"path": "internal/sysutil/sysutil_unsupported.go",
"chars": 188,
"preview": "//go:build !linux && !darwin\n\npackage sysutil\n\nimport \"berty.tech/weshnet/v2/pkg/protocoltypes\"\n\nfunc appendCustomSystem"
},
{
"path": "internal/tools/example_test.go",
"chars": 19,
"preview": "package tools_test\n"
},
{
"path": "internal/tools/tools.go",
"chars": 1119,
"preview": "//go:build tools\n\n// Package tools ensures that `go mod` detect some required dependencies.\n//\n// This package should no"
},
{
"path": "internal/tools/tools_untool.go",
"chars": 210,
"preview": "//go:build !tools\n\n// Package tools ensures that `go mod` detect some required dependencies.\n//\n// This package should n"
},
{
"path": "message_marshaler.go",
"chars": 6262,
"preview": "package weshnet\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"sync\"\n\n\t\"github.com/libp2p/go-libp2p/core/crypto\"\n\tpeer \"github.com/"
},
{
"path": "message_marshaler_test.go",
"chars": 5113,
"preview": "package weshnet\n\nimport (\n\t\"testing\"\n\t\"time\"\n\n\tmocknet \"github.com/libp2p/go-libp2p/p2p/net/mock\"\n\t\"github.com/stretchr/"
},
{
"path": "orbitdb.go",
"chars": 19876,
"preview": "package weshnet\n\nimport (\n\t\"context\"\n\t\"encoding/base64\"\n\t\"fmt\"\n\t\"sync\"\n\t\"time\"\n\n\t\"github.com/ipfs/go-cid\"\n\t\"github.com/i"
},
{
"path": "orbitdb_datastore_cache.go",
"chars": 1271,
"preview": "package weshnet\n\nimport (\n\t\"context\"\n\n\tdatastore \"github.com/ipfs/go-datastore\"\n\t\"github.com/ipfs/go-datastore/query\"\n\n\t"
},
{
"path": "orbitdb_many_adds_berty_test.go",
"chars": 3288,
"preview": "package weshnet\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"os\"\n\t\"path\"\n\t\"sync\"\n\t\"testing\"\n\t\"time\"\n\n\tsync_ds \"github.com/ipfs/go-datas"
},
{
"path": "orbitdb_many_adds_test.go",
"chars": 1633,
"preview": "package weshnet\n\nimport (\n\t\"context\"\n\tcrand \"crypto/rand\"\n\t\"fmt\"\n\t\"os\"\n\t\"testing\"\n\n\t\"github.com/libp2p/go-libp2p/core/cr"
},
{
"path": "orbitdb_signed_entry_accesscontroller.go",
"chars": 2973,
"preview": "package weshnet\n\nimport (\n\t\"context\"\n\t\"encoding/json\"\n\t\"sync\"\n\n\tcid \"github.com/ipfs/go-cid\"\n\tmh \"github.com/multiformat"
},
{
"path": "orbitdb_signed_entry_identity_provider.go",
"chars": 2652,
"preview": "package weshnet\n\nimport (\n\t\"context\"\n\n\t\"github.com/libp2p/go-libp2p/core/crypto\"\n\n\t\"berty.tech/go-ipfs-log/identityprovi"
},
{
"path": "orbitdb_signed_entry_keystore.go",
"chars": 1573,
"preview": "package weshnet\n\nimport (\n\t\"context\"\n\t\"encoding/hex\"\n\t\"sync\"\n\n\t\"github.com/libp2p/go-libp2p/core/crypto\"\n\n\t\"berty.tech/g"
},
{
"path": "orbitdb_test.go",
"chars": 5196,
"preview": "package weshnet\n\nimport (\n\t\"context\"\n\t\"encoding/hex\"\n\t\"os\"\n\t\"strings\"\n\t\"testing\"\n\t\"time\"\n\n\tdatastore \"github.com/ipfs/go"
},
{
"path": "orbitdb_utils_test.go",
"chars": 2603,
"preview": "package weshnet\n\nimport (\n\t\"context\"\n\t\"sync\"\n\t\"testing\"\n\n\t\"github.com/libp2p/go-libp2p/core/crypto\"\n\t\"github.com/stretch"
},
{
"path": "pkg/androidnearby/bridge_android.go",
"chars": 791,
"preview": "//go:build android && !noproximitytransport\n\npackage androidnearby\n\nimport (\n\t\"go.uber.org/zap\"\n\n\tproximity \"berty.tech/"
},
{
"path": "pkg/androidnearby/bridge_unsupported.go",
"chars": 470,
"preview": "//go:build !android || noproximitytransport\n\npackage androidnearby\n\nimport (\n\t\"go.uber.org/zap\"\n\n\tproximity \"berty.tech/"
},
{
"path": "pkg/androidnearby/const.go",
"chars": 154,
"preview": "package androidnearby\n\nconst (\n\tDefaultAddr = \"/nearby/Qmeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee\"\n\tProtocolCode = "
},
{
"path": "pkg/androidnearby/example_test.go",
"chars": 27,
"preview": "package androidnearby_test\n"
},
{
"path": "pkg/androidnearby/init.go",
"chars": 271,
"preview": "package androidnearby\n\nimport (\n\tma \"github.com/multiformats/go-multiaddr\"\n)\n\n// Add MC to the list of libp2p's multiadd"
},
{
"path": "pkg/androidnearby/multiaddr.go",
"chars": 762,
"preview": "package androidnearby\n\nimport (\n\tpeer \"github.com/libp2p/go-libp2p/core/peer\"\n\tma \"github.com/multiformats/go-multiaddr\""
},
{
"path": "pkg/bertyvcissuer/client.go",
"chars": 4213,
"preview": "package bertyvcissuer\n\nimport (\n\t\"context\"\n\t\"crypto\"\n\tcrand \"crypto/rand\"\n\t\"encoding/base64\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"i"
},
{
"path": "pkg/bertyvcissuer/urls.go",
"chars": 1019,
"preview": "package bertyvcissuer\n\nimport (\n\t\"encoding/base64\"\n\t\"fmt\"\n)\n\nconst (\n\tPathChallenge = \"/challenge\"\n\tPathAuthenticate "
},
{
"path": "pkg/bertyvcissuer/verifiable_public_key_fetcher.go",
"chars": 1406,
"preview": "package bertyvcissuer\n\nimport (\n\t\"crypto/ed25519\"\n\t\"fmt\"\n\t\"slices\"\n\t\"strings\"\n\n\t\"github.com/hyperledger/aries-framework-"
},
{
"path": "pkg/ble-driver/BertyDevice_darwin.h",
"chars": 3825,
"preview": "//\n// BertyDevice.h\n// ble\n//\n// Created by sacha on 03/06/2019.\n// Copyright © 2019 berty. All rights reserved.\n//\n"
},
{
"path": "pkg/ble-driver/BertyDevice_darwin.m",
"chars": 43286,
"preview": "// +build darwin,!noproximitytransport\n//\n// BertyDevice.m\n// ble\n//\n// Created by sacha on 03/06/2019.\n// Copyright"
},
{
"path": "pkg/ble-driver/BleInterface_darwin.h",
"chars": 813,
"preview": "//\n// BleInterface.h\n// ble\n//\n// Created by sacha on 26/09/2018.\n// Copyright © 2018 sacha. All rights reserved.\n//"
},
{
"path": "pkg/ble-driver/BleInterface_darwin.m",
"chars": 4610,
"preview": "// +build darwin,!noproximitytransport\n//\n// BleInterface.m\n// ble\n//\n// Created by sacha on 26/09/2018.\n// Copyrigh"
},
{
"path": "pkg/ble-driver/BleManager_darwin.h",
"chars": 2765,
"preview": "//\n// BleManager.h\n// ble\n//\n// Created by sacha on 23/05/2019.\n// Copyright © 2019 berty. All rights reserved.\n//\n\n"
},
{
"path": "pkg/ble-driver/BleManager_darwin.m",
"chars": 33396,
"preview": "// +build darwin,!noproximitytransport\n//\n// BleManager.m\n// ble\n//\n// Created by sacha on 23/05/2019.\n// Copyright "
},
{
"path": "pkg/ble-driver/BleQueue.h",
"chars": 896,
"preview": "//\n// BleQueue.h\n// BertyBridgeDemo\n//\n// Created by Rémi BARBERO on 03/05/2021.\n//\n\n#import <Foundation/Foundation.h"
},
{
"path": "pkg/ble-driver/BleQueue.m",
"chars": 3580,
"preview": "// +build darwin,!noproximitytransport\n//\n// BleQueue.m\n// BertyBridgeDemo\n//\n// Created by Rémi BARBERO on 03/05/202"
},
{
"path": "pkg/ble-driver/CircularQueue.h",
"chars": 689,
"preview": "//\n// CircularQueue.h\n//\n// Created on 9/21/13.\n//\n// https://gist.github.com/werediver/5345f91c897b8173e40e\n//\n\n#im"
},
{
"path": "pkg/ble-driver/CircularQueue.m",
"chars": 1946,
"preview": "// +build darwin,!noproximitytransport\n\n#import \"CircularQueue.h\"\n\n@implementation CircularQueue\n\n- (instancetype __nonn"
},
{
"path": "pkg/ble-driver/ConnectedPeer.h",
"chars": 467,
"preview": "//\n// ConnectedPeer.h\n// BertyBridgeDemo\n//\n// Created by Rémi BARBERO on 29/04/2021.\n//\n\n#import <Foundation/Foundat"
},
{
"path": "pkg/ble-driver/ConnectedPeer.m",
"chars": 311,
"preview": "// +build darwin,!noproximitytransport\n//\n// ConnectedPeer.m\n// BertyBridgeDemo\n//\n// Created by Rémi BARBERO on 29/0"
},
{
"path": "pkg/ble-driver/CountDownLatch_darwin.h",
"chars": 668,
"preview": "//\n// CountDownLatch.h\n// ble\n//\n// Created by sacha on 22/11/2018.\n// Copyright © 2018 berty. All rights reserved.\n"
},
{
"path": "pkg/ble-driver/CountDownLatch_darwin.m",
"chars": 1559,
"preview": "// +build darwin,!noproximitytransport\n//\n// CountDownLatch.m\n// ble\n//\n// Created by sacha on 22/11/2018.\n// Copyri"
},
{
"path": "pkg/ble-driver/Logger.h",
"chars": 1195,
"preview": "//\n// Logger.h\n// BertyBridgeDemo\n//\n// Created by Rémi BARBERO on 08/12/2021.\n//\n\n#import <Foundation/Foundation.h>\n"
},
{
"path": "pkg/ble-driver/Logger.m",
"chars": 2781,
"preview": "// +build darwin,!noproximitytransport\n//\n// Logger.m\n// BertyBridgeDemo\n//\n// Created by Rémi BARBERO on 08/12/2021."
},
{
"path": "pkg/ble-driver/PeerManager.h",
"chars": 808,
"preview": "//\n// PeerManager.h\n// BertyBridgeDemo\n//\n// Created by Rémi BARBERO on 29/04/2021.\n//\n\n#import <Foundation/Foundatio"
},
{
"path": "pkg/ble-driver/PeerManager.m",
"chars": 3654,
"preview": "// +build darwin,!noproximitytransport\n//\n// PeerManager.m\n// BertyBridgeDemo\n//\n// Created by Rémi BARBERO on 29/04/"
},
{
"path": "pkg/ble-driver/TaskDelay.h",
"chars": 572,
"preview": "//\n// TaskDelay.h\n// BertyBridgeDemo\n//\n// Created by Rémi BARBERO on 03/05/2021.\n//\n\n#import <Foundation/Foundation."
},
{
"path": "pkg/ble-driver/TaskDelay.m",
"chars": 629,
"preview": "// +build darwin,!noproximitytransport\n//\n// TaskDelay.m\n// BertyBridgeDemo\n//\n// Created by Rémi BARBERO on 03/05/20"
},
{
"path": "pkg/ble-driver/WriteDataCache.h",
"chars": 463,
"preview": "//\n// WriteDataCache.h\n// BertyBridgeDemo\n//\n// Created by Rémi BARBERO on 03/08/2021.\n//\n\n#import <Foundation/Founda"
},
{
"path": "pkg/ble-driver/WriteDataCache.m",
"chars": 559,
"preview": "// +build darwin,!noproximitytransport\n//\n// WriteDataCache.m\n// BertyBridgeDemo\n//\n// Created by Rémi BARBERO on 03/"
},
{
"path": "pkg/ble-driver/bridge_android.go",
"chars": 774,
"preview": "//go:build android && !noproximitytransport\n\npackage ble\n\nimport (\n\t\"go.uber.org/zap\"\n\n\tproximity \"berty.tech/weshnet/v2"
},
{
"path": "pkg/ble-driver/bridge_darwin.go",
"chars": 3558,
"preview": "//go:build darwin && cgo && !noproximitytransport\n// +build darwin,cgo,!noproximitytransport\n\npackage ble\n\n/*\n#cgo CFLAG"
},
{
"path": "pkg/ble-driver/bridge_unsupported.go",
"chars": 470,
"preview": "//go:build (!darwin && !android) || noproximitytransport\n\npackage ble\n\nimport (\n\t\"go.uber.org/zap\"\n\n\tproximity \"berty.te"
},
{
"path": "pkg/ble-driver/const.go",
"chars": 138,
"preview": "package ble\n\nconst (\n\tDefaultAddr = \"/ble/Qmeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee\"\n\tProtocolCode = 0x0042\n\tProto"
},
{
"path": "pkg/ble-driver/example_test.go",
"chars": 17,
"preview": "package ble_test\n"
},
{
"path": "pkg/ble-driver/init.go",
"chars": 180,
"preview": "package ble\n\nimport (\n\tma \"github.com/multiformats/go-multiaddr\"\n)\n\nfunc init() { // nolint:gochecknoinits\n\terr := ma.Ad"
},
{
"path": "pkg/ble-driver/multiaddr.go",
"chars": 752,
"preview": "package ble\n\nimport (\n\tpeer \"github.com/libp2p/go-libp2p/core/peer\"\n\tma \"github.com/multiformats/go-multiaddr\"\n)\n\nfunc n"
},
{
"path": "pkg/cryptoutil/cryptoutil.go",
"chars": 7018,
"preview": "package cryptoutil\n\nimport (\n\t\"crypto/aes\"\n\t\"crypto/cipher\"\n\tcrand \"crypto/rand\"\n\t\"crypto/sha256\"\n\t\"crypto/sha512\"\n\t\"fmt"
},
{
"path": "pkg/cryptoutil/cryptoutil_test.go",
"chars": 5274,
"preview": "package cryptoutil\n\nimport (\n\t\"bytes\"\n\t\"crypto/aes\"\n\t\"crypto/rand\"\n\t\"testing\"\n\n\t\"github.com/libp2p/go-libp2p/core/crypto"
},
{
"path": "pkg/cryptoutil/doc.go",
"chars": 86,
"preview": "// Package cryptoutil contains generic & stateless crypto helpers.\npackage cryptoutil\n"
},
{
"path": "pkg/cryptoutil/signer_wrapper.go",
"chars": 568,
"preview": "package cryptoutil\n\nimport (\n\tstdcrypto \"crypto\"\n\t\"io\"\n\n\tlibp2p_ci \"github.com/libp2p/go-libp2p/core/crypto\"\n)\n\nfunc New"
},
{
"path": "pkg/errcode/doc.go",
"chars": 75,
"preview": "// Package errcode contains the list of Berty error codes.\npackage errcode\n"
},
{
"path": "pkg/errcode/errcode.pb.go",
"chars": 35440,
"preview": "// Code generated by protoc-gen-go. DO NOT EDIT.\n// versions:\n// \tprotoc-gen-go v1.34.2\n// \tprotoc (unknown)\n// s"
},
{
"path": "pkg/errcode/error.go",
"chars": 5554,
"preview": "package errcode\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"slices\"\n\n\t\"golang.org/x/xerrors\"\n\t\"google.golang.org/grpc/codes\"\n\t\"google.golan"
},
{
"path": "pkg/errcode/error_test.go",
"chars": 5871,
"preview": "package errcode\n\nimport (\n\t\"fmt\"\n\t\"testing\"\n\n\t\"github.com/pkg/errors\"\n\t\"github.com/stretchr/testify/assert\"\n\t\"google.gol"
},
{
"path": "pkg/errcode/stdproto.go",
"chars": 672,
"preview": "package errcode\n\n// nolint:staticcheck // cannot use the new protobuf API while keeping gogoproto\n\n// nolint:gochecknoin"
},
{
"path": "pkg/grpcutil/buf_listener.go",
"chars": 755,
"preview": "package grpcutil\n\nimport (\n\t\"context\"\n\t\"net\"\n\n\t\"google.golang.org/grpc\"\n\t\"google.golang.org/grpc/credentials/insecure\"\n\t"
},
{
"path": "pkg/grpcutil/doc.go",
"chars": 99,
"preview": "// Package grpcutil contains gRPC lazy codecs, messages and a buf-based listener.\npackage grpcutil\n"
},
{
"path": "pkg/grpcutil/simple_auth.go",
"chars": 875,
"preview": "package grpcutil\n\nimport (\n\t\"context\"\n\n\t\"google.golang.org/grpc/credentials\"\n)\n\nconst headerAuthorize = \"authorization\"\n"
},
{
"path": "pkg/grpcutil/simple_auth_test.go",
"chars": 2584,
"preview": "package grpcutil\n\nimport (\n\t\"context\"\n\t\"net\"\n\t\"testing\"\n\n\tgrpc_middleware \"github.com/grpc-ecosystem/go-grpc-middleware\""
},
{
"path": "pkg/ipfsutil/collector_bandwidth.go",
"chars": 1312,
"preview": "package ipfsutil\n\nimport (\n\tmetrics \"github.com/libp2p/go-libp2p/core/metrics\"\n\tprometheus \"github.com/prometheus/client"
},
{
"path": "pkg/ipfsutil/collector_host.go",
"chars": 2688,
"preview": "package ipfsutil\n\nimport (\n\thost \"github.com/libp2p/go-libp2p/core/host\"\n\t\"github.com/libp2p/go-libp2p/core/network\"\n\t\"g"
},
{
"path": "pkg/ipfsutil/conn_logger.go",
"chars": 3225,
"preview": "package ipfsutil\n\nimport (\n\t\"context\"\n\t\"time\"\n\n\t\"github.com/libp2p/go-libp2p/core/host\"\n\t\"github.com/libp2p/go-libp2p/co"
},
{
"path": "pkg/ipfsutil/conn_manager.go",
"chars": 3224,
"preview": "package ipfsutil\n\nimport (\n\t\"fmt\"\n\t\"sync\"\n\n\t\"github.com/libp2p/go-libp2p/core/connmgr\"\n\t\"github.com/libp2p/go-libp2p/cor"
},
{
"path": "pkg/ipfsutil/consts.go",
"chars": 292,
"preview": "package ipfsutil\n\nconst (\n\t// svc ams 1\n\tDefaultP2PRdvpMaddr = \"/ip4/51.15.25.224/udp/4040/quic-v1/p2p/12D3KooWHhDBv6DJJ"
},
{
"path": "pkg/ipfsutil/doc.go",
"chars": 115,
"preview": "// Package ipfsutil contains helpers around IPFS (logging, datastore, networking, core API, ...).\npackage ipfsutil\n"
},
{
"path": "pkg/ipfsutil/extended_core_api.go",
"chars": 921,
"preview": "package ipfsutil\n\nimport (\n\tipfs_core \"github.com/ipfs/kubo/core\"\n\tipfs_coreapi \"github.com/ipfs/kubo/core/coreapi\"\n\tcor"
},
{
"path": "pkg/ipfsutil/helpers.go",
"chars": 3079,
"preview": "package ipfsutil\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"sync\"\n\t\"time\"\n\n\t\"github.com/libp2p/go-libp2p/core/network"
},
{
"path": "pkg/ipfsutil/helpers_test.go",
"chars": 5061,
"preview": "package ipfsutil\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"encoding/hex\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\tmrand \"math/rand\"\n\t\"testing\"\n\t\"ti"
},
{
"path": "pkg/ipfsutil/keystore_datastore.go",
"chars": 1243,
"preview": "package ipfsutil\n\nimport (\n\t\"context\"\n\n\tdatastore \"github.com/ipfs/go-datastore\"\n\tkeystore \"github.com/ipfs/go-ipfs-keys"
},
{
"path": "pkg/ipfsutil/lifecycle.go",
"chars": 4912,
"preview": "package ipfsutil\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"sync\"\n\t\"sync/atomic\"\n\t\"time\"\n\n\t\"github.com/libp2p/go-libp2p/core/connmgr\""
},
{
"path": "pkg/ipfsutil/localrecord.go",
"chars": 2209,
"preview": "package ipfsutil\n\nimport (\n\t\"context\"\n\t\"os\"\n\n\tipfs_core \"github.com/ipfs/kubo/core\"\n\tcoreiface \"github.com/ipfs/kubo/cor"
},
{
"path": "pkg/ipfsutil/metrics.go",
"chars": 17,
"preview": "package ipfsutil\n"
},
{
"path": "pkg/ipfsutil/mobile/host.go",
"chars": 1457,
"preview": "package node\n\nimport (\n\t\"fmt\"\n\n\tipfs_p2p \"github.com/ipfs/kubo/core/node/libp2p\"\n\tp2p \"github.com/libp2p/go-libp2p\"\n\tp2p"
},
{
"path": "pkg/ipfsutil/mobile/node.go",
"chars": 3135,
"preview": "package node\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"net\"\n\t\"os\"\n\n\tipfs_oldcmds \"github.com/ipfs/kubo/commands\"\n\tipfs_core \"github."
},
{
"path": "pkg/ipfsutil/mobile/repo.go",
"chars": 918,
"preview": "package node\n\nimport (\n\tipfs_config \"github.com/ipfs/kubo/config\"\n\tipfs_repo \"github.com/ipfs/kubo/repo\"\n)\n\nvar _ ipfs_r"
},
{
"path": "pkg/ipfsutil/mobile/routing.go",
"chars": 757,
"preview": "package node\n\nimport (\n\t\"fmt\"\n\n\tipfs_p2p \"github.com/ipfs/kubo/core/node/libp2p\"\n\tp2p_host \"github.com/libp2p/go-libp2p/"
},
{
"path": "pkg/ipfsutil/mobile.go",
"chars": 6067,
"preview": "package ipfsutil\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\tipfs_config \"github.com/ipfs/kubo/config\"\n\tipfs_p2p \"github.com/ipfs/kubo"
},
{
"path": "pkg/ipfsutil/peering.go",
"chars": 8785,
"preview": "// mostly from: https://github.com/ipfs/kubo/blob/master/peering/peering.go\n\npackage ipfsutil\n\nimport (\n\t\"context\"\n\t\"err"
},
{
"path": "pkg/ipfsutil/pubsub_adaptater.go",
"chars": 783,
"preview": "package ipfsutil\n\nimport (\n\tcoreiface \"github.com/ipfs/kubo/core/coreiface\"\n)\n\ntype pubsubCoreAPIAdapter struct {\n\tcorei"
},
{
"path": "pkg/ipfsutil/pubsub_api.go",
"chars": 3668,
"preview": "package ipfsutil\n\nimport (\n\t\"context\"\n\t\"sync\"\n\n\tcoreiface \"github.com/ipfs/kubo/core/coreiface\"\n\tcoreiface_options \"gith"
},
{
"path": "pkg/ipfsutil/pubsub_monitor.go",
"chars": 3437,
"preview": "package ipfsutil\n\nimport (\n\t\"sync\"\n\n\tps \"github.com/libp2p/go-libp2p-pubsub\"\n\tps_pb \"github.com/libp2p/go-libp2p-pubsub/"
},
{
"path": "pkg/ipfsutil/repo.go",
"chars": 5922,
"preview": "package ipfsutil\n\nimport (\n\tcrand \"crypto/rand\"\n\t\"encoding/base64\"\n\t\"fmt\"\n\t\"path/filepath\"\n\t\"time\"\n\n\tipfs_ds \"github.com"
}
]
// ... and 153 more files (download for full content)
About this extraction
This page contains the full source code of the berty/weshnet GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 353 files (2.3 MB), approximately 629.5k tokens, and a symbol index with 3771 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.