diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index a2707ef6..e4531cb1 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -42,14 +42,14 @@ jobs: with: go-version: "1.21.0" - - name: Install Blockless Runtime + - name: Install Bless Runtime run: | - mkdir -p /tmp/blockless-runtime - curl -L -o runtime.tar.gz https://github.com/blocklessnetwork/runtime/releases/download/v0.3.1/blockless-runtime.ubuntu-20.04.x86_64.tar.gz - tar xzf runtime.tar.gz -C /tmp/blockless-runtime + mkdir -p /tmp/bls-runtime + curl -L -o runtime.tar.gz https://github.com/blessnetwork/bls-runtime/releases/download/v0.3.1/blockless-runtime.ubuntu-20.04.x86_64.tar.gz + tar xzf runtime.tar.gz -C /tmp/bls-runtime rm runtime.tar.gz - name: Run integration tests run: | - export B7S_INTEG_RUNTIME_DIR=/tmp/blockless-runtime + export B7S_INTEG_RUNTIME_DIR=/tmp/bls-runtime go test --tags=integration ./... diff --git a/Makefile b/Makefile index aec860fd..3cf19f55 100644 --- a/Makefile +++ b/Makefile @@ -37,6 +37,6 @@ clean: setup: @echo "\n📥 Downloading and extracting runtime...\n" mkdir -p /tmp/runtime - wget -O /tmp/blockless-runtime.tar.gz https://github.com/blocklessnetwork/runtime/releases/download/v0.3.4/blockless-runtime.darwin-latest.x86_64.tar.gz - tar -xzf /tmp/blockless-runtime.tar.gz -C /tmp/runtime + wget -O /tmp/bls-runtime.tar.gz https://github.com/blessnetwork/bls-runtime/releases/download/v0.3.4/blockless-runtime.darwin-latest.x86_64.tar.gz + tar -xzf /tmp/bls-runtime.tar.gz -C /tmp/runtime @echo "\n✅ Done.\n" diff --git a/README.md b/README.md index 7db2358b..474b2e5a 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,13 @@ [](https://img.shields.io/badge/Coverage-64.5%25-yellow) -[](https://goreportcard.com/report/github.com/blocklessnetwork/b7s) -[](https://github.com/blocklessnetwork/b7s/blob/main/LICENSE.md) -[](https://img.shields.io/github/v/release/blocklessnetwork/b7s) +[](https://goreportcard.com/report/github.com/blessnetwork/b7s) +[](https://github.com/blessnetwork/b7s/blob/main/LICENSE.md) +[](https://img.shields.io/github/v/release/blessnetwork/b7s) # b7s daemon -b7s is a peer-to-peer networking daemon for the blockless network. It is supported on Windows, Linux, and MacOS platforms for both x64 and arm64 architectures. +b7s is a peer-to-peer networking daemon for the bless network. +It is supported on Windows, Linux, and MacOS platforms for both x64 and arm64 architectures. ## Installation @@ -14,10 +15,10 @@ You can install b7s using either curl or wget: ```bash # using curl -sudo sh -c "curl https://raw.githubusercontent.com/blocklessnetwork/b7s/main/download.sh | bash" +sudo sh -c "curl https://raw.githubusercontent.com/blessnetwork/b7s/main/download.sh | bash" # using wget -sudo sh -c "wget https://raw.githubusercontent.com/blocklessnetwork/b7s/main/download.sh -v -O download.sh; chmod +x download.sh; ./download.sh; rm -rf download.sh" +sudo sh -c "wget https://raw.githubusercontent.com/blessnetwork/b7s/main/download.sh -v -O download.sh; chmod +x download.sh; ./download.sh; rm -rf download.sh" ``` You can also use Docker to install b7s. See the [Docker documentation](/docker/README.md) for more information. @@ -34,7 +35,7 @@ You can see an example YAML config file [here](/cmd/node/example.yaml). | config | N/A | N/A | Config file to load. | | log-level | -l | "info" | Level of logging to use. | | db | N/A | "db" | Path to database used for persisting peer and function data. | -| role | -r | "worker" | Role this node will have in the Blockless protocol (head or worker). | +| role | -r | "worker" | Role this node will have in the Bless protocol (head or worker). | | workspace | N/A | "./workspace" | Directory that the node will use for file storage. | | concurrency | -c | node.DefaultConcurrency | Maximum number of requests the node will process in parallel. | | load-attributes | N/A | false | Load attributes from the environment. | @@ -62,10 +63,10 @@ You can see an example YAML config file [here](/cmd/node/example.yaml). | Flag | Short Form | Default Value | Description | | ------------------------- | ---------- | ----------------------- | --------------------------------------------------------------------------------------------- | -| runtime-path | N/A | N/A | Local path to the Blockless Runtime. | -| runtime-cli | N/A | "bls-runtime" | Name of the Blockless Runtime executable, as found in the runtime-path. | -| cpu-percentage-limit | N/A | 1.0 | Amount of CPU time allowed for Blockless Functions in the 0-1 range, 1 being unlimited (100%) | -| memory-limit | N/A | N/A | Memory limit for Blockless Functions, in kB. | +| runtime-path | N/A | N/A | Local path to the Bless Runtime. | +| runtime-cli | N/A | "bls-runtime" | Name of the Bless Runtime executable, as found in the runtime-path. | +| cpu-percentage-limit | N/A | 1.0 | Amount of CPU time allowed for Bless Functions in the 0-1 range, 1 being unlimited (100%) | +| memory-limit | N/A | N/A | Memory limit for Bless Functions, in kB. | ### Head Node @@ -87,8 +88,8 @@ You can see an example YAML config file [here](/cmd/node/example.yaml). b7s depends on the following repositories: -- blocklessnetwork/runtime -- blocklessnetwork/orchestration-chain +- blessnetwork/runtime +- blessnetwork/orchestration-chain ## Contributing diff --git a/SECURITY.md b/SECURITY.md index 2ef7e08b..f5489fc2 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -2,9 +2,9 @@ ## Reporting a Vulnerability -At Blockless Network, we take security very seriously. If you discover any security vulnerabilities, we encourage you to report them responsibly. +At Bless Network, we take security very seriously. If you discover any security vulnerabilities, we encourage you to report them responsibly. -Please report any security issues to our Security Advisories page: [Blockless Network Security Advisories](https://github.com/blocklessnetwork/b7s/security/advisories) +Please report any security issues to our Security Advisories page: [Bless Network Security Advisories](https://github.com/blessnetwork/b7s/security/advisories) ### Guidelines for Reporting @@ -16,4 +16,4 @@ Please report any security issues to our Security Advisories page: [Blockless Ne At this time, we do not offer a bounty award for reported vulnerabilities. However, we greatly appreciate your efforts in helping us maintain the security and integrity of our project. -Thank you for contributing to the security of Blockless Network. +Thank you for contributing to the security of Bless Network. diff --git a/api/api.go b/api/api.go index 57b63eef..16ffb173 100644 --- a/api/api.go +++ b/api/api.go @@ -4,13 +4,13 @@ import ( "github.com/rs/zerolog" ) -// API provides REST API functionality for the Blockless head node. +// API provides REST API functionality for the Bless head node. type API struct { Log zerolog.Logger Node Node } -// New creates a new instance of a Blockless head node REST API. Access to node data is provided by the provided `node`. +// New creates a new instance of a Bless head node REST API. Access to node data is provided by the provided `node`. func New(log zerolog.Logger, node Node) *API { api := API{ diff --git a/api/api_test.go b/api/api_test.go index 283b4bab..c2899923 100644 --- a/api/api_test.go +++ b/api/api_test.go @@ -10,8 +10,8 @@ import ( "github.com/labstack/echo/v4" - "github.com/blocklessnetwork/b7s/api" - "github.com/blocklessnetwork/b7s/testing/mocks" + "github.com/blessnetwork/b7s/api" + "github.com/blessnetwork/b7s/testing/mocks" ) const ( diff --git a/api/b7s-swagger.yaml b/api/b7s-swagger.yaml index 71f5a2da..d77afef5 100644 --- a/api/b7s-swagger.yaml +++ b/api/b7s-swagger.yaml @@ -10,10 +10,10 @@ externalDocs: url: http://swagger.io tags: - name: functions - description: Everything about Blockless Functions + description: Everything about Bless Functions externalDocs: description: Find out more - url: https://blockless.network/docs/network + url: https://bless.network/docs/network - name: health description: Verify node health and availability @@ -37,11 +37,11 @@ paths: post: tags: - functions - summary: Execute a Blockless Function - description: Execute a Blockless Function + summary: Execute a Bless Function + description: Execute a Bless Function operationId: executeFunction requestBody: - description: Execute a Blockless Function + description: Execute a Bless Function content: application/json: schema: @@ -89,11 +89,11 @@ paths: post: tags: - functions - summary: Install a Blockless Function - description: Install a Blockless Function + summary: Install a Bless Function + description: Install a Bless Function operationId: installFunction requestBody: - description: Install a Blockless Function + description: Install a Bless Function content: application/json: schema: @@ -133,7 +133,7 @@ components: x-go-type-skip-optional-pointer: true parameters: type: array - description: CLI arguments for the Blockless Function + description: CLI arguments for the Bless Function items: $ref: '#/components/schemas/ExecutionParameter' example: @@ -157,7 +157,7 @@ components: x-go-type-skip-optional-pointer: true x-go-type: execute.Parameter x-go-type-import: - path: github.com/blocklessnetwork/b7s/models/execute + path: github.com/blessnetwork/b7s/models/execute properties: value: type: string @@ -169,20 +169,20 @@ components: x-go-type-skip-optional-pointer: true x-go-type: execute.Config x-go-type-import: - path: github.com/blocklessnetwork/b7s/models/execute + path: github.com/blessnetwork/b7s/models/execute properties: runtime: $ref: '#/components/schemas/RuntimeConfig' env_vars: - description: Environment variables for the Blockless Function + description: Environment variables for the Bless Function type: array x-go-type-skip-optional-pointer: true items: $ref: '#/components/schemas/NamedValue' stdin: - description: Standard Input for the Blockless Function + description: Standard Input for the Bless Function type: string - example: Standard Input for the Blockless Function + example: Standard Input for the Bless Function x-go-type-skip-optional-pointer: true permissions: description: Permissions for the Execution @@ -196,7 +196,7 @@ components: attributes: $ref: '#/components/schemas/NodeAttributes' number_of_nodes: - description: Number of nodes that should execute the Blockless Function + description: Number of nodes that should execute the Bless Function type: integer example: 1 x-go-type-skip-optional-pointer: true @@ -216,12 +216,12 @@ components: x-go-type-skip-optional-pointer: true RuntimeConfig: - description: Configuration options for the Blockless Runtime + description: Configuration options for the Bless Runtime type: object x-go-type-skip-optional-pointer: true x-go-type: execute.BLSRuntimeConfig x-go-type-import: - path: github.com/blocklessnetwork/b7s/models/execute + path: github.com/blessnetwork/b7s/models/execute properties: entry: type: string @@ -254,7 +254,7 @@ components: x-go-type-skip-optional-pointer: true x-go-type: execute.Attributes x-go-type-import: - path: github.com/blocklessnetwork/b7s/models/execute + path: github.com/blessnetwork/b7s/models/execute properties: attestation_required: description: Is it necessary that the Node attributes are vouched for by an attestor @@ -275,7 +275,7 @@ components: x-go-type-skip-optional-pointer: true x-go-type: execute.AttributeAttestors x-go-type-import: - path: github.com/blocklessnetwork/b7s/models/execute + path: github.com/blessnetwork/b7s/models/execute properties: each: description: LibP2P Peer IDs of each mandatory attestor @@ -301,7 +301,7 @@ components: x-go-type-skip-optional-pointer: true x-go-type: execute.ResultAggregation x-go-type-import: - path: github.com/blocklessnetwork/b7s/models/execute + path: github.com/blessnetwork/b7s/models/execute properties: enable: type: boolean @@ -341,7 +341,7 @@ components: x-go-type-skip-optional-pointer: true x-go-type: aggregate.Results x-go-type-import: - path: github.com/blocklessnetwork/b7s/node/aggregate + path: github.com/blessnetwork/b7s/node/aggregate items: $ref: '#/components/schemas/AggregatedResult' @@ -351,7 +351,7 @@ components: x-go-type-skip-optional-pointer: true x-go-type: aggregate.Result x-go-type-import: - path: github.com/blocklessnetwork/b7s/node/aggregate + path: github.com/blessnetwork/b7s/node/aggregate properties: result: $ref: '#/components/schemas/ExecutionResult' @@ -377,7 +377,7 @@ components: x-go-type-skip-optional-pointer: true x-go-type: execute.RuntimeOutput x-go-type-import: - path: github.com/blocklessnetwork/b7s/models/execute + path: github.com/blessnetwork/b7s/models/execute properties: stdout: description: Standard Output of the execution @@ -398,7 +398,7 @@ components: x-go-type-skip-optional-pointer: true x-go-type: execute.Cluster x-go-type-import: - path: github.com/blocklessnetwork/b7s/models/execute + path: github.com/blessnetwork/b7s/models/execute properties: main: description: LibP2P ID of the Primary node for the cluster @@ -422,7 +422,7 @@ components: x-go-type-skip-optional-pointer: true x-go-type: execute.EnvVar x-go-type-import: - path: github.com/blocklessnetwork/b7s/models/execute + path: github.com/blessnetwork/b7s/models/execute required: - name - value diff --git a/api/execute.go b/api/execute.go index d4beca5f..97e1c29d 100644 --- a/api/execute.go +++ b/api/execute.go @@ -7,9 +7,9 @@ import ( "github.com/labstack/echo/v4" - "github.com/blocklessnetwork/b7s/models/blockless" - "github.com/blocklessnetwork/b7s/models/execute" - "github.com/blocklessnetwork/b7s/node/aggregate" + "github.com/blessnetwork/b7s/models/bls" + "github.com/blessnetwork/b7s/models/execute" + "github.com/blessnetwork/b7s/node/aggregate" ) // ExecuteFunction implements the REST API endpoint for function execution. @@ -49,7 +49,7 @@ func (a *API) ExecuteFunction(ctx echo.Context) error { } // Communicate the reason for failure in these cases. - if errors.Is(err, blockless.ErrRollCallTimeout) || errors.Is(err, blockless.ErrExecutionNotEnoughNodes) { + if errors.Is(err, bls.ErrRollCallTimeout) || errors.Is(err, bls.ErrExecutionNotEnoughNodes) { res.Message = err.Error() } diff --git a/api/execute_test.go b/api/execute_test.go index c4994717..9188e614 100644 --- a/api/execute_test.go +++ b/api/execute_test.go @@ -10,10 +10,10 @@ import ( "github.com/libp2p/go-libp2p/core/peer" "github.com/stretchr/testify/require" - "github.com/blocklessnetwork/b7s/api" - "github.com/blocklessnetwork/b7s/models/codes" - "github.com/blocklessnetwork/b7s/models/execute" - "github.com/blocklessnetwork/b7s/testing/mocks" + "github.com/blessnetwork/b7s/api" + "github.com/blessnetwork/b7s/models/codes" + "github.com/blessnetwork/b7s/models/execute" + "github.com/blessnetwork/b7s/testing/mocks" ) func TestAPI_Execute(t *testing.T) { diff --git a/api/health.go b/api/health.go index 8b361f41..2a312fa7 100644 --- a/api/health.go +++ b/api/health.go @@ -5,7 +5,7 @@ import ( "github.com/labstack/echo/v4" - "github.com/blocklessnetwork/b7s/models/response" + "github.com/blessnetwork/b7s/models/response" ) // Execute implements the REST API endpoint for function execution. diff --git a/api/health_test.go b/api/health_test.go index e7ac0ed6..e7668245 100644 --- a/api/health_test.go +++ b/api/health_test.go @@ -7,7 +7,7 @@ import ( "github.com/stretchr/testify/require" - "github.com/blocklessnetwork/b7s/models/response" + "github.com/blessnetwork/b7s/models/response" ) func TestAPI_HealthResult(t *testing.T) { diff --git a/api/install_test.go b/api/install_test.go index 8031b274..94d19a67 100644 --- a/api/install_test.go +++ b/api/install_test.go @@ -8,8 +8,8 @@ import ( "github.com/labstack/echo/v4" "github.com/stretchr/testify/require" - "github.com/blocklessnetwork/b7s/api" - "github.com/blocklessnetwork/b7s/testing/mocks" + "github.com/blessnetwork/b7s/api" + "github.com/blessnetwork/b7s/testing/mocks" ) func TestAPI_FunctionInstall(t *testing.T) { diff --git a/api/models.gen.go b/api/models.gen.go index 614c3a52..2fd758ff 100644 --- a/api/models.gen.go +++ b/api/models.gen.go @@ -4,8 +4,8 @@ package api import ( - "github.com/blocklessnetwork/b7s/models/execute" - "github.com/blocklessnetwork/b7s/node/aggregate" + "github.com/blessnetwork/b7s/models/execute" + "github.com/blessnetwork/b7s/node/aggregate" ) // AggregatedResult Result of an Execution Request @@ -34,7 +34,7 @@ type ExecutionRequest struct { // Method Name of the WASM file to execute Method string `json:"method"` - // Parameters CLI arguments for the Blockless Function + // Parameters CLI arguments for the Bless Function Parameters []ExecutionParameter `json:"parameters,omitempty"` // Topic In the scenario where workers form subgroups, you can target a specific subgroup by specifying its identifier @@ -103,7 +103,7 @@ type NodeCluster = execute.Cluster // ResultAggregation defines model for ResultAggregation. type ResultAggregation = execute.ResultAggregation -// RuntimeConfig Configuration options for the Blockless Runtime +// RuntimeConfig Configuration options for the Bless Runtime type RuntimeConfig = execute.BLSRuntimeConfig // ExecuteFunctionJSONRequestBody defines body for ExecuteFunction for application/json ContentType. diff --git a/api/node.go b/api/node.go index 639cee45..2b7f70fc 100644 --- a/api/node.go +++ b/api/node.go @@ -3,8 +3,8 @@ package api import ( "context" - "github.com/blocklessnetwork/b7s/models/codes" - "github.com/blocklessnetwork/b7s/models/execute" + "github.com/blessnetwork/b7s/models/codes" + "github.com/blessnetwork/b7s/models/execute" ) type Node interface { diff --git a/api/result_test.go b/api/result_test.go index c321bc37..08c8e22e 100644 --- a/api/result_test.go +++ b/api/result_test.go @@ -8,9 +8,9 @@ import ( "github.com/labstack/echo/v4" "github.com/stretchr/testify/require" - "github.com/blocklessnetwork/b7s/api" - "github.com/blocklessnetwork/b7s/models/execute" - "github.com/blocklessnetwork/b7s/testing/mocks" + "github.com/blessnetwork/b7s/api" + "github.com/blessnetwork/b7s/models/execute" + "github.com/blessnetwork/b7s/testing/mocks" ) func TestAPI_ExecutionResult(t *testing.T) { diff --git a/api/server.gen.go b/api/server.gen.go index 5c905080..8421b909 100644 --- a/api/server.gen.go +++ b/api/server.gen.go @@ -18,10 +18,10 @@ import ( // ServerInterface represents all server handlers. type ServerInterface interface { - // Execute a Blockless Function + // Execute a Bless Function // (POST /api/v1/functions/execute) ExecuteFunction(ctx echo.Context) error - // Install a Blockless Function + // Install a Bless Function // (POST /api/v1/functions/install) InstallFunction(ctx echo.Context) error // Get the result of an Execution Request @@ -111,48 +111,47 @@ func RegisterHandlersWithBaseURL(router EchoRouter, si ServerInterface, baseURL // Base64 encoded, gzipped, json marshaled Swagger object var swaggerSpec = []string{ - "H4sIAAAAAAAC/+xaW2/bOhL+K4R2H2U7cW6o39I03Qbb02abRYvdg8CgpJHEmiJVknLiBv7vC150sSXH", - "lzjHPYvzFIeiyE8z31w4wycv5FnOGTAlvdGTJ8MUMmx+XiaJgAQriL6ALKjSYxHIUJBcEc68kWfHEY8R", - "Zuj6EcJCP0Bf4EcBUnm+lwueg1AEzIKx0A9YOGuv9L58pBdTKZFI2LVxxlmCMKWI8QgkUilWCMxWECGV", - "AhLVbvCIs5yCNzrqn5/7nprl4I08VmQBCM/3HnsJ77nBmHKszk+boz05IXmPG0SY9nJOmALhjZQoYO57", - "OYCQbeAfSZAPc3TzTlrkgD7VOBOumh/ThPi7dzx8d/JPzr99yU8uv04ufqhweDk9fyQ/ksuf+Pi/vJjI", - "f+H/hHfDcPrpzenkw90Vx56/y2uBd+97REFm8DsJSCUIS7x5JScsBJ5tIRBRkeLvAmJv5P1tUFNp4Hg0", - "qFjhODSvN+TBdwjVkmJwSbr+l1JmNSCS5VyYLXOsUm/kJUSlRdAPeTYIKA8nFKRkoB64mAyCCznQnBlU", - "S+qP3fTrlsnfqXppuF8w8qMAp+OKBl3mUOngOYm1zO4ZFXUITB5MYkoJEhQKLpUCqXiXtWhREAFI5hCS", - "mIQIl3MRlmjKizDVVrbsOACHaafp3Q5v0S2AKO1PT0QZZhFWXMyq1ZuiP5wF7svwOIMxjzeSRy3ehxQE", - "oAfrLrUKsEIUsGYwg/8nx7TGv7jQ0e9g64vsJuMRUDlwy29jN5WjuOIsJklbr3a8ENh4E7uORDEXK/3M", - "ovXg8lPXuh4dui7r2XPfCzmTwGQhx5gmXBCVZm2A31ISpqiaiqqpSKa8oBEKQMPNIHKoiXQhXL/f4J6X", - "B7HGv8iEzUUJbDqe4i7Hc82mRHCWAVNoigXBAYVahm9LjaL3BQsdqo2c9SecQfQV0wJeYNA2QxnzeGxy", - "nDb6T2aCNuhGEuRk6xi3+jsq6R5XAPX2yWJOtDb7ERmRUjOvDe+2ftimZafv9VKlcjkaDHBO+m5U25bn", - "7zk9GZehzCB9Xpc2fl42XtDLFEyRDNa+a6c5E577nlQRYW1R3SkdnESEblheqOcJWEtrm7d2tR2VCpAp", - "p1GHfrmwrsdmNm0OCpA5ZxF6ICpFuEzdFTc+gUSwbPNIFmEIUsYF7SZoO2dfh55kwIuOI8oH/oCoPkI4", - "qPoDahwKT8Db2Sw2DDWOFIcOL7dY4AzMo6elCDE1DqwVgreQg8sqIp0/2NXuNxNOjerQ8inDZ0s6YRWX", - "Nzro1D4gdlY5Jh1GdXXzrjSouMvmAxzPAiB4eDo9DX/iqcq/T4chP/l+dspP8dlPFRU/wnw2IwzE94SF", - "jxdyKIdDeQH4BV4gA5XyDrQ6zpVwv13e/YZiQkFbeCnxJvQUKOW9By5o1H/AMnsBnrykR0fYufp4g7BI", - "Ch3U5Yau9PeK7F6vF1LSiylOjr25X4+bv4tD9dRhe+rQm99vmC102OLuAU7xnIRtqdwwIwYZAsOC8DLx", - "52ICwkgpQ7IIEsGLXPpoxgsUYu0IRQIK4fpkVk5CwcwNzghLEFESkQiYIjExRlurfWc1L/mPptlUjHzO", - "nWxu4TpMSegwcVpI5xnX5cdXbqpJjiPoDPGqqMoA3Xnu8OjoRUYqJU46tr5ZUXpAMSYUIt+GYfc6ykiS", - "KpTiKaCMC0CExRzhgBfKIhfCnJx3Renqcp3Or/Z9XceXhhM8j4MgPIPecXR83jsF/KYXnJ1d9M6O41N8", - "joOz87PwRRCr0s42FRn5fBVrCzp2VlUvQ1Vginih8kK1ieQjSiaAqpzws5nn1wPXWnE+un4kCl3xCBCo", - "sN9vF1UeiRp3U9i8qh91sXhXYUsVgRDPpMQG95537MwJl0S3vy03TAjdYcHufqi8p4yON0wqTOnq7OfP", - "k7ysjoj4TxUPfa8QZPG8vK/YqrX5glDaIs3KgOr8yn5C3vzliK2zbbB8kSP/AOWaSc91tPxa1ZHmQaP9", - "hG7etTzsLxv5lkixH06UEv4rx/orxzp0jvUBMFWpZUnHYVZnNtI+9H9Vx9WoLLczRDSBWc+cPlGOiWh9", - "BcPZ0leYkd21WFWI6hXt0J5ckIO3Venomk2/4oPVjZZ6JW0dVc9sqbThqFiCLAVtSVJ7h66mDWiK6nNw", - "LaiWjUtEFGIQancjZvVOZv268YOwANdetT2YYKYDXKM/Wuk1xlRCpYCAcwqYbcEU3Oz+Pmvx7Q5cSTQr", - "AUo/x6Zis16wLXHO/adNEW/e4LnfurkoD8nOqzrgLifEOu217cQ6Frn4vNRlaly1MfdYuluMGe5qdriG", - "dB2IbgXJNE31+lXBrswLmjFpxxb0zlXGlXd7LP6luz2EWWnUyA99u2Cn18L9XUrYtBNSCewgRtFu8LWS", - "VGA4oM1WyPYOcLFkvW3z+OmVSw8tERxKFwsN0y3vPNQ1frdMyyFFEBTJWGfbL9JlJMgUhBwLztXYyuTp", - "BbcTlJgttcH31ymJC6ANdNu3+ClPEhstdj8zZVx0XO78zYwjSjKium+A7AxaFGxc9ud/ucbv2493izQ/", - "iK1ptPCoQDBM3/GwI869JyxCOg0wR1SbEdw94MSKpBDUXdgYDQbSDvcJ1wBK+1pc7t9au0Sitxd36APg", - "yGZndyCmIFCAJUSI2ybV5xzY5e0NOukfVYU2Y/F9rRuijI3oZcwKX/QpW0/vNV/UpwYQ0m591D/tv9HI", - "eA4M58QbeSf9o/6J9g9YpebbBzgng+nxoCxc1iLVuuBd1aFrd8cGd3cXteMxsG+ienLjucua3vJo5vrJ", - "CpjZBuc5dZ88+C5tQLLRYYt7tTYlM3reCnZ9rKiP6qZ2Y8Skj72vANZVhzrQ3lV3QhquYe57pxbIcgo7", - "xZREDYsuU9O57511v2FNAElLRFt60TBkkemsdL3AFE5ks0EpPXMiaBOK2PLoakK5+ulmhHKTX5lQK/oB", - "HYpaA/6Po9WqavRqzLhJFYTDCeMPFKIEoiUmrPnGjZngttI/ymZfNyM2K0CvcDZ1M/F1ubFYRJ8vFnH+", - "KG0v1ZlX+j2raSNNAUoQmGotr/En+/AiG6tyDYtSU8TUGBLoYMxVCuHERkY3c5kcH8rhV9PJQp21QxMG", - "HZEO4GxJUF1fUMrEDdybRa2wpSkG1emIHA0GOSipuICTfp2ZWPmdmGs5brlWQJ+CmKmUsMSlO20rl95W", - "adNCoqSRVTlcv0ziIh7KgftHE8wWaRvan/vLW3wFQWJXL7ESQZhFCE8xoTgglCh9RncLOZHN7+f/CwAA", - "//9f2L021TUAAA==", + "H4sIAAAAAAAC/+xaW2/bOhL+K4R2H2U7cW44fkvTdBtsT5ttFi12DwKDkkYSa4pUScqJG/i/L3jRxZbs", + "2I5T9yzOU1OaIj/OfHPhDJ+8kGc5Z8CU9EZPngxTyLD58zJJBCRYQfQZZEGVHotAhoLkinDmjTw7jniM", + "MEPXjxAW+gf0Gb4XIJXne7ngOQhFwCwYC/0DC2ftld6VP+nFVEokEnZtnHGWIEwpYjwCiVSKFQKzFURI", + "pYBEtRs84iyn4I2O+ufnvqdmOXgjjxVZAMLzvcdewntuMKYcq/PT5mhPTkje4wYRpr2cE6ZAeCMlCpj7", + "Xg4gZBv4BxLkwxzdvJUWOaCPNc6Eq+ZhmhD/8I6Hb0/+yfnXz/nJ5ZfJxXcVDi+n54/ke3L5Ax//lxcT", + "+S/8n/BuGE4//nY6eX93xbHn7/JZ4N37HlGQGfxOAlIJwhJvXskJC4FnWwhEVKT4u4DYG3l/G9RUGjge", + "DSpWOA7N6w158A1CtaQYXJKu/7mUWQ2IZDkXZsscq9QbeQlRaRH0Q54NAgpSMlAPXEwGwYUcaL4MquX0", + "QTc92TLxO9UuDe8LRr4X4PRbUaDLFCr5r5NWy+TWqKdDWPIg0lJKkKBQcKkUSMW7rESLgQhAMoeQxCRE", + "uJyLsERTXoSptq5lhwE4TDtN7nZ4i24BRGl3eiLKMIuw4mJWrd4U++Esb18GxxmMebyRPGrxPqQgAD1Y", + "N6lVgBWigDV7Gfw/OaRn/IoLGf0Otu5sMxmPgMqBW3obm6kcxBVnMUnaOrXjhcDGi9h1JIq5WOlfFi0H", + "l8d81uXocHVZz577XsiZBCYLOcY04YKoNGsD/JqSMEXVVFRNRTLlBY1QABpuBpFDTaQL2/r7Bu+8PIg1", + "/kUWbC5KYNPxFHc5nWs2JYKzDJhCUywI1gqsZPhGaxO9K1joEG3koD/iDKIvmBbwAkO2GcmYx2OT07SR", + "fzQTtCE3kh4nV8e27jNUUj2uwOmtk8X859lMR2RESs24NrTb+sc2HTv9rZcqlcvRYIBz0nej2p48f8+p", + "yLgMXwbpej3aeHnZ+EAvUzBFMnj2WzvNme7c96SKCGuL6k7pgCQidMPyQq0mXi2pTb/Y1VZUKkCmnEYd", + "euXCuhqbwbR5J0DmnEXogagU4TI9V9z4ABLBso0jWYQhSBkXtJuY7bz8OfQkA150XEPe8wdE9TXBQdUH", + "qHEoPAFvZ3PYMKw4MhwylNxigTMwPz0tRYOpcVitULuFDFz2EOk8wa52v5lgalSHlE0ZJluSCav4u9El", + "prb52FnjmHQY09XN29KQ4i47D3A8C4Dg4en0NPyBpyr/Nh2G/OTb2Sk/xWc/VFR8D/PZjDAQ3xIWPl7I", + "oRwO5QXgF1h/BirlHWh1TCvhfr28+x3FhIK27FLiTegpUMp7D1zQqP+AZfYCPHlJjY4wc/XhBmGRFDp4", + "yw1c5x8Vyb1eL6SkF1OcHHtzvx43/y4O1VOH7alDb36/YVbQYYO7BzPFcxK2JXLDjAhkCAwLwsvEnosJ", + "CCOhDMkiSAQvcumjGS9QiLXzEwkohOubVzkJBTM3OCMsQURJRCJgisTEGGut8p1VvOQ3miZTsXGdG9nc", + "unVoktBh3rSQziM+lwNfuakmAY6gM5yrorrid+eyw6OjFxmolDjp2PpmRVkBxZhQiHwbet3nKCNJqlCK", + "p4AyLgARFnOEA14oi1wIczPeFaWrt3U6vtrvdV1RGg7wPA6C8Ax6x9Hxee8U8G+94Ozsond2HJ/icxyc", + "nZ+FL4JYlW22qbbI9dWpLejYWS29DFWBKeKFygvVJpKPKJkAqnLAT2aeXw9ca8X56PqRKHTFI0Cgwn6/", + "XTR5JGrcTWHzqf6pi8W7CluqCIRYk/4a3HvesTMPXBLd/rbcMAl0FwO7+yHynTIy3jCpMKWrs54/T9Ky", + "OhriP1Us9L1CkMV78b7iqtbmC8JoizQrg6nzKfsJd/OXI7aOtsHyRY78A5RrEK3rUvm1qiPNg0ZLCd28", + "bXnXXzbqLZFiP5woJfxXfvVXfnXo/Oo9YKpSy5KOS6zOaqT90f9VHVejetzODtEEZj1z80Q5JqJ1Coaz", + "pVOYkd21WFWF6hXt0J5ckIO3Vbnomk2/4IPUipb6IG39VL/ZsmjDSbEEWfrZ8qP2DF0NGdD01PffWkgt", + "+5aIKMQg1K5GzOqdzPp1UwdhAa5tavsrwUwHt0bfs9JpjKmESvgB5xQw24IluNnVXWvt7c5aSTIrAUo/", + "xaZS87xgW+Kc+0+bIt68gXO/ddNQHoqZV3WgXU6Edbpr24R1DHJxeamD1Hg2Y96kdLcOM9zVzHBN5joA", + "3QqSaYrq9asCXZkPNGPRjm3lnauKK9/pWPxL73QIs9KokR/6xcBOn4X7e2iwacejEthPN4h2866VmALD", + "AW22PLZ3fIvl6W2bwk+vXGpoieAQelhohG75hsHW8t0SLScUQVAkY51Zv0iHkSBTEHIsOFdjK4unF7w0", + "UGK21NreXzckLoA20G3ftqc8SWyE2P1+lHHR8TjzdzOOKMmI6n7NsTNoUbBx2XP/5Zq6bz7cLVL8p9uY", + "RgqPCgTD9C0PO+LaO8IipMO+uYraDODuASdWHIWg7gHGaDCQdrhPuAZQ2tbicv/WmiUSvbm4Q+8BRzYT", + "uwMxBYECLCFC3DaiPuXALm9v0En/qCqoGUvva70QZexDL2NW+Kxv03p6r/mhvh2AkHbro/5p/zeNjOfA", + "cE68kXfSP+qfaN+AVWrOPsA5GUyPB2WBshap1gPvqgJdu/cyuN091A7HQL6J6omN312G9IZHM9crVsDM", + "FjjPqTvu4Ju0AchGgy3ew9r0y+h4Y8j11aG+ipvajBGPvta+AlBX/elAele98Wi4g7nvnVogy6nqFFMS", + "Nay4TEHnvnfW/YWlPpKWgLa0omHIItPZ53phKZzIZuNReibjb5OI2NLnahK52ujzJHITX5lEK+r8HQpa", + "A/znUWlVhXk1XtykB8LhhPEHClEC0ZL215xvY+27bfQfZeOumwWbFZRXOJa6Mfi6nFgsis8XizI/S9NL", + "deOVPs5q2UhTgBIEplrDz/iPfXiNjVX5DItSU5TUGBLoYMxVCuHERkA3c5kc78vhV9PJQt20QxMGHZEO", + "4GxJUF0nKGXiBu7Nom6wFX6nIGYqJSxxycminUpvqwRnIaWRo4HNtPplqhXxUA7cfzQ9bMm0obu5v7z8", + "FxAkdlUMex6EWYTwFBOKA0KJ0jdnt5A78Px+/r8AAAD//848wzE3NQAA", } // GetSwagger returns the content of the embedded swagger specification file diff --git a/cmd/b7s-node-docs/b7sdocs.templ b/cmd/b7s-node-docs/b7sdocs.templ index f78088c0..26f354ae 100644 --- a/cmd/b7s-node-docs/b7sdocs.templ +++ b/cmd/b7s-node-docs/b7sdocs.templ @@ -1,17 +1,17 @@ package main import "fmt" -import "github.com/blocklessnetwork/b7s/config" +import "github.com/blessnetwork/b7s/config" templ page(version string, configs []config.ConfigOption) { <html> <head> - <title>Blockless B7S Node Configuration</title> + <title>Bless B7S Node Configuration</title> <link rel="icon" href="/assets/favicon/favicon.ico" type="image/x-icon" sizes="16x16"/> <link rel="stylesheet" href="/assets/css/style.css" /> </head> <body> - <h1>Blockless B7S Node Configuration</h1> + <h1>Bless B7S Node Configuration</h1> <p class="description"> This page lists all of the configuration options supported by the b7s daemon. diff --git a/cmd/b7s-node-docs/b7sdocs_templ.go b/cmd/b7s-node-docs/b7sdocs_templ.go index 257d52a6..75d979d2 100644 --- a/cmd/b7s-node-docs/b7sdocs_templ.go +++ b/cmd/b7s-node-docs/b7sdocs_templ.go @@ -1,6 +1,6 @@ // Code generated by templ - DO NOT EDIT. -// templ: version: v0.2.778 +// templ: version: v0.3.819 package main //lint:file-ignore SA4006 This context is only used if a nested component is present. @@ -9,7 +9,7 @@ import "github.com/a-h/templ" import templruntime "github.com/a-h/templ/runtime" import "fmt" -import "github.com/blocklessnetwork/b7s/config" +import "github.com/blessnetwork/b7s/config" func page(version string, configs []config.ConfigOption) templ.Component { return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { @@ -32,7 +32,7 @@ func page(version string, configs []config.ConfigOption) templ.Component { templ_7745c5c3_Var1 = templ.NopComponent } ctx = templ.ClearChildren(ctx) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<html><head><title>Blockless B7S Node Configuration</title><link rel=\"icon\" href=\"/assets/favicon/favicon.ico\" type=\"image/x-icon\" sizes=\"16x16\"><link rel=\"stylesheet\" href=\"/assets/css/style.css\"></head><body><h1>Blockless B7S Node Configuration</h1><p class=\"description\">This page lists all of the configuration options supported by the b7s daemon. It showcases the configuration structure, as accepted in a YAML config file, environment variables that can be used to set those options and, where applicable, the CLI flags and their default values.</p>") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 1, "<html><head><title>Bless B7S Node Configuration</title><link rel=\"icon\" href=\"/assets/favicon/favicon.ico\" type=\"image/x-icon\" sizes=\"16x16\"><link rel=\"stylesheet\" href=\"/assets/css/style.css\"></head><body><h1>Bless B7S Node Configuration</h1><p class=\"description\">This page lists all of the configuration options supported by the b7s daemon. It showcases the configuration structure, as accepted in a YAML config file, environment variables that can be used to set those options and, where applicable, the CLI flags and their default values.</p>") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -41,7 +41,7 @@ func page(version string, configs []config.ConfigOption) templ.Component { return templ_7745c5c3_Err } if version != "" { - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<footer><small>Node version: ") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 2, "<footer><small>Node version: ") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -54,16 +54,16 @@ func page(version string, configs []config.ConfigOption) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</small></footer>") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 3, "</small></footer>") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</body></html>") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 4, "</body></html>") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - return templ_7745c5c3_Err + return nil }) } @@ -88,12 +88,12 @@ func b7sdocs(configs []config.ConfigOption) templ.Component { templ_7745c5c3_Var3 = templ.NopComponent } ctx = templ.ClearChildren(ctx) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"cfg-list\">") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 5, "<div class=\"cfg-list\">") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } for _, cfg := range configs { - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"cfg\">") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 6, "<div class=\"cfg\">") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -101,16 +101,16 @@ func b7sdocs(configs []config.ConfigOption) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div>") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 7, "</div>") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div>") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 8, "</div>") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - return templ_7745c5c3_Err + return nil }) } @@ -144,7 +144,7 @@ func configOption(cfg config.ConfigOption) templ.Component { templ_7745c5c3_Var4 = templ.NopComponent } ctx = templ.ClearChildren(ctx) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<h2 id=\"") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 9, "<h2 id=\"") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -157,7 +157,7 @@ func configOption(cfg config.ConfigOption) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\">") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 10, "\">") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -170,7 +170,7 @@ func configOption(cfg config.ConfigOption) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" <a class=\"link-icon\" href=\"") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 11, " <a class=\"link-icon\" href=\"") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -179,12 +179,12 @@ func configOption(cfg config.ConfigOption) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\"><span>🔗</span></a></h2>") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 12, "\"><span>🔗</span></a></h2>") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } if cfg.Type() != "" { - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<p>Type: ") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 13, "<p>Type: ") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -197,12 +197,12 @@ func configOption(cfg config.ConfigOption) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</p>") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 14, "</p>") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<p>Path: ") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 15, "<p>Path: ") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -215,12 +215,12 @@ func configOption(cfg config.ConfigOption) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</p>") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 16, "</p>") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } if cfg.Env != "" { - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<p>Environment variable: ") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 17, "<p>Environment variable: ") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -233,13 +233,13 @@ func configOption(cfg config.ConfigOption) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</p>") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 18, "</p>") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } } if cfg.CLI.Flag != "" { - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<dl><dt>CLI flag:</dt><dd><ul class=\"cli-details\"><li class=\"cli\">Flag: <code>--") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 19, "<dl><dt>CLI flag:</dt><dd><ul class=\"cli-details\"><li class=\"cli\">Flag: <code>--") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -252,12 +252,12 @@ func configOption(cfg config.ConfigOption) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</code></li>") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 20, "</code></li>") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } if cfg.CLI.Shorthand != "" { - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<li class=\"cli\">Shorthand: <code>-") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 21, "<li class=\"cli\">Shorthand: <code>-") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -270,12 +270,12 @@ func configOption(cfg config.ConfigOption) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</code></li>") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 22, "</code></li>") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<li class=\"cli\">Default: ") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 23, "<li class=\"cli\">Default: ") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -288,7 +288,7 @@ func configOption(cfg config.ConfigOption) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</li><li class=\"cli\">Description: ") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 24, "</li><li class=\"cli\">Description: ") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -301,18 +301,18 @@ func configOption(cfg config.ConfigOption) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</li></ul></dd></dl>") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 25, "</li></ul></dd></dl>") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } } if len(cfg.Children) > 0 { - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<ul>") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 26, "<ul>") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } for _, child := range cfg.Children { - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<li class=\"child-cfg\">") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 27, "<li class=\"child-cfg\">") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -320,17 +320,17 @@ func configOption(cfg config.ConfigOption) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</li>") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 28, "</li>") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</ul>") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 29, "</ul>") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } } - return templ_7745c5c3_Err + return nil }) } diff --git a/cmd/b7s-node-docs/main.go b/cmd/b7s-node-docs/main.go index 09d15f36..3a2d4bdd 100644 --- a/cmd/b7s-node-docs/main.go +++ b/cmd/b7s-node-docs/main.go @@ -11,8 +11,8 @@ import ( "github.com/a-h/templ" "github.com/spf13/pflag" - "github.com/blocklessnetwork/b7s/config" - "github.com/blocklessnetwork/b7s/info" + "github.com/blessnetwork/b7s/config" + "github.com/blessnetwork/b7s/info" ) //go:embed assets/* diff --git a/cmd/bootstrap-limiter/README.md b/cmd/bootstrap-limiter/README.md index aa498d7f..24d9b22e 100644 --- a/cmd/bootstrap-limiter/README.md +++ b/cmd/bootstrap-limiter/README.md @@ -2,8 +2,8 @@ ## Description -This utility is aimed to provide an easy way to setup the system so that a non-privileged user can set resource limits for Blockless Functions. -This tool is designed to be run a single time, before runing the Blockless Worker Node. +This utility is aimed to provide an easy way to setup the system so that a non-privileged user can set resource limits for Bless Functions. +This tool is designed to be run a single time, before runing the Bless Worker Node. If the user has no intention of using cgroups to set resource limits, there is no need in running this tool. ## Workaround @@ -14,14 +14,14 @@ It is not mandatory to use the tool to setup your system. If you would like to setup your system manually, the steps are listed below. The readme assumes your `cgroup` mountpoint is the default - `/sys/fs/cgroup`. - 1. Create a directory `/sys/fs/cgroup/blockless` - 2. Change owner of the directory and its subdirectories to the user that will be running the node. Example: `sudo chown -R <user> /sys/fs/cgroup/blockless`. + 1. Create a directory `/sys/fs/cgroup/bless` + 2. Change owner of the directory and its subdirectories to the user that will be running the node. Example: `sudo chown -R <user> /sys/fs/cgroup/bless`. 3. Set files `/sys/fs/cgroup/cgroup.procs` and `/sys/fs/cgroup/cgroup.subtree_control` to be group writable. Example: `sudo chmod 0664 /sys/fs/cgroup/cgroup.procs` (same for `cgroup.subtree_control`) 4. Add user to the group that owns the files listed in step 3. By default this would be `root`, so for example `sudo usermod -a -G root <user>`. ## Removing Cgroup -You can remove a cgroup, effectively reverting the changes done by the tool by running `sudo rmdir /sys/fs/cgroup/blockless`. +You can remove a cgroup, effectively reverting the changes done by the tool by running `sudo rmdir /sys/fs/cgroup/bless`. ## Further Reading diff --git a/cmd/bootstrap-limiter/main.go b/cmd/bootstrap-limiter/main.go index 3184882b..a1cfb5da 100644 --- a/cmd/bootstrap-limiter/main.go +++ b/cmd/bootstrap-limiter/main.go @@ -18,7 +18,7 @@ import ( "github.com/fatih/color" "github.com/spf13/pflag" - "github.com/blocklessnetwork/b7s/executor/limits" + "github.com/blessnetwork/b7s/executor/limits" ) const ( @@ -165,7 +165,7 @@ func run() int { } // Get group name for gid. - color.Red("please ensure user '%v' is a member of '%v' group in order to be able to set resource limits for Blockless Functions\n", runningUser, group.Name) + color.Red("please ensure user '%v' is a member of '%v' group in order to be able to set resource limits for Bless Functions\n", runningUser, group.Name) color.Red("e.g. by running sudo usermod -a -G <group> <user>") return success @@ -175,7 +175,7 @@ func haveConsent() bool { reader := bufio.NewReader(os.Stdin) - fmt.Printf("This command will attempt to setup the system to set resource limits for Blockless Functions. Would you like to continue? [yes/no]: ") + fmt.Printf("This command will attempt to setup the system to set resource limits for Bless Functions. Would you like to continue? [yes/no]: ") answer, _ := reader.ReadString('\n') answer = strings.TrimSpace(strings.ToLower(answer)) diff --git a/cmd/keyforge/README.md b/cmd/keyforge/README.md index 9054474c..65dfc70b 100644 --- a/cmd/keyforge/README.md +++ b/cmd/keyforge/README.md @@ -52,4 +52,4 @@ Use OpenSSL to verify a signature: $ openssl dgst -sha256 -verify -signature message.sig -in -These commands enable you to manage cryptographic keys and perform signing and verification operations, including using OpenSSL for verification, conveniently within the Blockless b7s Node network. +These commands enable you to manage cryptographic keys and perform signing and verification operations, including using OpenSSL for verification, conveniently within the Bless b7s Node network. diff --git a/cmd/manager/main.go b/cmd/manager/main.go index 7cf7eb4c..3a977f3e 100644 --- a/cmd/manager/main.go +++ b/cmd/manager/main.go @@ -130,10 +130,10 @@ func handleRequest(s network.Stream) error { return err } - baseURL := "https://github.com/blocklessnetwork/b7s/releases/download" + baseURL := "https://github.com/blessnetwork/b7s/releases/download" version := "v0.0.25" - runtimeBaseURL := "https://github.com/blocklessnetwork/runtime/releases/download" + runtimeBaseURL := "https://github.com/blessnetwork/runtime/releases/download" runtimeVersion := "v0.0.12" responseMsg := &Message{} diff --git a/cmd/manager/service.go b/cmd/manager/service.go index 7857e2f9..01eae8f7 100644 --- a/cmd/manager/service.go +++ b/cmd/manager/service.go @@ -27,7 +27,7 @@ func createServiceAndStartB7s(binPath string) { func createLinuxService(binPath string) { serviceContent := `[Unit] -Description=Blockless b7s CLI Service +Description=Bless b7s CLI Service After=network.target [Service] @@ -73,10 +73,10 @@ func createMacOSService(binPath string) { <plist version="1.0"> <dict> <key>Label</key> - <string>com.blockless.b7s</string> + <string>com.bless.b7s</string> <key>ProgramArguments</key> <array> - <string>%s/Blockless Compute Engine</string> + <string>%s/Bless Compute Engine</string> </array> <key>RunAtLoad</key> <true/> @@ -94,7 +94,7 @@ func createMacOSService(binPath string) { launchAgentsPath := filepath.Join(usr.HomeDir, "Library", "LaunchAgents") os.MkdirAll(launchAgentsPath, os.ModePerm) - plistFilePath := filepath.Join(launchAgentsPath, "com.blockless.b7s.plist") + plistFilePath := filepath.Join(launchAgentsPath, "com.bless.b7s.plist") plistContent = fmt.Sprintf(plistContent, binPath) err = os.WriteFile(plistFilePath, []byte(plistContent), 0644) @@ -160,7 +160,7 @@ func removeMacOSService() { log.Fatal(err) } - plistFilePath := filepath.Join(usr.HomeDir, "Library", "LaunchAgents", "com.blockless.b7s.plist") + plistFilePath := filepath.Join(usr.HomeDir, "Library", "LaunchAgents", "com.bless.b7s.plist") cmd := exec.Command("launchctl", "unload", plistFilePath) err = cmd.Run() diff --git a/cmd/node/README.md b/cmd/node/README.md index 59d2f948..f7e0403f 100644 --- a/cmd/node/README.md +++ b/cmd/node/README.md @@ -1,19 +1,19 @@ -# Blockless Node +# Bless Node ## Description -Blockless b7s Node is a peer-to-peer networking daemon for the blockless network. +Bless b7s Node is a peer-to-peer networking daemon for the Bless network. -A Node in the Blockless network can have one of two roles - it can be a Head Node or a Worker Node. +A Node in the Bless network can have one of two roles - it can be a Head Node or a Worker Node. -In short, Worker Nodes are nodes that will be doing the actual execution of work within the Blockless P2P network. -Worker Nodes do this by relying on the Blockless Runtime. -Blockless Runtime needs to be available locally on the machine where the Node is run. +In short, Worker Nodes are nodes that will be doing the actual execution of work within the Bless P2P network. +Worker Nodes do this by relying on the Bless Runtime. +Bless Runtime needs to be available locally on the machine where the Node is run. Head Nodes are nodes that are performing coordination of work between a number of Worker Nodes. -When a Head Node receives an execution request to execute a piece of work (a Blockless Function), it will start a process of finding a Worker Node most suited to do this work. -Head Node does not need to have access to Blockless Runtime. +When a Head Node receives an execution request to execute a piece of work (a Bless Function), it will start a process of finding a Worker Node most suited to do this work. +Head Node does not need to have access to Bless Runtime. Head Nodes also serve a REST API that can be used to query or trigger certain actions. @@ -26,7 +26,7 @@ List of supported CLI flags is listed below. ```console Usage of b7s-node: - -r, --role string role this node will have in the Blockless protocol (head or worker) (default "worker") + -r, --role string role this node will have in the Bless protocol (head or worker) (default "worker") -c, --concurrency uint maximum number of requests node will process in parallel (default 10) --boot-nodes strings list of addresses that this node will connect to on startup, in multiaddr format --workspace string directory that the node can use for file storage @@ -47,10 +47,10 @@ Usage of b7s-node: --disable-connection-limits disable libp2p connection limits (experimental) --connection-count uint maximum number of connections the b7s host will aim to have --rest-api string address where the head node REST API will listen on - --runtime-path string Blockless Runtime location (used by the worker node) + --runtime-path string Bless Runtime location (used by the worker node) --runtime-cli string runtime CLI name (used by the worker node) - --cpu-percentage-limit float amount of CPU time allowed for Blockless Functions in the 0-1 range, 1 being unlimited - --memory-limit int memory limit (kB) for Blockless Functions + --cpu-percentage-limit float amount of CPU time allowed for Bless Functions in the 0-1 range, 1 being unlimited + --memory-limit int memory limit (kB) for Bless Functions --enable-tracing emit tracing data --tracing-grpc-endpoint string tracing exporter GRPC endpoint --tracing-http-endpoint string tracing exporter HTTP endpoint @@ -82,7 +82,7 @@ connectivity: worker: - runtime-path: /home/user/.local/blockless-runtime/bin + runtime-path: /home/user/.local/Bless-runtime/bin cpu-percentage-limit: 0.8 telemetry: @@ -117,8 +117,8 @@ $ ./node --db /tmp/db --log-level debug --port 9000 --role worker --runtime ~/.l The created `node` will listen on all addresses on TCP port 9000. Database used to persist Node data between runs will be created in the `/tmp/db` subdirectory. -Blockless Runtime path is given as `/home/user/.local/bin`. -At startup, node will check if the Blockless Runtime is actually found there, namely the [bls-runtime](https://blockless.network/docs/protocol/runtime). +Bless Runtime path is given as `/home/user/.local/bin`. +At startup, node will check if the Bless Runtime is actually found there, namely the [bls-runtime](https://Bless.network/docs/protocol/runtime). Node Identity will be determined by the private key found in `priv.bin` file in the `keys` subdirectory. diff --git a/cmd/node/example.yaml b/cmd/node/example.yaml index 67fb29f2..30f9bd1e 100644 --- a/cmd/node/example.yaml +++ b/cmd/node/example.yaml @@ -68,16 +68,16 @@ # worker node configuration # worker: - # local path to Blockless Runtime - # runtime-path: /path/to/blockless/runtime + # local path to Bless Runtime + # runtime-path: /path/to/bls/runtime # name of the Runtime executable # runtime-cli: bls-runtime - # max percentage of CPU time Blockless will use for execution (1.0 for 100%) + # max percentage of CPU time Bless will use for execution (1.0 for 100%) # cpu-percentage-limit: 1.0 - # max amount of memory (in kB) Blockless will use for execution (0 is unlimited) + # max amount of memory (in kB) Bless will use for execution (0 is unlimited) # memory-limit: 0 # telemetry: diff --git a/cmd/node/host.go b/cmd/node/host.go index 1bd3e8a9..20ffb7b9 100644 --- a/cmd/node/host.go +++ b/cmd/node/host.go @@ -5,12 +5,12 @@ import ( "github.com/rs/zerolog" - "github.com/blocklessnetwork/b7s/config" - "github.com/blocklessnetwork/b7s/host" - "github.com/blocklessnetwork/b7s/models/blockless" + "github.com/blessnetwork/b7s/config" + "github.com/blessnetwork/b7s/host" + "github.com/blessnetwork/b7s/models/bls" ) -func createHost(log zerolog.Logger, cfg config.Config, role blockless.NodeRole, dialbackPeers ...blockless.Peer) (*host.Host, error) { +func createHost(log zerolog.Logger, cfg config.Config, role bls.NodeRole, dialbackPeers ...bls.Peer) (*host.Host, error) { // Get the list of boot nodes addresses. bootNodes, err := getBootNodeAddresses(cfg.BootNodes) @@ -29,7 +29,7 @@ func createHost(log zerolog.Logger, cfg config.Config, role blockless.NodeRole, host.WithDialBackPeers(dialbackPeers), host.WithMustReachBootNodes(cfg.Connectivity.MustReachBootNodes), host.WithDisabledResourceLimits(cfg.Connectivity.DisableConnectionLimits), - host.WithEnableP2PRelay(role == blockless.HeadNode), + host.WithEnableP2PRelay(role == bls.HeadNode), host.WithConnectionLimit(cfg.Connectivity.ConnectionCount), } diff --git a/cmd/node/main.go b/cmd/node/main.go index e7d2e5ad..e5e4c938 100644 --- a/cmd/node/main.go +++ b/cmd/node/main.go @@ -18,15 +18,15 @@ import ( "github.com/ziflex/lecho/v3" "go.opentelemetry.io/contrib/instrumentation/github.com/labstack/echo/otelecho" - "github.com/blocklessnetwork/b7s/api" - "github.com/blocklessnetwork/b7s/config" - b7shost "github.com/blocklessnetwork/b7s/host" - "github.com/blocklessnetwork/b7s/models/blockless" - "github.com/blocklessnetwork/b7s/node" - "github.com/blocklessnetwork/b7s/store" - "github.com/blocklessnetwork/b7s/store/codec" - "github.com/blocklessnetwork/b7s/store/traceable" - "github.com/blocklessnetwork/b7s/telemetry" + "github.com/blessnetwork/b7s/api" + "github.com/blessnetwork/b7s/config" + b7shost "github.com/blessnetwork/b7s/host" + "github.com/blessnetwork/b7s/models/bls" + "github.com/blessnetwork/b7s/node" + "github.com/blessnetwork/b7s/store" + "github.com/blessnetwork/b7s/store/codec" + "github.com/blessnetwork/b7s/store/traceable" + "github.com/blessnetwork/b7s/telemetry" ) const ( @@ -67,7 +67,7 @@ func run() int { // HTTP server will be created in two scenarios: // - node is a head node (head node always has a REST API) // - node has prometheus metrics enabled - needHTTPServer = nodeRole == blockless.HeadNode || cfg.Telemetry.Metrics.Enable + needHTTPServer = nodeRole == bls.HeadNode || cfg.Telemetry.Metrics.Enable server *echo.Echo // If we have a REST API address, serve metrics there. @@ -184,7 +184,7 @@ func run() int { store := traceable.New(store.New(db, codec.NewJSONCodec())) // Create host. - var dialbackPeers []blockless.Peer + var dialbackPeers []bls.Peer if !cfg.Connectivity.NoDialbackPeers { dialbackPeers, err = store.RetrievePeers(ctx) if err != nil { @@ -212,8 +212,8 @@ func run() int { Msg("created host") // Ensure default topic is included in the topic list. - if !slices.Contains(cfg.Topics, blockless.DefaultTopic) { - cfg.Topics = append(cfg.Topics, blockless.DefaultTopic) + if !slices.Contains(cfg.Topics, bls.DefaultTopic) { + cfg.Topics = append(cfg.Topics, bls.DefaultTopic) } // Instantiate node. @@ -232,7 +232,7 @@ func run() int { ) switch nodeRole { - case blockless.WorkerNode: + case bls.WorkerNode: node, nodeshutdown, err = createWorkerNode(core, store, cfg) if nodeshutdown != nil { @@ -244,7 +244,7 @@ func run() int { }() } - case blockless.HeadNode: + case bls.HeadNode: node, err = createHeadNode(core, cfg) } if err != nil { @@ -260,24 +260,24 @@ func run() int { log.Info(). Stringer("role", nodeRole). - Msg("Blockless Node starting") + Msg("Bless Node starting") err := node.Run(ctx) if err != nil { - log.Error().Err(err).Msg("Blockless Node failed") + log.Error().Err(err).Msg("Bless Node failed") close(failed) } else { close(done) } - log.Info().Msg("Blockless Node stopped") + log.Info().Msg("Bless Node stopped") }() // Start the HTTP server if needed. if needHTTPServer { // Create an API handler if we're a head node. - if nodeRole == blockless.HeadNode { + if nodeRole == bls.HeadNode { headNode, ok := any(node).(api.Node) if !ok { @@ -311,11 +311,11 @@ func run() int { select { case <-sig: - log.Info().Msg("Blockless Node stopping") + log.Info().Msg("Bless Node stopping") case <-done: - log.Info().Msg("Blockless Node done") + log.Info().Msg("Bless Node done") case <-failed: - log.Info().Msg("Blockless Node aborted") + log.Info().Msg("Bless Node aborted") return failure } diff --git a/cmd/node/metrics.go b/cmd/node/metrics.go index 6db3e8e4..b9faf6fa 100644 --- a/cmd/node/metrics.go +++ b/cmd/node/metrics.go @@ -5,12 +5,12 @@ import ( mp "github.com/armon/go-metrics/prometheus" - "github.com/blocklessnetwork/b7s/consensus/pbft" - "github.com/blocklessnetwork/b7s/consensus/raft" - "github.com/blocklessnetwork/b7s/executor" - "github.com/blocklessnetwork/b7s/fstore" - "github.com/blocklessnetwork/b7s/host" - "github.com/blocklessnetwork/b7s/node" + "github.com/blessnetwork/b7s/consensus/pbft" + "github.com/blessnetwork/b7s/consensus/raft" + "github.com/blessnetwork/b7s/executor" + "github.com/blessnetwork/b7s/fstore" + "github.com/blessnetwork/b7s/host" + "github.com/blessnetwork/b7s/node" ) func metricCounters() []mp.CounterDefinition { diff --git a/cmd/node/node.go b/cmd/node/node.go index c90946f8..25c0befd 100644 --- a/cmd/node/node.go +++ b/cmd/node/node.go @@ -4,21 +4,21 @@ import ( "context" "fmt" - "github.com/blocklessnetwork/b7s/config" - "github.com/blocklessnetwork/b7s/executor" - "github.com/blocklessnetwork/b7s/executor/limits" - "github.com/blocklessnetwork/b7s/fstore" - "github.com/blocklessnetwork/b7s/models/blockless" - "github.com/blocklessnetwork/b7s/node" - "github.com/blocklessnetwork/b7s/node/head" - "github.com/blocklessnetwork/b7s/node/worker" + "github.com/blessnetwork/b7s/config" + "github.com/blessnetwork/b7s/executor" + "github.com/blessnetwork/b7s/executor/limits" + "github.com/blessnetwork/b7s/fstore" + "github.com/blessnetwork/b7s/models/bls" + "github.com/blessnetwork/b7s/node" + "github.com/blessnetwork/b7s/node/head" + "github.com/blessnetwork/b7s/node/worker" ) type Node interface { Run(context.Context) error } -func createWorkerNode(core node.Core, store blockless.Store, cfg *config.Config) (Node, func() error, error) { +func createWorkerNode(core node.Core, store bls.Store, cfg *config.Config) (Node, func() error, error) { // Create function store. fstore := fstore.New(log.With().Str("component", "fstore").Logger(), store, cfg.Workspace) diff --git a/cmd/node/parse.go b/cmd/node/parse.go index fd67f087..53dc7618 100644 --- a/cmd/node/parse.go +++ b/cmd/node/parse.go @@ -3,18 +3,18 @@ package main import ( "strings" - "github.com/blocklessnetwork/b7s/models/blockless" + "github.com/blessnetwork/b7s/models/bls" ) -func parseNodeRole(role string) blockless.NodeRole { +func parseNodeRole(role string) bls.NodeRole { switch strings.ToLower(role) { - case blockless.HeadNodeLabel: - return blockless.HeadNode + case bls.HeadNodeLabel: + return bls.HeadNode - case blockless.WorkerNodeLabel: - return blockless.WorkerNode + case bls.WorkerNodeLabel: + return bls.WorkerNode default: panic("invalid node role specified") diff --git a/config/config.go b/config/config.go index 6b144165..bce16e51 100644 --- a/config/config.go +++ b/config/config.go @@ -33,7 +33,7 @@ var DefaultConfig = Config{ }, } -// Config describes the Blockless configuration options. +// Config describes the Bless configuration options. // NOTE: DO NOT use TABS in struct tags - spaces only! // NOTE: When adding CLI flags (using the `flag` struct tag) - add the description for (for the flag long version, not the shorthand) it in getFlagDescription() below. type Config struct { @@ -125,7 +125,7 @@ func getFlagDescription(flag string) string { switch flag { case "role": - return "role this node will have in the Blockless protocol (head or worker)" + return "role this node will have in the Bless protocol (head or worker)" case "concurrency": return "maximum number of requests node will process in parallel" case "boot-nodes": @@ -161,13 +161,13 @@ func getFlagDescription(flag string) string { case "rest-api": return "address where the head node REST API will listen on" case "runtime-path": - return "Blockless Runtime location (used by the worker node)" + return "Bless Runtime location (used by the worker node)" case "runtime-cli": return "runtime CLI name (used by the worker node)" case "cpu-percentage-limit": - return "amount of CPU time allowed for Blockless Functions in the 0-1 range, 1 being unlimited" + return "amount of CPU time allowed for Bless Functions in the 0-1 range, 1 being unlimited" case "memory-limit": - return "memory limit (kB) for Blockless Functions" + return "memory limit (kB) for Bless Functions" case "no-dialback-peers": return "start without dialing back peers from previous runs" case "must-reach-boot-nodes": diff --git a/config/config_options.go b/config/config_options.go index d2c90c79..a49d4bfb 100644 --- a/config/config_options.go +++ b/config/config_options.go @@ -5,7 +5,7 @@ import ( "reflect" "strings" - "github.com/blocklessnetwork/b7s/models/blockless" + "github.com/blessnetwork/b7s/models/bls" ) type ConfigOption struct { @@ -128,7 +128,7 @@ func envName(name string, parents ...string) string { } var components []string - components = append(components, strings.TrimSuffix(blockless.EnvPrefix, EnvDelimiter)) // Trim trailing underscore so we don't repeat it. + components = append(components, strings.TrimSuffix(bls.EnvPrefix, EnvDelimiter)) // Trim trailing underscore so we don't repeat it. components = append(components, parts...) components = append(components, formattedName) diff --git a/config/load.go b/config/load.go index fe62e638..abc6774a 100644 --- a/config/load.go +++ b/config/load.go @@ -13,7 +13,7 @@ import ( "github.com/knadh/koanf/v2" "github.com/spf13/pflag" - "github.com/blocklessnetwork/b7s/models/blockless" + "github.com/blessnetwork/b7s/models/bls" ) const ( @@ -43,7 +43,7 @@ func load(args []string) (*Config, error) { delimiter := defaultDelimiter konfig := koanf.New(delimiter) - err = konfig.Load(env.ProviderWithValue(blockless.EnvPrefix, EnvDelimiter, envClean), nil) + err = konfig.Load(env.ProviderWithValue(bls.EnvPrefix, EnvDelimiter, envClean), nil) if err != nil { return nil, fmt.Errorf("could not load configuration from env: %w", err) } @@ -101,7 +101,7 @@ func cliFlagTranslate(mapping map[string]string, fs *pflag.FlagSet) func(*pflag. // Koanf then uses the underscore to determine structure and in which section the config option belongs. func envClean(key string, value string) (string, any) { - key = strings.TrimPrefix(key, blockless.EnvPrefix) + key = strings.TrimPrefix(key, bls.EnvPrefix) sections := strings.Split(key, EnvDelimiter) cleaned := make([]string, 0, len(sections)) diff --git a/config/load_test.go b/config/load_test.go index 1f1ac082..408833d4 100644 --- a/config/load_test.go +++ b/config/load_test.go @@ -173,7 +173,7 @@ func TestConfig_CLIArgsWithConfigFile(t *testing.T) { filepath := writeConfigFile(t, cfgMap) - // NOTE: For compatiblity with Windows we will manually append config param later because `shlex.Split` doesn't jive with Windows paths. + // NOTE: For compatibility with Windows we will manually append config param later because `shlex.Split` doesn't jive with Windows paths. cmdline := fmt.Sprintf( "--role %v --runtime-path %v --concurrency %v --workspace %v --boot-nodes %v --log-level %v --address %v --port %v --cpu-percentage-limit %v --rest-api %v", role, diff --git a/configs/head-config.yaml b/configs/head-config.yaml index 9a71278e..2f9987bb 100644 --- a/configs/head-config.yaml +++ b/configs/head-config.yaml @@ -2,7 +2,7 @@ node: name: head#1 ip: 0.0.0.0 port: 9527 - key_path: /Users/derekanderson/Projects/blockless/net2/configs/testkeys/ident1/priv.bin + key_path: /Users/derekanderson/Projects/bless/net2/configs/testkeys/ident1/priv.bin use_static_keys: true workspace_root: /tmp/head runtime_path: /tmp/runtime diff --git a/configs/worker-config.yaml b/configs/worker-config.yaml index ea93c47c..a6a149b0 100644 --- a/configs/worker-config.yaml +++ b/configs/worker-config.yaml @@ -3,7 +3,7 @@ node: ip: 0.0.0.0 # 0 means random port port: 0 - key_path: /Users/derekanderson/Projects/blockless/net2/configs/testkeys/ident2/priv.bin + key_path: /Users/derekanderson/Projects/bless/net2/configs/testkeys/ident2/priv.bin boot_nodes: - /ip4/0.0.0.0/tcp/9527/p2p/12D3KooWH9GerdSEroL2nqjpd2GuE5dwmqNi7uHX7FoywBdKcP4q workspace_root: /tmp/worker diff --git a/consensus/consensus.go b/consensus/consensus.go index 05b4dad6..44da2d19 100644 --- a/consensus/consensus.go +++ b/consensus/consensus.go @@ -5,7 +5,7 @@ import ( "strings" ) -// Type identifies consensus protocols suported by Blockless. +// Type identifies consensus protocols suported by Bless. type Type uint const ( diff --git a/consensus/pbft/config.go b/consensus/pbft/config.go index 5ba9d01b..14bf04a6 100644 --- a/consensus/pbft/config.go +++ b/consensus/pbft/config.go @@ -5,9 +5,9 @@ import ( "github.com/libp2p/go-libp2p/core/peer" - "github.com/blocklessnetwork/b7s/metadata" - "github.com/blocklessnetwork/b7s/models/execute" - "github.com/blocklessnetwork/b7s/telemetry/tracing" + "github.com/blessnetwork/b7s/metadata" + "github.com/blessnetwork/b7s/models/execute" + "github.com/blessnetwork/b7s/telemetry/tracing" ) // Option can be used to set PBFT configuration options. diff --git a/consensus/pbft/execute.go b/consensus/pbft/execute.go index 2de63e1a..e5098905 100644 --- a/consensus/pbft/execute.go +++ b/consensus/pbft/execute.go @@ -8,11 +8,11 @@ import ( "github.com/armon/go-metrics" "github.com/libp2p/go-libp2p/core/peer" - "github.com/blocklessnetwork/b7s/models/blockless" - "github.com/blocklessnetwork/b7s/models/codes" - "github.com/blocklessnetwork/b7s/models/execute" - "github.com/blocklessnetwork/b7s/models/response" - "github.com/blocklessnetwork/b7s/telemetry/tracing" + "github.com/blessnetwork/b7s/models/bls" + "github.com/blessnetwork/b7s/models/codes" + "github.com/blessnetwork/b7s/models/execute" + "github.com/blessnetwork/b7s/models/response" + "github.com/blessnetwork/b7s/telemetry/tracing" ) // Execute fullfils the consensus interface by inserting the request into the pipeline. @@ -111,7 +111,7 @@ func (r *Replica) execute(ctx context.Context, view uint, sequence uint, digest } msg := response.WorkOrder{ - BaseMessage: blockless.BaseMessage{TraceInfo: r.cfg.TraceInfo}, + BaseMessage: bls.BaseMessage{TraceInfo: r.cfg.TraceInfo}, Code: res.Code, RequestID: request.ID, Result: nres, @@ -125,7 +125,7 @@ func (r *Replica) execute(ctx context.Context, view uint, sequence uint, digest proc(request.ID, request.Origin, request.Execute, nres) } - err = r.send(ctx, request.Origin, &msg, blockless.ProtocolID) + err = r.send(ctx, request.Origin, &msg, bls.ProtocolID) if err != nil { return fmt.Errorf("could not send execution response to node (target: %s, request: %s): %w", request.Origin.String(), request.ID, err) } diff --git a/consensus/pbft/message.go b/consensus/pbft/message.go index 74ce0b63..e8deac9a 100644 --- a/consensus/pbft/message.go +++ b/consensus/pbft/message.go @@ -6,8 +6,8 @@ import ( "github.com/libp2p/go-libp2p/core/peer" - "github.com/blocklessnetwork/b7s/models/execute" - "github.com/blocklessnetwork/b7s/telemetry/tracing" + "github.com/blessnetwork/b7s/models/execute" + "github.com/blessnetwork/b7s/telemetry/tracing" ) type PBFTMessage interface { diff --git a/consensus/pbft/pbft.go b/consensus/pbft/pbft.go index a5477ca1..5d209749 100644 --- a/consensus/pbft/pbft.go +++ b/consensus/pbft/pbft.go @@ -19,11 +19,11 @@ import ( "github.com/libp2p/go-libp2p/core/peer" "github.com/libp2p/go-libp2p/core/protocol" - "github.com/blocklessnetwork/b7s/consensus" - "github.com/blocklessnetwork/b7s/host" - "github.com/blocklessnetwork/b7s/models/blockless" - "github.com/blocklessnetwork/b7s/telemetry/b7ssemconv" - "github.com/blocklessnetwork/b7s/telemetry/tracing" + "github.com/blessnetwork/b7s/consensus" + "github.com/blessnetwork/b7s/host" + "github.com/blessnetwork/b7s/models/bls" + "github.com/blessnetwork/b7s/telemetry/b7ssemconv" + "github.com/blessnetwork/b7s/telemetry/tracing" ) // TODO (pbft): Request timestamp - execution exactly once, prevent multiple/out of order executions. @@ -42,7 +42,7 @@ type Replica struct { // Components. log zerolog.Logger host *host.Host - executor blockless.Executor + executor bls.Executor // Cluster identity. id peer.ID @@ -59,7 +59,7 @@ type Replica struct { } // NewReplica creates a new PBFT replica. -func NewReplica(log zerolog.Logger, host *host.Host, executor blockless.Executor, peers []peer.ID, clusterID string, options ...Option) (*Replica, error) { +func NewReplica(log zerolog.Logger, host *host.Host, executor bls.Executor, peers []peer.ID, clusterID string, options ...Option) (*Replica, error) { total := uint(len(peers)) diff --git a/consensus/pbft/pbft_test.go b/consensus/pbft/pbft_test.go index b6118ce5..4bff829a 100644 --- a/consensus/pbft/pbft_test.go +++ b/consensus/pbft/pbft_test.go @@ -5,8 +5,8 @@ import ( "github.com/stretchr/testify/require" - "github.com/blocklessnetwork/b7s/host" - "github.com/blocklessnetwork/b7s/testing/mocks" + "github.com/blessnetwork/b7s/host" + "github.com/blessnetwork/b7s/testing/mocks" ) const ( diff --git a/consensus/pbft/request.go b/consensus/pbft/request.go index cdc63a77..87b273b9 100644 --- a/consensus/pbft/request.go +++ b/consensus/pbft/request.go @@ -6,7 +6,7 @@ import ( "github.com/libp2p/go-libp2p/core/peer" - "github.com/blocklessnetwork/b7s/models/blockless" + "github.com/blessnetwork/b7s/models/bls" ) func (r *Replica) processRequest(ctx context.Context, from peer.ID, req Request) error { @@ -32,7 +32,7 @@ func (r *Replica) processRequest(ctx context.Context, from peer.ID, req Request) if ok { log.Info().Msg("request already executed, sending result to client") - err := r.send(ctx, req.Origin, &result, blockless.ProtocolID) + err := r.send(ctx, req.Origin, &result, bls.ProtocolID) if err != nil { return fmt.Errorf("could not send execution result back to client (request: %s, client: %s): %w", req.ID, req.Origin.String(), err) } diff --git a/consensus/pbft/serialization_test.go b/consensus/pbft/serialization_test.go index 948bfbc0..4ce403b7 100644 --- a/consensus/pbft/serialization_test.go +++ b/consensus/pbft/serialization_test.go @@ -8,7 +8,7 @@ import ( "github.com/libp2p/go-libp2p/core/peer" "github.com/stretchr/testify/require" - "github.com/blocklessnetwork/b7s/testing/mocks" + "github.com/blessnetwork/b7s/testing/mocks" ) var ( diff --git a/consensus/pbft/signature_test.go b/consensus/pbft/signature_test.go index 8decfc3f..f5f18ce3 100644 --- a/consensus/pbft/signature_test.go +++ b/consensus/pbft/signature_test.go @@ -6,7 +6,7 @@ import ( "github.com/stretchr/testify/require" - "github.com/blocklessnetwork/b7s/testing/mocks" + "github.com/blessnetwork/b7s/testing/mocks" ) func TestSign_PrePrepare(t *testing.T) { diff --git a/consensus/pbft/state.go b/consensus/pbft/state.go index 2bb59e66..e3864451 100644 --- a/consensus/pbft/state.go +++ b/consensus/pbft/state.go @@ -3,7 +3,7 @@ package pbft import ( "sync" - "github.com/blocklessnetwork/b7s/models/response" + "github.com/blessnetwork/b7s/models/response" ) type replicaState struct { diff --git a/consensus/pbft/tracing.go b/consensus/pbft/tracing.go index 9d2dc40d..76d25f83 100644 --- a/consensus/pbft/tracing.go +++ b/consensus/pbft/tracing.go @@ -5,8 +5,8 @@ import ( "encoding/json" "fmt" - "github.com/blocklessnetwork/b7s/models/blockless" - "github.com/blocklessnetwork/b7s/telemetry/tracing" + "github.com/blessnetwork/b7s/models/bls" + "github.com/blessnetwork/b7s/telemetry/tracing" ) const ( @@ -16,7 +16,7 @@ const ( ) func saveTraceContext(ctx context.Context, msg any) { - tmsg, ok := msg.(blockless.TraceableMessage) + tmsg, ok := msg.(bls.TraceableMessage) if !ok { return } @@ -41,7 +41,7 @@ func messageType(msg any) string { return pmsg.Type().String() } - bmsg, ok := msg.(blockless.Message) + bmsg, ok := msg.(bls.Message) if ok { return bmsg.Type() } diff --git a/consensus/raft/config.go b/consensus/raft/config.go index 5ecb4274..074a5a0b 100644 --- a/consensus/raft/config.go +++ b/consensus/raft/config.go @@ -7,7 +7,7 @@ import ( "github.com/hashicorp/raft" "github.com/rs/zerolog" - "github.com/blocklessnetwork/b7s/log/hclog" + "github.com/blessnetwork/b7s/log/hclog" ) // Option can be used to set Raft configuration options. diff --git a/consensus/raft/execute.go b/consensus/raft/execute.go index d7a54666..f99c98e9 100644 --- a/consensus/raft/execute.go +++ b/consensus/raft/execute.go @@ -7,8 +7,8 @@ import ( "github.com/libp2p/go-libp2p/core/peer" - "github.com/blocklessnetwork/b7s/models/codes" - "github.com/blocklessnetwork/b7s/models/execute" + "github.com/blessnetwork/b7s/models/codes" + "github.com/blessnetwork/b7s/models/execute" ) func (r *Replica) Execute(from peer.ID, requestID string, timestamp time.Time, req execute.Request) (codes.Code, execute.Result, error) { diff --git a/consensus/raft/fsm.go b/consensus/raft/fsm.go index 1e7d8f1c..9cdd30e7 100644 --- a/consensus/raft/fsm.go +++ b/consensus/raft/fsm.go @@ -12,8 +12,8 @@ import ( "github.com/libp2p/go-libp2p/core/peer" "github.com/rs/zerolog" - "github.com/blocklessnetwork/b7s/models/blockless" - "github.com/blocklessnetwork/b7s/models/execute" + "github.com/blessnetwork/b7s/models/bls" + "github.com/blessnetwork/b7s/models/execute" ) type FSMLogEntry struct { @@ -26,11 +26,11 @@ type FSMProcessFunc func(req FSMLogEntry, res execute.NodeResult) type fsmExecutor struct { log zerolog.Logger - executor blockless.Executor + executor bls.Executor processors []FSMProcessFunc } -func newFsmExecutor(log zerolog.Logger, executor blockless.Executor, processors ...FSMProcessFunc) *fsmExecutor { +func newFsmExecutor(log zerolog.Logger, executor bls.Executor, processors ...FSMProcessFunc) *fsmExecutor { ps := make([]FSMProcessFunc, 0, len(processors)) ps = append(ps, processors...) diff --git a/consensus/raft/raft.go b/consensus/raft/raft.go index 11dc17eb..2cd73989 100644 --- a/consensus/raft/raft.go +++ b/consensus/raft/raft.go @@ -15,9 +15,9 @@ import ( libp2praft "github.com/libp2p/go-libp2p-raft" "github.com/libp2p/go-libp2p/core/peer" - "github.com/blocklessnetwork/b7s/consensus" - "github.com/blocklessnetwork/b7s/host" - "github.com/blocklessnetwork/b7s/models/blockless" + "github.com/blessnetwork/b7s/consensus" + "github.com/blessnetwork/b7s/host" + "github.com/blessnetwork/b7s/models/bls" ) type Replica struct { @@ -34,7 +34,7 @@ type Replica struct { // New creates a new raft replica, bootstraps the cluster and waits until a first leader is elected. We do this because // only after the election the cluster is really operational and ready to process requests. -func New(log zerolog.Logger, host *host.Host, workspace string, requestID string, executor blockless.Executor, peers []peer.ID, options ...Option) (*Replica, error) { +func New(log zerolog.Logger, host *host.Host, workspace string, requestID string, executor bls.Executor, peers []peer.ID, options ...Option) (*Replica, error) { // Step 1: Create a new raft replica. replica, err := newReplica(log, host, workspace, requestID, executor, peers, options...) @@ -88,7 +88,7 @@ func (r *Replica) Consensus() consensus.Type { return consensus.Raft } -func newReplica(log zerolog.Logger, host *host.Host, workspace string, requestID string, executor blockless.Executor, peers []peer.ID, options ...Option) (*Replica, error) { +func newReplica(log zerolog.Logger, host *host.Host, workspace string, requestID string, executor bls.Executor, peers []peer.ID, options ...Option) (*Replica, error) { if len(peers) == 0 { return nil, errors.New("empty peer list") @@ -153,7 +153,7 @@ func newReplica(log zerolog.Logger, host *host.Host, workspace string, requestID peers: peers, } - rh.log.Info().Strs("peers", blockless.PeerIDsToStr(peers)).Msg("created new raft handler") + rh.log.Info().Strs("peers", bls.PeerIDsToStr(peers)).Msg("created new raft handler") return &rh, nil } diff --git a/docker/Dockerfile b/docker/Dockerfile index eca662ce..fffbbdf9 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -11,12 +11,9 @@ RUN curl -o ./gomplate -sSL https://github.com/hairyhenderson/gomplate/releases/ RUN chmod 755 gomplate # get the runtime -RUN curl -o ./runtime.tar.gz -sSL https://github.com/blocklessnetwork/runtime/releases/download/v0.3.5/blockless-runtime.ubuntu-20.04.x86_64.tar.gz +RUN curl -o ./runtime.tar.gz -sSL https://github.com/blessnetwork/bls-runtime/releases/download/v0.3.5/blockless-runtime.ubuntu-20.04.x86_64.tar.gz RUN mkdir /app/runtime && tar -xvkf ./runtime.tar.gz -C /app/runtime -# install blockchain client -# RUN curl https://raw.githubusercontent.com/blocklessnetwork/orchestration-chain/main/download.sh | bash - # libssl 1.1 RUN curl -o ./libssl.deb -sSL http://archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.1f-1ubuntu2_amd64.deb RUN dpkg -i ./libssl.deb diff --git a/docker/akash.sdl.md b/docker/akash.sdl.md index f5404026..9dc83ea4 100644 --- a/docker/akash.sdl.md +++ b/docker/akash.sdl.md @@ -2,7 +2,7 @@ This is a pretty easy process documented here! -Here is the `Akash` SDL used to launch a `worker` node on `Blockless`! +Here is the `Akash` SDL used to launch a `worker` node on `Bless`! ```yaml # this is an example of launching a node on akash diff --git a/docker/integration-tests/Dockerfile.testing b/docker/integration-tests/Dockerfile.testing index dd39f251..8b10dcec 100644 --- a/docker/integration-tests/Dockerfile.testing +++ b/docker/integration-tests/Dockerfile.testing @@ -15,7 +15,7 @@ RUN rm -rf /usr/local/go && tar -C /usr/local -xzf go1.21.0.linux-amd64.tar.gz ENV PATH=$PATH:/usr/local/go/bin # get the runtime -RUN curl -o ./runtime.tar.gz -sSL https://github.com/blocklessnetwork/runtime/releases/download/v0.3.1/blockless-runtime.linux-latest.x86_64.tar.gz +RUN curl -o ./runtime.tar.gz -sSL https://github.com/blessnetwork/bls-runtime/releases/download/v0.3.1/blockless-runtime.linux-latest.x86_64.tar.gz RUN mkdir /app/runtime && tar -xvkf ./runtime.tar.gz -C /app/runtime diff --git a/docs/function_manifest_spec.md b/docs/function_manifest_spec.md index 8158932a..5841104d 100644 --- a/docs/function_manifest_spec.md +++ b/docs/function_manifest_spec.md @@ -7,7 +7,7 @@ this is the `json` specification for the manifests that describe how a function "version" : 2.0, "function": { // organization and function identifier - "id": "org.blockless.functions.myfunction", + "id": "org.bless.functions.myfunction", // descriptive name of the function "name": "The Best Little Function In TX (Labs)", @@ -28,7 +28,7 @@ this is the `json` specification for the manifests that describe how a function // to retrieve the package "cid": "basy1234566", - // because we want blockless to remain decoupled + // because we want bless to remain decoupled // a uri can also be specified to retrieve the package "uri": "basy1234566", diff --git a/docs/worker_roll_call.md b/docs/worker_roll_call.md index 63144c54..a9c5d1a8 100644 --- a/docs/worker_roll_call.md +++ b/docs/worker_roll_call.md @@ -1,7 +1,7 @@  ```text -title Blockless Node Execute Communication Flow +title Bless Node Execute Communication Flow Work Request->Head: Request to work from Chain / API Head->PubSub: Roll Call note right of PubSub: Workers inventory installed functions, and capactity diff --git a/download.sh b/download.sh index 468879bf..4064eb56 100755 --- a/download.sh +++ b/download.sh @@ -69,19 +69,19 @@ function install { VERSION=${1:-$DEFAULT_VERSION} case "${OS}_${ARCH}" in "darwin_amd64") - URL="https://github.com/blocklessnetwork/b7s/releases/download/${VERSION}/b7s-darwin.amd64.tar.gz" + URL="https://github.com/blessnetwork/b7s/releases/download/${VERSION}/b7s-darwin.amd64.tar.gz" FTYPE=".tar.gz" ;; "darwin_arm64") - URL="https://github.com/blocklessnetwork/b7s/releases/download/${VERSION}/b7s-darwin.arm64.tar.gz" + URL="https://github.com/blessnetwork/b7s/releases/download/${VERSION}/b7s-darwin.arm64.tar.gz" FTYPE=".tar.gz" ;; "linux_amd64") - URL="https://github.com/blocklessnetwork/b7s/releases/download/${VERSION}/b7s-linux.amd64.tar.gz" + URL="https://github.com/blessnetwork/b7s/releases/download/${VERSION}/b7s-linux.amd64.tar.gz" FTYPE=".tar.gz" ;; "linux_arm64") - URL="https://github.com/blocklessnetwork/b7s/releases/download/${VERSION}/b7s-linux.arm64.tar.gz" + URL="https://github.com/blessnetwork/b7s/releases/download/${VERSION}/b7s-linux.arm64.tar.gz" FTYPE=".tar.gz" ;; *) fail "No asset for platform ${OS}-${ARCH}";; diff --git a/executor/command.go b/executor/command.go index 39d7359e..93a4484e 100644 --- a/executor/command.go +++ b/executor/command.go @@ -8,7 +8,7 @@ import ( "path/filepath" "strings" - "github.com/blocklessnetwork/b7s/models/execute" + "github.com/blessnetwork/b7s/models/execute" ) // createCmd will create the command to be executed, prepare working directory, environment, standard input and all else. diff --git a/executor/command_internal_test.go b/executor/command_internal_test.go index ee55d098..b1155af4 100644 --- a/executor/command_internal_test.go +++ b/executor/command_internal_test.go @@ -10,9 +10,9 @@ import ( "github.com/stretchr/testify/require" - "github.com/blocklessnetwork/b7s/models/blockless" - "github.com/blocklessnetwork/b7s/models/execute" - "github.com/blocklessnetwork/b7s/testing/mocks" + "github.com/blessnetwork/b7s/models/bls" + "github.com/blessnetwork/b7s/models/execute" + "github.com/blessnetwork/b7s/testing/mocks" ) func TestExecute_CreateCMD(t *testing.T) { @@ -25,7 +25,7 @@ func TestExecute_CreateCMD(t *testing.T) { runtimeLogger = "whatever.log" limitedMemory = 256 - executablePath = filepath.Join(runtimeDir, blockless.RuntimeCLI()) + executablePath = filepath.Join(runtimeDir, bls.RuntimeCLI()) requestID = mocks.GenericUUID.String() stdin = "dummy stdin payload" @@ -48,7 +48,7 @@ func TestExecute_CreateCMD(t *testing.T) { cfg: Config{ RuntimeDir: runtimeDir, WorkDir: workdir, - ExecutableName: blockless.RuntimeCLI(), + ExecutableName: bls.RuntimeCLI(), }, } paths := executor.generateRequestPaths(requestID, functionID, functionMethod) diff --git a/executor/config.go b/executor/config.go index 53f4dadf..677339af 100644 --- a/executor/config.go +++ b/executor/config.go @@ -4,14 +4,14 @@ import ( "github.com/armon/go-metrics" "github.com/spf13/afero" - "github.com/blocklessnetwork/b7s/models/blockless" + "github.com/blessnetwork/b7s/models/bls" ) // defaultConfig used to create Executor. var defaultConfig = Config{ WorkDir: "workspace", RuntimeDir: "", - ExecutableName: blockless.RuntimeCLI(), + ExecutableName: bls.RuntimeCLI(), FS: afero.NewOsFs(), Limiter: &noopLimiter{}, DriversRootPath: "", diff --git a/executor/execute_function.go b/executor/execute_function.go index b3ae5306..6244d6b2 100644 --- a/executor/execute_function.go +++ b/executor/execute_function.go @@ -8,12 +8,12 @@ import ( "github.com/armon/go-metrics" "go.opentelemetry.io/otel/trace" - "github.com/blocklessnetwork/b7s/models/codes" - "github.com/blocklessnetwork/b7s/models/execute" - "github.com/blocklessnetwork/b7s/telemetry/tracing" + "github.com/blessnetwork/b7s/models/codes" + "github.com/blessnetwork/b7s/models/execute" + "github.com/blessnetwork/b7s/telemetry/tracing" ) -// ExecuteFunction will run the Blockless function defined by the execution request. +// ExecuteFunction will run the Bless function defined by the execution request. func (e *Executor) ExecuteFunction(ctx context.Context, requestID string, req execute.Request) (result execute.Result, retErr error) { ml := []metrics.Label{{Name: "function", Value: req.FunctionID}} @@ -61,7 +61,7 @@ func (e *Executor) ExecuteFunction(ctx context.Context, requestID string, req ex return res, nil } -// executeFunction handles the actual execution of the Blockless function. It returns the +// executeFunction handles the actual execution of the Bless function. It returns the // execution information like standard output, standard error, exit code and resource usage. func (e *Executor) executeFunction(requestID string, req execute.Request) (execute.RuntimeOutput, execute.Usage, error) { diff --git a/executor/execute_ux.go b/executor/execute_ux.go index 3d6fded6..c36560ef 100644 --- a/executor/execute_ux.go +++ b/executor/execute_ux.go @@ -9,8 +9,8 @@ import ( "os/exec" "time" - "github.com/blocklessnetwork/b7s/executor/internal/process" - "github.com/blocklessnetwork/b7s/models/execute" + "github.com/blessnetwork/b7s/executor/internal/process" + "github.com/blessnetwork/b7s/models/execute" ) // executeCommand on non-windows systems is pretty straightforward and equivalent to the ordinary `cmd.Run()` or `cmd.Output`. diff --git a/executor/execute_windows.go b/executor/execute_windows.go index 6ad17a64..fdf159bb 100644 --- a/executor/execute_windows.go +++ b/executor/execute_windows.go @@ -11,8 +11,8 @@ import ( "golang.org/x/sys/windows" - "github.com/blocklessnetwork/b7s/executor/internal/process" - "github.com/blocklessnetwork/b7s/models/execute" + "github.com/blessnetwork/b7s/executor/internal/process" + "github.com/blessnetwork/b7s/models/execute" ) // executeCommand on Windows contains some dark sorcery. On Windows, the `rusage` equivalent does not include diff --git a/executor/executor.go b/executor/executor.go index 44f725da..091a454e 100644 --- a/executor/executor.go +++ b/executor/executor.go @@ -9,7 +9,7 @@ import ( "github.com/armon/go-metrics" "github.com/rs/zerolog" - "github.com/blocklessnetwork/b7s/telemetry/tracing" + "github.com/blessnetwork/b7s/telemetry/tracing" ) // Executor provides the capabilities to run external applications. diff --git a/executor/executor_integration_test.go b/executor/executor_integration_test.go index 88fee46c..7591c1c1 100644 --- a/executor/executor_integration_test.go +++ b/executor/executor_integration_test.go @@ -16,12 +16,12 @@ import ( "github.com/prometheus/client_golang/prometheus" "github.com/stretchr/testify/require" - "github.com/blocklessnetwork/b7s/executor" - "github.com/blocklessnetwork/b7s/models/codes" - "github.com/blocklessnetwork/b7s/models/execute" - "github.com/blocklessnetwork/b7s/telemetry" - "github.com/blocklessnetwork/b7s/testing/helpers" - "github.com/blocklessnetwork/b7s/testing/mocks" + "github.com/blessnetwork/b7s/executor" + "github.com/blessnetwork/b7s/models/codes" + "github.com/blessnetwork/b7s/models/execute" + "github.com/blessnetwork/b7s/telemetry" + "github.com/blessnetwork/b7s/testing/helpers" + "github.com/blessnetwork/b7s/testing/mocks" ) const ( diff --git a/executor/executor_test.go b/executor/executor_test.go index 38f7bab6..f91c0f86 100644 --- a/executor/executor_test.go +++ b/executor/executor_test.go @@ -8,9 +8,9 @@ import ( "github.com/spf13/afero" "github.com/stretchr/testify/require" - "github.com/blocklessnetwork/b7s/executor" - "github.com/blocklessnetwork/b7s/models/blockless" - "github.com/blocklessnetwork/b7s/testing/mocks" + "github.com/blessnetwork/b7s/executor" + "github.com/blessnetwork/b7s/models/bls" + "github.com/blessnetwork/b7s/testing/mocks" ) func TestExecutor_Create(t *testing.T) { @@ -18,7 +18,7 @@ func TestExecutor_Create(t *testing.T) { var ( runtimeDir = os.TempDir() - cliPath = filepath.Join(runtimeDir, blockless.RuntimeCLI()) + cliPath = filepath.Join(runtimeDir, bls.RuntimeCLI()) fs = afero.NewMemMapFs() ) diff --git a/executor/internal/process/usage.go b/executor/internal/process/usage.go index b5768e55..11cf9d5c 100644 --- a/executor/internal/process/usage.go +++ b/executor/internal/process/usage.go @@ -4,7 +4,7 @@ import ( "fmt" "os/exec" - "github.com/blocklessnetwork/b7s/models/execute" + "github.com/blessnetwork/b7s/models/execute" ) // GetUsage returns the resource usage information about the executed process. diff --git a/executor/limiter.go b/executor/limiter.go index b7580f52..d3482fde 100644 --- a/executor/limiter.go +++ b/executor/limiter.go @@ -1,7 +1,7 @@ package executor import ( - "github.com/blocklessnetwork/b7s/models/execute" + "github.com/blessnetwork/b7s/models/execute" ) // noopLimiter is a dummy limiter used when processes run without any resource limitations. diff --git a/executor/limits.go b/executor/limits.go index 10631f9d..9a7a71cb 100644 --- a/executor/limits.go +++ b/executor/limits.go @@ -1,7 +1,7 @@ package executor import ( - "github.com/blocklessnetwork/b7s/models/execute" + "github.com/blessnetwork/b7s/models/execute" ) type Limiter interface { diff --git a/executor/limits/config_internal_test.go b/executor/limits/config_internal_test.go index d97511eb..52f56169 100644 --- a/executor/limits/config_internal_test.go +++ b/executor/limits/config_internal_test.go @@ -8,7 +8,7 @@ import ( func TestConfig_Cgroup(t *testing.T) { - const cgroup = "/blockless-test" + const cgroup = "/bless-test" cfg := Config{ Cgroup: DefaultCgroup, @@ -44,7 +44,7 @@ func TestConfig_WithMemoryKB(t *testing.T) { func TestConfig_JobName(t *testing.T) { - const jobName = "blockless-test" + const jobName = "bless-test" cfg := Config{ JobName: DefaultJobObjectName, diff --git a/executor/limits/limits_gen.go b/executor/limits/limits_gen.go index 8aca52c1..776b7db3 100644 --- a/executor/limits/limits_gen.go +++ b/executor/limits/limits_gen.go @@ -6,7 +6,7 @@ package limits import ( "errors" - "github.com/blocklessnetwork/b7s/models/execute" + "github.com/blessnetwork/b7s/models/execute" ) // NOTE: Placeholder for operating systems where we do not support limiters yet. diff --git a/executor/limits/limits_linux.go b/executor/limits/limits_linux.go index b9d8026c..79adbabc 100644 --- a/executor/limits/limits_linux.go +++ b/executor/limits/limits_linux.go @@ -12,7 +12,7 @@ import ( "github.com/containerd/cgroups/v3" "github.com/containerd/cgroups/v3/cgroup2" - "github.com/blocklessnetwork/b7s/models/execute" + "github.com/blessnetwork/b7s/models/execute" ) // TODO: Add support for cgroups v1 - determine on the fly which version to use diff --git a/executor/limits/limits_linux_integration_test.go b/executor/limits/limits_linux_integration_test.go index bb210844..cee39414 100644 --- a/executor/limits/limits_linux_integration_test.go +++ b/executor/limits/limits_linux_integration_test.go @@ -13,8 +13,8 @@ import ( "github.com/stretchr/testify/require" - "github.com/blocklessnetwork/b7s/executor/limits" - "github.com/blocklessnetwork/b7s/models/execute" + "github.com/blessnetwork/b7s/executor/limits" + "github.com/blessnetwork/b7s/models/execute" ) const ( diff --git a/executor/limits/limits_windows.go b/executor/limits/limits_windows.go index 27ceb872..8b0488db 100644 --- a/executor/limits/limits_windows.go +++ b/executor/limits/limits_windows.go @@ -8,7 +8,7 @@ import ( "golang.org/x/sys/windows" - "github.com/blocklessnetwork/b7s/models/execute" + "github.com/blessnetwork/b7s/models/execute" ) type Limits struct { diff --git a/executor/limits/limits_windows_test.go b/executor/limits/limits_windows_test.go index 275d763a..e5d67b89 100644 --- a/executor/limits/limits_windows_test.go +++ b/executor/limits/limits_windows_test.go @@ -10,8 +10,8 @@ import ( "github.com/stretchr/testify/require" "golang.org/x/sys/windows" - "github.com/blocklessnetwork/b7s/executor/limits" - "github.com/blocklessnetwork/b7s/models/execute" + "github.com/blessnetwork/b7s/executor/limits" + "github.com/blessnetwork/b7s/models/execute" ) func TestLimits(t *testing.T) { diff --git a/executor/limits/params.go b/executor/limits/params.go index 7b55fa43..18266ba4 100644 --- a/executor/limits/params.go +++ b/executor/limits/params.go @@ -1,9 +1,9 @@ package limits const ( - DefaultCgroup = "/blockless" + DefaultCgroup = "/bless" DefaultMountpoint = "/sys/fs/cgroup" - DefaultJobObjectName = "blockless" + DefaultJobObjectName = "bless" // Default percentage of the CPU allowed. By default we run unlimited. DefaultCPUPercentage = 1.0 diff --git a/executor/path_internal_test.go b/executor/path_internal_test.go index fa1eeffe..20e09690 100644 --- a/executor/path_internal_test.go +++ b/executor/path_internal_test.go @@ -6,7 +6,7 @@ import ( "github.com/stretchr/testify/assert" - "github.com/blocklessnetwork/b7s/testing/mocks" + "github.com/blessnetwork/b7s/testing/mocks" ) func TestExecutor_RequestPaths(t *testing.T) { diff --git a/executor/runtime_flags.go b/executor/runtime_flags.go index 099d3366..064591a9 100644 --- a/executor/runtime_flags.go +++ b/executor/runtime_flags.go @@ -3,7 +3,7 @@ package executor import ( "fmt" - "github.com/blocklessnetwork/b7s/models/execute" + "github.com/blessnetwork/b7s/models/execute" ) // runtimeFlags returns flags that can be passed to the runtime, for example by `exec.Cmd`. diff --git a/executor/runtime_flags_test.go b/executor/runtime_flags_test.go index 744fe9da..9a929d05 100644 --- a/executor/runtime_flags_test.go +++ b/executor/runtime_flags_test.go @@ -6,7 +6,7 @@ import ( "github.com/stretchr/testify/require" - "github.com/blocklessnetwork/b7s/models/execute" + "github.com/blessnetwork/b7s/models/execute" ) func TestRuntimeFlags(t *testing.T) { diff --git a/fstore/deployment.go b/fstore/deployment.go index 6d224b88..7cdca0a8 100644 --- a/fstore/deployment.go +++ b/fstore/deployment.go @@ -4,12 +4,12 @@ import ( "fmt" "net/url" - "github.com/blocklessnetwork/b7s/models/blockless" + "github.com/blessnetwork/b7s/models/bls" ) // updateDeployment info will add some missing information to the deployment info, // based on the info found in the manifest URL. -func updateDeploymentInfo(manifest *blockless.FunctionManifest, manifestAddress string) error { +func updateDeploymentInfo(manifest *bls.FunctionManifest, manifestAddress string) error { // Parse the deployment address. deploymentURL, err := url.Parse(manifest.Runtime.URL) @@ -31,7 +31,7 @@ func updateDeploymentInfo(manifest *blockless.FunctionManifest, manifestAddress deploymentURL.Scheme = manifestURL.Scheme } - manifest.Deployment = blockless.Deployment{ + manifest.Deployment = bls.Deployment{ URI: deploymentURL.String(), Checksum: manifest.Runtime.Checksum, } diff --git a/fstore/deployment_internal_test.go b/fstore/deployment_internal_test.go index 6ae75d70..3a7b59ca 100644 --- a/fstore/deployment_internal_test.go +++ b/fstore/deployment_internal_test.go @@ -6,7 +6,7 @@ import ( "github.com/stretchr/testify/require" - "github.com/blocklessnetwork/b7s/models/blockless" + "github.com/blessnetwork/b7s/models/bls" ) func TestFunction_UpdateDeploymentInfo(t *testing.T) { @@ -20,12 +20,12 @@ func TestFunction_UpdateDeploymentInfo(t *testing.T) { manifestURL = "https://example.com" ) - manifest := blockless.FunctionManifest{ - Runtime: blockless.Runtime{ + manifest := bls.FunctionManifest{ + Runtime: bls.Runtime{ URL: runtimeURL, Checksum: checksum, }, - Deployment: blockless.Deployment{ + Deployment: bls.Deployment{ URI: "", Checksum: "", }, @@ -46,12 +46,12 @@ func TestFunction_UpdateDeploymentInfo(t *testing.T) { manifestURL = "https://example.com/manifest-address" ) - manifest := blockless.FunctionManifest{ - Runtime: blockless.Runtime{ + manifest := bls.FunctionManifest{ + Runtime: bls.Runtime{ URL: runtimeURL, Checksum: checksum, }, - Deployment: blockless.Deployment{ + Deployment: bls.Deployment{ URI: "", Checksum: "", }, @@ -81,12 +81,12 @@ func TestFunction_UpdateDeploymentInfo(t *testing.T) { manifestURL = "https://example.com/manifest-address" ) - manifest := blockless.FunctionManifest{ - Runtime: blockless.Runtime{ + manifest := bls.FunctionManifest{ + Runtime: bls.Runtime{ URL: runtimeURL, Checksum: checksum, }, - Deployment: blockless.Deployment{ + Deployment: bls.Deployment{ URI: "", Checksum: "", }, @@ -104,12 +104,12 @@ func TestFunction_UpdateDeploymentInfo(t *testing.T) { manifestURL = "https://example.com/manifest-address\r" ) - manifest := blockless.FunctionManifest{ - Runtime: blockless.Runtime{ + manifest := bls.FunctionManifest{ + Runtime: bls.Runtime{ URL: runtimeURL, Checksum: checksum, }, - Deployment: blockless.Deployment{ + Deployment: bls.Deployment{ URI: "", Checksum: "", }, diff --git a/fstore/fstore.go b/fstore/fstore.go index 6c912091..7861fb77 100644 --- a/fstore/fstore.go +++ b/fstore/fstore.go @@ -11,14 +11,14 @@ import ( "go.opentelemetry.io/otel" "go.opentelemetry.io/otel/trace" - "github.com/blocklessnetwork/b7s/models/blockless" + "github.com/blessnetwork/b7s/models/bls" ) // FStore - function store - deals with all of the function-related actions - saving/reading them from backing storage, // downloading them, unpacking them etc. type FStore struct { log zerolog.Logger - store blockless.FunctionStore + store bls.FunctionStore http *http.Client downloader *grab.Client @@ -30,7 +30,7 @@ type FStore struct { } // New creates a new function store. -func New(log zerolog.Logger, store blockless.FunctionStore, workdir string) *FStore { +func New(log zerolog.Logger, store bls.FunctionStore, workdir string) *FStore { // Create an HTTP client. cli := &http.Client{ diff --git a/fstore/fstore_integration_test.go b/fstore/fstore_integration_test.go index d6c914de..ee287666 100644 --- a/fstore/fstore_integration_test.go +++ b/fstore/fstore_integration_test.go @@ -16,12 +16,12 @@ import ( "github.com/stretchr/testify/require" - "github.com/blocklessnetwork/b7s/fstore" - "github.com/blocklessnetwork/b7s/models/blockless" - "github.com/blocklessnetwork/b7s/store" - "github.com/blocklessnetwork/b7s/store/codec" - "github.com/blocklessnetwork/b7s/testing/helpers" - "github.com/blocklessnetwork/b7s/testing/mocks" + "github.com/blessnetwork/b7s/fstore" + "github.com/blessnetwork/b7s/models/bls" + "github.com/blessnetwork/b7s/store" + "github.com/blessnetwork/b7s/store/codec" + "github.com/blessnetwork/b7s/testing/helpers" + "github.com/blessnetwork/b7s/testing/mocks" ) const ( @@ -115,14 +115,14 @@ func cleanupDisabled() bool { return os.Getenv(cleanupDisableEnv) == "yes" } -func getManifest(t *testing.T, url string) blockless.FunctionManifest { +func getManifest(t *testing.T, url string) bls.FunctionManifest { t.Helper() res, err := http.Get(url) require.NoError(t, err) defer res.Body.Close() - var manifest blockless.FunctionManifest + var manifest bls.FunctionManifest err = json.NewDecoder(res.Body).Decode(&manifest) require.NoError(t, err) diff --git a/fstore/get_test.go b/fstore/get_test.go index 3647657e..3067e55f 100644 --- a/fstore/get_test.go +++ b/fstore/get_test.go @@ -7,9 +7,9 @@ import ( "github.com/stretchr/testify/require" - "github.com/blocklessnetwork/b7s/fstore" - "github.com/blocklessnetwork/b7s/models/blockless" - "github.com/blocklessnetwork/b7s/testing/mocks" + "github.com/blessnetwork/b7s/fstore" + "github.com/blessnetwork/b7s/models/bls" + "github.com/blessnetwork/b7s/testing/mocks" ) func TestFunction_RetrieveHandlesErrors(t *testing.T) { @@ -24,8 +24,8 @@ func TestFunction_RetrieveHandlesErrors(t *testing.T) { defer os.RemoveAll(workdir) store := mocks.BaselineStore(t) - store.RetrieveFunctionFunc = func(context.Context, string) (blockless.FunctionRecord, error) { - return blockless.FunctionRecord{}, mocks.GenericError + store.RetrieveFunctionFunc = func(context.Context, string) (bls.FunctionRecord, error) { + return bls.FunctionRecord{}, mocks.GenericError } fh := fstore.New(mocks.NoopLogger, store, workdir) diff --git a/fstore/gzip_internal_test.go b/fstore/gzip_internal_test.go index 680c3ebf..fa0047fd 100644 --- a/fstore/gzip_internal_test.go +++ b/fstore/gzip_internal_test.go @@ -6,7 +6,7 @@ import ( "github.com/stretchr/testify/require" - "github.com/blocklessnetwork/b7s/testing/mocks" + "github.com/blessnetwork/b7s/testing/mocks" ) func TestFunction_UnpackArchive(t *testing.T) { diff --git a/fstore/http.go b/fstore/http.go index 345e5073..e94c772b 100644 --- a/fstore/http.go +++ b/fstore/http.go @@ -11,7 +11,7 @@ import ( "github.com/cavaliergopher/grab/v3" - "github.com/blocklessnetwork/b7s/models/blockless" + "github.com/blessnetwork/b7s/models/bls" ) func (f *FStore) getJSON(address string, out interface{}) error { @@ -35,7 +35,7 @@ func (f *FStore) getJSON(address string, out interface{}) error { // download will retrieve the function with the given manifest. It returns the full path // of the file where the function is saved on the local storage or any error that might have // occurred in the process. The function blocks until the download is complete. -func (f *FStore) download(ctx context.Context, cid string, manifest blockless.FunctionManifest) (string, error) { +func (f *FStore) download(ctx context.Context, cid string, manifest bls.FunctionManifest) (string, error) { // Determine directory where files should be stored. fdir := filepath.Join(f.workdir, cid) diff --git a/fstore/http_internal_test.go b/fstore/http_internal_test.go index a12f9279..c5b4af15 100644 --- a/fstore/http_internal_test.go +++ b/fstore/http_internal_test.go @@ -14,11 +14,11 @@ import ( "github.com/stretchr/testify/require" - "github.com/blocklessnetwork/b7s/models/blockless" - "github.com/blocklessnetwork/b7s/store" - "github.com/blocklessnetwork/b7s/store/codec" - "github.com/blocklessnetwork/b7s/testing/helpers" - "github.com/blocklessnetwork/b7s/testing/mocks" + "github.com/blessnetwork/b7s/models/bls" + "github.com/blessnetwork/b7s/store" + "github.com/blessnetwork/b7s/store/codec" + "github.com/blessnetwork/b7s/testing/helpers" + "github.com/blessnetwork/b7s/testing/mocks" ) func TestFunction_GetJSON(t *testing.T) { @@ -39,7 +39,7 @@ func TestFunction_GetJSON(t *testing.T) { store := store.New(helpers.InMemoryDB(t), codec.NewJSONCodec()) fh := New(mocks.NoopLogger, store, workdir) - var downloaded blockless.FunctionManifest + var downloaded bls.FunctionManifest err := fh.getJSON(srv.URL, &downloaded) require.NoError(t, err) @@ -78,8 +78,8 @@ func TestFunction_GetJSONHandlesErrors(t *testing.T) { "uri":"generic-uri" }, "runtime":{}, - "fs_root_path":"/var/tmp/blockless/", - "entry":"/var/tmp/blockless/app.wasm"`), // <- missing closing brace + "fs_root_path":"/var/tmp/bless/", + "entry":"/var/tmp/bless/app.wasm"`), // <- missing closing brace }, { name: "handles unexpected format", @@ -101,7 +101,7 @@ func TestFunction_GetJSONHandlesErrors(t *testing.T) { "uri":"generic-uri" }, "runtime":{}, - "fs_root_path":"/var/tmp/blockless/", + "fs_root_path":"/var/tmp/bless/", "entry":999 }`), }, @@ -127,7 +127,7 @@ func TestFunction_GetJSONHandlesErrors(t *testing.T) { fh := New(mocks.NoopLogger, newInMemoryStore(t), workdir) - var response blockless.FunctionManifest + var response bls.FunctionManifest err := fh.getJSON(srv.URL, &response) require.Error(t, err) }) @@ -158,8 +158,8 @@ func TestFunction_Download(t *testing.T) { address := fmt.Sprintf("%s/test-file", srv.URL) hash := sha256.Sum256(payload) - manifest := blockless.FunctionManifest{ - Deployment: blockless.Deployment{ + manifest := bls.FunctionManifest{ + Deployment: bls.Deployment{ URI: address, Checksum: fmt.Sprintf("%x", hash), }, @@ -207,8 +207,8 @@ func TestFunction_DownloadHandlesErrors(t *testing.T) { invalidChecksum := fmt.Sprintf("%x", hash) + "Z" - manifest := blockless.FunctionManifest{ - Deployment: blockless.Deployment{ + manifest := bls.FunctionManifest{ + Deployment: bls.Deployment{ URI: address, Checksum: invalidChecksum, }, @@ -229,8 +229,8 @@ func TestFunction_DownloadHandlesErrors(t *testing.T) { address := fmt.Sprintf("%s/test-file", srv.URL) + "\n" hash := sha256.Sum256(payload) - manifest := blockless.FunctionManifest{ - Deployment: blockless.Deployment{ + manifest := bls.FunctionManifest{ + Deployment: bls.Deployment{ URI: address, Checksum: fmt.Sprintf("%x", hash), }, @@ -253,8 +253,8 @@ func TestFunction_DownloadHandlesErrors(t *testing.T) { address := fmt.Sprintf("%s/test-file", srv.URL) hash := sha256.Sum256(payload) - manifest := blockless.FunctionManifest{ - Deployment: blockless.Deployment{ + manifest := bls.FunctionManifest{ + Deployment: bls.Deployment{ URI: address, Checksum: fmt.Sprintf("%x", hash), }, diff --git a/fstore/install.go b/fstore/install.go index b522055b..5db39fbf 100644 --- a/fstore/install.go +++ b/fstore/install.go @@ -9,8 +9,8 @@ import ( "go.opentelemetry.io/otel/trace" - "github.com/blocklessnetwork/b7s/models/blockless" - "github.com/blocklessnetwork/b7s/telemetry/b7ssemconv" + "github.com/blessnetwork/b7s/models/bls" + "github.com/blessnetwork/b7s/telemetry/b7ssemconv" ) // Install will download and install function identified by the manifest/CID. @@ -37,7 +37,7 @@ func (f *FStore) Install(ctx context.Context, address string, cid string) (retEr Msg("installing function") // Retrieve function manifest from the given address. - var manifest blockless.FunctionManifest + var manifest bls.FunctionManifest err := f.getJSON(address, &manifest) if err != nil { return fmt.Errorf("could not retrieve manifest: %w", err) @@ -70,7 +70,7 @@ func (f *FStore) Install(ctx context.Context, address string, cid string) (retEr manifest.Deployment.File = functionPath // Store the function record. - fn := blockless.FunctionRecord{ + fn := bls.FunctionRecord{ CID: cid, URL: address, Manifest: manifest, @@ -97,7 +97,7 @@ func (f *FStore) Install(ctx context.Context, address string, cid string) (retEr func (f *FStore) IsInstalled(cid string) (bool, error) { fn, err := f.getFunction(context.Background(), cid) - if err != nil && errors.Is(err, blockless.ErrNotFound) { + if err != nil && errors.Is(err, bls.ErrNotFound) { return false, nil } if err != nil { diff --git a/fstore/install_test.go b/fstore/install_test.go index 390f3ee1..37225f2a 100644 --- a/fstore/install_test.go +++ b/fstore/install_test.go @@ -15,12 +15,12 @@ import ( "github.com/stretchr/testify/require" - "github.com/blocklessnetwork/b7s/fstore" - "github.com/blocklessnetwork/b7s/models/blockless" - "github.com/blocklessnetwork/b7s/store" - "github.com/blocklessnetwork/b7s/store/codec" - "github.com/blocklessnetwork/b7s/testing/helpers" - "github.com/blocklessnetwork/b7s/testing/mocks" + "github.com/blessnetwork/b7s/fstore" + "github.com/blessnetwork/b7s/models/bls" + "github.com/blessnetwork/b7s/store" + "github.com/blessnetwork/b7s/store/codec" + "github.com/blessnetwork/b7s/testing/helpers" + "github.com/blessnetwork/b7s/testing/mocks" ) func TestFunction_Install(t *testing.T) { @@ -120,7 +120,7 @@ func TestFunction_InstallHandlesErrors(t *testing.T) { defer os.RemoveAll(workdir) store := mocks.BaselineStore(t) - store.SaveFunctionFunc = func(context.Context, blockless.FunctionRecord) error { + store.SaveFunctionFunc = func(context.Context, bls.FunctionRecord) error { return mocks.GenericError } @@ -179,8 +179,8 @@ func TestFunction_InstalledHandlesError(t *testing.T) { defer os.RemoveAll(workdir) store := mocks.BaselineStore(t) - store.RetrieveFunctionFunc = func(context.Context, string) (blockless.FunctionRecord, error) { - return blockless.FunctionRecord{}, mocks.GenericError + store.RetrieveFunctionFunc = func(context.Context, string) (bls.FunctionRecord, error) { + return bls.FunctionRecord{}, mocks.GenericError } fh := fstore.New(mocks.NoopLogger, store, workdir) @@ -201,8 +201,8 @@ func TestFunction_InstalledHandlesError(t *testing.T) { defer os.RemoveAll(workdir) store := mocks.BaselineStore(t) - store.RetrieveFunctionFunc = func(context.Context, string) (blockless.FunctionRecord, error) { - return blockless.FunctionRecord{}, blockless.ErrNotFound + store.RetrieveFunctionFunc = func(context.Context, string) (bls.FunctionRecord, error) { + return bls.FunctionRecord{}, bls.ErrNotFound } fh := fstore.New(mocks.NoopLogger, store, workdir) @@ -232,8 +232,8 @@ func createServers(t *testing.T, manifestURL string, functionURL string, functio // Setup manifest that points to the function server. functionAddress := fmt.Sprintf("%s/%s", fsrv.URL, functionURL) hash := sha256.Sum256(functionPayload) - sourceManifest := blockless.FunctionManifest{ - Deployment: blockless.Deployment{ + sourceManifest := bls.FunctionManifest{ + Deployment: bls.Deployment{ URI: functionAddress, Checksum: fmt.Sprintf("%x", hash), }, diff --git a/fstore/record.go b/fstore/record.go index 13fd793c..93c1bf43 100644 --- a/fstore/record.go +++ b/fstore/record.go @@ -5,25 +5,25 @@ import ( "fmt" "time" - "github.com/blocklessnetwork/b7s/models/blockless" + "github.com/blessnetwork/b7s/models/bls" ) // Get retrieves a function manifest for the given function from storage. -func (f *FStore) Get(ctx context.Context, cid string) (blockless.FunctionRecord, error) { +func (f *FStore) Get(ctx context.Context, cid string) (bls.FunctionRecord, error) { fn, err := f.getFunction(ctx, cid) if err != nil { - return blockless.FunctionRecord{}, fmt.Errorf("could not get function from store: %w", err) + return bls.FunctionRecord{}, fmt.Errorf("could not get function from store: %w", err) } return fn, nil } -func (f *FStore) getFunction(ctx context.Context, cid string) (blockless.FunctionRecord, error) { +func (f *FStore) getFunction(ctx context.Context, cid string) (bls.FunctionRecord, error) { function, err := f.store.RetrieveFunction(ctx, cid) if err != nil { - return blockless.FunctionRecord{}, fmt.Errorf("could not retrieve function record: %w", err) + return bls.FunctionRecord{}, fmt.Errorf("could not retrieve function record: %w", err) } go func() { @@ -38,7 +38,7 @@ func (f *FStore) getFunction(ctx context.Context, cid string) (blockless.Functio return function, nil } -func (f *FStore) saveFunction(ctx context.Context, fn blockless.FunctionRecord) error { +func (f *FStore) saveFunction(ctx context.Context, fn bls.FunctionRecord) error { // Clean paths - make them relative to the current working directory. fn.Archive = f.cleanPath(fn.Archive) diff --git a/fstore/sync.go b/fstore/sync.go index 420a8217..12922e62 100644 --- a/fstore/sync.go +++ b/fstore/sync.go @@ -9,8 +9,8 @@ import ( "github.com/hashicorp/go-multierror" "go.opentelemetry.io/otel/trace" - "github.com/blocklessnetwork/b7s/models/blockless" - "github.com/blocklessnetwork/b7s/telemetry/b7ssemconv" + "github.com/blessnetwork/b7s/models/bls" + "github.com/blessnetwork/b7s/telemetry/b7ssemconv" ) func (f *FStore) Sync(ctx context.Context, haltOnError bool) error { @@ -50,7 +50,7 @@ func (f *FStore) Sync(ctx context.Context, haltOnError bool) error { // Sync will verify that the function identified by `cid` is still found on the local filesystem. // If the function archive of function files are missing, they will be recreated. -func (f *FStore) sync(ctx context.Context, fn blockless.FunctionRecord) error { +func (f *FStore) sync(ctx context.Context, fn bls.FunctionRecord) error { ctx, span := f.tracer.Start(ctx, spanSync, trace.WithSpanKind(trace.SpanKindClient), trace.WithAttributes(b7ssemconv.FunctionCID.String(fn.CID))) defer span.End() @@ -122,7 +122,7 @@ func (f *FStore) sync(ctx context.Context, fn blockless.FunctionRecord) error { // checkFunctionFiles checks if the files required by the function are found on local storage. // It returns two booleans indicating presence of the archive file, the unpacked files, and a potential error. -func (f *FStore) checkFunctionFiles(fn blockless.FunctionRecord) (bool, bool, error) { +func (f *FStore) checkFunctionFiles(fn bls.FunctionRecord) (bool, bool, error) { // Check if the archive is found. archiveFound := true diff --git a/fstore/sync_internal_test.go b/fstore/sync_internal_test.go index ea792253..782a3485 100644 --- a/fstore/sync_internal_test.go +++ b/fstore/sync_internal_test.go @@ -7,8 +7,8 @@ import ( "github.com/stretchr/testify/require" - "github.com/blocklessnetwork/b7s/models/blockless" - "github.com/blocklessnetwork/b7s/testing/mocks" + "github.com/blessnetwork/b7s/models/bls" + "github.com/blessnetwork/b7s/testing/mocks" ) func TestFstore_CheckFunctionFiles(t *testing.T) { @@ -25,7 +25,7 @@ func TestFstore_CheckFunctionFiles(t *testing.T) { functionFileName = "function-file" ) - rec := blockless.FunctionRecord{ + rec := bls.FunctionRecord{ Archive: archiveName, Files: functionFileName, } diff --git a/go.mod b/go.mod index 9a1afebf..783cf010 100644 --- a/go.mod +++ b/go.mod @@ -1,10 +1,10 @@ -module github.com/blocklessnetwork/b7s +module github.com/blessnetwork/b7s go 1.23.2 require ( github.com/Microsoft/go-winio v0.6.1 - github.com/a-h/templ v0.2.778 + github.com/a-h/templ v0.3.819 github.com/armon/go-metrics v0.4.1 github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 github.com/blocklessnetwork/b7s-attributes v0.0.0 diff --git a/go.sum b/go.sum index eb84a35c..e4672f18 100644 --- a/go.sum +++ b/go.sum @@ -13,8 +13,8 @@ github.com/DataDog/zstd v1.5.6 h1:LbEglqepa/ipmmQJUDnSsfvA8e8IStVcGaFWDuxvGOY= github.com/DataDog/zstd v1.5.6/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw= github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow= github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM= -github.com/a-h/templ v0.2.778 h1:VzhOuvWECrwOec4790lcLlZpP4Iptt5Q4K9aFxQmtaM= -github.com/a-h/templ v0.2.778/go.mod h1:lq48JXoUvuQrU0VThrK31yFwdRjTCnIE5bcPCM9IP1w= +github.com/a-h/templ v0.3.819 h1:KDJ5jTFN15FyJnmSmo2gNirIqt7hfvBD2VXVDTySckM= +github.com/a-h/templ v0.3.819/go.mod h1:iDJKJktpttVKdWoTkRNNLcllRI+BlpopJc+8au3gOUo= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= diff --git a/host/config.go b/host/config.go index ea91857f..72ae8eb0 100644 --- a/host/config.go +++ b/host/config.go @@ -5,7 +5,7 @@ import ( "github.com/multiformats/go-multiaddr" - "github.com/blocklessnetwork/b7s/models/blockless" + "github.com/blessnetwork/b7s/models/bls" ) // defaultConfig used to create Host. @@ -26,7 +26,7 @@ type Config struct { ConnectionThreshold uint BootNodes []multiaddr.Multiaddr - DialBackPeers []blockless.Peer + DialBackPeers []bls.Peer DialBackPeersLimit uint DiscoveryInterval time.Duration ConnectionLimit uint @@ -66,7 +66,7 @@ func WithBootNodes(nodes []multiaddr.Multiaddr) func(*Config) { } // WithDialBackPeers specifies dial-back peers that the host initially tries to connect to. -func WithDialBackPeers(peers []blockless.Peer) func(*Config) { +func WithDialBackPeers(peers []bls.Peer) func(*Config) { return func(cfg *Config) { cfg.DialBackPeers = peers } diff --git a/host/discovery.go b/host/discovery.go index e9da3461..3573d210 100644 --- a/host/discovery.go +++ b/host/discovery.go @@ -12,7 +12,7 @@ import ( "github.com/multiformats/go-multiaddr" "golang.org/x/sync/errgroup" - "github.com/blocklessnetwork/b7s/models/blockless" + "github.com/blessnetwork/b7s/models/bls" ) func (h *Host) ConnectToKnownPeers(ctx context.Context) error { @@ -53,7 +53,7 @@ func (h *Host) ConnectToKnownPeers(ctx context.Context) error { func (h *Host) ConnectToBootNodes(ctx context.Context) error { // Bootstrap nodes we try to connect to on start. - var peers []blockless.Peer + var peers []bls.Peer for _, addr := range h.cfg.BootNodes { addrInfo, err := peer.AddrInfoFromP2pAddr(addr) @@ -67,7 +67,7 @@ func (h *Host) ConnectToBootNodes(ctx context.Context) error { continue } - node := blockless.Peer{ + node := bls.Peer{ ID: addrInfo.ID, AddrInfo: *addrInfo, } @@ -94,7 +94,7 @@ func (h *Host) ConnectToDialbackPeers(ctx context.Context) error { added := uint(0) addLimit := h.cfg.DialBackPeersLimit - var peers []blockless.Peer + var peers []bls.Peer for _, peer := range h.cfg.DialBackPeers { // If the limit of dial-back peers is set and we've reached it - stop now. @@ -129,7 +129,7 @@ func (h *Host) ConnectToDialbackPeers(ctx context.Context) error { return nil } -func (h *Host) connectToPeers(ctx context.Context, peers []blockless.Peer) error { +func (h *Host) connectToPeers(ctx context.Context, peers []bls.Peer) error { // Connect to the bootstrap nodes. var errGroup errgroup.Group diff --git a/host/notifiee.go b/host/notifiee.go index e3309653..b0670d6a 100644 --- a/host/notifiee.go +++ b/host/notifiee.go @@ -9,18 +9,18 @@ import ( "github.com/rs/zerolog" "go.opentelemetry.io/otel/trace" - "github.com/blocklessnetwork/b7s/models/blockless" - "github.com/blocklessnetwork/b7s/telemetry/b7ssemconv" - "github.com/blocklessnetwork/b7s/telemetry/tracing" + "github.com/blessnetwork/b7s/models/bls" + "github.com/blessnetwork/b7s/telemetry/b7ssemconv" + "github.com/blessnetwork/b7s/telemetry/tracing" ) type Notifiee struct { log zerolog.Logger - store blockless.PeerStore + store bls.PeerStore tracer *tracing.Tracer } -func NewNotifee(log zerolog.Logger, store blockless.PeerStore) *Notifiee { +func NewNotifee(log zerolog.Logger, store bls.PeerStore) *Notifiee { cn := Notifiee{ log: log.With().Str("component", "notifiee").Logger(), @@ -41,7 +41,7 @@ func (n *Notifiee) Connected(network network.Network, conn network.Conn) { maddr := conn.RemoteMultiaddr() laddr := conn.LocalMultiaddr() - peer := blockless.Peer{ + peer := bls.Peer{ ID: peerID, MultiAddr: maddr.String(), // AddrInfo struct basically repeats the above info (multiaddress). diff --git a/host/notifiee_test.go b/host/notifiee_test.go index a0bac825..e644e072 100644 --- a/host/notifiee_test.go +++ b/host/notifiee_test.go @@ -6,10 +6,10 @@ import ( "github.com/stretchr/testify/require" - "github.com/blocklessnetwork/b7s/host" - "github.com/blocklessnetwork/b7s/models/blockless" - "github.com/blocklessnetwork/b7s/testing/helpers" - "github.com/blocklessnetwork/b7s/testing/mocks" + "github.com/blessnetwork/b7s/host" + "github.com/blessnetwork/b7s/models/bls" + "github.com/blessnetwork/b7s/testing/helpers" + "github.com/blessnetwork/b7s/testing/mocks" ) const ( @@ -24,7 +24,7 @@ func TestNotifiee(t *testing.T) { store := mocks.BaselineStore(t) // Override the peerstore methods so we know if the node correctly handled incoming connection. - store.SavePeerFunc = func(context.Context, blockless.Peer) error { + store.SavePeerFunc = func(context.Context, bls.Peer) error { storedPeer = true return nil } diff --git a/host/send.go b/host/send.go index 3211554c..2e04b7ca 100644 --- a/host/send.go +++ b/host/send.go @@ -8,12 +8,12 @@ import ( "github.com/libp2p/go-libp2p/core/peer" "github.com/libp2p/go-libp2p/core/protocol" - "github.com/blocklessnetwork/b7s/models/blockless" + "github.com/blessnetwork/b7s/models/bls" ) -// SendMessage sends a message directly to the specified peer, on the standard blockless protocol. +// SendMessage sends a message directly to the specified peer, on the standard bls protocol. func (h *Host) SendMessage(ctx context.Context, to peer.ID, payload []byte) error { - return h.SendMessageOnProtocol(ctx, to, payload, blockless.ProtocolID) + return h.SendMessageOnProtocol(ctx, to, payload, bls.ProtocolID) } // SendMessageOnProtocol sends a message directly to the specified peer, using the specified protocol. diff --git a/integration/node/execute_integration_test.go b/integration/node/execute_integration_test.go index db1c2078..bd0df774 100644 --- a/integration/node/execute_integration_test.go +++ b/integration/node/execute_integration_test.go @@ -16,10 +16,10 @@ import ( "github.com/libp2p/go-libp2p/core/network" "github.com/stretchr/testify/require" - "github.com/blocklessnetwork/b7s/models/blockless" - "github.com/blocklessnetwork/b7s/models/codes" - "github.com/blocklessnetwork/b7s/models/response" - "github.com/blocklessnetwork/b7s/testing/helpers" + "github.com/blessnetwork/b7s/models/bls" + "github.com/blessnetwork/b7s/models/codes" + "github.com/blessnetwork/b7s/models/response" + "github.com/blessnetwork/b7s/testing/helpers" ) func TestHeadNode_Execute(t *testing.T) { @@ -53,13 +53,13 @@ This is the end of my program // Phase 0: Create libp2p hosts, loggers, temporary directories and nodes. - headNode := instantiateNode(t, dirPattern, blockless.HeadNode) + headNode := instantiateNode(t, dirPattern, bls.HeadNode) defer headNode.logFile.Close() if !cleanupDisabled { defer os.RemoveAll(headNode.dir) } - workerNode := instantiateNode(t, dirPattern, blockless.WorkerNode) + workerNode := instantiateNode(t, dirPattern, bls.WorkerNode) defer workerNode.db.Close() defer workerNode.logFile.Close() if !cleanupDisabled { @@ -120,7 +120,7 @@ This is the end of my program installWG.Add(1) // Setup verifier for the response we expect. - client.host.SetStreamHandler(blockless.ProtocolID, func(stream network.Stream) { + client.host.SetStreamHandler(bls.ProtocolID, func(stream network.Stream) { defer installWG.Done() defer stream.Close() @@ -150,7 +150,7 @@ This is the end of my program var executeWG sync.WaitGroup executeWG.Add(1) - client.host.SetStreamHandler(blockless.ProtocolID, func(stream network.Stream) { + client.host.SetStreamHandler(bls.ProtocolID, func(stream network.Stream) { defer executeWG.Done() defer stream.Close() diff --git a/integration/node/node_integration_test.go b/integration/node/node_integration_test.go index 4fe6b7ce..0b7f095e 100644 --- a/integration/node/node_integration_test.go +++ b/integration/node/node_integration_test.go @@ -20,20 +20,20 @@ import ( "github.com/rs/zerolog" "github.com/stretchr/testify/require" - "github.com/blocklessnetwork/b7s/consensus" - "github.com/blocklessnetwork/b7s/executor" - "github.com/blocklessnetwork/b7s/fstore" - "github.com/blocklessnetwork/b7s/host" - "github.com/blocklessnetwork/b7s/models/blockless" - "github.com/blocklessnetwork/b7s/models/execute" - "github.com/blocklessnetwork/b7s/models/request" - "github.com/blocklessnetwork/b7s/node" - "github.com/blocklessnetwork/b7s/node/head" - "github.com/blocklessnetwork/b7s/node/worker" - "github.com/blocklessnetwork/b7s/store" - "github.com/blocklessnetwork/b7s/store/codec" - "github.com/blocklessnetwork/b7s/testing/helpers" - "github.com/blocklessnetwork/b7s/testing/mocks" + "github.com/blessnetwork/b7s/consensus" + "github.com/blessnetwork/b7s/executor" + "github.com/blessnetwork/b7s/fstore" + "github.com/blessnetwork/b7s/host" + "github.com/blessnetwork/b7s/models/bls" + "github.com/blessnetwork/b7s/models/execute" + "github.com/blessnetwork/b7s/models/request" + "github.com/blessnetwork/b7s/node" + "github.com/blessnetwork/b7s/node/head" + "github.com/blessnetwork/b7s/node/worker" + "github.com/blessnetwork/b7s/store" + "github.com/blessnetwork/b7s/store/codec" + "github.com/blessnetwork/b7s/testing/helpers" + "github.com/blessnetwork/b7s/testing/mocks" ) const ( @@ -57,7 +57,7 @@ type nodeScaffolding struct { node runnable } -func instantiateNode(t *testing.T, nodeDir string, role blockless.NodeRole) *nodeScaffolding { +func instantiateNode(t *testing.T, nodeDir string, role bls.NodeRole) *nodeScaffolding { t.Helper() // Bootstrap node directory. @@ -77,7 +77,7 @@ func instantiateNode(t *testing.T, nodeDir string, role blockless.NodeRole) *nod core := node.NewCore(logger, host) // If we're creating a head node - we have everything we need. - if role == blockless.HeadNode { + if role == bls.HeadNode { headNode, err := head.New(core) require.NoError(t, err) @@ -188,7 +188,7 @@ func (c *client) sendExecutionMessage(ctx context.Context, to peer.ID, cid strin func createFunctionServer(t *testing.T, manifestPath string, deploymentPath string, archivePath string, cid string) *helpers.FunctionServer { - manifest := blockless.FunctionManifest{ + manifest := bls.FunctionManifest{ Name: "hello", FSRootPath: "./", DriversRootPath: "", diff --git a/integration/node/pbft_integration_test.go b/integration/node/pbft_integration_test.go index 8069b780..bfd61e17 100644 --- a/integration/node/pbft_integration_test.go +++ b/integration/node/pbft_integration_test.go @@ -17,12 +17,12 @@ import ( "github.com/libp2p/go-libp2p/core/peer" "github.com/stretchr/testify/require" - "github.com/blocklessnetwork/b7s/consensus" - "github.com/blocklessnetwork/b7s/consensus/pbft" - "github.com/blocklessnetwork/b7s/models/blockless" - "github.com/blocklessnetwork/b7s/models/codes" - "github.com/blocklessnetwork/b7s/models/response" - "github.com/blocklessnetwork/b7s/testing/helpers" + "github.com/blessnetwork/b7s/consensus" + "github.com/blessnetwork/b7s/consensus/pbft" + "github.com/blessnetwork/b7s/models/bls" + "github.com/blessnetwork/b7s/models/codes" + "github.com/blessnetwork/b7s/models/response" + "github.com/blessnetwork/b7s/testing/helpers" ) func TestNode_PBFT_ExecuteComplete(t *testing.T) { @@ -55,14 +55,14 @@ This is the end of my program // Phase 0: Create libp2p hosts, loggers, temporary directories and nodes. nodeDir := fmt.Sprintf("%v-head-", dirPattern) - head := instantiateNode(t, nodeDir, blockless.HeadNode) + head := instantiateNode(t, nodeDir, bls.HeadNode) t.Logf("head node workspace: %s", head.dir) var workers []*nodeScaffolding for i := 0; i < 4; i++ { nodeDir := fmt.Sprintf("%v-worker-%v-", dirPattern, i) - worker := instantiateNode(t, nodeDir, blockless.WorkerNode) + worker := instantiateNode(t, nodeDir, bls.WorkerNode) t.Logf("worker node #%v workspace: %s", i, worker.dir) workers = append(workers, worker) @@ -164,7 +164,7 @@ This is the end of my program installWG.Add(len(workers)) // Setup verifier for the response we expect. - client.host.SetStreamHandler(blockless.ProtocolID, func(stream network.Stream) { + client.host.SetStreamHandler(bls.ProtocolID, func(stream network.Stream) { defer installWG.Done() defer stream.Close() @@ -199,7 +199,7 @@ This is the end of my program var executeWG sync.WaitGroup executeWG.Add(1) - client.host.SetStreamHandler(blockless.ProtocolID, func(stream network.Stream) { + client.host.SetStreamHandler(bls.ProtocolID, func(stream network.Stream) { defer executeWG.Done() defer stream.Close() diff --git a/metadata/metadata.go b/metadata/metadata.go index dc157394..0abac963 100644 --- a/metadata/metadata.go +++ b/metadata/metadata.go @@ -1,7 +1,7 @@ package metadata import ( - "github.com/blocklessnetwork/b7s/models/execute" + "github.com/blessnetwork/b7s/models/execute" ) type Provider interface { diff --git a/models/blockless/executor.go b/models/bls/executor.go similarity index 69% rename from models/blockless/executor.go rename to models/bls/executor.go index 02877cc9..f25f5294 100644 --- a/models/blockless/executor.go +++ b/models/bls/executor.go @@ -1,9 +1,9 @@ -package blockless +package bls import ( "context" - "github.com/blocklessnetwork/b7s/models/execute" + "github.com/blessnetwork/b7s/models/execute" ) type Executor interface { diff --git a/models/blockless/function.go b/models/bls/function.go similarity index 95% rename from models/blockless/function.go rename to models/bls/function.go index 63352e8c..b6e13b33 100644 --- a/models/blockless/function.go +++ b/models/bls/function.go @@ -1,6 +1,6 @@ -package blockless +package bls -// FunctionManifest describes some important configuration options for a Blockless function. +// FunctionManifest describes some important configuration options for a Bless function. type FunctionManifest struct { ID string `json:"id,omitempty"` Name string `json:"name,omitempty"` @@ -26,7 +26,7 @@ type Runtime struct { URL string `json:"url,omitempty"` } -// Function represents a Blockless function that can be executed. +// Function represents a Bless function that can be executed. type Function struct { ID string `json:"id,omitempty"` Name string `json:"name,omitempty"` diff --git a/models/blockless/function_record.go b/models/bls/function_record.go similarity index 95% rename from models/blockless/function_record.go rename to models/bls/function_record.go index 07876c01..108f61dc 100644 --- a/models/blockless/function_record.go +++ b/models/bls/function_record.go @@ -1,4 +1,4 @@ -package blockless +package bls import ( "time" diff --git a/models/blockless/message.go b/models/bls/message.go similarity index 90% rename from models/blockless/message.go rename to models/bls/message.go index f0c79c16..ea595149 100644 --- a/models/blockless/message.go +++ b/models/bls/message.go @@ -1,14 +1,14 @@ -package blockless +package bls import ( - "github.com/blocklessnetwork/b7s/telemetry/tracing" + "github.com/blessnetwork/b7s/telemetry/tracing" ) type Message interface { Type() string } -// Message types in the Blockless protocol. +// Message types in the bls protocol. const ( MessageHealthCheck = "MsgHealthCheck" MessageInstallFunction = "MsgInstallFunction" diff --git a/models/blockless/params.go b/models/bls/params.go similarity index 96% rename from models/blockless/params.go rename to models/bls/params.go index a8219e91..c2b95983 100644 --- a/models/blockless/params.go +++ b/models/bls/params.go @@ -1,4 +1,4 @@ -package blockless +package bls import ( "errors" diff --git a/models/blockless/peer.go b/models/bls/peer.go similarity index 85% rename from models/blockless/peer.go rename to models/bls/peer.go index a5346c93..ebb7618b 100644 --- a/models/blockless/peer.go +++ b/models/bls/peer.go @@ -1,10 +1,10 @@ -package blockless +package bls import ( "github.com/libp2p/go-libp2p/core/peer" ) -// Peer identifies another node in the Blockless network. +// Peer identifies another node in the Bless network. type Peer struct { ID peer.ID `json:"id,omitempty"` MultiAddr string `json:"multiaddress,omitempty"` diff --git a/models/blockless/role.go b/models/bls/role.go similarity index 97% rename from models/blockless/role.go rename to models/bls/role.go index 3635308d..42a923ba 100644 --- a/models/blockless/role.go +++ b/models/bls/role.go @@ -1,4 +1,4 @@ -package blockless +package bls // NodeRole is a representation of the node's role. type NodeRole uint8 diff --git a/models/blockless/runtime.go b/models/bls/runtime.go similarity index 67% rename from models/blockless/runtime.go rename to models/bls/runtime.go index 9e056d97..c10d21cc 100644 --- a/models/blockless/runtime.go +++ b/models/bls/runtime.go @@ -1,4 +1,4 @@ -package blockless +package bls import ( "runtime" @@ -8,7 +8,7 @@ const ( runtimeCLI = "bls-runtime" ) -// RuntimeCLI returns the name of the Blockless Runtime executable. +// RuntimeCLI returns the name of the Bless Runtime executable. func RuntimeCLI() string { cli := runtimeCLI diff --git a/models/blockless/store.go b/models/bls/store.go similarity index 97% rename from models/blockless/store.go rename to models/bls/store.go index d6c04ff9..b40bcf23 100644 --- a/models/blockless/store.go +++ b/models/bls/store.go @@ -1,4 +1,4 @@ -package blockless +package bls import ( "context" diff --git a/models/execute/result.go b/models/execute/result.go index 77f205b0..acb912fa 100644 --- a/models/execute/result.go +++ b/models/execute/result.go @@ -10,7 +10,7 @@ import ( "github.com/libp2p/go-libp2p/core/crypto" "github.com/libp2p/go-libp2p/core/peer" - "github.com/blocklessnetwork/b7s/models/codes" + "github.com/blessnetwork/b7s/models/codes" ) // NodeResult is an annotated execution result. @@ -35,7 +35,7 @@ type Cluster struct { Peers []peer.ID `json:"peers,omitempty"` } -// RuntimeOutput describes the output produced by the Blockless Runtime during execution. +// RuntimeOutput describes the output produced by the Bless Runtime during execution. type RuntimeOutput struct { Stdout string `json:"stdout"` Stderr string `json:"stderr"` diff --git a/models/execute/runtime.go b/models/execute/runtime.go index bc16e7b6..d22a1071 100644 --- a/models/execute/runtime.go +++ b/models/execute/runtime.go @@ -19,7 +19,7 @@ type BLSRuntimeConfig struct { } const ( - // Blockless Runtime flag names. + // Bless Runtime flag names. BLSRuntimeFlagEntry = "entry" BLSRuntimeFlagExecutionTime = "run-time" BLSRuntimeFlagDebug = "debug-info" diff --git a/models/execute/signature_test.go b/models/execute/signature_test.go index bf747456..44f9db79 100644 --- a/models/execute/signature_test.go +++ b/models/execute/signature_test.go @@ -3,7 +3,7 @@ package execute import ( "testing" - "github.com/blocklessnetwork/b7s/models/codes" + "github.com/blessnetwork/b7s/models/codes" "github.com/libp2p/go-libp2p/core/crypto" "github.com/stretchr/testify/require" ) diff --git a/models/request/disband_cluster.go b/models/request/disband_cluster.go index 2fe24df0..d9829629 100644 --- a/models/request/disband_cluster.go +++ b/models/request/disband_cluster.go @@ -3,7 +3,7 @@ package request import ( "encoding/json" - "github.com/blocklessnetwork/b7s/models/blockless" + "github.com/blessnetwork/b7s/models/bls" ) var _ (json.Marshaler) = (*DisbandCluster)(nil) @@ -11,11 +11,11 @@ var _ (json.Marshaler) = (*DisbandCluster)(nil) // DisbandCluster describes the `MessageDisbandCluster` request payload. // It is sent after head node receives the leaders execution response. type DisbandCluster struct { - blockless.BaseMessage + bls.BaseMessage RequestID string `json:"request_id,omitempty"` } -func (DisbandCluster) Type() string { return blockless.MessageDisbandCluster } +func (DisbandCluster) Type() string { return bls.MessageDisbandCluster } func (d DisbandCluster) MarshalJSON() ([]byte, error) { type Alias DisbandCluster diff --git a/models/request/execute.go b/models/request/execute.go index 0632caad..a167e171 100644 --- a/models/request/execute.go +++ b/models/request/execute.go @@ -5,12 +5,12 @@ import ( "fmt" "time" - "github.com/blocklessnetwork/b7s/consensus" - "github.com/blocklessnetwork/b7s/consensus/pbft" - "github.com/blocklessnetwork/b7s/models/blockless" - "github.com/blocklessnetwork/b7s/models/codes" - "github.com/blocklessnetwork/b7s/models/execute" - "github.com/blocklessnetwork/b7s/models/response" + "github.com/blessnetwork/b7s/consensus" + "github.com/blessnetwork/b7s/consensus/pbft" + "github.com/blessnetwork/b7s/models/bls" + "github.com/blessnetwork/b7s/models/codes" + "github.com/blessnetwork/b7s/models/execute" + "github.com/blessnetwork/b7s/models/response" "github.com/hashicorp/go-multierror" ) @@ -18,7 +18,7 @@ var _ (json.Marshaler) = (*Execute)(nil) // Execute describes the `MessageExecute` request payload. type Execute struct { - blockless.BaseMessage + bls.BaseMessage execute.Request // execute request is embedded. @@ -27,7 +27,7 @@ type Execute struct { func (e Execute) Response(c codes.Code, id string) *response.Execute { return &response.Execute{ - BaseMessage: blockless.BaseMessage{TraceInfo: e.TraceInfo}, + BaseMessage: bls.BaseMessage{TraceInfo: e.TraceInfo}, RequestID: id, Code: c, } @@ -35,7 +35,7 @@ func (e Execute) Response(c codes.Code, id string) *response.Execute { func (e Execute) RollCall(id string, c consensus.Type) *RollCall { return &RollCall{ - BaseMessage: blockless.BaseMessage{TraceInfo: e.TraceInfo}, + BaseMessage: bls.BaseMessage{TraceInfo: e.TraceInfo}, RequestID: id, FunctionID: e.FunctionID, Consensus: c, @@ -45,14 +45,14 @@ func (e Execute) RollCall(id string, c consensus.Type) *RollCall { func (e Execute) WorkOrder(id string) *WorkOrder { return &WorkOrder{ - BaseMessage: blockless.BaseMessage{TraceInfo: e.TraceInfo}, + BaseMessage: bls.BaseMessage{TraceInfo: e.TraceInfo}, RequestID: id, Request: e.Request, Timestamp: time.Now().UTC(), } } -func (Execute) Type() string { return blockless.MessageExecute } +func (Execute) Type() string { return bls.MessageExecute } func (e Execute) MarshalJSON() ([]byte, error) { type Alias Execute diff --git a/models/request/form_cluster.go b/models/request/form_cluster.go index cfc3e05a..addc0512 100644 --- a/models/request/form_cluster.go +++ b/models/request/form_cluster.go @@ -5,10 +5,10 @@ import ( "github.com/libp2p/go-libp2p/core/peer" - "github.com/blocklessnetwork/b7s/consensus" - "github.com/blocklessnetwork/b7s/models/blockless" - "github.com/blocklessnetwork/b7s/models/codes" - "github.com/blocklessnetwork/b7s/models/response" + "github.com/blessnetwork/b7s/consensus" + "github.com/blessnetwork/b7s/models/bls" + "github.com/blessnetwork/b7s/models/codes" + "github.com/blessnetwork/b7s/models/response" ) var _ (json.Marshaler) = (*FormCluster)(nil) @@ -16,7 +16,7 @@ var _ (json.Marshaler) = (*FormCluster)(nil) // FormCluster describes the `MessageFormCluster` request payload. // It is sent on clustered execution of a request. type FormCluster struct { - blockless.BaseMessage + bls.BaseMessage RequestID string `json:"request_id,omitempty"` Peers []peer.ID `json:"peers,omitempty"` Consensus consensus.Type `json:"consensus,omitempty"` @@ -25,13 +25,13 @@ type FormCluster struct { func (f FormCluster) Response(c codes.Code) *response.FormCluster { return &response.FormCluster{ - BaseMessage: blockless.BaseMessage{TraceInfo: f.TraceInfo}, + BaseMessage: bls.BaseMessage{TraceInfo: f.TraceInfo}, RequestID: f.RequestID, Code: c, } } -func (FormCluster) Type() string { return blockless.MessageFormCluster } +func (FormCluster) Type() string { return bls.MessageFormCluster } func (f FormCluster) MarshalJSON() ([]byte, error) { type Alias FormCluster diff --git a/models/request/install_function.go b/models/request/install_function.go index 7abd5ea5..4060f5b8 100644 --- a/models/request/install_function.go +++ b/models/request/install_function.go @@ -4,30 +4,30 @@ import ( "encoding/json" "errors" - "github.com/blocklessnetwork/b7s/models/blockless" - "github.com/blocklessnetwork/b7s/models/codes" - "github.com/blocklessnetwork/b7s/models/response" + "github.com/blessnetwork/b7s/models/bls" + "github.com/blessnetwork/b7s/models/codes" + "github.com/blessnetwork/b7s/models/response" ) var _ (json.Marshaler) = (*InstallFunction)(nil) // InstallFunction describes the `MessageInstallFunction` request payload. type InstallFunction struct { - blockless.BaseMessage + bls.BaseMessage ManifestURL string `json:"manifest_url,omitempty"` CID string `json:"cid,omitempty"` } func (f InstallFunction) Response(c codes.Code) *response.InstallFunction { return &response.InstallFunction{ - BaseMessage: blockless.BaseMessage{TraceInfo: f.TraceInfo}, + BaseMessage: bls.BaseMessage{TraceInfo: f.TraceInfo}, Code: c, Message: "installed", CID: f.CID, } } -func (InstallFunction) Type() string { return blockless.MessageInstallFunction } +func (InstallFunction) Type() string { return bls.MessageInstallFunction } func (f InstallFunction) MarshalJSON() ([]byte, error) { type Alias InstallFunction diff --git a/models/request/roll_call.go b/models/request/roll_call.go index 73ce5f0e..bea049b2 100644 --- a/models/request/roll_call.go +++ b/models/request/roll_call.go @@ -3,18 +3,18 @@ package request import ( "encoding/json" - "github.com/blocklessnetwork/b7s/consensus" - "github.com/blocklessnetwork/b7s/models/blockless" - "github.com/blocklessnetwork/b7s/models/codes" - "github.com/blocklessnetwork/b7s/models/execute" - "github.com/blocklessnetwork/b7s/models/response" + "github.com/blessnetwork/b7s/consensus" + "github.com/blessnetwork/b7s/models/bls" + "github.com/blessnetwork/b7s/models/codes" + "github.com/blessnetwork/b7s/models/execute" + "github.com/blessnetwork/b7s/models/response" ) var _ (json.Marshaler) = (*RollCall)(nil) // RollCall describes the `MessageRollCall` message payload. type RollCall struct { - blockless.BaseMessage + bls.BaseMessage FunctionID string `json:"function_id,omitempty"` RequestID string `json:"request_id,omitempty"` Consensus consensus.Type `json:"consensus"` @@ -23,14 +23,14 @@ type RollCall struct { func (r RollCall) Response(c codes.Code) *response.RollCall { return &response.RollCall{ - BaseMessage: blockless.BaseMessage{TraceInfo: r.TraceInfo}, + BaseMessage: bls.BaseMessage{TraceInfo: r.TraceInfo}, FunctionID: r.FunctionID, RequestID: r.RequestID, Code: c, } } -func (RollCall) Type() string { return blockless.MessageRollCall } +func (RollCall) Type() string { return bls.MessageRollCall } func (r RollCall) MarshalJSON() ([]byte, error) { type Alias RollCall diff --git a/models/request/work_order.go b/models/request/work_order.go index fc32361d..1fe9d2ad 100644 --- a/models/request/work_order.go +++ b/models/request/work_order.go @@ -4,14 +4,14 @@ import ( "encoding/json" "time" - "github.com/blocklessnetwork/b7s/models/blockless" - "github.com/blocklessnetwork/b7s/models/codes" - "github.com/blocklessnetwork/b7s/models/execute" - "github.com/blocklessnetwork/b7s/models/response" + "github.com/blessnetwork/b7s/models/bls" + "github.com/blessnetwork/b7s/models/codes" + "github.com/blessnetwork/b7s/models/execute" + "github.com/blessnetwork/b7s/models/response" ) type WorkOrder struct { - blockless.BaseMessage + bls.BaseMessage execute.Request // execute request is embedded @@ -22,7 +22,7 @@ type WorkOrder struct { func (w WorkOrder) Response(c codes.Code, res execute.Result) *response.WorkOrder { return &response.WorkOrder{ - BaseMessage: blockless.BaseMessage{TraceInfo: w.TraceInfo}, + BaseMessage: bls.BaseMessage{TraceInfo: w.TraceInfo}, Code: c, RequestID: w.RequestID, Result: execute.NodeResult{ @@ -31,7 +31,7 @@ func (w WorkOrder) Response(c codes.Code, res execute.Result) *response.WorkOrde } } -func (WorkOrder) Type() string { return blockless.MessageWorkOrder } +func (WorkOrder) Type() string { return bls.MessageWorkOrder } func (w WorkOrder) MarshalJSON() ([]byte, error) { type Alias WorkOrder diff --git a/models/response/execute.go b/models/response/execute.go index 0a0db873..19c4fcd7 100644 --- a/models/response/execute.go +++ b/models/response/execute.go @@ -3,16 +3,16 @@ package response import ( "encoding/json" - "github.com/blocklessnetwork/b7s/models/blockless" - "github.com/blocklessnetwork/b7s/models/codes" - "github.com/blocklessnetwork/b7s/models/execute" + "github.com/blessnetwork/b7s/models/bls" + "github.com/blessnetwork/b7s/models/codes" + "github.com/blessnetwork/b7s/models/execute" ) var _ (json.Marshaler) = (*Execute)(nil) // Execute describes the response to the `MessageExecute` message. type Execute struct { - blockless.BaseMessage + bls.BaseMessage RequestID string `json:"request_id,omitempty"` Code codes.Code `json:"code,omitempty"` Results execute.ResultMap `json:"results,omitempty"` @@ -37,7 +37,7 @@ func (e *Execute) WithErrorMessage(err error) *Execute { return e } -func (Execute) Type() string { return blockless.MessageExecuteResponse } +func (Execute) Type() string { return bls.MessageExecuteResponse } func (e Execute) MarshalJSON() ([]byte, error) { type Alias Execute diff --git a/models/response/form_cluster.go b/models/response/form_cluster.go index 6dfc9f48..16647802 100644 --- a/models/response/form_cluster.go +++ b/models/response/form_cluster.go @@ -3,16 +3,16 @@ package response import ( "encoding/json" - "github.com/blocklessnetwork/b7s/consensus" - "github.com/blocklessnetwork/b7s/models/blockless" - "github.com/blocklessnetwork/b7s/models/codes" + "github.com/blessnetwork/b7s/consensus" + "github.com/blessnetwork/b7s/models/bls" + "github.com/blessnetwork/b7s/models/codes" ) var _ (json.Marshaler) = (*FormCluster)(nil) // FormCluster describes the `MessageFormClusteRr` response. type FormCluster struct { - blockless.BaseMessage + bls.BaseMessage RequestID string `json:"request_id,omitempty"` Code codes.Code `json:"code,omitempty"` Consensus consensus.Type `json:"consensus,omitempty"` @@ -23,7 +23,7 @@ func (f *FormCluster) WithConsensus(c consensus.Type) *FormCluster { return f } -func (FormCluster) Type() string { return blockless.MessageFormClusterResponse } +func (FormCluster) Type() string { return bls.MessageFormClusterResponse } func (f FormCluster) MarshalJSON() ([]byte, error) { type Alias FormCluster diff --git a/models/response/health.go b/models/response/health.go index 09a84070..bf124c54 100644 --- a/models/response/health.go +++ b/models/response/health.go @@ -3,18 +3,18 @@ package response import ( "encoding/json" - "github.com/blocklessnetwork/b7s/models/blockless" + "github.com/blessnetwork/b7s/models/bls" ) var _ (json.Marshaler) = (*Health)(nil) // Health describes the message sent as a health ping. type Health struct { - blockless.BaseMessage + bls.BaseMessage Code int `json:"code,omitempty"` } -func (Health) Type() string { return blockless.MessageHealthCheck } +func (Health) Type() string { return bls.MessageHealthCheck } func (h Health) MarshalJSON() ([]byte, error) { type Alias Health diff --git a/models/response/install_function.go b/models/response/install_function.go index 7b196eaa..33da3664 100644 --- a/models/response/install_function.go +++ b/models/response/install_function.go @@ -3,21 +3,21 @@ package response import ( "encoding/json" - "github.com/blocklessnetwork/b7s/models/blockless" - "github.com/blocklessnetwork/b7s/models/codes" + "github.com/blessnetwork/b7s/models/bls" + "github.com/blessnetwork/b7s/models/codes" ) var _ (json.Marshaler) = (*InstallFunction)(nil) // InstallFunction describes the response to the `MessageInstallFunction` message. type InstallFunction struct { - blockless.BaseMessage + bls.BaseMessage Code codes.Code `json:"code,omitempty"` Message string `json:"message,omitempty"` CID string `json:"cid,omitempty"` } -func (InstallFunction) Type() string { return blockless.MessageInstallFunctionResponse } +func (InstallFunction) Type() string { return bls.MessageInstallFunctionResponse } func (f InstallFunction) MarshalJSON() ([]byte, error) { type Alias InstallFunction diff --git a/models/response/roll_call.go b/models/response/roll_call.go index 550e0872..e8cda49d 100644 --- a/models/response/roll_call.go +++ b/models/response/roll_call.go @@ -3,21 +3,21 @@ package response import ( "encoding/json" - "github.com/blocklessnetwork/b7s/models/blockless" - "github.com/blocklessnetwork/b7s/models/codes" + "github.com/blessnetwork/b7s/models/bls" + "github.com/blessnetwork/b7s/models/codes" ) var _ (json.Marshaler) = (*RollCall)(nil) // RollCall describes the `MessageRollCall` response payload. type RollCall struct { - blockless.BaseMessage + bls.BaseMessage Code codes.Code `json:"code,omitempty"` FunctionID string `json:"function_id,omitempty"` RequestID string `json:"request_id,omitempty"` } -func (RollCall) Type() string { return blockless.MessageRollCallResponse } +func (RollCall) Type() string { return bls.MessageRollCallResponse } func (r RollCall) MarshalJSON() ([]byte, error) { type Alias RollCall diff --git a/models/response/work_order.go b/models/response/work_order.go index 12d2e055..08db59a3 100644 --- a/models/response/work_order.go +++ b/models/response/work_order.go @@ -3,13 +3,13 @@ package response import ( "encoding/json" - "github.com/blocklessnetwork/b7s/models/blockless" - "github.com/blocklessnetwork/b7s/models/codes" - "github.com/blocklessnetwork/b7s/models/execute" + "github.com/blessnetwork/b7s/models/bls" + "github.com/blessnetwork/b7s/models/codes" + "github.com/blessnetwork/b7s/models/execute" ) type WorkOrder struct { - blockless.BaseMessage + bls.BaseMessage RequestID string `json:"request_id,omitempty"` Code codes.Code `json:"code,omitempty"` @@ -28,7 +28,7 @@ func (w *WorkOrder) WithErrorMessage(err error) *WorkOrder { return w } -func (WorkOrder) Type() string { return blockless.MessageWorkOrderResponse } +func (WorkOrder) Type() string { return bls.MessageWorkOrderResponse } func (w WorkOrder) MarshalJSON() ([]byte, error) { type Alias WorkOrder diff --git a/node/aggregate/aggregate.go b/node/aggregate/aggregate.go index 4610b784..a31691a1 100644 --- a/node/aggregate/aggregate.go +++ b/node/aggregate/aggregate.go @@ -5,7 +5,7 @@ import ( "github.com/libp2p/go-libp2p/core/peer" - "github.com/blocklessnetwork/b7s/models/execute" + "github.com/blessnetwork/b7s/models/execute" ) func Aggregate(results execute.ResultMap) Results { diff --git a/node/aggregate/models.go b/node/aggregate/models.go index 2019c67f..5a549680 100644 --- a/node/aggregate/models.go +++ b/node/aggregate/models.go @@ -5,7 +5,7 @@ import ( "github.com/libp2p/go-libp2p/core/peer" - "github.com/blocklessnetwork/b7s/models/execute" + "github.com/blessnetwork/b7s/models/execute" ) type Results []Result diff --git a/node/config.go b/node/config.go index 1d50afad..8ab9d3d1 100644 --- a/node/config.go +++ b/node/config.go @@ -3,7 +3,7 @@ package node import ( "time" - "github.com/blocklessnetwork/b7s/models/blockless" + "github.com/blessnetwork/b7s/models/bls" ) const ( @@ -17,9 +17,9 @@ type Option func(*Config) // DefaultConfig represents the default settings for the node core. var DefaultConfig = Config{ - Topics: []string{blockless.DefaultTopic}, - HealthInterval: blockless.DefaultHealthInterval, - Concurrency: blockless.DefaultConcurrency, + Topics: []string{bls.DefaultTopic}, + HealthInterval: bls.DefaultHealthInterval, + Concurrency: bls.DefaultConcurrency, } type Config struct { diff --git a/node/core.go b/node/core.go index 58aa6103..79dad4dd 100644 --- a/node/core.go +++ b/node/core.go @@ -7,10 +7,10 @@ import ( "github.com/libp2p/go-libp2p/core/peer" "github.com/rs/zerolog" - "github.com/blocklessnetwork/b7s/host" - "github.com/blocklessnetwork/b7s/models/blockless" - "github.com/blocklessnetwork/b7s/node/internal/syncmap" - "github.com/blocklessnetwork/b7s/telemetry/tracing" + "github.com/blessnetwork/b7s/host" + "github.com/blessnetwork/b7s/models/bls" + "github.com/blessnetwork/b7s/node/internal/syncmap" + "github.com/blessnetwork/b7s/telemetry/tracing" ) type Core interface { @@ -34,13 +34,13 @@ type Network interface { } type Messaging interface { - Send(context.Context, peer.ID, blockless.Message) error - SendToMany(context.Context, []peer.ID, blockless.Message, bool) error + Send(context.Context, peer.ID, bls.Message) error + SendToMany(context.Context, []peer.ID, bls.Message, bool) error JoinTopic(string) error Subscribe(context.Context, string) error - Publish(context.Context, blockless.Message) error - PublishToTopic(context.Context, string, blockless.Message) error + Publish(context.Context, bls.Message) error + PublishToTopic(context.Context, string, bls.Message) error } type Telemetry interface { diff --git a/node/head/cluster.go b/node/head/cluster.go index 4744ef32..a3b26f52 100644 --- a/node/head/cluster.go +++ b/node/head/cluster.go @@ -7,11 +7,11 @@ import ( "github.com/libp2p/go-libp2p/core/peer" - "github.com/blocklessnetwork/b7s/consensus" - "github.com/blocklessnetwork/b7s/models/blockless" - "github.com/blocklessnetwork/b7s/models/codes" - "github.com/blocklessnetwork/b7s/models/request" - "github.com/blocklessnetwork/b7s/models/response" + "github.com/blessnetwork/b7s/consensus" + "github.com/blessnetwork/b7s/models/bls" + "github.com/blessnetwork/b7s/models/codes" + "github.com/blessnetwork/b7s/models/request" + "github.com/blessnetwork/b7s/models/response" ) func (h *HeadNode) formCluster(ctx context.Context, requestID string, replicas []peer.ID, consensus consensus.Type) error { @@ -111,7 +111,7 @@ func (h *HeadNode) disbandCluster(requestID string, replicas []peer.ID) error { h.Log().Info(). Err(err). Str("request", requestID). - Strs("peers", blockless.PeerIDsToStr(replicas)). + Strs("peers", bls.PeerIDsToStr(replicas)). Msg("sent cluster disband request") return nil diff --git a/node/head/config.go b/node/head/config.go index 964d30ed..e150bac5 100644 --- a/node/head/config.go +++ b/node/head/config.go @@ -3,7 +3,7 @@ package head import ( "time" - "github.com/blocklessnetwork/b7s/consensus" + "github.com/blessnetwork/b7s/consensus" ) // Option can be used to set Node configuration options. diff --git a/node/head/execute.go b/node/head/execute.go index 79e19f96..253dca8e 100644 --- a/node/head/execute.go +++ b/node/head/execute.go @@ -9,13 +9,13 @@ import ( "github.com/libp2p/go-libp2p/core/peer" "go.opentelemetry.io/otel/trace" - cons "github.com/blocklessnetwork/b7s/consensus" - "github.com/blocklessnetwork/b7s/models/blockless" - "github.com/blocklessnetwork/b7s/models/codes" - "github.com/blocklessnetwork/b7s/models/execute" - "github.com/blocklessnetwork/b7s/models/request" - "github.com/blocklessnetwork/b7s/models/response" - "github.com/blocklessnetwork/b7s/telemetry/tracing" + cons "github.com/blessnetwork/b7s/consensus" + "github.com/blessnetwork/b7s/models/bls" + "github.com/blessnetwork/b7s/models/codes" + "github.com/blessnetwork/b7s/models/execute" + "github.com/blessnetwork/b7s/models/request" + "github.com/blessnetwork/b7s/models/response" + "github.com/blessnetwork/b7s/telemetry/tracing" ) // NOTE: head node typically receives execution requests from the REST API. This message handling is not cognizant of subgroups. @@ -50,7 +50,7 @@ func (h *HeadNode) processExecute(ctx context.Context, from peer.ID, req request res := req.Response(code, requestID).WithResults(results).WithCluster(cluster) // Communicate the reason for failure in these cases. - if errors.Is(err, blockless.ErrRollCallTimeout) || errors.Is(err, blockless.ErrExecutionNotEnoughNodes) { + if errors.Is(err, bls.ErrRollCallTimeout) || errors.Is(err, bls.ErrExecutionNotEnoughNodes) { res.ErrorMessage = err.Error() } @@ -106,7 +106,7 @@ func (h *HeadNode) execute(ctx context.Context, requestID string, req request.Ex reportingPeers, err := h.executeRollCall(ctx, requestID, req, consensus) if err != nil { code := codes.Error - if errors.Is(err, blockless.ErrRollCallTimeout) { + if errors.Is(err, bls.ErrRollCallTimeout) { code = codes.Timeout } @@ -120,7 +120,7 @@ func (h *HeadNode) execute(ctx context.Context, requestID string, req request.Ex // Phase 2. - Request cluster formation, if we need consensus. if consensusRequired(consensus) { - log.Info().Strs("peers", blockless.PeerIDsToStr(reportingPeers)).Msg("requesting cluster formation from peers who reported for roll call") + log.Info().Strs("peers", bls.PeerIDsToStr(reportingPeers)).Msg("requesting cluster formation from peers who reported for roll call") err := h.formCluster(ctx, requestID, reportingPeers, consensus) if err != nil { diff --git a/node/head/execute_internal_test.go b/node/head/execute_internal_test.go index 48184b52..ae7d2a52 100644 --- a/node/head/execute_internal_test.go +++ b/node/head/execute_internal_test.go @@ -11,13 +11,13 @@ import ( "github.com/libp2p/go-libp2p/core/peer" "github.com/stretchr/testify/require" - "github.com/blocklessnetwork/b7s/consensus" - "github.com/blocklessnetwork/b7s/models/blockless" - "github.com/blocklessnetwork/b7s/models/codes" - "github.com/blocklessnetwork/b7s/models/execute" - "github.com/blocklessnetwork/b7s/models/request" - "github.com/blocklessnetwork/b7s/models/response" - "github.com/blocklessnetwork/b7s/testing/mocks" + "github.com/blessnetwork/b7s/consensus" + "github.com/blessnetwork/b7s/models/bls" + "github.com/blessnetwork/b7s/models/codes" + "github.com/blessnetwork/b7s/models/execute" + "github.com/blessnetwork/b7s/models/request" + "github.com/blessnetwork/b7s/models/response" + "github.com/blessnetwork/b7s/testing/mocks" ) func TestHead_Execute(t *testing.T) { @@ -58,7 +58,7 @@ func TestHead_Execute(t *testing.T) { return true } // Setup a publish func - we expect the head node to publish a roll call. - core.PublishToTopicFunc = func(_ context.Context, topic string, msg blockless.Message) error { + core.PublishToTopicFunc = func(_ context.Context, topic string, msg bls.Message) error { lock.Lock() defer lock.Unlock() @@ -82,7 +82,7 @@ func TestHead_Execute(t *testing.T) { } // Setup a send func - we expect the head node to send the work order to the worker. - core.SendToManyFunc = func(_ context.Context, peers []peer.ID, msg blockless.Message, requireAll bool) error { + core.SendToManyFunc = func(_ context.Context, peers []peer.ID, msg bls.Message, requireAll bool) error { lock.Lock() defer lock.Unlock() diff --git a/node/head/execution_results.go b/node/head/execution_results.go index ef1b8339..528b3d65 100644 --- a/node/head/execution_results.go +++ b/node/head/execution_results.go @@ -7,8 +7,8 @@ import ( "github.com/libp2p/go-libp2p/core/peer" - "github.com/blocklessnetwork/b7s/consensus/pbft" - "github.com/blocklessnetwork/b7s/models/execute" + "github.com/blessnetwork/b7s/consensus/pbft" + "github.com/blessnetwork/b7s/models/execute" ) // gatherExecutionResultsPBFT collects execution results from a PBFT cluster. This means f+1 identical results. diff --git a/node/head/head.go b/node/head/head.go index b8039be0..bbf56c9f 100644 --- a/node/head/head.go +++ b/node/head/head.go @@ -7,11 +7,11 @@ import ( "github.com/armon/go-metrics" "github.com/google/uuid" - "github.com/blocklessnetwork/b7s/info" - "github.com/blocklessnetwork/b7s/models/execute" - "github.com/blocklessnetwork/b7s/models/response" - "github.com/blocklessnetwork/b7s/node" - "github.com/blocklessnetwork/b7s/node/internal/waitmap" + "github.com/blessnetwork/b7s/info" + "github.com/blessnetwork/b7s/models/execute" + "github.com/blessnetwork/b7s/models/response" + "github.com/blessnetwork/b7s/node" + "github.com/blessnetwork/b7s/node/internal/waitmap" ) type HeadNode struct { diff --git a/node/head/health.go b/node/head/health.go index 7cdd19c4..c2a75257 100644 --- a/node/head/health.go +++ b/node/head/health.go @@ -5,7 +5,7 @@ import ( "github.com/libp2p/go-libp2p/core/peer" - "github.com/blocklessnetwork/b7s/models/response" + "github.com/blessnetwork/b7s/models/response" ) func (h *HeadNode) processHealthCheck(ctx context.Context, from peer.ID, _ response.Health) error { diff --git a/node/head/install.go b/node/head/install.go index fe7cd34d..559a5158 100644 --- a/node/head/install.go +++ b/node/head/install.go @@ -5,7 +5,7 @@ import ( "github.com/libp2p/go-libp2p/core/peer" - "github.com/blocklessnetwork/b7s/models/response" + "github.com/blessnetwork/b7s/models/response" ) func (h *HeadNode) processInstallFunctionResponse(ctx context.Context, from peer.ID, res response.InstallFunction) error { diff --git a/node/head/params.go b/node/head/params.go index 402e89c9..ba0ad96e 100644 --- a/node/head/params.go +++ b/node/head/params.go @@ -3,7 +3,7 @@ package head import ( "time" - "github.com/blocklessnetwork/b7s/consensus" + "github.com/blessnetwork/b7s/consensus" ) const ( diff --git a/node/head/process.go b/node/head/process.go index 8ab406b8..af615dab 100644 --- a/node/head/process.go +++ b/node/head/process.go @@ -6,25 +6,25 @@ import ( "github.com/libp2p/go-libp2p/core/peer" - "github.com/blocklessnetwork/b7s/models/blockless" - "github.com/blocklessnetwork/b7s/node" + "github.com/blessnetwork/b7s/models/bls" + "github.com/blessnetwork/b7s/node" ) // processMessage will determine which message was received and how to process it. func (h *HeadNode) process(ctx context.Context, from peer.ID, msg string, payload []byte) error { switch msg { - case blockless.MessageHealthCheck: + case bls.MessageHealthCheck: return node.HandleMessage(ctx, from, payload, h.processHealthCheck) - case blockless.MessageInstallFunctionResponse: + case bls.MessageInstallFunctionResponse: return node.HandleMessage(ctx, from, payload, h.processInstallFunctionResponse) - case blockless.MessageExecute: + case bls.MessageExecute: return node.HandleMessage(ctx, from, payload, h.processExecute) - case blockless.MessageRollCallResponse: + case bls.MessageRollCallResponse: return node.HandleMessage(ctx, from, payload, h.processRollCallResponse) - case blockless.MessageWorkOrderResponse: + case bls.MessageWorkOrderResponse: return node.HandleMessage(ctx, from, payload, h.processWorkOrderResponse) - case blockless.MessageFormClusterResponse: + case bls.MessageFormClusterResponse: return node.HandleMessage(ctx, from, payload, h.processFormClusterResponse) } diff --git a/node/head/queue.go b/node/head/queue.go index 3a3d1e93..35725d5c 100644 --- a/node/head/queue.go +++ b/node/head/queue.go @@ -5,7 +5,7 @@ import ( "github.com/libp2p/go-libp2p/core/peer" - "github.com/blocklessnetwork/b7s/models/response" + "github.com/blessnetwork/b7s/models/response" ) type rollCallQueue struct { diff --git a/node/head/queue_internal_test.go b/node/head/queue_internal_test.go index 59c24b90..79cba04e 100644 --- a/node/head/queue_internal_test.go +++ b/node/head/queue_internal_test.go @@ -6,8 +6,8 @@ import ( "github.com/stretchr/testify/require" - "github.com/blocklessnetwork/b7s/models/response" - "github.com/blocklessnetwork/b7s/testing/mocks" + "github.com/blessnetwork/b7s/models/response" + "github.com/blessnetwork/b7s/testing/mocks" ) func TestRollCallQueue(t *testing.T) { diff --git a/node/head/rest.go b/node/head/rest.go index e8c2972b..2662deab 100644 --- a/node/head/rest.go +++ b/node/head/rest.go @@ -5,10 +5,10 @@ import ( "crypto/sha256" "fmt" - "github.com/blocklessnetwork/b7s/models/blockless" - "github.com/blocklessnetwork/b7s/models/codes" - "github.com/blocklessnetwork/b7s/models/execute" - "github.com/blocklessnetwork/b7s/models/request" + "github.com/blessnetwork/b7s/models/bls" + "github.com/blessnetwork/b7s/models/codes" + "github.com/blessnetwork/b7s/models/execute" + "github.com/blessnetwork/b7s/models/request" ) // ExecuteFunction can be used to start function execution. At the moment this is used by the API server to start execution on the head node. @@ -45,7 +45,7 @@ func (h *HeadNode) PublishFunctionInstall(ctx context.Context, uri string, cid s } if subgroup == "" { - subgroup = blockless.DefaultTopic + subgroup = bls.DefaultTopic } h.Log().Debug().Str("subgroup", subgroup).Str("url", req.ManifestURL).Str("cid", req.CID).Msg("publishing function install message") diff --git a/node/head/roll_call.go b/node/head/roll_call.go index 1ae694ec..a45b9523 100644 --- a/node/head/roll_call.go +++ b/node/head/roll_call.go @@ -9,12 +9,12 @@ import ( "github.com/armon/go-metrics" "github.com/libp2p/go-libp2p/core/peer" - cons "github.com/blocklessnetwork/b7s/consensus" - "github.com/blocklessnetwork/b7s/consensus/pbft" - "github.com/blocklessnetwork/b7s/models/blockless" - "github.com/blocklessnetwork/b7s/models/codes" - "github.com/blocklessnetwork/b7s/models/request" - "github.com/blocklessnetwork/b7s/models/response" + cons "github.com/blessnetwork/b7s/consensus" + "github.com/blessnetwork/b7s/consensus/pbft" + "github.com/blessnetwork/b7s/models/bls" + "github.com/blessnetwork/b7s/models/codes" + "github.com/blessnetwork/b7s/models/request" + "github.com/blessnetwork/b7s/models/response" ) func (h *HeadNode) executeRollCall( @@ -70,7 +70,7 @@ rollCallResponseLoop: } log.Warn().Msg("roll call timed out") - return nil, blockless.ErrRollCallTimeout + return nil, bls.ErrRollCallTimeout case reply := <-h.rollCall.responses(requestID): @@ -115,7 +115,7 @@ rollCallResponseLoop: // On successful issuance of the roll call request, we return the ID of the issued request. func (h *HeadNode) publishRollCall(ctx context.Context, rc *request.RollCall, subgroup string) error { - subgroup = cmp.Or(subgroup, blockless.DefaultTopic) + subgroup = cmp.Or(subgroup, bls.DefaultTopic) err := h.PublishToTopic(ctx, subgroup, rc) if err != nil { diff --git a/node/health.go b/node/health.go index 93e59c2d..f77875e8 100644 --- a/node/health.go +++ b/node/health.go @@ -5,7 +5,7 @@ import ( "net/http" "time" - "github.com/blocklessnetwork/b7s/models/response" + "github.com/blessnetwork/b7s/models/response" ) // HealthPing will run a long running loop, publishing health signal until cancelled. diff --git a/node/internal/syncmap/map_test.go b/node/internal/syncmap/map_test.go index c240beb7..c4ebdad9 100644 --- a/node/internal/syncmap/map_test.go +++ b/node/internal/syncmap/map_test.go @@ -5,7 +5,7 @@ import ( "github.com/stretchr/testify/require" - "github.com/blocklessnetwork/b7s/node/internal/syncmap" + "github.com/blessnetwork/b7s/node/internal/syncmap" ) func TestSyncMap(t *testing.T) { diff --git a/node/internal/waitmap/waitmap_test.go b/node/internal/waitmap/waitmap_test.go index 5d096db3..f76d096e 100644 --- a/node/internal/waitmap/waitmap_test.go +++ b/node/internal/waitmap/waitmap_test.go @@ -6,7 +6,7 @@ import ( "testing" "time" - "github.com/blocklessnetwork/b7s/node/internal/waitmap" + "github.com/blessnetwork/b7s/node/internal/waitmap" "github.com/stretchr/testify/require" ) diff --git a/node/message.go b/node/message.go index d860d826..a696269d 100644 --- a/node/message.go +++ b/node/message.go @@ -10,7 +10,7 @@ import ( pubsub "github.com/libp2p/go-libp2p-pubsub" "github.com/libp2p/go-libp2p/core/peer" - "github.com/blocklessnetwork/b7s/models/blockless" + "github.com/blessnetwork/b7s/models/bls" ) type topicInfo struct { @@ -38,7 +38,7 @@ func (c *core) Subscribe(ctx context.Context, topic string) error { } // send serializes the message and sends it to the specified peer. -func (c *core) Send(ctx context.Context, to peer.ID, msg blockless.Message) error { +func (c *core) Send(ctx context.Context, to peer.ID, msg bls.Message) error { opts := new(messageSpanConfig).pipeline(DirectMessagePipeline).peer(to).spanOpts() ctx, span := c.tracer.Start(ctx, msgSendSpanName(spanMessageSend, msg.Type()), opts...) @@ -64,7 +64,7 @@ func (c *core) Send(ctx context.Context, to peer.ID, msg blockless.Message) erro } // sendToMany serializes the message and sends it to a number of peers. `requireAll` dictates how we treat partial errors. -func (c *core) SendToMany(ctx context.Context, peers []peer.ID, msg blockless.Message, requireAll bool) error { +func (c *core) SendToMany(ctx context.Context, peers []peer.ID, msg bls.Message, requireAll bool) error { opts := new(messageSpanConfig).pipeline(DirectMessagePipeline).peers(peers...).spanOpts() ctx, span := c.tracer.Start(ctx, msgSendSpanName(spanMessageSend, msg.Type()), opts...) @@ -119,11 +119,11 @@ func (c *core) SendToMany(ctx context.Context, peers []peer.ID, msg blockless.Me } } -func (c *core) Publish(ctx context.Context, msg blockless.Message) error { - return c.PublishToTopic(ctx, blockless.DefaultTopic, msg) +func (c *core) Publish(ctx context.Context, msg bls.Message) error { + return c.PublishToTopic(ctx, bls.DefaultTopic, msg) } -func (c *core) PublishToTopic(ctx context.Context, topic string, msg blockless.Message) error { +func (c *core) PublishToTopic(ctx context.Context, topic string, msg bls.Message) error { opts := new(messageSpanConfig).pipeline(PubSubPipeline(topic)).spanOpts() ctx, span := c.tracer.Start(ctx, msgSendSpanName(spanMessagePublish, msg.Type()), opts...) diff --git a/node/message_test.go b/node/message_test.go index f2b5659f..f1581c24 100644 --- a/node/message_test.go +++ b/node/message_test.go @@ -11,11 +11,11 @@ import ( "github.com/libp2p/go-libp2p/core/peer" "github.com/stretchr/testify/require" - "github.com/blocklessnetwork/b7s/host" - "github.com/blocklessnetwork/b7s/models/blockless" - "github.com/blocklessnetwork/b7s/node" - "github.com/blocklessnetwork/b7s/testing/helpers" - "github.com/blocklessnetwork/b7s/testing/mocks" + "github.com/blessnetwork/b7s/host" + "github.com/blessnetwork/b7s/models/bls" + "github.com/blessnetwork/b7s/node" + "github.com/blessnetwork/b7s/testing/helpers" + "github.com/blessnetwork/b7s/testing/mocks" ) const ( @@ -38,7 +38,7 @@ func TestNode_Publish(t *testing.T) { var ( rec = newDummyRecord() ctx = context.Background() - topic = blockless.DefaultTopic + topic = bls.DefaultTopic ) client, err := host.New(mocks.NoopLogger, loopback, 0) @@ -52,7 +52,7 @@ func TestNode_Publish(t *testing.T) { err = core.Host().InitPubSub(ctx) require.NoError(t, err) - err = core.Subscribe(ctx, blockless.DefaultTopic) + err = core.Subscribe(ctx, bls.DefaultTopic) require.NoError(t, err) // Establish a connection between peers. @@ -96,8 +96,8 @@ func TestNode_SendMessageToMany(t *testing.T) { core = node.NewCore(log, helpers.NewLoopbackHost(t, log)) ) - client1.SetStreamHandler(blockless.ProtocolID, func(stream network.Stream) {}) - client2.SetStreamHandler(blockless.ProtocolID, func(stream network.Stream) {}) + client1.SetStreamHandler(bls.ProtocolID, func(stream network.Stream) {}) + client2.SetStreamHandler(bls.ProtocolID, func(stream network.Stream) {}) // NOTE: These subtests are sequential. diff --git a/node/pipeline.go b/node/pipeline.go index 6a31db83..322c02e7 100644 --- a/node/pipeline.go +++ b/node/pipeline.go @@ -3,7 +3,7 @@ package node import ( "fmt" - "github.com/blocklessnetwork/b7s/models/blockless" + "github.com/blessnetwork/b7s/models/bls" ) type PipelineID int @@ -53,8 +53,8 @@ func correctPipeline(msg string, pipeline Pipeline) bool { switch msg { // Messages we don't expect as direct messages. case - blockless.MessageHealthCheck, - blockless.MessageRollCall: + bls.MessageHealthCheck, + bls.MessageRollCall: // Technically we only publish InstallFunction. However, it's handy for tests to support // direct install, and it's somewhat of a low risk. @@ -69,13 +69,13 @@ func correctPipeline(msg string, pipeline Pipeline) bool { switch msg { // Messages we don't allow to be published. case - blockless.MessageInstallFunctionResponse, - blockless.MessageExecute, - blockless.MessageExecuteResponse, - blockless.MessageFormCluster, - blockless.MessageFormClusterResponse, - blockless.MessageDisbandCluster, - blockless.MessageRollCallResponse: + bls.MessageInstallFunctionResponse, + bls.MessageExecute, + bls.MessageExecuteResponse, + bls.MessageFormCluster, + bls.MessageFormClusterResponse, + bls.MessageDisbandCluster, + bls.MessageRollCallResponse: return false diff --git a/node/pipeline_internal_test.go b/node/pipeline_internal_test.go index 97638d31..f9059f8a 100644 --- a/node/pipeline_internal_test.go +++ b/node/pipeline_internal_test.go @@ -5,13 +5,13 @@ import ( "github.com/stretchr/testify/require" - "github.com/blocklessnetwork/b7s/models/blockless" + "github.com/blessnetwork/b7s/models/bls" ) func TestNode_DisallowedMessages(t *testing.T) { var ( - pubsub = PubSubPipeline(blockless.DefaultTopic) + pubsub = PubSubPipeline(bls.DefaultTopic) direct = DirectMessagePipeline ) @@ -20,15 +20,15 @@ func TestNode_DisallowedMessages(t *testing.T) { message string }{ // Messages disallowed for publishing. - {pubsub, blockless.MessageInstallFunctionResponse}, - {pubsub, blockless.MessageExecute}, - {pubsub, blockless.MessageExecuteResponse}, - {pubsub, blockless.MessageFormCluster}, - {pubsub, blockless.MessageFormClusterResponse}, - {pubsub, blockless.MessageDisbandCluster}, + {pubsub, bls.MessageInstallFunctionResponse}, + {pubsub, bls.MessageExecute}, + {pubsub, bls.MessageExecuteResponse}, + {pubsub, bls.MessageFormCluster}, + {pubsub, bls.MessageFormClusterResponse}, + {pubsub, bls.MessageDisbandCluster}, // Messages disallowed for direct sending. - {direct, blockless.MessageHealthCheck}, - {direct, blockless.MessageRollCall}, + {direct, bls.MessageHealthCheck}, + {direct, bls.MessageRollCall}, } for _, test := range tests { diff --git a/node/process.go b/node/process.go index b04f52d4..73e01cd2 100644 --- a/node/process.go +++ b/node/process.go @@ -9,8 +9,8 @@ import ( "github.com/libp2p/go-libp2p/core/peer" otelcodes "go.opentelemetry.io/otel/codes" - "github.com/blocklessnetwork/b7s/models/blockless" - "github.com/blocklessnetwork/b7s/telemetry/tracing" + "github.com/blessnetwork/b7s/models/bls" + "github.com/blessnetwork/b7s/telemetry/tracing" ) func (c *core) processMessage(ctx context.Context, from peer.ID, payload []byte, pipeline Pipeline, process func(context.Context, peer.ID, string, []byte) error) (procError error) { @@ -63,7 +63,7 @@ func (c *core) processMessage(ctx context.Context, from peer.ID, payload []byte, return process(ctx, from, typ, payload) } -func HandleMessage[T blockless.Message](ctx context.Context, from peer.ID, payload []byte, processFunc func(ctx context.Context, from peer.ID, msg T) error) error { +func HandleMessage[T bls.Message](ctx context.Context, from peer.ID, payload []byte, processFunc func(ctx context.Context, from peer.ID, msg T) error) error { var msg T err := json.Unmarshal(payload, &msg) diff --git a/node/run.go b/node/run.go index 44442f36..d5631444 100644 --- a/node/run.go +++ b/node/run.go @@ -13,7 +13,7 @@ import ( "github.com/libp2p/go-libp2p/core/network" "github.com/libp2p/go-libp2p/core/peer" - "github.com/blocklessnetwork/b7s/models/blockless" + "github.com/blessnetwork/b7s/models/bls" ) // Run will start the main loop for the node. @@ -130,7 +130,7 @@ func (c *core) Run(ctx context.Context, process func(context.Context, peer.ID, s // listenDirectMessages will process messages sent directly to the peer (as opposed to published messages). func (c *core) listenDirectMessages(ctx context.Context, process func(context.Context, peer.ID, string, []byte) error) { - c.host.SetStreamHandler(blockless.ProtocolID, func(stream network.Stream) { + c.host.SetStreamHandler(bls.ProtocolID, func(stream network.Stream) { defer stream.Close() from := stream.Conn().RemotePeer() diff --git a/node/telemetry.go b/node/telemetry.go index 0815414e..fdee81bc 100644 --- a/node/telemetry.go +++ b/node/telemetry.go @@ -8,13 +8,13 @@ import ( "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/trace" - "github.com/blocklessnetwork/b7s/models/blockless" - "github.com/blocklessnetwork/b7s/telemetry/b7ssemconv" - "github.com/blocklessnetwork/b7s/telemetry/tracing" + "github.com/blessnetwork/b7s/models/bls" + "github.com/blessnetwork/b7s/telemetry/b7ssemconv" + "github.com/blessnetwork/b7s/telemetry/tracing" ) -func saveTraceContext(ctx context.Context, msg blockless.Message) { - tmsg, ok := msg.(blockless.TraceableMessage) +func saveTraceContext(ctx context.Context, msg bls.Message) { + tmsg, ok := msg.(bls.TraceableMessage) if !ok { return } @@ -67,7 +67,7 @@ func (c *messageSpanConfig) spanOpts() []trace.SpanStartOption { attrs = append(attrs, b7ssemconv.MessagePeer.String(c.receivers[0].String())) } else if len(c.receivers) > 1 { attrs = append(attrs, b7ssemconv.MessagePeers.String( - strings.Join(blockless.PeerIDsToStr(c.receivers), ","), + strings.Join(bls.PeerIDsToStr(c.receivers), ","), )) } diff --git a/node/telemetry_internal_test.go b/node/telemetry_internal_test.go index 6799ec04..54dbcc4b 100644 --- a/node/telemetry_internal_test.go +++ b/node/telemetry_internal_test.go @@ -10,17 +10,17 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/otel" - "github.com/blocklessnetwork/b7s/models/blockless" - "github.com/blocklessnetwork/b7s/models/response" - "github.com/blocklessnetwork/b7s/telemetry" - "github.com/blocklessnetwork/b7s/testing/helpers" + "github.com/blessnetwork/b7s/models/bls" + "github.com/blessnetwork/b7s/models/response" + "github.com/blessnetwork/b7s/telemetry" + "github.com/blessnetwork/b7s/testing/helpers" ) func TestTelemetry_SaveTraceContext(t *testing.T) { var ( ctx = context.Background() - resource, _ = telemetry.CreateResource(ctx, "instance-id", blockless.WorkerNode) + resource, _ = telemetry.CreateResource(ctx, "instance-id", bls.WorkerNode) _, tp = helpers.CreateTracerProvider(t, resource) tracer = tp.Tracer("test-tracer") spanName = fmt.Sprintf("test-span-%v", rand.Int()) diff --git a/node/telemetry_message_internal_test.go b/node/telemetry_message_internal_test.go index 77b6ce4e..3a433df3 100644 --- a/node/telemetry_message_internal_test.go +++ b/node/telemetry_message_internal_test.go @@ -14,13 +14,13 @@ import ( otelcodes "go.opentelemetry.io/otel/codes" "go.opentelemetry.io/otel/trace" - "github.com/blocklessnetwork/b7s/models/blockless" - "github.com/blocklessnetwork/b7s/models/request" - "github.com/blocklessnetwork/b7s/models/response" - "github.com/blocklessnetwork/b7s/telemetry" - "github.com/blocklessnetwork/b7s/telemetry/tracing" - "github.com/blocklessnetwork/b7s/testing/helpers" - "github.com/blocklessnetwork/b7s/testing/mocks" + "github.com/blessnetwork/b7s/models/bls" + "github.com/blessnetwork/b7s/models/request" + "github.com/blessnetwork/b7s/models/response" + "github.com/blessnetwork/b7s/telemetry" + "github.com/blessnetwork/b7s/telemetry/tracing" + "github.com/blessnetwork/b7s/testing/helpers" + "github.com/blessnetwork/b7s/testing/mocks" ) func TestNode_TraceHealthCheck(t *testing.T) { @@ -29,7 +29,7 @@ func TestNode_TraceHealthCheck(t *testing.T) { ctx = context.Background() peerID = mocks.GenericPeerID - role = blockless.WorkerNode + role = bls.WorkerNode resource, _ = telemetry.CreateResource(ctx, peerID.String(), role) exporter, tp = helpers.CreateTracerProvider(t, resource) from = mocks.GenericPeerIDs[0] @@ -48,7 +48,7 @@ func TestNode_TraceHealthCheck(t *testing.T) { return nil } - pipeline := PubSubPipeline(blockless.DefaultTopic) + pipeline := PubSubPipeline(bls.DefaultTopic) err := core.processMessage(ctx, from, payload, pipeline, process) require.NoError(t, err) @@ -81,7 +81,7 @@ func TestNode_TraceHealthCheck(t *testing.T) { require.Equal(t, from.String(), attributes["message.peer"].AsString()) require.Equal(t, pipeline.ID.String(), attributes["message.pipeline"].AsString()) require.Equal(t, pipeline.Topic, attributes["message.topic"].AsString()) - require.Equal(t, blockless.MessageHealthCheck, attributes["message.type"].AsString()) + require.Equal(t, bls.MessageHealthCheck, attributes["message.type"].AsString()) require.Equal(t, resource, span.Resource) } @@ -138,7 +138,7 @@ func TestNode_ProcessedMessageMetric(t *testing.T) { }{ { count: healthcheckCount, - pipeline: PubSubPipeline(blockless.DefaultTopic), + pipeline: PubSubPipeline(bls.DefaultTopic), rec: healthCheck, }, { diff --git a/node/worker/attributes.go b/node/worker/attributes.go index c5e29d3f..c80f4fcc 100644 --- a/node/worker/attributes.go +++ b/node/worker/attributes.go @@ -10,9 +10,9 @@ import ( "github.com/libp2p/go-libp2p/core/crypto" "github.com/libp2p/go-libp2p/core/peer" + "github.com/blessnetwork/b7s/models/bls" + "github.com/blessnetwork/b7s/models/execute" "github.com/blocklessnetwork/b7s-attributes/attributes" - "github.com/blocklessnetwork/b7s/models/blockless" - "github.com/blocklessnetwork/b7s/models/execute" ) const ( @@ -93,7 +93,7 @@ func haveAttributes(have attributes.Attestation, want execute.Attributes) error } } if !found { - return fmt.Errorf("at least one attestor wanted but none found (wanted: %s)", blockless.PeerIDsToStr(want.Attestors.OneOf)) + return fmt.Errorf("at least one attestor wanted but none found (wanted: %s)", bls.PeerIDsToStr(want.Attestors.OneOf)) } } diff --git a/node/worker/cluster.go b/node/worker/cluster.go index 771e38ee..b8089a0f 100644 --- a/node/worker/cluster.go +++ b/node/worker/cluster.go @@ -8,16 +8,16 @@ import ( "github.com/libp2p/go-libp2p/core/peer" - "github.com/blocklessnetwork/b7s/consensus" - "github.com/blocklessnetwork/b7s/models/blockless" - "github.com/blocklessnetwork/b7s/models/request" + "github.com/blessnetwork/b7s/consensus" + "github.com/blessnetwork/b7s/models/bls" + "github.com/blessnetwork/b7s/models/request" ) func (w *Worker) processFormCluster(ctx context.Context, from peer.ID, req request.FormCluster) error { w.Log().Info(). Str("request", req.RequestID). - Strs("peers", blockless.PeerIDsToStr(req.Peers)). + Strs("peers", bls.PeerIDsToStr(req.Peers)). Stringer("consensus", req.Consensus). Msg("received request to form consensus cluster") diff --git a/node/worker/config.go b/node/worker/config.go index 0b7085e0..2a1c1ad1 100644 --- a/node/worker/config.go +++ b/node/worker/config.go @@ -6,7 +6,7 @@ import ( "github.com/hashicorp/go-multierror" - "github.com/blocklessnetwork/b7s/metadata" + "github.com/blessnetwork/b7s/metadata" ) // Option can be used to set Node configuration options. diff --git a/node/worker/consensus.go b/node/worker/consensus.go index 3535a55d..6007d9f2 100644 --- a/node/worker/consensus.go +++ b/node/worker/consensus.go @@ -7,14 +7,14 @@ import ( "github.com/libp2p/go-libp2p/core/peer" - "github.com/blocklessnetwork/b7s/consensus" - "github.com/blocklessnetwork/b7s/consensus/pbft" - "github.com/blocklessnetwork/b7s/consensus/raft" - "github.com/blocklessnetwork/b7s/models/codes" - "github.com/blocklessnetwork/b7s/models/execute" - "github.com/blocklessnetwork/b7s/models/request" - "github.com/blocklessnetwork/b7s/models/response" - "github.com/blocklessnetwork/b7s/telemetry/tracing" + "github.com/blessnetwork/b7s/consensus" + "github.com/blessnetwork/b7s/consensus/pbft" + "github.com/blessnetwork/b7s/consensus/raft" + "github.com/blessnetwork/b7s/models/codes" + "github.com/blessnetwork/b7s/models/execute" + "github.com/blessnetwork/b7s/models/request" + "github.com/blessnetwork/b7s/models/response" + "github.com/blessnetwork/b7s/telemetry/tracing" ) // consensusExecutor defines the interface we have for managing clustered execution. diff --git a/node/worker/health.go b/node/worker/health.go index af1589bb..bcadc654 100644 --- a/node/worker/health.go +++ b/node/worker/health.go @@ -5,7 +5,7 @@ import ( "github.com/libp2p/go-libp2p/core/peer" - "github.com/blocklessnetwork/b7s/models/response" + "github.com/blessnetwork/b7s/models/response" ) func (w *Worker) processHealthCheck(ctx context.Context, from peer.ID, _ response.Health) error { diff --git a/node/worker/install.go b/node/worker/install.go index b16a324f..63b9acba 100644 --- a/node/worker/install.go +++ b/node/worker/install.go @@ -6,8 +6,8 @@ import ( "github.com/libp2p/go-libp2p/core/peer" - "github.com/blocklessnetwork/b7s/models/codes" - "github.com/blocklessnetwork/b7s/models/request" + "github.com/blessnetwork/b7s/models/codes" + "github.com/blessnetwork/b7s/models/request" ) func (w *Worker) processInstallFunction(ctx context.Context, from peer.ID, req request.InstallFunction) error { diff --git a/node/worker/process.go b/node/worker/process.go index 83ac07f4..4a1eab1c 100644 --- a/node/worker/process.go +++ b/node/worker/process.go @@ -6,24 +6,24 @@ import ( "github.com/libp2p/go-libp2p/core/peer" - "github.com/blocklessnetwork/b7s/models/blockless" - "github.com/blocklessnetwork/b7s/node" + "github.com/blessnetwork/b7s/models/bls" + "github.com/blessnetwork/b7s/node" ) func (w *Worker) process(ctx context.Context, from peer.ID, msg string, payload []byte) error { switch msg { - case blockless.MessageHealthCheck: + case bls.MessageHealthCheck: return node.HandleMessage(ctx, from, payload, w.processHealthCheck) - case blockless.MessageInstallFunction: + case bls.MessageInstallFunction: return node.HandleMessage(ctx, from, payload, w.processInstallFunction) - case blockless.MessageRollCall: + case bls.MessageRollCall: return node.HandleMessage(ctx, from, payload, w.processRollCall) - case blockless.MessageWorkOrder: + case bls.MessageWorkOrder: return node.HandleMessage(ctx, from, payload, w.processWorkOrder) - case blockless.MessageFormCluster: + case bls.MessageFormCluster: return node.HandleMessage(ctx, from, payload, w.processFormCluster) - case blockless.MessageDisbandCluster: + case bls.MessageDisbandCluster: return node.HandleMessage(ctx, from, payload, w.processDisbandCluster) } diff --git a/node/worker/roll_call.go b/node/worker/roll_call.go index 541bb3cc..c2eb09af 100644 --- a/node/worker/roll_call.go +++ b/node/worker/roll_call.go @@ -7,9 +7,9 @@ import ( "github.com/armon/go-metrics" "github.com/libp2p/go-libp2p/core/peer" - "github.com/blocklessnetwork/b7s/consensus" - "github.com/blocklessnetwork/b7s/models/codes" - "github.com/blocklessnetwork/b7s/models/request" + "github.com/blessnetwork/b7s/consensus" + "github.com/blessnetwork/b7s/models/codes" + "github.com/blessnetwork/b7s/models/request" ) func (w *Worker) processRollCall(ctx context.Context, from peer.ID, req request.RollCall) error { diff --git a/node/worker/work_order.go b/node/worker/work_order.go index b361f894..ef5e633f 100644 --- a/node/worker/work_order.go +++ b/node/worker/work_order.go @@ -10,11 +10,11 @@ import ( "github.com/libp2p/go-libp2p/core/peer" "go.opentelemetry.io/otel/trace" - "github.com/blocklessnetwork/b7s/consensus" - "github.com/blocklessnetwork/b7s/models/codes" - "github.com/blocklessnetwork/b7s/models/execute" - "github.com/blocklessnetwork/b7s/models/request" - "github.com/blocklessnetwork/b7s/telemetry/tracing" + "github.com/blessnetwork/b7s/consensus" + "github.com/blessnetwork/b7s/models/codes" + "github.com/blessnetwork/b7s/models/execute" + "github.com/blessnetwork/b7s/models/request" + "github.com/blessnetwork/b7s/telemetry/tracing" ) func (w *Worker) processWorkOrder(ctx context.Context, from peer.ID, req request.WorkOrder) error { diff --git a/node/worker/work_order_internal_test.go b/node/worker/work_order_internal_test.go index a991b97b..4344dbdb 100644 --- a/node/worker/work_order_internal_test.go +++ b/node/worker/work_order_internal_test.go @@ -11,13 +11,13 @@ import ( "github.com/libp2p/go-libp2p/core/peer" "github.com/stretchr/testify/require" - "github.com/blocklessnetwork/b7s/consensus" - "github.com/blocklessnetwork/b7s/models/blockless" - "github.com/blocklessnetwork/b7s/models/codes" - "github.com/blocklessnetwork/b7s/models/execute" - "github.com/blocklessnetwork/b7s/models/request" - "github.com/blocklessnetwork/b7s/models/response" - "github.com/blocklessnetwork/b7s/testing/mocks" + "github.com/blessnetwork/b7s/consensus" + "github.com/blessnetwork/b7s/models/bls" + "github.com/blessnetwork/b7s/models/codes" + "github.com/blessnetwork/b7s/models/execute" + "github.com/blessnetwork/b7s/models/request" + "github.com/blessnetwork/b7s/models/response" + "github.com/blessnetwork/b7s/testing/mocks" ) func createWorkerNode(t *testing.T) *Worker { @@ -75,7 +75,7 @@ func TestWorker_ProcessWorkOrder(t *testing.T) { // Create node core with overrridden Send function. // Send function verifies that the result it is passed to it is what the executor returned. core := mocks.BaselineNodeCore(t) - core.SendFunc = func(_ context.Context, _ peer.ID, msg blockless.Message) error { + core.SendFunc = func(_ context.Context, _ peer.ID, msg bls.Message) error { er, ok := any(msg).(*response.WorkOrder) require.True(t, ok) @@ -126,7 +126,7 @@ func TestWorker_ProcessWorkOrder_Metadata(t *testing.T) { // Setup Send function to verify metadata is correctly set core := mocks.BaselineNodeCore(t) - core.SendFunc = func(_ context.Context, _ peer.ID, msg blockless.Message) error { + core.SendFunc = func(_ context.Context, _ peer.ID, msg bls.Message) error { er, ok := any(msg).(*response.WorkOrder) require.True(t, ok) require.Equal(t, data, er.Result.Metadata) @@ -161,7 +161,7 @@ func TestWorker_ProcessWorkOrder_HandlesErrors(t *testing.T) { // Override Send function to verify that the result it is passed to it is what the executor returned, and it was sent despite an execution error. core := mocks.BaselineNodeCore(t) - core.SendFunc = func(_ context.Context, _ peer.ID, msg blockless.Message) error { + core.SendFunc = func(_ context.Context, _ peer.ID, msg bls.Message) error { er, ok := any(msg).(*response.WorkOrder) require.True(t, ok) @@ -204,7 +204,7 @@ func TestWorker_ProcessWorkOrder_HandlesErrors(t *testing.T) { worker := createWorkerNode(t) // Setup send failure. core := mocks.BaselineNodeCore(t) - core.SendFunc = func(_ context.Context, _ peer.ID, _ blockless.Message) error { + core.SendFunc = func(_ context.Context, _ peer.ID, _ bls.Message) error { return sendErr } worker.Core = core @@ -247,7 +247,7 @@ func TestWorker_ProcessWorkOrder_HandlesErrors(t *testing.T) { // Override Send function to verify that the result it is passed to it is what the executor returned, and it was sent despite an execution error. core := mocks.BaselineNodeCore(t) - core.SendFunc = func(_ context.Context, _ peer.ID, msg blockless.Message) error { + core.SendFunc = func(_ context.Context, _ peer.ID, msg bls.Message) error { er, ok := any(msg).(*response.WorkOrder) require.True(t, ok) @@ -275,7 +275,7 @@ func TestWorker_ProcessWorkOrder_HandlesErrors(t *testing.T) { worker := createWorkerNode(t) core := mocks.BaselineNodeCore(t) - core.SendFunc = func(_ context.Context, _ peer.ID, msg blockless.Message) error { + core.SendFunc = func(_ context.Context, _ peer.ID, msg bls.Message) error { er, ok := any(msg).(*response.WorkOrder) require.True(t, ok) diff --git a/node/worker/worker.go b/node/worker/worker.go index acf51880..5d7a96ed 100644 --- a/node/worker/worker.go +++ b/node/worker/worker.go @@ -6,13 +6,13 @@ import ( "github.com/armon/go-metrics" + "github.com/blessnetwork/b7s/info" + "github.com/blessnetwork/b7s/models/bls" + "github.com/blessnetwork/b7s/models/execute" + "github.com/blessnetwork/b7s/node" + "github.com/blessnetwork/b7s/node/internal/syncmap" + "github.com/blessnetwork/b7s/node/internal/waitmap" "github.com/blocklessnetwork/b7s-attributes/attributes" - "github.com/blocklessnetwork/b7s/info" - "github.com/blocklessnetwork/b7s/models/blockless" - "github.com/blocklessnetwork/b7s/models/execute" - "github.com/blocklessnetwork/b7s/node" - "github.com/blocklessnetwork/b7s/node/internal/syncmap" - "github.com/blocklessnetwork/b7s/node/internal/waitmap" ) type Worker struct { @@ -20,7 +20,7 @@ type Worker struct { cfg Config - executor blockless.Executor + executor bls.Executor fstore FStore attributes *attributes.Attestation @@ -29,7 +29,7 @@ type Worker struct { executeResponses *waitmap.WaitMap[string, execute.NodeResult] } -func New(core node.Core, fstore FStore, executor blockless.Executor, options ...Option) (*Worker, error) { +func New(core node.Core, fstore FStore, executor bls.Executor, options ...Option) (*Worker, error) { // Initialize config. cfg := DefaultConfig diff --git a/store/key_test.go b/store/key_test.go index 075a1e2e..30826550 100644 --- a/store/key_test.go +++ b/store/key_test.go @@ -6,7 +6,7 @@ import ( "github.com/stretchr/testify/require" - "github.com/blocklessnetwork/b7s/testing/mocks" + "github.com/blessnetwork/b7s/testing/mocks" ) func TestStore_KeyEncoding(t *testing.T) { diff --git a/store/retrieve.go b/store/retrieve.go index 55fa8178..cce01065 100644 --- a/store/retrieve.go +++ b/store/retrieve.go @@ -8,29 +8,29 @@ import ( "github.com/cockroachdb/pebble" "github.com/libp2p/go-libp2p/core/peer" - "github.com/blocklessnetwork/b7s/models/blockless" + "github.com/blessnetwork/b7s/models/bls" ) -func (s *Store) RetrievePeer(_ context.Context, id peer.ID) (blockless.Peer, error) { +func (s *Store) RetrievePeer(_ context.Context, id peer.ID) (bls.Peer, error) { idBytes, err := id.MarshalBinary() if err != nil { - return blockless.Peer{}, fmt.Errorf("could not serialize peer ID: %w", err) + return bls.Peer{}, fmt.Errorf("could not serialize peer ID: %w", err) } key := encodeKey(PrefixPeer, idBytes) - var peer blockless.Peer + var peer bls.Peer err = s.retrieve(key, &peer) if err != nil { - return blockless.Peer{}, fmt.Errorf("could not retrieve value: %w", err) + return bls.Peer{}, fmt.Errorf("could not retrieve value: %w", err) } return peer, nil } -func (s *Store) RetrievePeers(_ context.Context) ([]blockless.Peer, error) { +func (s *Store) RetrievePeers(_ context.Context) ([]bls.Peer, error) { - peers := make([]blockless.Peer, 0) + peers := make([]bls.Peer, 0) opts := prefixIterOptions([]byte{PrefixPeer}) it, err := s.db.NewIter(opts) @@ -39,7 +39,7 @@ func (s *Store) RetrievePeers(_ context.Context) ([]blockless.Peer, error) { } for it.First(); it.Valid(); it.Next() { - var peer blockless.Peer + var peer bls.Peer err := s.retrieve(it.Key(), &peer) if err != nil { return nil, fmt.Errorf("could not retrieve peer (key: %x): %w", it.Key(), err) @@ -51,21 +51,21 @@ func (s *Store) RetrievePeers(_ context.Context) ([]blockless.Peer, error) { return peers, nil } -func (s *Store) RetrieveFunction(_ context.Context, cid string) (blockless.FunctionRecord, error) { +func (s *Store) RetrieveFunction(_ context.Context, cid string) (bls.FunctionRecord, error) { key := encodeKey(PrefixFunction, cid) - var function blockless.FunctionRecord + var function bls.FunctionRecord err := s.retrieve(key, &function) if err != nil { - return blockless.FunctionRecord{}, fmt.Errorf("could not retrieve function record: %w", err) + return bls.FunctionRecord{}, fmt.Errorf("could not retrieve function record: %w", err) } return function, nil } -func (s *Store) RetrieveFunctions(_ context.Context) ([]blockless.FunctionRecord, error) { +func (s *Store) RetrieveFunctions(_ context.Context) ([]bls.FunctionRecord, error) { - functions := make([]blockless.FunctionRecord, 0) + functions := make([]bls.FunctionRecord, 0) opts := prefixIterOptions([]byte{PrefixFunction}) it, err := s.db.NewIter(opts) @@ -74,7 +74,7 @@ func (s *Store) RetrieveFunctions(_ context.Context) ([]blockless.FunctionRecord } for it.First(); it.Valid(); it.Next() { - var function blockless.FunctionRecord + var function bls.FunctionRecord err := s.retrieve(it.Key(), &function) if err != nil { return nil, fmt.Errorf("could not retrieve functioN (key: %x): %w", it.Key(), err) @@ -91,7 +91,7 @@ func (s *Store) retrieve(key []byte, out any) error { value, closer, err := s.db.Get(key) if err != nil { if errors.Is(err, pebble.ErrNotFound) { - return blockless.ErrNotFound + return bls.ErrNotFound } return fmt.Errorf("could not retrieve value: %w", err) } diff --git a/store/save.go b/store/save.go index 19d728b2..afff8a46 100644 --- a/store/save.go +++ b/store/save.go @@ -6,10 +6,10 @@ import ( "github.com/cockroachdb/pebble" - "github.com/blocklessnetwork/b7s/models/blockless" + "github.com/blessnetwork/b7s/models/bls" ) -func (s *Store) SavePeer(_ context.Context, peer blockless.Peer) error { +func (s *Store) SavePeer(_ context.Context, peer bls.Peer) error { id, err := peer.ID.MarshalBinary() if err != nil { @@ -25,7 +25,7 @@ func (s *Store) SavePeer(_ context.Context, peer blockless.Peer) error { return nil } -func (s *Store) SaveFunction(_ context.Context, function blockless.FunctionRecord) error { +func (s *Store) SaveFunction(_ context.Context, function bls.FunctionRecord) error { key := encodeKey(PrefixFunction, function.CID) err := s.save(key, function) diff --git a/store/store_test.go b/store/store_test.go index 087f0342..e1c07f45 100644 --- a/store/store_test.go +++ b/store/store_test.go @@ -10,11 +10,11 @@ import ( "github.com/libp2p/go-libp2p/core/peer" "github.com/stretchr/testify/require" - "github.com/blocklessnetwork/b7s/models/blockless" - "github.com/blocklessnetwork/b7s/store" - "github.com/blocklessnetwork/b7s/store/codec" - "github.com/blocklessnetwork/b7s/testing/helpers" - "github.com/blocklessnetwork/b7s/testing/mocks" + "github.com/blessnetwork/b7s/models/bls" + "github.com/blessnetwork/b7s/store" + "github.com/blessnetwork/b7s/store/codec" + "github.com/blessnetwork/b7s/testing/helpers" + "github.com/blessnetwork/b7s/testing/mocks" ) func TestStore_PeerOperations(t *testing.T) { @@ -41,7 +41,7 @@ func TestStore_PeerOperations(t *testing.T) { // Verify peer is gone. _, err = store.RetrievePeer(ctx, peer.ID) - require.ErrorIs(t, err, blockless.ErrNotFound) + require.ErrorIs(t, err, bls.ErrNotFound) }) } @@ -52,7 +52,7 @@ func TestStore_RetrievePeers(t *testing.T) { ctx := context.Background() count := 10 - peers := make(map[peer.ID]blockless.Peer) + peers := make(map[peer.ID]bls.Peer) generated := helpers.CreateRandomPeers(t, count) for _, peer := range generated { peers[peer.ID] = peer @@ -99,7 +99,7 @@ func TestStore_FunctionOperations(t *testing.T) { // Verify function is gone. _, err = store.RetrieveFunction(ctx, function.CID) - require.ErrorIs(t, err, blockless.ErrNotFound) + require.ErrorIs(t, err, bls.ErrNotFound) }) } @@ -110,10 +110,10 @@ func TestStore_RetrieveFunctions(t *testing.T) { ctx := context.Background() count := 10 - functions := make(map[string]blockless.FunctionRecord) + functions := make(map[string]bls.FunctionRecord) for i := 0; i < count; i++ { - fn := blockless.FunctionRecord{ + fn := bls.FunctionRecord{ CID: fmt.Sprintf("dummy-cid-%v", i), URL: fmt.Sprintf("https://example.com/dummy-url-%v", i), Manifest: mocks.GenericManifest, diff --git a/store/traceable/traceable.go b/store/traceable/traceable.go index 9025fc81..08043c99 100644 --- a/store/traceable/traceable.go +++ b/store/traceable/traceable.go @@ -7,10 +7,10 @@ import ( "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/trace" - "github.com/blocklessnetwork/b7s/models/blockless" - "github.com/blocklessnetwork/b7s/store" - "github.com/blocklessnetwork/b7s/telemetry/b7ssemconv" - "github.com/blocklessnetwork/b7s/telemetry/tracing" + "github.com/blessnetwork/b7s/models/bls" + "github.com/blessnetwork/b7s/store" + "github.com/blessnetwork/b7s/telemetry/b7ssemconv" + "github.com/blessnetwork/b7s/telemetry/tracing" ) // Store is a thin wrapper around the standard b7s store, adding a tracer to it. @@ -29,7 +29,7 @@ func New(store *store.Store) *Store { return &s } -func (s *Store) SavePeer(ctx context.Context, peer blockless.Peer) error { +func (s *Store) SavePeer(ctx context.Context, peer bls.Peer) error { callback := func() error { return s.store.SavePeer(ctx, peer) @@ -39,7 +39,7 @@ func (s *Store) SavePeer(ctx context.Context, peer blockless.Peer) error { return s.tracer.WithSpanFromContext(ctx, "SavePeer", callback, opts...) } -func (s *Store) SaveFunction(ctx context.Context, function blockless.FunctionRecord) error { +func (s *Store) SaveFunction(ctx context.Context, function bls.FunctionRecord) error { callback := func() error { return s.store.SaveFunction(ctx, function) @@ -49,9 +49,9 @@ func (s *Store) SaveFunction(ctx context.Context, function blockless.FunctionRec return s.tracer.WithSpanFromContext(ctx, "SaveFunction", callback, opts...) } -func (s *Store) RetrievePeer(ctx context.Context, id peer.ID) (blockless.Peer, error) { +func (s *Store) RetrievePeer(ctx context.Context, id peer.ID) (bls.Peer, error) { - var peer blockless.Peer + var peer bls.Peer var err error callback := func() error { peer, err = s.store.RetrievePeer(ctx, id) @@ -63,9 +63,9 @@ func (s *Store) RetrievePeer(ctx context.Context, id peer.ID) (blockless.Peer, e return peer, err } -func (s *Store) RetrievePeers(ctx context.Context) ([]blockless.Peer, error) { +func (s *Store) RetrievePeers(ctx context.Context) ([]bls.Peer, error) { - var peers []blockless.Peer + var peers []bls.Peer var err error callback := func() error { peers, err = s.store.RetrievePeers(ctx) @@ -76,9 +76,9 @@ func (s *Store) RetrievePeers(ctx context.Context) ([]blockless.Peer, error) { return peers, err } -func (s *Store) RetrieveFunction(ctx context.Context, cid string) (blockless.FunctionRecord, error) { +func (s *Store) RetrieveFunction(ctx context.Context, cid string) (bls.FunctionRecord, error) { - var function blockless.FunctionRecord + var function bls.FunctionRecord var err error callback := func() error { function, err = s.store.RetrieveFunction(ctx, cid) @@ -90,9 +90,9 @@ func (s *Store) RetrieveFunction(ctx context.Context, cid string) (blockless.Fun return function, err } -func (s *Store) RetrieveFunctions(ctx context.Context) ([]blockless.FunctionRecord, error) { +func (s *Store) RetrieveFunctions(ctx context.Context) ([]bls.FunctionRecord, error) { - var functions []blockless.FunctionRecord + var functions []bls.FunctionRecord var err error callback := func() error { functions, err = s.store.RetrieveFunctions(ctx) @@ -123,7 +123,7 @@ func (s *Store) RemoveFunction(ctx context.Context, cid string) error { opts...) } -func peerAttributes(peer blockless.Peer) []attribute.KeyValue { +func peerAttributes(peer bls.Peer) []attribute.KeyValue { return []attribute.KeyValue{ b7ssemconv.PeerID.String(peer.ID.String()), b7ssemconv.PeerMultiaddr.String(peer.MultiAddr), diff --git a/telemetry/metrics_test.go b/telemetry/metrics_test.go index b0aacd83..9bf4a510 100644 --- a/telemetry/metrics_test.go +++ b/telemetry/metrics_test.go @@ -9,7 +9,7 @@ import ( dto "github.com/prometheus/client_model/go" "github.com/stretchr/testify/require" - "github.com/blocklessnetwork/b7s/telemetry" + "github.com/blessnetwork/b7s/telemetry" ) func TestTelemetry_Metrics(t *testing.T) { diff --git a/telemetry/params.go b/telemetry/params.go index 7507837f..5f096d5a 100644 --- a/telemetry/params.go +++ b/telemetry/params.go @@ -1,7 +1,7 @@ package telemetry import ( - "github.com/blocklessnetwork/b7s/info" + "github.com/blessnetwork/b7s/info" "go.opentelemetry.io/otel/sdk/resource" semconv "go.opentelemetry.io/otel/semconv/v1.4.0" ) diff --git a/telemetry/resource.go b/telemetry/resource.go index cb41149b..95686054 100644 --- a/telemetry/resource.go +++ b/telemetry/resource.go @@ -9,11 +9,11 @@ import ( "go.opentelemetry.io/otel/sdk/resource" semconv "go.opentelemetry.io/otel/semconv/v1.4.0" - "github.com/blocklessnetwork/b7s/models/blockless" - "github.com/blocklessnetwork/b7s/telemetry/b7ssemconv" + "github.com/blessnetwork/b7s/models/bls" + "github.com/blessnetwork/b7s/telemetry/b7ssemconv" ) -func CreateResource(ctx context.Context, id string, role blockless.NodeRole) (*resource.Resource, error) { +func CreateResource(ctx context.Context, id string, role bls.NodeRole) (*resource.Resource, error) { if id == "" { return nil, errors.New("instance ID is required") diff --git a/telemetry/telemetry_test.go b/telemetry/telemetry_test.go index 7c06f29c..059c9669 100644 --- a/telemetry/telemetry_test.go +++ b/telemetry/telemetry_test.go @@ -7,15 +7,15 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/otel/attribute" - "github.com/blocklessnetwork/b7s/models/blockless" - "github.com/blocklessnetwork/b7s/telemetry" + "github.com/blessnetwork/b7s/models/bls" + "github.com/blessnetwork/b7s/telemetry" ) func TestTelemetry_Resource(t *testing.T) { var ( id = "resource-id" - role = blockless.WorkerNode + role = bls.WorkerNode ) resource, err := telemetry.CreateResource(context.Background(), id, role) diff --git a/telemetry/trace_config.go b/telemetry/trace_config.go index f9b6c209..17a25c85 100644 --- a/telemetry/trace_config.go +++ b/telemetry/trace_config.go @@ -3,7 +3,7 @@ package telemetry import ( "time" - "github.com/blocklessnetwork/b7s/models/blockless" + "github.com/blessnetwork/b7s/models/bls" ) var DefaultTraceConfig = TraceConfig{ @@ -28,7 +28,7 @@ type TraceConfig struct { // Node ID, registered as service instance ID attribute. ID string // Node role, registered as service role attribute. - Role blockless.NodeRole + Role bls.NodeRole // Maximum time after which exporters will send batched span. ExporterBatchTimeout time.Duration // Configuration for GRPC trace exporter. @@ -61,7 +61,7 @@ type TraceInMemConfig struct { type TraceOption func(*TraceConfig) -func WithNodeRole(r blockless.NodeRole) TraceOption { +func WithNodeRole(r bls.NodeRole) TraceOption { return func(cfg *TraceConfig) { cfg.Role = r } diff --git a/telemetry/trace_config_internal_test.go b/telemetry/trace_config_internal_test.go index 8762ab3c..110f4e2b 100644 --- a/telemetry/trace_config_internal_test.go +++ b/telemetry/trace_config_internal_test.go @@ -6,7 +6,7 @@ import ( "github.com/stretchr/testify/require" - "github.com/blocklessnetwork/b7s/models/blockless" + "github.com/blessnetwork/b7s/models/bls" ) func TestTraceConfig_ID(t *testing.T) { @@ -23,10 +23,10 @@ func TestTraceConfig_ID(t *testing.T) { func TestTraceConfig_NodeRole(t *testing.T) { - const role = blockless.WorkerNode + const role = bls.WorkerNode cfg := TraceConfig{ - Role: blockless.HeadNode, + Role: bls.HeadNode, } WithNodeRole(role)(&cfg) diff --git a/telemetry/trace_test.go b/telemetry/trace_test.go index 167d3326..4aa615e2 100644 --- a/telemetry/trace_test.go +++ b/telemetry/trace_test.go @@ -12,8 +12,8 @@ import ( otelcodes "go.opentelemetry.io/otel/codes" "go.opentelemetry.io/otel/trace" - "github.com/blocklessnetwork/b7s/models/blockless" - "github.com/blocklessnetwork/b7s/telemetry" + "github.com/blessnetwork/b7s/models/bls" + "github.com/blessnetwork/b7s/telemetry" ) func TestTelemetry_TraceProviderInMem(t *testing.T) { @@ -25,7 +25,7 @@ func TestTelemetry_TraceProviderInMem(t *testing.T) { attrValue = fmt.Sprintf("span-attr-%v", rand.Int()) spanError = errors.New("test-error") resourceID = "instance-id" - role = blockless.WorkerNode + role = bls.WorkerNode ) resource, err := telemetry.CreateResource(ctx, resourceID, role) diff --git a/telemetry/tracing/propagation_test.go b/telemetry/tracing/propagation_test.go index 6ff498d6..6e980eef 100644 --- a/telemetry/tracing/propagation_test.go +++ b/telemetry/tracing/propagation_test.go @@ -10,17 +10,17 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/otel/trace" - "github.com/blocklessnetwork/b7s/models/blockless" - "github.com/blocklessnetwork/b7s/telemetry" - "github.com/blocklessnetwork/b7s/telemetry/tracing" - "github.com/blocklessnetwork/b7s/testing/helpers" + "github.com/blessnetwork/b7s/models/bls" + "github.com/blessnetwork/b7s/telemetry" + "github.com/blessnetwork/b7s/telemetry/tracing" + "github.com/blessnetwork/b7s/testing/helpers" ) func TestTraceInfo(t *testing.T) { var ( ctx = context.Background() - resource, _ = telemetry.CreateResource(ctx, "instance-id", blockless.WorkerNode) + resource, _ = telemetry.CreateResource(ctx, "instance-id", bls.WorkerNode) _, tp = helpers.CreateTracerProvider(t, resource) tracer = tracing.NewTracerFromProvider(tp, fmt.Sprintf("test-tracer-%v", rand.Int())) ) diff --git a/telemetry/tracing/tracer.go b/telemetry/tracing/tracer.go index 92fb56fb..370efd54 100644 --- a/telemetry/tracing/tracer.go +++ b/telemetry/tracing/tracer.go @@ -8,8 +8,8 @@ import ( "go.opentelemetry.io/otel/codes" "go.opentelemetry.io/otel/trace" - "github.com/blocklessnetwork/b7s/models/execute" - "github.com/blocklessnetwork/b7s/telemetry/b7ssemconv" + "github.com/blessnetwork/b7s/models/execute" + "github.com/blessnetwork/b7s/telemetry/b7ssemconv" ) type Tracer struct { diff --git a/telemetry/tracing/tracer_test.go b/telemetry/tracing/tracer_test.go index ce3ee6f4..4243ad5a 100644 --- a/telemetry/tracing/tracer_test.go +++ b/telemetry/tracing/tracer_test.go @@ -12,10 +12,10 @@ import ( otelcodes "go.opentelemetry.io/otel/codes" "go.opentelemetry.io/otel/trace" - "github.com/blocklessnetwork/b7s/models/blockless" - "github.com/blocklessnetwork/b7s/telemetry" - "github.com/blocklessnetwork/b7s/telemetry/tracing" - "github.com/blocklessnetwork/b7s/testing/helpers" + "github.com/blessnetwork/b7s/models/bls" + "github.com/blessnetwork/b7s/telemetry" + "github.com/blessnetwork/b7s/telemetry/tracing" + "github.com/blessnetwork/b7s/testing/helpers" ) func TestTracer_TraceFunction(t *testing.T) { @@ -25,7 +25,7 @@ func TestTracer_TraceFunction(t *testing.T) { fnErr = errors.New("function-error") ) - resource, err := telemetry.CreateResource(context.Background(), "instance-id", blockless.WorkerNode) + resource, err := telemetry.CreateResource(context.Background(), "instance-id", bls.WorkerNode) require.NoError(t, err) tests := []struct { diff --git a/testing/helpers/function_server.go b/testing/helpers/function_server.go index 427ac782..9651fcee 100644 --- a/testing/helpers/function_server.go +++ b/testing/helpers/function_server.go @@ -12,14 +12,14 @@ import ( "github.com/stretchr/testify/require" - "github.com/blocklessnetwork/b7s/models/blockless" + "github.com/blessnetwork/b7s/models/bls" ) type FunctionServer struct { *httptest.Server } -func CreateFunctionServer(t *testing.T, manifestEndpoint string, manifest blockless.FunctionManifest, deploymentEndpoint string, archivePath string, cid string) *FunctionServer { +func CreateFunctionServer(t *testing.T, manifestEndpoint string, manifest bls.FunctionManifest, deploymentEndpoint string, archivePath string, cid string) *FunctionServer { t.Helper() // Archive to serve. @@ -44,7 +44,7 @@ func CreateFunctionServer(t *testing.T, manifestEndpoint string, manifest blockl Path: deploymentEndpoint, } - manifest.Deployment = blockless.Deployment{ + manifest.Deployment = bls.Deployment{ CID: cid, Checksum: fmt.Sprintf("%x", checksum), URI: deploymentURL.String(), diff --git a/testing/helpers/host.go b/testing/helpers/host.go index 1541aef9..b33bbf81 100644 --- a/testing/helpers/host.go +++ b/testing/helpers/host.go @@ -9,7 +9,7 @@ import ( "github.com/rs/zerolog" "github.com/stretchr/testify/require" - "github.com/blocklessnetwork/b7s/host" + "github.com/blessnetwork/b7s/host" ) const ( diff --git a/testing/helpers/peer.go b/testing/helpers/peer.go index 8ff65171..db8dfa6e 100644 --- a/testing/helpers/peer.go +++ b/testing/helpers/peer.go @@ -5,12 +5,12 @@ import ( "fmt" "testing" - "github.com/blocklessnetwork/b7s/models/blockless" "github.com/libp2p/go-libp2p/core/peer" ma "github.com/multiformats/go-multiaddr" mh "github.com/multiformats/go-multihash" - "github.com/stretchr/testify/require" + + "github.com/blessnetwork/b7s/models/bls" ) // NOTE: Inspiration by go-libp2p/core/test @@ -39,15 +39,15 @@ func GenerateTestAddrs(t *testing.T, n int) []ma.Multiaddr { return out } -func CreateRandomPeers(t *testing.T, count int) []blockless.Peer { +func CreateRandomPeers(t *testing.T, count int) []bls.Peer { - peers := make([]blockless.Peer, count) + peers := make([]bls.Peer, count) for i := 0; i < count; i++ { id := RandPeerID(t) addrs := GenerateTestAddrs(t, 1) - p := blockless.Peer{ + p := bls.Peer{ ID: id, MultiAddr: addrs[0].String(), AddrInfo: peer.AddrInfo{ diff --git a/testing/helpers/trace.go b/testing/helpers/trace.go index e22cc83e..530b0661 100644 --- a/testing/helpers/trace.go +++ b/testing/helpers/trace.go @@ -7,7 +7,7 @@ import ( "go.opentelemetry.io/otel/sdk/trace" "go.opentelemetry.io/otel/sdk/trace/tracetest" - "github.com/blocklessnetwork/b7s/telemetry" + "github.com/blessnetwork/b7s/telemetry" ) func CreateTracerProvider(t *testing.T, resource *resource.Resource) (*tracetest.InMemoryExporter, *trace.TracerProvider) { diff --git a/testing/mocks/core.go b/testing/mocks/core.go index 39377ca4..67ba9f62 100644 --- a/testing/mocks/core.go +++ b/testing/mocks/core.go @@ -10,10 +10,10 @@ import ( "github.com/rs/zerolog" "github.com/stretchr/testify/require" - "github.com/blocklessnetwork/b7s/host" - "github.com/blocklessnetwork/b7s/models/blockless" - "github.com/blocklessnetwork/b7s/telemetry" - "github.com/blocklessnetwork/b7s/telemetry/tracing" + "github.com/blessnetwork/b7s/host" + "github.com/blessnetwork/b7s/models/bls" + "github.com/blessnetwork/b7s/telemetry" + "github.com/blessnetwork/b7s/telemetry/tracing" ) const ( @@ -25,12 +25,12 @@ type NodeCore struct { LogFunc func() *zerolog.Logger HostFunc func() *host.Host ConnectedFunc func(peer.ID) bool - SendFunc func(context.Context, peer.ID, blockless.Message) error - SendToManyFunc func(context.Context, []peer.ID, blockless.Message, bool) error + SendFunc func(context.Context, peer.ID, bls.Message) error + SendToManyFunc func(context.Context, []peer.ID, bls.Message, bool) error JoinTopicFunc func(string) error SubscribeFunc func(context.Context, string) error - PublishFunc func(context.Context, blockless.Message) error - PublishToTopicFunc func(context.Context, string, blockless.Message) error + PublishFunc func(context.Context, bls.Message) error + PublishToTopicFunc func(context.Context, string, bls.Message) error TracerFunc func() *tracing.Tracer MetricsFunc func() *metrics.Metrics RunFunc func(context.Context, func(context.Context, peer.ID, string, []byte) error) error @@ -64,10 +64,10 @@ func BaselineNodeCore(t *testing.T) *NodeCore { ConnectedFunc: func(peer.ID) bool { return false }, - SendFunc: func(context.Context, peer.ID, blockless.Message) error { + SendFunc: func(context.Context, peer.ID, bls.Message) error { return nil }, - SendToManyFunc: func(context.Context, []peer.ID, blockless.Message, bool) error { + SendToManyFunc: func(context.Context, []peer.ID, bls.Message, bool) error { return nil }, JoinTopicFunc: func(string) error { @@ -76,10 +76,10 @@ func BaselineNodeCore(t *testing.T) *NodeCore { SubscribeFunc: func(context.Context, string) error { return nil }, - PublishFunc: func(context.Context, blockless.Message) error { + PublishFunc: func(context.Context, bls.Message) error { return nil }, - PublishToTopicFunc: func(context.Context, string, blockless.Message) error { + PublishToTopicFunc: func(context.Context, string, bls.Message) error { return nil }, TracerFunc: func() *tracing.Tracer { @@ -112,11 +112,11 @@ func (c NodeCore) Connected(peerID peer.ID) bool { return c.ConnectedFunc(peerID) } -func (c NodeCore) Send(ctx context.Context, peerID peer.ID, msg blockless.Message) error { +func (c NodeCore) Send(ctx context.Context, peerID peer.ID, msg bls.Message) error { return c.SendFunc(ctx, peerID, msg) } -func (c NodeCore) SendToMany(ctx context.Context, peerIDs []peer.ID, msg blockless.Message, flag bool) error { +func (c NodeCore) SendToMany(ctx context.Context, peerIDs []peer.ID, msg bls.Message, flag bool) error { return c.SendToManyFunc(ctx, peerIDs, msg, flag) } @@ -128,11 +128,11 @@ func (c NodeCore) Subscribe(ctx context.Context, topic string) error { return c.SubscribeFunc(ctx, topic) } -func (c NodeCore) Publish(ctx context.Context, msg blockless.Message) error { +func (c NodeCore) Publish(ctx context.Context, msg bls.Message) error { return c.PublishFunc(ctx, msg) } -func (c NodeCore) PublishToTopic(ctx context.Context, topic string, msg blockless.Message) error { +func (c NodeCore) PublishToTopic(ctx context.Context, topic string, msg bls.Message) error { return c.PublishToTopicFunc(ctx, topic, msg) } diff --git a/testing/mocks/executor.go b/testing/mocks/executor.go index dc2645dc..ec5c8794 100644 --- a/testing/mocks/executor.go +++ b/testing/mocks/executor.go @@ -4,11 +4,11 @@ import ( "context" "testing" - "github.com/blocklessnetwork/b7s/models/blockless" - "github.com/blocklessnetwork/b7s/models/execute" + "github.com/blessnetwork/b7s/models/bls" + "github.com/blessnetwork/b7s/models/execute" ) -var _ (blockless.Executor) = (*Executor)(nil) +var _ (bls.Executor) = (*Executor)(nil) type Executor struct { ExecFunctionFunc func(context.Context, string, execute.Request) (execute.Result, error) diff --git a/testing/mocks/generic.go b/testing/mocks/generic.go index b0ea83fd..ef6856c6 100644 --- a/testing/mocks/generic.go +++ b/testing/mocks/generic.go @@ -10,9 +10,9 @@ import ( "github.com/multiformats/go-multiaddr" "github.com/rs/zerolog" - "github.com/blocklessnetwork/b7s/models/blockless" - "github.com/blocklessnetwork/b7s/models/codes" - "github.com/blocklessnetwork/b7s/models/execute" + "github.com/blessnetwork/b7s/models/bls" + "github.com/blessnetwork/b7s/models/codes" + "github.com/blessnetwork/b7s/models/execute" ) // Global variables that can be used for testing. They are valid non-nil values for commonly needed types. @@ -57,22 +57,22 @@ var ( }, } - GenericManifest = blockless.FunctionManifest{ + GenericManifest = bls.FunctionManifest{ ID: "generic-id", Name: "generic-name", Description: "generic-description", - Function: blockless.Function{ + Function: bls.Function{ ID: "function-id", Name: "function-name", Runtime: "generic-runtime", }, - Deployment: blockless.Deployment{ + Deployment: bls.Deployment{ CID: "generic-cid", Checksum: "1234567890", URI: "generic-uri", }, - FSRootPath: "/var/tmp/blockless/", - Entry: "/var/tmp/blockless/app.wasm", + FSRootPath: "/var/tmp/bless/", + Entry: "/var/tmp/bless/app.wasm", } // List of a few peer IDs in case multiple are required. @@ -94,7 +94,7 @@ var ( peer.ID([]byte{0x0, 0x24, 0x8, 0x1, 0x12, 0x20, 0xc6, 0x8f, 0x95, 0xd3, 0x98, 0x66, 0x40, 0x6b, 0xc4, 0x6c, 0x19, 0x5e, 0x80, 0xe0, 0x8c, 0x9b, 0x15, 0x4f, 0x8c, 0x6b, 0xd0, 0x1d, 0x5b, 0x83, 0x23, 0x7b, 0x9a, 0x97, 0xc0, 0x9b, 0x9d, 0x9b}), } - GenericPeer = blockless.Peer{ + GenericPeer = bls.Peer{ ID: GenericPeerID, MultiAddr: GenericMultiaddress.String(), AddrInfo: peer.AddrInfo{ @@ -103,7 +103,7 @@ var ( }, } - GenericFunctionRecord = blockless.FunctionRecord{ + GenericFunctionRecord = bls.FunctionRecord{ CID: "dummy-cid", URL: fmt.Sprintf("https://example.com/%v", GenericString), Manifest: GenericManifest, diff --git a/testing/mocks/node.go b/testing/mocks/node.go index e0dea3dc..74bc8c92 100644 --- a/testing/mocks/node.go +++ b/testing/mocks/node.go @@ -4,8 +4,8 @@ import ( "context" "testing" - "github.com/blocklessnetwork/b7s/models/codes" - "github.com/blocklessnetwork/b7s/models/execute" + "github.com/blessnetwork/b7s/models/codes" + "github.com/blessnetwork/b7s/models/execute" ) // APINode implements the `Node` interface expected by the API. diff --git a/testing/mocks/store.go b/testing/mocks/store.go index b5a9f624..140c5068 100644 --- a/testing/mocks/store.go +++ b/testing/mocks/store.go @@ -6,18 +6,18 @@ import ( "github.com/libp2p/go-libp2p/core/peer" - "github.com/blocklessnetwork/b7s/models/blockless" + "github.com/blessnetwork/b7s/models/bls" ) type Store struct { - SavePeerFunc func(context.Context, blockless.Peer) error - RetrievePeerFunc func(context.Context, peer.ID) (blockless.Peer, error) - RetrievePeersFunc func(context.Context) ([]blockless.Peer, error) + SavePeerFunc func(context.Context, bls.Peer) error + RetrievePeerFunc func(context.Context, peer.ID) (bls.Peer, error) + RetrievePeersFunc func(context.Context) ([]bls.Peer, error) RemovePeerFunc func(context.Context, peer.ID) error - SaveFunctionFunc func(context.Context, blockless.FunctionRecord) error - RetrieveFunctionFunc func(context.Context, string) (blockless.FunctionRecord, error) - RetrieveFunctionsFunc func(context.Context) ([]blockless.FunctionRecord, error) + SaveFunctionFunc func(context.Context, bls.FunctionRecord) error + RetrieveFunctionFunc func(context.Context, string) (bls.FunctionRecord, error) + RetrieveFunctionsFunc func(context.Context) ([]bls.FunctionRecord, error) RemoveFunctionFunc func(context.Context, string) error } @@ -25,27 +25,27 @@ func BaselineStore(t *testing.T) *Store { t.Helper() store := Store{ - SavePeerFunc: func(context.Context, blockless.Peer) error { + SavePeerFunc: func(context.Context, bls.Peer) error { return nil }, - RetrievePeerFunc: func(context.Context, peer.ID) (blockless.Peer, error) { + RetrievePeerFunc: func(context.Context, peer.ID) (bls.Peer, error) { return GenericPeer, nil }, - RetrievePeersFunc: func(context.Context) ([]blockless.Peer, error) { - return []blockless.Peer{GenericPeer}, nil + RetrievePeersFunc: func(context.Context) ([]bls.Peer, error) { + return []bls.Peer{GenericPeer}, nil }, RemovePeerFunc: func(context.Context, peer.ID) error { return nil }, - SaveFunctionFunc: func(context.Context, blockless.FunctionRecord) error { + SaveFunctionFunc: func(context.Context, bls.FunctionRecord) error { return nil }, - RetrieveFunctionFunc: func(context.Context, string) (blockless.FunctionRecord, error) { + RetrieveFunctionFunc: func(context.Context, string) (bls.FunctionRecord, error) { return GenericFunctionRecord, nil }, - RetrieveFunctionsFunc: func(context.Context) ([]blockless.FunctionRecord, error) { - return []blockless.FunctionRecord{GenericFunctionRecord}, nil + RetrieveFunctionsFunc: func(context.Context) ([]bls.FunctionRecord, error) { + return []bls.FunctionRecord{GenericFunctionRecord}, nil }, RemoveFunctionFunc: func(context.Context, string) error { return nil @@ -55,22 +55,22 @@ func BaselineStore(t *testing.T) *Store { return &store } -func (s *Store) SavePeer(ctx context.Context, peer blockless.Peer) error { +func (s *Store) SavePeer(ctx context.Context, peer bls.Peer) error { return s.SavePeerFunc(ctx, peer) } -func (s *Store) SaveFunction(ctx context.Context, function blockless.FunctionRecord) error { +func (s *Store) SaveFunction(ctx context.Context, function bls.FunctionRecord) error { return s.SaveFunctionFunc(ctx, function) } -func (s *Store) RetrievePeer(ctx context.Context, id peer.ID) (blockless.Peer, error) { +func (s *Store) RetrievePeer(ctx context.Context, id peer.ID) (bls.Peer, error) { return s.RetrievePeerFunc(ctx, id) } -func (s *Store) RetrievePeers(ctx context.Context) ([]blockless.Peer, error) { +func (s *Store) RetrievePeers(ctx context.Context) ([]bls.Peer, error) { return s.RetrievePeersFunc(ctx) } -func (s *Store) RetrieveFunction(ctx context.Context, cid string) (blockless.FunctionRecord, error) { +func (s *Store) RetrieveFunction(ctx context.Context, cid string) (bls.FunctionRecord, error) { return s.RetrieveFunctionFunc(ctx, cid) } -func (s *Store) RetrieveFunctions(ctx context.Context) ([]blockless.FunctionRecord, error) { +func (s *Store) RetrieveFunctions(ctx context.Context) ([]bls.FunctionRecord, error) { return s.RetrieveFunctionsFunc(ctx) } func (s *Store) RemovePeer(ctx context.Context, id peer.ID) error {