Help us shape the future of Go! Take the 2026 Go Developer Survey

managedblockchain

package
v1.9.0 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2026 License: MIT Imports: 26 Imported by: 0

README

Managed Blockchain

Parity grade: A · SDK aws-sdk-go-v2/service/managedblockchain@v1.40.3 · last audited 2026-10-07 (a5efc2c05)

Coverage

Metric Value
PARITY entries audited 27 (27 ok)
Feature families 7 (7 ok)
Known gaps none
Structural gaps (can't be emulated) 3
Deferred items 0
Resource leaks clean
Structural gaps

These do not block an A grade — no implementation could produce real data here because the underlying data source cannot exist in an emulator.

  • Hyperledger Fabric channels (8 per network) are not an API resource in this SDK, so that quota has nothing to attach to.
  • Member.IsOwned is always true: the emulator has a single account, so every member belongs to the caller's account.
  • ResourceNotReadyException is never returned: every network/member/node is AVAILABLE synchronously and there is no CREATING/DELETING lifecycle to be 'not ready' in.

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,
	)
	// ErrResourceNotReady is returned when the resource is still CREATING.
	ErrResourceNotReady = awserr.New(
		"ResourceNotReadyException: resource is not in a status that can complete the operation",
		awserr.ErrConflict,
	)
	// ErrMissingNetworkName is returned when the network name is missing.
	ErrMissingNetworkName = errors.New("Name is required for CreateNetwork")
	// ErrMissingClientRequestToken is returned when ClientRequestToken is missing from
	// CreateNetwork/CreateMember/CreateNode/CreateProposal/CreateAccessor. The real
	// aws-sdk-go-v2 client-side validator (validators.go, all 5 ops, v1.34.4) marks it
	// required and the SDK's idempotency-token middleware always fills it in when a caller
	// leaves it unset, so a real SDK client never omits it; a raw HTTP caller bypassing that
	// middleware can, and real AWS rejects that request.
	ErrMissingClientRequestToken = errors.New("ClientRequestToken is required")
	// 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")
	// ErrMissingNodeAvailabilityZone is returned when an Ethereum node omits AvailabilityZone.
	ErrMissingNodeAvailabilityZone = awserr.New(
		"AvailabilityZone is required for Ethereum nodes",
		awserr.ErrInvalidParameter,
	)

	// ErrMissingNodeMemberID is returned when MemberId is missing for a Hyperledger Fabric node operation.
	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")
	// ErrMissingInvitationID is returned when CreateMemberInput.InvitationId is missing.
	// The real aws-sdk-go-v2 client-side validator (validateOpCreateMemberInput) marks
	// this field required and refuses to send the request without it.
	ErrMissingInvitationID = errors.New("InvitationId is required for CreateMember")
	// ErrInvitationNetworkMismatch is returned when CreateMember's InvitationId names an
	// invitation issued for a different network than the one in the request path.
	ErrInvitationNetworkMismatch = awserr.New(
		"InvalidRequestException: invitation is not for this network",
		awserr.ErrInvalidParameter,
	)
	// ErrInvitationNotPending is returned when CreateMember's InvitationId names an
	// invitation that is not PENDING -- already used to join (ACCEPTED), rejected, or
	// expired. Real AWS's Invitation.Status doc documents ACCEPTED as "The invitee created
	// a member and joined the network using the InvitationId", implying an invitation is
	// consumed exactly once.
	ErrInvitationNotPending = awserr.New(
		"InvalidRequestException: invitation is not pending",
		awserr.ErrInvalidParameter,
	)
	// ErrValidation is returned when input validation fails.
	ErrValidation = awserr.New("InvalidRequestException: validation error", awserr.ErrInvalidParameter)
	// ErrTooManyTags is returned when tagging a resource would push its total
	// tag count above the 50-tag-per-resource limit (botocore
	// managedblockchain/2018-09-24 service-2.json.gz InputTagMap: max 50;
	// TagResourceRequest.Tags doc: "an overall maximum of 50 tags added to
	// each resource" -- the cap is on the resource's resulting tag count,
	// not the request's tag count). TagResource and every Create* op that
	// accepts Tags (CreateNetwork, CreateMember via MemberConfiguration.Tags,
	// CreateNode, CreateProposal, CreateAccessor) declare TooManyTagsException
	// (aws-sdk-go-v2 managedblockchain@v1.34.4 deserializers.go, each op's own
	// awsRestjson1_deserializeOpError<Op> switch).
	ErrTooManyTags = awserr.New("TooManyTagsException: too many tags", 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.

View Source
var ErrResourceLimitExceeded = awserr.New(
	"ResourceLimitExceededException: resource limit exceeded",
	awserr.ErrInvalidParameter,
)

ErrResourceLimitExceeded maps to ResourceLimitExceededException (HTTP 429).

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
	// contains filtered or unexported fields
}

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) BackendFor

