managedblockchain

package
v1.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 3, 2026 License: MIT Imports: 23 Imported by: 0

README

Managed Blockchain

Parity grade: A · SDK aws-sdk-go-v2/service/managedblockchain@v1.31.19 · last audited 2026-07-24 (efd78e54)

Coverage

Metric Value
Operations audited 27 (27 ok)
Feature families 7 (7 ok)
Known gaps 3
Deferred items 0
Resource leaks clean
Known gaps
  • CreateMember ignores req.InvitationId -- every CreateMember call succeeds as if the caller already owns the network (IsOwned: true always), whereas real AWS requires a live invitation for cross-account members. gopherstack has no multi-account model, so this is a reasonable simplification, not flagged as a bug to fix.
  • No artificial service quotas (max members per network, max nodes per member, max networks per account) are enforced, so ResourceLimitExceededException is never returned. Consistent with this emulator's general no-limits style elsewhere; not treated as a bug.
  • Network.FrameworkAttributes.Ethereum and Node.FrameworkAttributes.Ethereum are not modeled: CreateNetwork's real API documents itself as "Applies only to Hyperledger Fabric" (new networks can no longer be created on Ethereum), and gopherstack rejects a non-Fabric Framework at CreateNetwork accordingly (ErrUnsupportedNetworkFramework). Real AWS's Ethereum surface is reached only via CreateNode against a pre-existing public network (e.g. NetworkId "n-ethereum-mainnet"), which gopherstack does not pre-seed. Deferred: pre-seeding a public Ethereum network is a bigger design question (what does an emulated public network with no owning account even mean?) than a wire-shape fix, and CreateNode's actual routed behavior (member-owned Fabric nodes) is unaffected.

