Пример #1
0
        public override async Task ConfigureAsync(ClusterConfig clusterConfig, PoolConfig poolConfig)
        {
            await base.ConfigureAsync(clusterConfig, poolConfig);

            poolExtraConfig = poolConfig.Extra.SafeExtensionDataAs <EquihashPoolConfigExtra>();

            // detect network
            var blockchainInfoResponse = await daemon.ExecuteCmdSingleAsync <BlockchainInfo>(logger, BitcoinCommands.GetBlockchainInfo);

            if (blockchainInfoResponse.Response.Chain.ToLower() == "test")
            {
                networkType = BitcoinNetworkType.Test;
            }
            else if (blockchainInfoResponse.Response.Chain.ToLower() == "regtest")
            {
                networkType = BitcoinNetworkType.RegTest;
            }
            else
            {
                networkType = BitcoinNetworkType.Main;
            }

            chainConfig = poolConfig.Template.As <EquihashCoinTemplate>().GetNetwork(networkType);

            // detect z_shieldcoinbase support
            var response = await daemon.ExecuteCmdSingleAsync <JObject>(logger, EquihashCommands.ZShieldCoinbase);

            supportsNativeShielding = response.Error.Code != (int)BitcoinRPCErrorCode.RPC_METHOD_NOT_FOUND;
        }
Пример #2
0
        public override void Configure(PoolConfig poolConfig, ClusterConfig clusterConfig)
        {
            base.Configure(poolConfig, clusterConfig);

            extraConfig = poolConfig.Extra.SafeExtensionDataAs <EquihashPoolConfigExtra>();

            if (poolConfig.Template.As <EquihashCoinTemplate>().UsesZCashAddressFormat&&
                string.IsNullOrEmpty(extraConfig?.ZAddress))
            {
                logger.ThrowLogPoolStartupException($"Pool z-address is not configured");
            }
        }
Пример #3
0
    public override void Configure(PoolConfig pc, ClusterConfig cc)
    {
        coin = pc.Template.As <EquihashCoinTemplate>();

        base.Configure(pc, cc);

        extraConfig = pc.Extra.SafeExtensionDataAs <EquihashPoolConfigExtra>();

        if (pc.Template.As <EquihashCoinTemplate>().UsesZCashAddressFormat&&
            string.IsNullOrEmpty(extraConfig?.ZAddress))
        {
            throw new PoolStartupException("Pool z-address is not configured");
        }
    }
Пример #4
0
        public override async Task ConfigureAsync(ClusterConfig clusterConfig, PoolConfig poolConfig, CancellationToken ct)
        {
            await base.ConfigureAsync(clusterConfig, poolConfig, ct);

            poolExtraConfig = poolConfig.Extra.SafeExtensionDataAs <EquihashPoolConfigExtra>();

            // detect network
            var blockchainInfoResponse = await rpcClient.ExecuteAsync <BlockchainInfo>(logger, BitcoinCommands.GetBlockchainInfo, ct);

            network = Network.GetNetwork(blockchainInfoResponse.Response.Chain.ToLower());

            chainConfig = poolConfig.Template.As <EquihashCoinTemplate>().GetNetwork(network.ChainName);

            // detect z_shieldcoinbase support
            var response = await rpcClient.ExecuteAsync <JObject>(logger, EquihashCommands.ZShieldCoinbase, ct);

            supportsNativeShielding = response.Error.Code != (int)BitcoinRPCErrorCode.RPC_METHOD_NOT_FOUND;
        }