小编deb*_*kar的帖子

ValidationError:io.k8s.api.v1.DeploymentSpec 中缺少必填字段“选择器”

我创建了 Hyper-V 机器并尝试使用 Sawtooth YAML 文件在 Minikube 上部署 Sawtooth:https ://sawtooth.hyperledger.org/docs/core/nightly/master/app_developers_guide/sawtooth-kubernetes-default.yaml

我将 apiVersion ie 更改apiVersion: extensions/v1beta1apiVersion: apps/v1,尽管我已经使用此命令在 Kubernetes v1.17.0 中启动了 Minikube

minikube start --kubernetes-version v1.17.0

之后我无法部署服务器。命令是

kubectl apply -f 锯齿-kubernetes-default.yaml --validate=false

它显示“sawtooth-0”无效的错误。

在此处输入图片说明

---
apiVersion: v1
kind: List

items:

- apiVersion: apps/v1
  kind: Deployment
  metadata:
    name: sawtooth-0
  spec:
    replicas: 1
    selector:
      matchLabels:
        name: sawtooth-0
    template:
      metadata:
        labels:
          name: sawtooth-0
      spec:
        containers:
          - name: sawtooth-devmode-engine
            image: hyperledger/sawtooth-devmode-engine-rust:chime
            command:
              - bash
            args:
              - -c
              - "devmode-engine-rust -C tcp://$HOSTNAME:5050"

          - …
Run Code Online (Sandbox Code Playgroud)

kubernetes hyperledger-sawtooth

26
推荐指数
1
解决办法
4万
查看次数

无法通过binance Websockets获取socket数据

这是我的客户端代码库。它正在与交换 websocket 之一一起使用,但不与此 websocket 一起使用。有什么建议么?

websocket参考:https://github.com/binance-exchange/binance-official-api-docs/blob/master/web-socket-streams.md

import React, { Component, createContext } from "react";

export const Contx = createContext();

export class ConProvider extends Component {
  state = {
    coins: [],
    digCoin: [],
    sou: [],
    passSocket: undefined
  };

  componentDidMount() {
    this.socketCall();  
  }

  socketCall = () => {
    var ws = new WebSocket("wss://stream.binance.com:9443");
    var msg = {
      "method": "SUBSCRIBE",
      "params": "btcusdt@depth",
      "id": 1
    };

    ws.onopen = () => {
      ws.send(msg);
    };

    ws.onmessage = e => {
      const value = e.data;
      this.setState({ …
Run Code Online (Sandbox Code Playgroud)

javascript websocket reactjs cryptocurrency binance

1
推荐指数
1
解决办法
5846
查看次数