More

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNetworkNotFound is returned when a network does not exist.
	ErrNetworkNotFound = awserr.New("ResourceNotFoundException: network not found", awserr.ErrNotFound)
	// ErrMemberNotFound is returned when a member does not exist.
	ErrMemberNotFound = awserr.New("ResourceNotFoundException: member not found", awserr.ErrNotFound)
	// ErrResourceNotFound is returned when a resource (network or member) cannot be found by ARN.
	ErrResourceNotFound = awserr.New("ResourceNotFoundException: resource not found", awserr.ErrNotFound)
	// ErrNetworkAlreadyExists is returned when a network already exists.
	ErrNetworkAlreadyExists = awserr.New(
		"ResourceAlreadyExistsException: network already exists",
		awserr.ErrAlreadyExists,
	)
	// ErrMissingNetworkName is returned when the network name is missing.
	ErrMissingNetworkName = errors.New("Name is required for CreateNetwork")
	// ErrMissingMemberName is returned when the member name is missing.
	ErrMissingMemberName = errors.New("Name is required for member configuration")
	// ErrMissingNetworkID is returned when the network ID is missing from a path.
	ErrMissingNetworkID = errors.New("networkId is required")
	// ErrNodeNotFound is returned when a node does not exist.
	ErrNodeNotFound = awserr.New("ResourceNotFoundException: node not found", awserr.ErrNotFound)
	// ErrAccessorNotFound is returned when an accessor does not exist.
	ErrAccessorNotFound = awserr.New("ResourceNotFoundException: accessor not found", awserr.ErrNotFound)
	// ErrProposalNotFound is returned when a proposal does not exist.
	ErrProposalNotFound = awserr.New("ResourceNotFoundException: proposal not found", awserr.ErrNotFound)
	// ErrInvitationNotFound is returned when an invitation does not exist.
	ErrInvitationNotFound = awserr.New("ResourceNotFoundException: invitation not found", awserr.ErrNotFound)
	// ErrMissingMemberID is returned when the member ID is missing for a proposal.
	ErrMissingMemberID = errors.New("MemberId is required for CreateProposal")
	// ErrMissingVoterMemberID is returned when the voter member ID is missing for VoteOnProposal.
	ErrMissingVoterMemberID = errors.New("VoterMemberId is required for VoteOnProposal")
	// ErrMissingNodeMemberID is returned when MemberId is missing for a node operation. Real AWS
	// documents MemberId as "required for Hyperledger Fabric" on every node op (CreateNode's body
	// field, GetNode/ListNodes/DeleteNode/UpdateNode's "memberId" query parameter); gopherstack
	// only emulates Hyperledger Fabric networks, so it is always required here.
	ErrMissingNodeMemberID = errors.New("MemberId is required for Hyperledger Fabric node operations")
	// ErrMissingMemberFrameworkConfig is returned when MemberConfiguration.FrameworkConfiguration
	// is missing. The real aws-sdk-go-v2 client-side validator (validateMemberConfiguration)
	// requires this field on both CreateNetwork's and CreateMember's MemberConfiguration.
	ErrMissingMemberFrameworkConfig = errors.New("FrameworkConfiguration is required for member configuration")
	// ErrMissingMemberFabricConfig is returned when MemberConfiguration.FrameworkConfiguration.Fabric
	// is missing. gopherstack only emulates Hyperledger Fabric networks (see ErrMissingNodeMemberID),
	// so unlike the real API (which permits an empty FrameworkConfiguration for future frameworks),
	// Fabric is always required here.
	ErrMissingMemberFabricConfig = errors.New(
		"FrameworkConfiguration.Fabric is required for Hyperledger Fabric member configuration",
	)
	// ErrMissingMemberAdminUsername is returned when Fabric.AdminUsername is missing. Real AWS's
	// client-side validator (validateMemberFabricConfiguration) requires this field.
	ErrMissingMemberAdminUsername = errors.New("AdminUsername is required for member's Fabric configuration")
	// ErrMissingMemberAdminPassword is returned when Fabric.AdminPassword is missing. Real AWS's
	// client-side validator (validateMemberFabricConfiguration) requires this field.
	ErrMissingMemberAdminPassword = errors.New("AdminPassword is required for member's Fabric configuration")
	// ErrInvalidMemberAdminPassword is returned when Fabric.AdminPassword does not meet the real
	// API's documented length constraint (8-32 characters).
	ErrInvalidMemberAdminPassword = errors.New("AdminPassword must be between 8 and 32 characters")
	// ErrMissingNetworkFabricEdition is returned when FrameworkConfiguration.Fabric is present but
	// Edition is missing. Real AWS's client-side validator (validateNetworkFabricConfiguration)
	// requires this field whenever a Fabric configuration object is supplied.
	ErrMissingNetworkFabricEdition = errors.New(
		"FrameworkConfiguration.Fabric.Edition is required when Fabric is specified",
	)
	// ErrUnsupportedNetworkFramework is returned when Framework is set to a value other than
	// HYPERLEDGER_FABRIC. Real AWS's CreateNetwork documents itself as "Applies only to
	// Hyperledger Fabric" -- new networks (including ETHEREUM, still a valid Framework enum
	// member used elsewhere, e.g. accessors) can no longer be created through this operation.
	ErrUnsupportedNetworkFramework = errors.New("CreateNetworkInput.Framework must be HYPERLEDGER_FABRIC")
	// ErrValidation is returned when input validation fails.
	ErrValidation = awserr.New("InvalidRequestException: validation error", awserr.ErrInvalidParameter)
)
View Source
var ErrNilAppContext = errors.New("managedblockchain: AppContext must not be nil")

ErrNilAppContext is returned when Init is called with a nil AppContext.

Functions

This section is empty.

Types

type Accessor

type Accessor struct {
	CreationDate *time.Time        `json:"creationDate"`
	Tags         map[string]string `json:"tags"`
	Arn          string            `json:"arn"`
	BillingToken string            `json:"billingToken"`
	ID           string            `json:"id"`
	NetworkType  string            `json:"networkType"`
	Status       string            `json:"status"`
	Type         string            `json:"type"`
}

Accessor represents an Amazon Managed Blockchain accessor for token-based access.

type ApprovalThresholdPolicy

type ApprovalThresholdPolicy struct {
	ThresholdComparator     string `json:"thresholdComparator,omitempty"`
	ProposalDurationInHours int32  `json:"proposalDurationInHours,omitempty"`
	ThresholdPercentage     int32  `json:"thresholdPercentage,omitempty"`
}

ApprovalThresholdPolicy defines the threshold for proposal approval.

type CloudWatchLogState

