Documentation
¶
Overview ¶
Copyright © 2020 AMIS Technologies
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright © 2020 AMIS Technologies ¶
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright © 2020 AMIS Technologies ¶
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Cmd = &cobra.Command{ Use: "signer", Short: "Signer process", Long: `Signing for using the secret shares to generate a signature.`, RunE: func(cmd *cobra.Command, args []string) error { err := initService(cmd) if err != nil { log.Crit("Failed to init", "err", err) } c, err := readSignerConfigFile(configFile) if err != nil { log.Crit("Failed to read config file", "configFile", configFile, "err", err) } host, err := peer.MakeBasicHost(c.Port) if err != nil { log.Crit("Failed to create a basic host", "err", err) } pm := peer.NewPeerManager(utils.GetPeerIDFromPort(c.Port), host, signerProtocol) err = pm.AddPeers(c.Peers) if err != nil { log.Crit("Failed to add peers", "err", err) } service, err := NewService(c, pm) if err != nil { log.Crit("Failed to new service", "err", err) } host.SetStreamHandler(signerProtocol, func(s network.Stream) { service.Handle(s) }) pm.EnsureAllConnected() service.Process() return nil }, }
Functions ¶
func NewService ¶
func NewService(config *SignerConfig, pm types.PeerManager) (*service, error)