func (h *Handler) BackendFor(region string) StorageBackend

BackendFor returns the backend serving region: the home backend, or the sibling built on first use.

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) EnableRegions

func (h *Handler) EnableRegions()

EnableRegions makes h serve every other region through lazily built per-region siblings.

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 serves each request from the handler of its region.

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) RegionBackends

func (h *Handler) RegionBackends() []StorageBackend

RegionBackends returns the home backend followed by every sibling built so far.

func (*Handler) RegionHandler

func (h *Handler) RegionHandler(region string) *Handler

RegionHandler returns the handler serving region: h itself for the home region, else its sibling.

func (*Handler) Reset

func (h *Handler) Reset()

Reset clears every region.

func (*Handler) Restore

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

Restore implements persistence.Persistable.

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; other regions ride in an additive "regions" key.

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, invitationID, name, description, adminUsername, kmsKeyArn string,
	tags map[string]string,
) (*Member, error)

CreateMember creates a new member in an existing network. invitationID must name a PENDING invitation issued for networkID -- real AWS requires InvitationId on every CreateMember call (aws-sdk-go-v2 managedblockchain validators.go:805-806, v1.34.4) and documents ACCEPTED as the status an invitation moves to once used (types/enums.go:111). On success the invitation is consumed (marked ACCEPTED) so it cannot be reused.

func (*InMemoryBackend) CreateNetwork

func (b *InMemoryBackend) CreateNetwork(
	region, accountID, name, description, framework, frameworkVersion, memberName, memberDescription string,
	tags, memberTags 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 transitions an accessor to PENDING_DELETION. Real AWS does not remove the resource: GetAccessor/ListAccessors keep reporting it (see accessorStatusPendingDeletion's doc comment). The ARN is dropped from arnToResource so TagResource/UntagResource/ListTagsForResource correctly stop resolving it -- matching the once-deleted-can't-be-tagged behavior every other resource kind in this backend already has.

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. If memberID is the network's last member, the network is deleted too: "If MemberId is the last member in a network specified by the last Amazon Web Services account, the network is deleted also." (aws-sdk-go-v2 managedblockchain api_op_DeleteMember.go doc comment, v1.34.4). gopherstack has no multi-account model, so every network's only account is trivially "the last" one.

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) SetCreateDelay

func (b *InMemoryBackend) SetCreateDelay(d time.Duration)

SetCreateDelay keeps new networks, members and nodes in CREATING for d before they report AVAILABLE (default 0: AVAILABLE immediately).

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) TaggedResources added in v1.3.1

func (b *InMemoryBackend) TaggedResources() []TaggedEntry

TaggedResources returns every Managed Blockchain resource ARN that currently has at least one tag applied via TagResource.

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 NetworkEthereumAttributesState

type NetworkEthereumAttributesState struct {
	ChainID string `json:"chainId,omitempty"`
}

NetworkEthereumAttributesState holds Ethereum-specific network attributes.

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"`
	Ethereum *NetworkEthereumAttributesState `json:"ethereum,omitempty"`
}

NetworkFrameworkAttributesState holds framework-specific network attributes. Created networks are Hyperledger Fabric; Ethereum appears only on the public n-ethereum-mainnet network.

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 NodeEthereumAttributesState

type NodeEthereumAttributesState struct {
	HTTPEndpoint      string `json:"httpEndpoint,omitempty"`
	WebSocketEndpoint string `json:"webSocketEndpoint,omitempty"`
}

NodeEthereumAttributesState holds Ethereum-specific node attributes.

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"`
	Ethereum *NodeEthereumAttributesState `json:"ethereum,omitempty"`
}

NodeFrameworkAttributesState holds framework-specific node attributes.

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, memberTags 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, invitationID, 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 TaggedEntry added in v1.3.1

type TaggedEntry struct {
	Tags map[string]string
	ARN  string
}

TaggedEntry pairs a resource ARN with its tags.

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