type CloudWatchLogState struct {
	Enabled bool `json:"enabled"`
}

CloudWatchLogState stores CloudWatch logging state.

type ExportedMember

type ExportedMember = Member

ExportedMember is a compatibility alias used by the dashboard package.

type ExportedNetwork

type ExportedNetwork = Network

ExportedNetwork is a compatibility alias used by the dashboard package.

type Handler

type Handler struct {
	Backend       StorageBackend
	AccountID     string
	DefaultRegion string
}

Handler is the HTTP handler for the Managed Blockchain REST API.

func NewHandler

func NewHandler(backend StorageBackend) *Handler

NewHandler creates a new Managed Blockchain handler.

func (*Handler) ChaosOperations

func (h *Handler) ChaosOperations() []string

ChaosOperations returns all operations that can be fault-injected.

func (*Handler) ChaosRegions

func (h *Handler) ChaosRegions() []string

ChaosRegions returns all regions this handler handles.

func (*Handler) ChaosServiceName

func (h *Handler) ChaosServiceName() string

ChaosServiceName returns the lowercase AWS service name for fault rule matching.

func (*Handler) ExtractOperation

func (h *Handler) ExtractOperation(c *echo.Context) string

ExtractOperation extracts the operation name from the request.

func (*Handler) ExtractResource

func (h *Handler) ExtractResource(c *echo.Context) string

ExtractResource extracts the resource ID from the request.

func (*Handler) GetSupportedOperations

func (h *Handler) GetSupportedOperations() []string

GetSupportedOperations returns the list of supported Managed Blockchain operations.

func (*Handler) Handler

func (h *Handler) Handler() echo.HandlerFunc

Handler returns the Echo handler function for Managed Blockchain requests.

func (*Handler) MatchPriority

func (h *Handler) MatchPriority() int

MatchPriority returns the routing priority.

func (*Handler) Name

func (h *Handler) Name() string

Name returns the service name.

func (*Handler) Reset

func (h *Handler) Reset()

Reset implements service.Resettable by delegating to the backend.

func (*Handler) Restore

func (h *Handler) Restore(ctx context.Context, data []byte) error

Restore implements persistence.Persistable by delegating to the backend.

func (*Handler) RouteMatcher

func (h *Handler) RouteMatcher() service.Matcher

RouteMatcher returns a function that matches Managed Blockchain REST API requests.

func (*Handler) Snapshot

func (h *Handler) Snapshot(ctx context.Context) []byte

Snapshot implements persistence.Persistable by delegating to the backend.

type InMemoryBackend

type InMemoryBackend struct {
	// contains filtered or unexported fields
}

InMemoryBackend is the in-memory implementation of StorageBackend.

networks, members, nodes, accessors, proposals, proposalVotes, and invitations are all *store.Table (Phase 3.3 of the datalayer refactor); see store_setup.go for their key functions, indexes, and registration. arnToResource remains a plain map -- see store_setup.go's doc comment for why it cannot become a store.Table.

func NewInMemoryBackend

func NewInMemoryBackend() *InMemoryBackend

NewInMemoryBackend creates a new in-memory Managed Blockchain backend.

func (*InMemoryBackend) AddAccessorInternal

func (b *InMemoryBackend) AddAccessorInternal(region, accountID, accessorType, networkType string) *Accessor

AddAccessorInternal adds an accessor directly to the backend (for testing and seeding).

func (*InMemoryBackend) AddInvitationInternal

func (b *InMemoryBackend) AddInvitationInternal(region, accountID, networkID, networkName string) *Invitation

AddInvitationInternal adds an invitation directly to the backend (for testing and seeding).

func (*InMemoryBackend) AddMemberInternal

func (b *InMemoryBackend) AddMemberInternal(region, accountID, networkID, name string) *Member

AddMemberInternal adds a member directly to the backend (for testing and seeding). The network must already exist.

func (*InMemoryBackend) AddNetworkInternal

func (b *InMemoryBackend) AddNetworkInternal(region, accountID, name string) *Network

AddNetworkInternal adds a network directly to the backend (for testing and seeding).

func (*InMemoryBackend) AddNodeInternal

func (b *InMemoryBackend) AddNodeInternal(region, accountID, networkID, memberID, instanceType string) *Node

