Rust client for AWS Infinidash service.

Overview

AWS Infinidash Rust Client

AWS Infinidash - Fully featured Rust client

Fully featured AWS Infinidash client for Rust applications. You can use the AWS Infinidash client to make AWS API calls, and to get your application to scale on the AWS infrastructure automagically. AWS Infinidash leverages the blockchain to provide the ultimate security and scalability. The decentrality of the blockchain ensures that no single point of failure can be used to access the application. Using the Infinidash client, you can scale your application to any available AWS region, and you can scale your application to any available AWS account. Using asymmetric cryptography, the Infinidash client can be used to encrypt data between any two AWS regions with no need for any shared secret.

The client was fully developed with assistance of GitHub Copilot and is currently in beta. Production usage is not recommended for now, but the client is still in development. If you find any bugs, please report them on the issue tracker.

Usage

AWS Infinidash client expects a JSON configuration file to be present in the working directory. The configuration file should be named aws-infinidash.json and it should be in the same directory as the executable.

use infinidash::{Infinidash, InfinidashClient};
use web3::{
    contract::{Contract, Options},
    types::U256,
};

#[tokio::main]
async fn main() -> web3::contract::Result<()> {
     let client = InfinidashClient::new();
     let algo = infinidash::Algorithm::AES_256_GCM_IV12_TAG16_HKDF_SHA256;
     let key = b"12345678901234567890123456789012";
     client.encrypt("Hello World".to_owned(), algo, key).unwrap();

     client.publish().expect("Failed to publish");
     let application: infinidash::Application = client.application().expect("Failed to get application");
     let app_id = application.get_application_id().unwrap();
     application.scale_to(1_345).expect("Failed to scale application");

     let actor_infra = application.get_actor_mode().expect("Failed to get actor mode");
     let available_actors = actor_infra.acquire::<Vec<aws_infinidash::Actor>>().unwrap();
     for actor in &available_actors {
         println!("{}", actor.get_id().unwrap());
     }

     let contract = Contract::deploy(web3.eth(), include_bytes!("../src/infinidash_app_desc.json"))?
        .confirmations(0)
        .options(Options::with(|opt| {
            opt.value = Some(5.into());
            opt.gas_price = Some(5.into());
            opt.gas = Some(3_000_000.into());
        }))
        .execute(
            bytecode,
            (U256::from(1_000_000_u64), "My Token".to_owned(), 3u64, "MT".to_owned()),
            my_account,
        )
        .await?;

    let contract_address = contract.address();
    println!("Contract address: {}", contract_address);

    Ok(());
}

Make sure to check out the example configuration file.

Credentials are read from environment variables.

Contributing

Open a pull request with your changes. Make sure to add tests for your changes. Only PRs with passing tests are accepted.

You might also like...
Remote Secret Editor for AWS Secret Manager

Barberousse - Remote Secrets Editor About Usage Options Printing Editing Copying RoadMap 1.0 1.1 Future About A project aimed to avoid downloading sec

Easy switch between AWS Profiles and Regions
Easy switch between AWS Profiles and Regions

AWSP - CLI To Manage your AWS Profiles! AWSP provides an interactive terminal to interact with your AWS Profiles. The aim of this project is to make i

Simple fake AWS Cognito User Pool API server for development.

Fakey Cognito 🏡 Homepage Simple fake AWS Cognito API server for development. ✅ Implemented features AdminXxx on User Pools API. Get Started # run wit

Postgres proxy which allows tools that don't natively supports IAM auth to connect to AWS RDS instances.

rds-iamauth-proxy rds-proxy lets you make use of IAM-based authentication to AWS RDS instances from tools that don't natively support that method of a

A tool to run web applications on AWS Lambda without changing code.
A tool to run web applications on AWS Lambda without changing code.

AWS Lambda Adapter A tool to run web applications on AWS Lambda without changing code. How does it work? AWS Lambda Adapter supports AWS Lambda functi

