This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| LDConfig config = new LDConfig.Builder() | |
| .logging(Components.logging(Logs.basic())) | |
| .build(); | |
| LDClient client = new LDClient(SDK_KEY, config); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| repositories { | |
| mavenCentral() | |
| maven { url "https://oss.sonatype.org/content/groups/public/" } | |
| } | |
| dependencies { | |
| testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.1' | |
| testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.1' | |
| // https://mvnrepository.com/artifact/com.launchdarkly/launchdarkly-java-server-sdk | |
| implementation 'com.launchdarkly:launchdarkly-java-server-sdk:5.10.0' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import 'package:flutter/material.dart'; | |
| void main() { | |
| runApp(const MyApp()); | |
| } | |
| class MyApp extends StatelessWidget { | |
| const MyApp({Key? key}) : super(key: key); | |
| // This widget is the root of your application. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| plugins { | |
| id 'org.springframework.boot' version '2.7.2' | |
| id 'io.spring.dependency-management' version '1.0.12.RELEASE' | |
| id 'java' | |
| } | |
| group = 'com.example' | |
| version = '0.0.1-SNAPSHOT' | |
| sourceCompatibility = '11' | |
| def grpcVersion = "1.39.0" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.example.shedlockdemo; | |
| import com.authzed.api.v1.Core; | |
| import com.authzed.api.v1.PermissionService; | |
| import com.authzed.api.v1.PermissionsServiceGrpc; | |
| import com.authzed.grpcutil.BearerToken; | |
| import io.grpc.ManagedChannel; | |
| import io.grpc.ManagedChannelBuilder; | |
| import org.springframework.boot.SpringApplication; | |
| import org.springframework.boot.autoconfigure.SpringBootApplication; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| syntax = "proto3"; | |
| option java_multiple_files = true; | |
| option java_package = "io.grpc.examples.helloworld"; | |
| option java_outer_classname = "HelloWorldProto"; | |
| option objc_class_prefix = "HLW"; | |
| package helloworld; | |
| // The greeting service definition. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var PROTO_PATH = __dirname + '/../../protos/helloworld.proto'; | |
| var parseArgs = require('minimist'); | |
| var grpc = require('@grpc/grpc-js'); | |
| var protoLoader = require('@grpc/proto-loader'); | |
| var packageDefinition = protoLoader.loadSync( | |
| PROTO_PATH, | |
| {keepCase: true, | |
| longs: String, | |
| enums: String, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const bodyParser= require('body-parser') | |
| const express = require('express') | |
| const app = express() | |
| const port = 80 | |
| var PROTO_PATH = __dirname + '/../../protos/helloworld.proto'; | |
| const protobuf = require('protobufjs'); | |
| app.use(bodyParser.json({ | |
| verify: (req, res, buf) => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| admin: | |
| address: | |
| socket_address: | |
| address: 0.0.0.0 | |
| port_value: 9901 | |
| static_resources: | |
| listeners: | |
| - name: listener_0 | |
| address: | |
| socket_address: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| app.get('/getBalance', (req, res) => { // new | |
| var myContract = new web3.eth.Contract(contracts.abi, process.env.CONTRACTS_ADDRESS, { | |
| from: req.query.account_id, // default from address | |
| gasPrice: '3000000' // default gas price in wei, 20 gwei in this case | |
| }); | |
| myContract.methods.balance().call({from: req.query.account_id,gasPrice: '3000000'}) | |
| .then(function(result){ | |
| console.log(result+' wei') | |
| res.header('Access-Control-Allow-Origin', "*"); | |
| res.header('Access-Control-Allow-Headers', "*"); |