AddNodeInternal adds a node directly to the backend (for testing and seeding). The network and member must already exist.

func (*InMemoryBackend) AddProposalInternal

func (b *InMemoryBackend) AddProposalInternal(region, accountID, networkID, memberID, description string) *Proposal

AddProposalInternal adds a proposal directly to the backend (for testing and seeding). The network and member must already exist.

func (*InMemoryBackend) CreateAccessor

func (b *InMemoryBackend) CreateAccessor(
	region, accountID, accessorType, networkType string,
	tags map[string]string,
) (*Accessor, error)

CreateAccessor creates a new accessor for token-based access.

func (*InMemoryBackend) CreateMember

func (b *InMemoryBackend) CreateMember(
	region, accountID, networkID, name, description, adminUsername, kmsKeyArn string,
	tags map[string]string,
) (*Member, error)

CreateMember creates a new member in an existing network.

func (*InMemoryBackend) CreateNetwork

func (b *InMemoryBackend) CreateNetwork(
	region, accountID, name, description, framework, frameworkVersion, memberName, memberDescription string,
	tags map[string]string,
	votingPolicy *VotingPolicy,
	fabricEdition, memberAdminUsername, memberKmsKeyArn string,
) (*Network, *Member, error)

CreateNetwork creates a new Managed Blockchain network and its first member.

func (*InMemoryBackend) CreateNode

func (b *InMemoryBackend) CreateNode(
	region, accountID, networkID, memberID, instanceType, availabilityZone, stateDB string,
	tags map[string]string,
) (*Node, error)

CreateNode creates a new peer node within a member. The node's KmsKeyArn is inherited from its owning member, matching real AWS ("The node inherits this parameter from the member that it belongs to.").

func (*InMemoryBackend) CreateProposal

func (b *InMemoryBackend) CreateProposal(
	region, accountID, networkID, memberID, description string,
	actions *ProposalActions,
	tags map[string]string,
) (*Proposal, error)

CreateProposal creates a new governance proposal on a network.

func (*InMemoryBackend) DeleteAccessor

func (b *InMemoryBackend) DeleteAccessor(accessorID string) error

DeleteAccessor removes an accessor.

func (*InMemoryBackend) DeleteMember

func (b *InMemoryBackend) DeleteMember(networkID, memberID string) error

DeleteMember removes a member from a network, cascading the delete to all of its nodes.

func (*InMemoryBackend) DeleteNode

func (b *InMemoryBackend) DeleteNode(networkID, memberID, nodeID string) error

DeleteNode removes a node from a member.

func (*InMemoryBackend) GetAccessor

func (b *InMemoryBackend) GetAccessor(accessorID string) (*Accessor, error)

GetAccessor returns an accessor by ID.

func (*InMemoryBackend) GetMember

func (b *InMemoryBackend) GetMember(networkID, memberID string) (*Member, error)

GetMember returns a member by network ID and member ID.

func (*InMemoryBackend) GetNetwork

func (b *InMemoryBackend) GetNetwork(networkID string) (*Network, error)

GetNetwork returns the details of a network by ID.

func (*InMemoryBackend) GetNode

func (b *InMemoryBackend) GetNode(networkID, memberID, nodeID string) (*Node, error)

GetNode returns a node by network ID, member ID, and node ID.

func (*InMemoryBackend) GetProposal

func (b *InMemoryBackend) GetProposal(networkID, proposalID string) (*Proposal, error)

GetProposal returns a proposal by network ID and proposal ID.

func (*InMemoryBackend) ListAccessors

func (b *InMemoryBackend) ListAccessors(filter ListAccessorsFilter) ([]*Accessor, error)

ListAccessors returns all accessors sorted by ID, optionally filtered.

func (*InMemoryBackend) ListInvitations

func (b *InMemoryBackend) ListInvitations() ([]*Invitation, error)

ListInvitations returns all invitations sorted by invitation ID.

func (*InMemoryBackend) ListMembers

func (b *InMemoryBackend) ListMembers(networkID string, filter ListMembersFilter) ([]*Member, error)

ListMembers returns all members in a network, optionally filtered.

func (*InMemoryBackend) ListNetworks