cargo-lambda a Cargo subcommand to help you work with AWS Lambda

cargo-lambda cargo-lambda is a Cargo subcommand to help you work with AWS Lambda. This subcommand compiles AWS Lambda functions natively and produces

cargo-lambda is a Cargo subcommand to help you work with AWS Lambda.

cargo-lambda cargo-lambda is a Cargo subcommand to help you work with AWS Lambda. The new subcommand creates a basic Rust package from a well defined

Managing schema for AWS Athena in GitOps-style

athena-rs Managing AWS Athena Schemas Installation $ cargo install --git https://github.com/duyet/athena-rs $ athena --help athena 0.1.0 Duyet me@du

Nitrogen - a tool for deploying web services to AWS Nitro Enclaves

Nitrogen CLI Nitrogen is a tool for deploying web services to AWS Nitro Enclaves. Given a dockerfile and an ssh key, Nitrogen will spin up an EC2, con

Comments
  • Improve with Ethereum blockchain network integration

    Improve with Ethereum blockchain network integration

    Would be nice to leverage contracts for Infinidash applications to store complex business rules. Contracts are safe since they cannot be updated after published to the Ethereum network, makes it perfect of complex applications.

    help wanted good first issue 
    opened by rafaelcaricio 0
Owner
Rafael Carício
I like to write software.
Rafael Carício
Rs.aws-login - A command line utility to simplify logging into AWS services.

aws-login A command line utility to simplify logging into AWS accounts and services. $ aws-login use ? Please select a profile to use: › ❯ dev-read

Kevin Herrera 11 Oct 30, 2022
Wait Service is a pure rust program to test and wait on the availability of a service.

Wait Service Wait Service is a pure rust program to test and wait on the availability of a service.

Magic Len (Ron Li) 3 Jan 18, 2022
Rusoto is an AWS SDK for Rust

Rusoto is an AWS SDK for Rust You may be looking for: An overview of Rusoto AWS services supported by Rusoto API documentation Getting help with Rusot

null 2.6k Jan 3, 2023
Cookiecutter templates for Serverless applications using AWS SAM and the Rust programming language.

Cookiecutter SAM template for Lambda functions in Rust This is a Cookiecutter template to create a serverless application based on the Serverless Appl

AWS Samples 24 Nov 11, 2022
📦 🚀 a smooth-talking smuggler of Rust HTTP functions into AWS lambda

lando ?? maintenance mode ahead ?? As of this announcement AWS not officialy supports Rust through this project. As mentioned below this projects goal

Doug Tangren 68 Dec 7, 2021
Ref Arch: Serverless GraphQL in Rust on AWS

A Whole Hog Reference Architecture for an Apollo Federation-Ready, Serverless, Rust-Based GraphQL Microservice on AWS using Cloud Development Kit (CDK)

Michael Edelman 3 Jan 12, 2022
A Rust runtime for AWS Lambda

Rust Runtime for AWS Lambda This package makes it easy to run AWS Lambda Functions written in Rust. This workspace includes multiple crates: lambda-ru

Amazon Web Services - Labs 2.4k Dec 29, 2022
An opinionated Rust library for interacting with AWS DynamoDB single-table designs.

Modyne An opinionated library for interacting with AWS DynamoDB single-table designs. † Motive Modyne follows the precepts laid out for effective sing

Marcus Griep 14 Jun 8, 2023
An AI Toolbox for Simplified Access to AWS Bedrocks, Ollama from Rust

Hiramu Hiramu is a powerful and flexible Rust library that provides a high-level interface for interacting with various AI models and APIs, including

Raphael MANSUY 5 Apr 21, 2024
A simple workshop to learn how to write, test and deploy AWS Lambda functions using the Rust programming language

Rust Lambda Workshop Material to host a workshop on how to build and deploy Rust Lambda functions with AWS SAM and Cargo Lambda. Intro What is Serverl

Luciano Mammino 13 Mar 28, 2024