func (b *InMemoryBackend) ListNetworks(filter ListNetworksFilter) ([]*Network, error)

ListNetworks returns all networks, optionally filtered.

func (*InMemoryBackend) ListNodes

func (b *InMemoryBackend) ListNodes(networkID, memberID string, filter ListNodesFilter) ([]*Node, error)

ListNodes returns all nodes for a member sorted by ID, optionally filtered.

func (*InMemoryBackend) ListProposalVotes

func (b *InMemoryBackend) ListProposalVotes(networkID, proposalID string) ([]*ProposalVote, error)

ListProposalVotes returns all votes for a proposal.

func (*InMemoryBackend) ListProposals

func (b *InMemoryBackend) ListProposals(networkID, statusFilter string) ([]*Proposal, error)

ListProposals returns all proposals for a network sorted by proposal ID. statusFilter, when non-empty, limits results to proposals with that status.

func (*InMemoryBackend) ListTagsForResource

func (b *InMemoryBackend) ListTagsForResource(resourceARN string) (map[string]string, error)

ListTagsForResource returns tags for a resource identified by ARN.

func (*InMemoryBackend) RejectInvitation

func (b *InMemoryBackend) RejectInvitation(invitationID string) error

RejectInvitation rejects an invitation by setting its status to REJECTED.

func (*InMemoryBackend) Reset

func (b *InMemoryBackend) Reset()

Reset clears all in-memory state.

func (*InMemoryBackend) Restore

func (b *InMemoryBackend) Restore(ctx context.Context, data []byte) error

Restore loads backend state from a JSON snapshot.

func (*InMemoryBackend) Snapshot

func (b *InMemoryBackend) Snapshot(ctx context.Context) []byte

Snapshot serialises the backend state to JSON.

func (*InMemoryBackend) TagResource

func (b *InMemoryBackend) TagResource(resourceARN string, tags map[string]string) error

TagResource adds or updates tags on a resource.

func (*InMemoryBackend) UntagResource

func (b *InMemoryBackend) UntagResource(resourceARN string, tagKeys []string) error

UntagResource removes tags from a resource.

func (*InMemoryBackend) UpdateMember

func (b *InMemoryBackend) UpdateMember(
	networkID, memberID string,
	logConfig *MemberLogPublishingConfigState,
) (*Member, error)

UpdateMember updates a member's log publishing configuration.

func (*InMemoryBackend) UpdateNode

func (b *InMemoryBackend) UpdateNode(
	networkID, memberID, nodeID string,
	logConfig *NodeLogPublishingConfigState,
) (*Node, error)

UpdateNode updates a node's log publishing configuration.

func (*InMemoryBackend) VoteOnProposal

func (b *InMemoryBackend) VoteOnProposal(networkID, proposalID, memberID, vote string) error

VoteOnProposal records a YES or NO vote on a proposal and transitions its status when threshold met.

type Invitation

type Invitation struct {
	NetworkSummary *InvitationNetworkSummary `json:"networkSummary,omitempty"`
	CreationDate   *time.Time                `json:"creationDate"`
	ExpirationDate *time.Time                `json:"expirationDate,omitempty"`
	Arn            string                    `json:"arn"`
	InvitationID   string                    `json:"invitationId"`
	NetworkID      string                    `json:"networkId"`
	NetworkName    string                    `json:"networkName"`
	Status         string                    `json:"status"`
}

Invitation represents an invitation to join a Managed Blockchain network.

type InvitationNetworkSummary

type InvitationNetworkSummary struct {
	CreationDate     *time.Time `json:"creationDate,omitempty"`
	Arn              string     `json:"arn,omitempty"`
	Description      string     `json:"description,omitempty"`
	Framework        string     `json:"framework,omitempty"`
	FrameworkVersion string     `json:"frameworkVersion,omitempty"`
	ID               string     `json:"id,omitempty"`
	Name             string     `json:"name,omitempty"`
	Status           string     `json:"status,omitempty"`
}

InvitationNetworkSummary is a summary of the network included in an Invitation.

type InviteAction

type InviteAction struct {
	Principal string `json:"principal"`
}

InviteAction represents an invitation to an AWS account to join the network.

type ListAccessorsFilter

type ListAccessorsFilter struct {
	NetworkType string
}

ListAccessorsFilter contains optional filters for ListAccessors.

type ListMembersFilter

type ListMembersFilter struct {
	IsOwned *bool
	Name    string
	Status  string
}

ListMembersFilter contains optional filters for ListMembers.

type ListNetworksFilter

type ListNetworksFilter struct {
	Name      string
	Framework string
	Status    string
}

ListNetworksFilter contains optional filters for ListNetworks.

type ListNodesFilter

type ListNodesFilter struct {
	Status string
}

ListNodesFilter contains optional filters for ListNodes.

type LogConfigState

type LogConfigState struct {
	CloudWatch *CloudWatchLogState `json:"cloudWatch,omitempty"`
}

LogConfigState stores whether logging is enabled.

type Member

type Member struct {
	CreationDate               *time.Time                      `json:"creationDate"`
	Tags                       map[string]string               `json:"tags"`
	LogPublishingConfiguration *MemberLogPublishingConfigState `json:"logPublishingConfiguration,omitempty"`
	FrameworkAttributes        *MemberFrameworkAttributesState `json:"frameworkAttributes,omitempty"`
	Arn                        string                          `json:"arn"`
	Description                string                          `json:"description"`
	ID                         string                          `json:"id"`
	KmsKeyArn                  string                          `json:"kmsKeyArn,omitempty"`
	Name                       string                          `json:"name"`
	NetworkID                  string                          `json:"networkID"`
	Status                     string                          `json:"status"`
	IsOwned                    bool                            `json:"isOwned"`
}

Member represents a member within a Managed Blockchain network.

type MemberFabricAttributesState added in v1.2.0

type MemberFabricAttributesState struct {
	AdminUsername string `json:"adminUsername,omitempty"`
	CaEndpoint    string `json:"caEndpoint,omitempty"`
}

MemberFabricAttributesState holds Hyperledger Fabric-specific member attributes.

type MemberFabricLogState

type MemberFabricLogState struct {
	CALogs *LogConfigState `json:"caLogs,omitempty"`
}

MemberFabricLogState stores Fabric-specific log config for a member.

type MemberFrameworkAttributesState added in v1.2.0

type MemberFrameworkAttributesState struct {
	Fabric *MemberFabricAttributesState `json:"fabric,omitempty"`
}

MemberFrameworkAttributesState holds framework-specific member attributes. Only Fabric is modeled -- see Network.FrameworkAttributes' doc comment.

type MemberLogPublishingConfigState

type MemberLogPublishingConfigState struct {
	Fabric *MemberFabricLogState `json:"fabric,omitempty"`
}

MemberLogPublishingConfigState stores log publishing configuration for a member.

type MemberSummary

type MemberSummary struct {
	CreationDate *time.Time `json:"creationDate"`
	Arn          string     `json:"arn"`
	Description  string     `json:"description"`
	ID           string     `json:"id"`
	Name         string     `json:"name"`
	Status       string     `json:"status"`
	IsOwned      bool       `json:"isOwned"`
}

MemberSummary is the short form returned by ListMembers.

type Network

type Network struct {
	CreationDate           *time.Time                       `json:"creationDate"`
	Tags                   map[string]string                `json:"tags"`
	VotingPolicy           *VotingPolicy                    `json:"votingPolicy,omitempty"`
	FrameworkAttributes    *NetworkFrameworkAttributesState `json:"frameworkAttributes,omitempty"`
	Arn                    string                           `json:"arn"`
	Description            string                           `json:"description"`
	Framework              string                           `json:"framework"`
	FrameworkVersion       string                           `json:"frameworkVersion"`
	ID                     string                           `json:"id"`
	Name                   string                           `json:"name"`
	Status                 string                           `json:"status"`
	VpcEndpointServiceName string                           `json:"vpcEndpointServiceName,omitempty"`
}

Network represents an Amazon Managed Blockchain network.

type NetworkFabricAttributesState added in v1.2.0

type NetworkFabricAttributesState struct {
	Edition                 string `json:"edition,omitempty"`
	OrderingServiceEndpoint string `json:"orderingServiceEndpoint,omitempty"`
}

NetworkFabricAttributesState holds Hyperledger Fabric-specific network attributes.

type NetworkFrameworkAttributesState added in v1.2.0

type NetworkFrameworkAttributesState struct {
	Fabric *NetworkFabricAttributesState `json:"fabric,omitempty"`
}

NetworkFrameworkAttributesState holds framework-specific network attributes. gopherstack only emulates the Hyperledger Fabric framework (CreateNetwork's real API also documents itself as "Applies only to Hyperledger Fabric" -- new networks can no longer be created on the Ethereum framework), so only Fabric is modeled; the real API's sibling Ethereum field is intentionally omitted here since gopherstack never populates it.

type NetworkSummary

type NetworkSummary struct {
	CreationDate     *time.Time `json:"creationDate"`
	Arn              string     `json:"arn"`
	Description      string     `json:"description"`
	Framework        string     `json:"framework"`
	FrameworkVersion string     `json:"frameworkVersion"`
	ID               string     `json:"id"`
	Name             string     `json:"name"`
	Status           string     `json:"status"`
}

NetworkSummary is the short form returned by ListNetworks.

type Node

type Node struct {
	CreationDate               *time.Time                    `json:"creationDate"`
	Tags                       map[string]string             `json:"tags"`
	LogPublishingConfiguration *NodeLogPublishingConfigState `json:"logPublishingConfiguration,omitempty"`
	FrameworkAttributes        *NodeFrameworkAttributesState `json:"frameworkAttributes,omitempty"`
	Arn                        string                        `json:"arn"`
	AvailabilityZone           string                        `json:"availabilityZone"`
	ID                         string                        `json:"id"`
	InstanceType               string                        `json:"instanceType"`
	KmsKeyArn                  string                        `json:"kmsKeyArn,omitempty"`
	MemberID                   string                        `json:"memberID"`
	NetworkID                  string                        `json:"networkID"`
	StateDB                    string                        `json:"stateDB,omitempty"`
	Status                     string                        `json:"status"`
}

Node represents a peer node within a Managed Blockchain member.

type NodeFabricAttributesState added in v1.2.0

type NodeFabricAttributesState struct {
	PeerEndpoint      string `json:"peerEndpoint,omitempty"`
	PeerEventEndpoint string `json:"peerEventEndpoint,omitempty"`
}

NodeFabricAttributesState holds Hyperledger Fabric-specific node attributes.

type NodeFabricLogState

type NodeFabricLogState struct {
	ChaincodeLogs *LogConfigState `json:"chaincodeLogs,omitempty"`
	PeerLogs      *LogConfigState `json:"peerLogs,omitempty"`
}

NodeFabricLogState stores Fabric-specific log config for a node.

type NodeFrameworkAttributesState added in v1.2.0

type NodeFrameworkAttributesState struct {
	Fabric *NodeFabricAttributesState `json:"fabric,omitempty"`
}

NodeFrameworkAttributesState holds framework-specific node attributes. Only Fabric is modeled -- see Network.FrameworkAttributes' doc comment; gopherstack's nodes always belong to a Fabric member (CreateNode requires MemberId, see ErrMissingNodeMemberID), so the real API's sibling Ethereum field is intentionally omitted here since gopherstack never populates it.

type NodeLogPublishingConfigState

type NodeLogPublishingConfigState struct {
	Fabric *NodeFabricLogState `json:"fabric,omitempty"`
}

NodeLogPublishingConfigState stores log publishing configuration for a node.

type NodeSummary

type NodeSummary struct {
	CreationDate     *time.Time `json:"creationDate"`
	Arn              string     `json:"arn"`
	AvailabilityZone string     `json:"availabilityZone,omitempty"`
	ID               string     `json:"id"`
	InstanceType     string     `json:"instanceType"`
	Status           string     `json:"status"`
}

NodeSummary is the short form returned by ListNodes.

type Proposal

type Proposal struct {
	Actions              *ProposalActions  `json:"actions,omitempty"`
	CreationDate         *time.Time        `json:"creationDate"`
	ExpirationDate       *time.Time        `json:"expirationDate,omitempty"`
	Tags                 map[string]string `json:"tags"`
	Arn                  string            `json:"arn"`
	Description          string            `json:"description"`
	NetworkID            string            `json:"networkId"`
	ProposalID           string            `json:"proposalId"`
	ProposedByMemberID   string            `json:"proposedByMemberId"`
	ProposedByMemberName string            `json:"proposedByMemberName"`
	Status               string            `json:"status"`
	NoVoteCount          int               `json:"noVoteCount"`
	OutstandingVoteCount int               `json:"outstandingVoteCount"`
	YesVoteCount         int               `json:"yesVoteCount"`
}

Proposal represents a governance proposal on a Managed Blockchain network.

type ProposalActions

type ProposalActions struct {
	Invitations []InviteAction `json:"invitations,omitempty"`
	Removals    []RemoveAction `json:"removals,omitempty"`
}

ProposalActions defines the actions taken when a proposal is approved.

type ProposalVote

type ProposalVote struct {
	MemberID   string `json:"memberId"`
	MemberName string `json:"memberName"`
	Vote       string `json:"vote"`
	// contains filtered or unexported fields
}

ProposalVote represents a single vote cast on a proposal.

type Provider

type Provider struct{}

Provider implements service.Provider for the Managed Blockchain service.

func (*Provider) Init

Init initializes the Managed Blockchain service backend and handler.

func (*Provider) Name

func (p *Provider) Name() string

Name returns the provider name.

type RemoveAction

type RemoveAction struct {
	MemberID string `json:"memberId"`
}

RemoveAction represents a removal of a member from the network.

type StorageBackend

type StorageBackend interface {
	CreateNetwork(
		region, accountID, name, description, framework, frameworkVersion, memberName, memberDescription string,
		tags map[string]string,
		votingPolicy *VotingPolicy,
		fabricEdition, memberAdminUsername, memberKmsKeyArn string,
	) (*Network, *Member, error)
	GetNetwork(networkID string) (*Network, error)
	ListNetworks(filter ListNetworksFilter) ([]*Network, error)
	CreateMember(
		region, accountID, networkID, name, description, adminUsername, kmsKeyArn string,
		tags map[string]string,
	) (*Member, error)
	GetMember(networkID, memberID string) (*Member, error)
	ListMembers(networkID string, filter ListMembersFilter) ([]*Member, error)
	DeleteMember(networkID, memberID string) error
	CreateNode(
		region, accountID, networkID, memberID, instanceType, availabilityZone, stateDB string,
		tags map[string]string,
	) (*Node, error)
	GetNode(networkID, memberID, nodeID string) (*Node, error)
	ListNodes(networkID, memberID string, filter ListNodesFilter) ([]*Node, error)
	DeleteNode(networkID, memberID, nodeID string) error
	ListTagsForResource(resourceARN string) (map[string]string, error)
	TagResource(resourceARN string, tags map[string]string) error
	UntagResource(resourceARN string, tagKeys []string) error
	CreateAccessor(region, accountID, accessorType, networkType string, tags map[string]string) (*Accessor, error)
	GetAccessor(accessorID string) (*Accessor, error)
	DeleteAccessor(accessorID string) error
	ListAccessors(filter ListAccessorsFilter) ([]*Accessor, error)
	CreateProposal(
		region, accountID, networkID, memberID, description string,
		actions *ProposalActions,
		tags map[string]string,
	) (*Proposal, error)
	GetProposal(networkID, proposalID string) (*Proposal, error)
	ListProposals(networkID, statusFilter string) ([]*Proposal, error)
	ListProposalVotes(networkID, proposalID string) ([]*ProposalVote, error)
	ListInvitations() ([]*Invitation, error)
	RejectInvitation(invitationID string) error
	UpdateMember(networkID, memberID string, logConfig *MemberLogPublishingConfigState) (*Member, error)
	UpdateNode(networkID, memberID, nodeID string, logConfig *NodeLogPublishingConfigState) (*Node, error)
	VoteOnProposal(networkID, proposalID, memberID, vote string) error
}

StorageBackend is the interface for the Managed Blockchain in-memory backend.

type VotingPolicy

type VotingPolicy struct {
	ApprovalThresholdPolicy *ApprovalThresholdPolicy `json:"approvalThresholdPolicy,omitempty"`
}

VotingPolicy defines how a network votes on proposals.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL